[R-SIG-Mac] GCC on Lion and above
Kasper Daniel Hansen
kasperdanielhansen at gmail.com
Thu May 3 01:09:12 CEST 2012
Hi Tim
I encountered this recently. If you do
gcc --version
you'll notice that you get the llvm, whereas
gcc-4.2 --version
gives you the "right"s standard GCC. So essentially, when you
compile, you need to make sure you use
gcc-4.2
and
gfortran-4.2
both of which are in /usr/bin. Note that gcc-4.2 and gcc are two
different beasts. All of this can usually be done by doing something
like
CC=/usr/bin/gcc-4.2 ./configure
Kasper
Output:
gcc --version
i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc.
build 5658) (LLVM build 2336.9.00)
gcc-4.2 --version
i686-apple-darwin11-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5666) (dot 3)
On Tue, Apr 24, 2012 at 3:06 PM, Timothy Bates
<timothy.c.bates at gmail.com> wrote:
> Dear all (simon...)
>
> I’ve installed what I think is the recommended gcc+fortran installer pkg for Lion:
>
> http://r.research.att.com/tools/gcc-42-5666.3-darwin11.pkg
>
> but get no fortran in my /usr/local/bin and compiling an R package that needs it (http://openmx.psyc.virginia.edu) fails... no fortran.
>
> I _think_ i have followed the instructions on http://r.research.att.com/tools/#gcc42
> (it’s confusing that up-to-date OS instructions are buried down in the (long) list of possible packages to install: I would be happy to help reorg this...)
>
>
> gcc is fine
> which gcc
> /usr/local/bin/gcc
>
> but
> gfortran
> -bash: gfortran: command not found
>
>
> config info follows... sorry for the hassle
> t
>
> *** Config info ***
>
> Xcode 4.4 with command line tools installed
>
> echo $PATH
>
> :/usr/local/bin:/usr/local/mysql/bin/:/Users/tim/bin:/Users/tim/Applications/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/bin:/usr/local/mysql/bin:/Users/tim/bin:/Users/tim/bin/plink
>
>
>
> FYI, here’s the make trail from attempting to make OpenMx
>
>
> spearman:Users tim$ cd ~/bin/OpenMx/; svn update; cd trunk/; make clean; make install; cd ..; svn status
> At revision 2028.
> rm -rf build/*
> rm -rf models/passing/temp-files/*
> rm -rf models/failing/temp-files/*
> rm -rf build/*
> rm -rf models/passing/temp-files/*
> rm -rf models/failing/temp-files/*
> cp DESCRIPTION DESCRIPTION.bak
> sed '/Version:/d' DESCRIPTION.bak > DESCRIPTION
> echo "Version: "999.0.0"-"2028 >> DESCRIPTION
> cd build; R CMD build ..
> * checking for file ‘../DESCRIPTION’ ... OK
> * preparing ‘OpenMx’:
> * checking DESCRIPTION meta-information ... OK
> * cleaning src
> * checking for LF line-endings in source and make files
> * checking for empty or unneeded directories
> Removed empty directory ‘OpenMx/docs/source/static/Rdoc’
> Removed empty directory ‘OpenMx/docs/source/static/demo’
> Removed empty directory ‘OpenMx/docs/source/static’
> Removed empty directory ‘OpenMx/docs/source/templates’
> Removed empty directory ‘OpenMx/inst/unit-tests’
> Removed empty directory ‘OpenMx/models/failing/temp-files’
> Removed empty directory ‘OpenMx/models/passing/temp-files’
> Removed empty directory ‘OpenMx/testsuite’
> * looking to see if a ‘data/datalist’ file should be added
> * re-saving tabular files
> * building ‘OpenMx_999.0.0-2028.tar.gz’
>
> mv DESCRIPTION.bak DESCRIPTION
> cd build; R CMD INSTALL "--configure-args=--enable-openmp" OpenMx_999.0.0-2028.tar.gz
> * installing to library ‘/Users/tim/Library/R/2.15/library’
> * installing *source* package ‘OpenMx’ ...
> checking for gcc... gcc
> checking whether the C compiler works... yes
> checking for C compiler default output file name... a.out
> checking for suffix of executables...
> checking whether we are cross compiling... no
> checking for suffix of object files... o
> checking whether we are using the GNU C compiler... yes
> checking whether gcc accepts -g... yes
> checking for gcc option to accept ISO C89... none needed
> checking for gcc option to support OpenMP... -fopenmp
> checking whether gcc is installed... yes
> checking build system type... i386-apple-darwin12.0.0
> checking host system type... i386-apple-darwin12.0.0
> checking for inst/npsol/osx/libnpsol.a... yes
> configure: creating ./config.status
> config.status: creating src/Makevars
> config.status: executing src/omxSymbolTable.h commands
> config.status: executing src/omxSymbolTable.c commands
> ** libs
> *** arch - i386
> gcc -arch i386 -std=gnu99 -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include/i386 -DNDEBUG -I/usr/local/include -Wall -fopenmp -mmacosx-version-min=10.4 -fPIC -g -O2 -c merge.c -o merge.o
> gcc -arch i386 -std=gnu99 -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include/i386 -DNDEBUG -I/usr/local/include -Wall -fopenmp -mmacosx-version-min=10.4 -fPIC -g -O2 -c npsolWrap.c -o npsolWrap.o
> npsolWrap.c: In function ‘constraintFunction_’:
> npsolWrap.c:798:19: warning: variable ‘size’ set but not used [-Wunused-but-set-variable]
> gcc -arch i386 -std=gnu99 -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include/i386 -DNDEBUG -I/usr/local/include -Wall -fopenmp -mmacosx-version-min=10.4 -fPIC -g -O2 -c omxAlgebra.c -o omxAlgebra.o
> gcc -arch i386 -std=gnu99 -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include/i386 -DNDEBUG -I/usr/local/include -Wall -fopenmp -mmacosx-version-min=10.4 -fPIC -g -O2 -c omxAlgebraFunctions.c -o omxAlgebraFunctions.o
> gcc -arch i386 -std=gnu99 -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include/i386 -DNDEBUG -I/usr/local/include -Wall -fopenmp -mmacosx-version-min=10.4 -fPIC -g -O2 -c omxAlgebraObjective.c -o omxAlgebraObjective.o
> gfortran -arch i386 -fPIC -g -O2 -c omxBLAS.f -o omxBLAS.o
> make[1]: gfortran: No such file or directory
> make[1]: *** [omxBLAS.o] Error 1
> ERROR: compilation failed for package ‘OpenMx’
> * removing ‘/Users/tim/Library/R/2.15/library/OpenMx’
> * restoring previous ‘/Users/tim/Library/R/2.15/library/OpenMx’
> make: *** [install] Error 1
> ? typescript
> ? .profile
> ? trunk/demo/UnivariateTwinAnalysis_MatrixRaw_plusCov.R
> ? trunk/build/OpenMx_999.0.0-2028.tar.gz
> ? branches/three-matrix/src/.BC.szkLWC
> ? branches/experimental/src/.BC.zDfeyx
> spearman:OpenMx tim$
>
> _______________________________________________
> R-SIG-Mac mailing list
> R-SIG-Mac at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
More information about the R-SIG-Mac
mailing list