LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Anyone good with Makefiles? (https://www.linuxquestions.org/questions/linux-newbie-8/anyone-good-with-makefiles-4175411488/)

emmiesix 06-14-2012 02:53 PM

Anyone good with Makefiles?
 
1 Attachment(s)
I have been using linux as a scientist for many years, and I sort of vaguely understand how install scripts and Makefiles work, though I am embarassed to say I have never done a proper study of them.

I am installing some scientific software from source, and I have a problem where the

-ldl

flag is not recognized. Here is an example of an error that comes up in the output:

Code:

/bin/bash ../../libtool --mode=link g++  -g -O2  -o DllPlugInTester -ldl DllPlugInTester.o CommandLineParser.o ../../src/cppunit/libcppunit.la
g++ -g -O2 -o .libs/DllPlugInTester DllPlugInTester.o CommandLineParser.o  -ldl ../../src/cppunit/.libs/libcppunit.so -Wl,--rpath -Wl,/media/shared/research/software/ScienceTools-v9r27p1-fssc-20120410/external/x86_64-unknown-linux-gnu-libc2.13-20/lib
../../src/cppunit/.libs/libcppunit.so: undefined reference to `dlsym'
../../src/cppunit/.libs/libcppunit.so: undefined reference to `dlopen'
../../src/cppunit/.libs/libcppunit.so: undefined reference to `dlclose'
collect2: ld returned 1 exit status
make[10]: *** [DllPlugInTester] Error 1
make[10]: Leaving directory `/media/shared/research/software/ScienceTools-v9r27p1-fssc-20120410/external/cppunit/src/DllPlugInTester'
make[9]: *** [all-recursive] Error 1

Now I have gone into the directory where the offending "g++ ..." command is executed, and if I add the -ldl flag to the END of that compile statement, everything works. The problem is, I have NO CLUE how to get that done in the script, so that it doesn't throw this error and stop. Perhaps an alternative would be to have it stop exiting for errors? I am not sure how to do that either. I will attach the makefile, as soon as I figure out how...

Thank you!

Didier Spaier 06-14-2012 03:08 PM

To attach your Makefile, edit your post, click the "Go Advanced" button, then click the paperclip icon, click "Browse", select your file then click "Upload".

LQ is a bit picky about file types allowed, so append ".txt" to its name in order to make it recognized as a text file.

Oh and I almost forgot: welcome to LQ ;)

emmiesix 06-14-2012 03:14 PM

Thanks, it is now attached!

The thing I find so confusing about makefiles is all the variables that I don't see defined anywhere... where do they get their values?

emmiesix 06-14-2012 03:35 PM

Ok, the board ate my reply.

I just wanted to report that I have found that the attached makefile simply calls many other (100s) of makefiles.

The good news is that I figured out how to alter the particular one causing the error above and now it goes smoothly. The bad news is that there are HUNDREDS of makefiles!

So, I guess I need to work at the automake stage to figure out how to fix this? Yikes...


All times are GMT -5. The time now is 03:45 PM.