Closed teuben closed 6 years ago
Yes this is something I always notice with gyrfalcON compilation : At first compilation it always fails (mageia linux distro) with some weird messages about .rodata .... then after a make clean all && make it pass the compilation
I added a 2nd "make -i all" to the "make libs" in the root Makefile.in, that gets around the problem for now.
This is the message I always get the first time I compile falcON : /usr/bin/ld: lib/basic.o: relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC lib/basic.o: error adding symbols: Bad value
I found why I was always getting this error and I solved it ! Let me explain :
the first time you compile Dehen
then it goes to falcON and make tonemo
in falcON/Makefile there is this statement : -include makedefs
which include falcON/makedefs file which include utils/make.gcc file.
BUT at the first compilation, when make process gets into falcON directory, link "ln -sf ../utils " has NOT been yet created, whereas "-include makedefs" has been called. And makedefs file has a statement, "-include utils/make.gcc", which should load utils/make.gcc file, but it cannot because link on "utils" does not exist yet !!!! (actually the dash "-" before "include" means that error is ignored if file is missing, this is why I have never understood the pb) Ok then that means that g++ CXXFLAGS compilations options (from make.gcc file) are not loaded, AND options "-fPIC" is missing (because it comes from make.gcc file) which is mandatory to generate shared lib. This is why it give error messages (see above).
BUT at at the second compilation of Dehnen, links "falcON/utils -> ../utils" already exist, then makefefs can load utils/make.gcc options, then shared library can be completed !!!!
confirmed and fixed!
linking issues first time. testsuite fails in src/nbody/evolve/dehnen and src/orbit/potential (missing Plummer.so) 2nd time "make -i clean all" in usr/dehnen it works.