g+
g+ Communities
Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014 
<== Date ==> <== Thread ==>

Subject: Re: compile EPICS base on Mac OS (Snow Leopard) using GCC from macport
From: "Shen, Guobao" <shengb@bnl.gov>
To: Andrew Johnson <anj@aps.anl.gov>
Cc: tech-talk@aps.anl.gov
Date: Fri, 09 Nov 2012 07:35:54 -0500
Hi Andrew,

On 11/8/12 6:01 PM, Andrew Johnson wrote:
Hi Guobao,

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:
<snip>
gcc: error: x86_64: No such file or directory
gcc: error: unrecognized option '-arch'
gmake[3]: *** [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 R3.14.12.2, 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:
   comment out
#ARCH_CLASS = i386
#ARCH_CLASS = x86_64
#ARCH_CLASS = i386 x86_64

    and set
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:
./config/CONFIG.Host.Darwin
./configure/os/CONFIG.Common.iosCommon
./configure/os/CONFIG.darwinCommon.darwinCommon

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.

Guobao
It's entirely
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.

- Andrew



References:
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:
Prev: bcc55 "Ing.- Büro Austel"
Next: Re: Problems sending \x0 with devGpib driver Dirk Zimoch
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014 
Navigate by Thread:
Prev: Re: compile EPICS base on Mac OS (Snow Leopard) using GCC from macport Andrew Johnson
Next: bcc55 "Ing.- Büro Austel"
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014 
ANJ, 18 Nov 2013 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· EPICSv4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·