paula-tataru / polyDFE

predicting DFE and alpha from polymorphism data
GNU General Public License v3.0
28 stars 0 forks source link

compile errors with GCC C Linker #1

Closed kjgilbert closed 6 years ago

kjgilbert commented 6 years ago

Hi Paula, I am trying to install polyDFE and ran into an error, but it is very possible it is something to do with my GSL, as I am on a campus-wide server that installed that themselves. But I wonder if there's a chance this is not the problem because I got an immediate error when I previously tried on a local server where I do found out we do not have the GSL and it failed in the 'building src/basinhopping' step.

When I do 'make all' on my server with the GSL, it works through the following steps up until the error you see at the end. Which makes me think it can correctly access the GSL, and I just wanted to ask if you have any insight or might know how I can fix this, or if indeed it is still the GSL at fault?

Many thanks, Kim

Building file: src/basinhopping.c Invoking: GCC C Compiler gcc -O2 -g3 -Wall -c -msse2 -mfpmath=sse -frounding-math -fmessage-length=0 -MMD -MP -MF"src/basinhopping.d" -MT"src/basinhopping.d" -o "src/basinhopping.o" "src/basinhopping.c" Finished building: src/basinhopping.c

Building file: src/likelihood.c Invoking: GCC C Compiler gcc -O2 -g3 -Wall -c -msse2 -mfpmath=sse -frounding-math -fmessage-length=0 -MMD -MP -MF"src/likelihood.d" -MT"src/likelihood.d" -o "src/likelihood.o" "src/likelihood.c" Finished building: src/likelihood.c

Building file: src/localoptim.c Invoking: GCC C Compiler gcc -O2 -g3 -Wall -c -msse2 -mfpmath=sse -frounding-math -fmessage-length=0 -MMD -MP -MF"src/localoptim.d" -MT"src/localoptim.d" -o "src/localoptim.o" "src/localoptim.c" src/localoptim.c: In function ‘set_lnL_df’: src/localoptim.c:378: warning: implicit declaration of function ‘gsl_multifit_fdfsolver_dif_df’ src/localoptim.c: In function ‘optimize_using_derivatives’: src/localoptim.c:500: warning: implicit declaration of function ‘gsl_vector_equal’ Finished building: src/localoptim.c

Building file: src/parse.c Invoking: GCC C Compiler gcc -O2 -g3 -Wall -c -msse2 -mfpmath=sse -frounding-math -fmessage-length=0 -MMD -MP -MF"src/parse.d" -MT"src/parse.d" -o "src/parse.o" "src/parse.c" Finished building: src/parse.c

Building file: src/run.c Invoking: GCC C Compiler gcc -O2 -g3 -Wall -c -msse2 -mfpmath=sse -frounding-math -fmessage-length=0 -MMD -MP -MF"src/run.d" -MT"src/run.d" -o "src/run.o" "src/run.c" Finished building: src/run.c

Building file: src/simulate.c Invoking: GCC C Compiler gcc -O2 -g3 -Wall -c -msse2 -mfpmath=sse -frounding-math -fmessage-length=0 -MMD -MP -MF"src/simulate.d" -MT"src/simulate.d" -o "src/simulate.o" "src/simulate.c" Finished building: src/simulate.c

Building file: src/transform.c Invoking: GCC C Compiler gcc -O2 -g3 -Wall -c -msse2 -mfpmath=sse -frounding-math -fmessage-length=0 -MMD -MP -MF"src/transform.d" -MT"src/transform.d" -o "src/transform.o" "src/transform.c" Finished building: src/transform.c

Building target: all Invoking: GCC C Linker gcc -o "polyDFE" ./src/basinhopping.o ./src/likelihood.o ./src/localoptim.o ./src/parse.o ./src/run.o ./src/simulate.o ./src/transform.o -lm -lgsl -lgslcblas ./src/localoptim.o: In function set_lnL_df': /home/ubelix/iee/gilbert/polyDFE/src/localoptim.c:378: undefined reference togsl_multifit_fdfsolver_dif_df' ./src/localoptim.o: In function optimize_using_derivatives': /home/ubelix/iee/gilbert/polyDFE/src/localoptim.c:500: undefined reference togsl_vector_equal' /home/ubelix/iee/gilbert/polyDFE/src/localoptim.c:525: undefined reference to `gsl_vector_equal' collect2: ld returned 1 exit status make: *** [all] Error 1

paula-tataru commented 6 years ago

Hi Kim,

Which version of GSL are you using? polyDFE requires version 1.16, but there is a newer version which is not back compatible.

Best, Paula

kjgilbert commented 6 years ago

Hi Paula, that was indeed the issue. Thanks for your response, have gotten it compiled now with the right version, sorry to have wasted your time! GSL compatibility issues never seem to cease :)

kjgilbert commented 6 years ago

Hi again Paula,

I have polyDFE successfully compiled with GSL 1.16, and it runs to an extent, but it still get an error that for sure is somehow GSL-related.

If I try one of the examples included, I get the following output to my console. Does this make any sense to you? Could the program have compiled yet still not work from some GSL library somehow? Many thanks for the help!

Kim

./polyDFE -d input/example_1 ---- Performing inference on input/example_1 using model C

---- Data does not contain divergence counts. Using option -w. ---- Warning: mutation variability is not used when only one neutral and one selected fragment is available. ---- No mutation variability. Using Poisson likelihood.

---- Calculating initial values for neutral parameters ---- Calculating initial values for selection parameters

-- Starting local optimization ./polyDFE: symbol lookup error: ./polyDFE: undefined symbol: gsl_multifit_fdfsolver_dif_df

paula-tataru commented 6 years ago

It does look indeed like a GSL error and I think it is due to some linking problems. When you compiled the code, did you get any warnings? What was the output on the screen?

I have never seen that type of error myself, and googling a bit shows that it should be some linking / configuration error. https://stackoverflow.com/questions/14405601/gnu-scientific-library-cblas-symbol-lookup-error https://bugzilla.redhat.com/show_bug.cgi?id=1043153

kjgilbert commented 6 years ago

I'll check out the links you sent. I did not get any errors on the compile, it gave the following:

$ make all Building file: src/basinhopping.c Invoking: GCC C Compiler gcc -I/home/ubelix/iee/gilbert/custom_software/gsl-1.16/include/ -O2 -g3 -Wall -c -msse2 -mfpmath=sse -frounding-math -fmessage-length=0 -MMD -MP -MF"src/basinhopping.d" -MT"src/basinhopping.d" -o "src/basinhopping.o" "src/basinhopping.c" Finished building: src/basinhopping.c

Building file: src/likelihood.c Invoking: GCC C Compiler gcc -I/home/ubelix/iee/gilbert/custom_software/gsl-1.16/include/ -O2 -g3 -Wall -c -msse2 -mfpmath=sse -frounding-math -fmessage-length=0 -MMD -MP -MF"src/likelihood.d" -MT"src/likelihood.d" -o "src/likelihood.o" "src/likelihood.c" Finished building: src/likelihood.c

Building file: src/localoptim.c Invoking: GCC C Compiler gcc -I/home/ubelix/iee/gilbert/custom_software/gsl-1.16/include/ -O2 -g3 -Wall -c -msse2 -mfpmath=sse -frounding-math -fmessage-length=0 -MMD -MP -MF"src/localoptim.d" -MT"src/localoptim.d" -o "src/localoptim.o" "src/localoptim.c" Finished building: src/localoptim.c

Building file: src/parse.c Invoking: GCC C Compiler gcc -I/home/ubelix/iee/gilbert/custom_software/gsl-1.16/include/ -O2 -g3 -Wall -c -msse2 -mfpmath=sse -frounding-math -fmessage-length=0 -MMD -MP -MF"src/parse.d" -MT"src/parse.d" -o "src/parse.o" "src/parse.c" Finished building: src/parse.c

Building file: src/run.c Invoking: GCC C Compiler gcc -I/home/ubelix/iee/gilbert/custom_software/gsl-1.16/include/ -O2 -g3 -Wall -c -msse2 -mfpmath=sse -frounding-math -fmessage-length=0 -MMD -MP -MF"src/run.d" -MT"src/run.d" -o "src/run.o" "src/run.c" Finished building: src/run.c

Building file: src/simulate.c Invoking: GCC C Compiler gcc -I/home/ubelix/iee/gilbert/custom_software/gsl-1.16/include/ -O2 -g3 -Wall -c -msse2 -mfpmath=sse -frounding-math -fmessage-length=0 -MMD -MP -MF"src/simulate.d" -MT"src/simulate.d" -o "src/simulate.o" "src/simulate.c" Finished building: src/simulate.c

Building file: src/transform.c Invoking: GCC C Compiler gcc -I/home/ubelix/iee/gilbert/custom_software/gsl-1.16/include/ -O2 -g3 -Wall -c -msse2 -mfpmath=sse -frounding-math -fmessage-length=0 -MMD -MP -MF"src/transform.d" -MT"src/transform.d" -o "src/transform.o" "src/transform.c" Finished building: src/transform.c

Building target: all Invoking: GCC C Linker gcc -o "polyDFE" -L/home/ubelix/iee/gilbert/custom_software/gsl-1.16/lib/ ./src/basinhopping.o ./src/likelihood.o ./src/localoptim.o ./src/parse.o ./src/run.o ./src/simulate.o ./src/transform.o -lm -lgsl -lgslcblas Finished building target: all

paula-tataru commented 6 years ago

Can you change the line LIBS := -lm -lgsl -lgslcblas in the makefile to LIBS := -lgsl -lgslcblas -lm and let me know if it makes any difference?

kjgilbert commented 6 years ago

It still compiles and produces the same error upon trying to run.

kjgilbert commented 6 years ago

Hi Paula, just to update you, I didn't manage a solution, but it for sure is just GSL linking. It seems to be that both servers I tried had other versions of the GSL installed, and despite updating the library path, it at some point looks for the wrong version when running and throws that error. I have gotten the software compiled and running properly on my personal computer at least and it is working like a charm, so thanks for your help!

paula-tataru commented 6 years ago

Hi Kim, Sorry I couldn't be of more help. On our cluster we can 'source' the older versions of libraries before running a program (as, by default, the latest version is used), maybe your server has a similar option? Glad to hear it works fine on your personal computer.