On 11/8/12 6:01 PM, Andrew Johnson wrote:
On 2012-11-08 Shen, Guobao wrote:
Is there anyone succeeded using GCC tool chain to compile EPICS?
It looks like that macport version of GCC swallowed the option "arch", and
I got a error like:
gcc: error: x86_64: No such file or directory
gcc: error: unrecognized option '-arch'
gmake: *** [bucketLib.o] Error 1
However, there is no problem with the tool chain coming with XCode.
Which version of Base are you building,
I am compiling R22.214.171.124, but also tried 3.14.11. It is same.
My MacPorts GCC is gcc-mp-4.6 (MacPorts gcc46 4.6.3_9) 4.6.3.
and have you configured the settings
in configure/os/CONFIG_SITE.Common.darwin-x86 properly?
Yes. With the same settings, if I use the gcc coming with Xcode, the compiling went smoothly.
To compile with my MacPorts gcc:
1. The default MacPorts gcc does not support to build a fat binary supporting both x86, and x64, and not like the version from Apple.
It does not support -option "arch", and '-no-cpp-precomp'. Apple has a patch, which is available for free, but it is not adopted by MacPorts.
I do not want to recompile my MacPorts tool, therefore, I have to change configure/os/CONFIG_SITE.Common.darwin-x86:
#ARCH_CLASS = i386
#ARCH_CLASS = x86_64
#ARCH_CLASS = i386 x86_64
GNU_DIR = /opt/local
CC = $(GNU_BIN)/gcc -m64
CCC = $(GNU_BIN)/g++ -m64
2. Then following the instruction to make, but the make will run into error with gcc: error: unrecognized option '-no-cpp-precomp'
when compiling Cap5.c:
/opt/local/bin/gcc -m64 -c -DUNIX -Ddarwin -O3 -g -Wall -pipe -O2 -fno-common -DPERL_DARWIN -I/opt/local/include -no-cpp-precomp -fno-strict-aliasing -fstack-protector
-I/opt/local/include -fno-common -fPIC -I. -I../O.Common -I. -I.. -I../../../include/os/Darwin -I../../../include -I/opt/local/lib/perl5/5.12.4/darwin-thread-multi-2level/CORE
-I/opt/local/include -I/sw/include Cap5.c
gcc: error: unrecognized option '-no-cpp-precomp'
I commented out all flags from any files I can find:
But it still compiles with '-no-cpp-precomp', do not know why.
I have to manually compile Cap5.c without option '-no-cpp-precomp'
Message from internet mentioned that this option was used before the gcc version "3.4", and not necessary for later version like 4.0.
3. After that, run make on the top again, and everything looks fine.
I build a test example, and it works also.
possible that this doesn't work with the macports version of GCC, I don't test
that combination myself and I don't know if anyone else does either. If you
can work out what configuration changes are needed I'd be willing to add them
as a comment for the next release of Base.
- compile EPICS base on Mac OS (Snow Leopard) using GCC from macport Shen, Guobao
- Re: compile EPICS base on Mac OS (Snow Leopard) using GCC from macport Andrew Johnson
- Navigate by Date:
bcc55 "Ing.- Büro Austel"
Re: Problems sending \x0 with devGpib driver Dirk Zimoch
- Navigate by Thread:
Re: compile EPICS base on Mac OS (Snow Leopard) using GCC from macport Andrew Johnson
bcc55 "Ing.- Büro Austel"