Page 1 of 1

camb making error in mac 10.14.1

Posted: March 05 2019
by Ding-fang Zeng
Dear All,

Does any one hit errors of the following type when making camb(v2019-1.0.3) in mac osx(10.14.1, majave)?
... ...
ld: library not found for -lSystem
collect2: error: ld returned 1 exit status
make[2]: *** [camb_exe] Error 1
make[1]: *** [../camb] Error 2
make: *** [camb] Error 2
How should I do to resolve this trouble?
Thank you in advances.

Re: camb making error in mac 10.14.1

Posted: March 20 2019
by Ding-fang Zeng
Now I know by changing the compiling command the following way, the CAMB-fortran code can be compiled successfully on my mac-majave. But I do not want to input this command line by hand every time I compile the project. How should I change the Makefile so that the option ``-L/usr/lib/'' can be added into the command automatically? Another question I want to ask is, how to change the Makefile so that I can use lldb provided by xcode to follow CAMB's running line by line? (without any revision of the Makefile, I can lldb, but cannot list source code in lldb window)

The original command is produced by the Makefile, which does not work fluently on my mac-majave+gfortran platform,
--------------------------------------------------------
gfortran -O3 -MMD -cpp -ffree-line-length-none -fmax-errors=4 -fopenmp -JRelease -IRelease/ -I"/Volumes/mac-data/dfzeng19-21/HDE-ricci/CAMB-103/fortran/../forutils/Release/" Release/inidriver.o Release/libcamb.a -L"/Volumes/mac-data/dfzeng19-21/HDE-ricci/CAMB-103/fortran/../forutils/Release/" -lforutils -o camb
--------------------------------------------------------
The proper compile command which works successfully is as follows,

********************************************************
gfortran -O3 -MMD -cpp -ffree-line-length-none -fmax-errors=4 -fopenmp -JRelease -IRelease/ -I"/Volumes/mac-data/dfzeng19-21/HDE-ricci/CAMB-103/fortran/../forutils/Release/" Release/inidriver.o Release/libcamb.a -L/usr/lib/ -L"/Volumes/mac-data/dfzeng19-21/HDE-ricci/CAMB-103/fortran/../forutils/Release/" -lforutils -o camb
********************************************************

Thanks to all

Re: camb making error in mac 10.14.1

Posted: March 20 2019
by Cosmo Xu
You just need to add '-L/usr/lib' into the Makefile.
The option '-L/usr/lib' is passed to the compiler, so that the compiler will know where to find the needed library and link it to the final excutable file (camb)