I am on macOS 14.6 and I want to build Gnu Scientific Library (GSL) for x86_64 architecture.
I have an Xcode app which uses GSL, but when I compile this app I get the warning message ‘ld: warning: ignoring file ‘/usr/local/lib/libgsl.28.dylib’: found architecture ‘arm64’, required architecture ‘x86_64’
and none of the GSL module is found (they are all properly linked).
How may I build GSL for x86_64? The suggestion in the INSTALL file to do
./configure CC="gcc -arch i386 -arch x86_64" CXX="g++ -arch x86_64" CPP="gcc -E" CXXCPP="g++ -E"
does not work, it yields the error message
./configure CC="gcc -arch i386 -arch x86_64" CXX="g++ -arch x86_64" CPP="gcc -E" CXXCPP="g++ -E"
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a race-free mkdir -p... mkdir -p
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for a sed that does not truncate output... /usr/bin/sed
checking whether make sets $(MAKE)... (cached) yes
checking build system type... arm-apple-darwin23.6.0
checking host system type... arm-apple-darwin23.6.0
checking for gcc... gcc -arch i386 -arch x86_64
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... configure: error: in '/Applications/gsl-2.8':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use '--host'.
See 'config.log' for more details
I also tried to add --host
and it does not work
./configure --host CC="gcc -arch x86_64" CXX="g++ -arch x86_64" CPP="gcc -E" CXXCPP="g++ -E"
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for CC=gcc... no
checking for strip... strip
checking for a race-free mkdir -p... mkdir -p
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for a sed that does not truncate output... /usr/bin/sed
checking whether make sets $(MAKE)... (cached) yes
checking build system type... arm-apple-darwin23.6.0
checking host system type... config.sub: too many arguments
Try `config.sub --help' for more information.
configure: error: /bin/sh ./config.sub CC=gcc -arch x86_64 failed
Any ideas ? Thanks
7