Hello,
When I try to compile the latest release of ROOT on my mac I get the following error –
Linking CXX shared library ../../lib/libHbook.so
ld: in /usr/local/lib/libgfortran.3.dylib, file was built for unsupported file format which is not the architecture being linked (x86_64) for architecture x86_64
collect2: ld returned 1 exit status
make[2]: *** [lib/libHbook.so] Error 1
make[1]: *** [hist/hbook/CMakeFiles/Hbook.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
Could you please tell me what is going wrong here. I am using Mac OS X 10.6.8.
Here is the command I use to compile –
cmake $ROOTSYS -DGSL_CONFIG_EXECUTABLE=/Users/subho/Documents/Workshop/GSL/bin/gsl-config -Dmathmore=ON
make -j4
Is there any way of explicitly selecting the 64bit version of the archive in the compilation process?
Cheers,
Subho.
[EDIT]
Also, I forgot to mention this happens on the CMake build.
The old make based build system is able to manage this and root compiles successfully. However the CMake based one fails!
Very likely you have a 32 bit installation of gfortran. From CMake point of view there is no handle from where the internal libraries will be taken. CMake simply locates the compiler and use it.
In my installation if I do “gfortran -print-search-dirs” I get:
As far I can see the -m64 flag is applied for the macosx64 platform. Still the problem is during the linking (ld) it finds the file /usr/local/lib/libgfortran.3.dylib which is not adequate for the 64 architecture. Can you for a try remove (rename) the library in /usr/local/lib?
Linking CXX shared library ../../lib/libHbook.so
ld: in /usr/local/lib/libgfortran.3.dylib, file was built for unsupported file format which is not the architecture being linked (x86_64) for architecture x86_64
collect2: ld returned 1 exit status
make[2]: *** [lib/libHbook.so] Error 1
make[1]: *** [hist/hbook/CMakeFiles/Hbook.dir/all] Error 2
make: *** [all] Error 2