Re: [Lapackpp-devel] question of including lapack++ in my makefile
Status: Beta
Brought to you by:
cstim
From: Dee <de...@de...> - 2011-11-16 20:47:51
|
Dear changtsan, please do start the command from the command line itself: $ ./makefile $ LD_LIBRARY_PATH=/home/changtsl/lapackpp_lib/lib ./main.exe Usually you do not start a programm with a real makefile. (But of course you do not have a real Makefile.) If this doesn't work, you could display what libraries are searched for and where they are found: $ ldd main.exe Further please list the content of the lib-folder: $ ls /home/changtsl/lapackpp_lib/lib With regards Dominik -------- Original-Nachricht -------- Betreff: Re: [Lapackpp-devel] question of including lapack++ in my makefile Von: Abraham Chang-Tsan Lu <cha...@cm...> An: lap...@li... Datum: 16.11.2011 21:42 > Dear Dominik, > > Sorry for taking you so much time. > My makefile now is > > # main.o : main.cpp > g++ -c -I/home/changtsl/lapackpp_lib/include/lapackpp main.cpp > # main.exe : main.o > g++ -L/home/changtsl/lapackpp_lib/lib -llapackpp main.o -o main.exe > > date > LD_LIBRARY_PATH=/home/changtsl/lapackpp_lib/lib ./main.exe > echo finished > /bin/echo -e "\a" > date > > But the error is still the same: > > [changtsl@cee-changtsl EIG]$ ./makefile > Wed Nov 16 15:35:56 EST 2011 > ./main.exe: error while loading shared libraries: liblapackpp.so.14: > cannot open shared object file: No such file or directory > finished > > Thank you for your help and patience. > > Sincerely, > changtsan > > > On Wed, November 16, 2011 15:28, Dee wrote: > Dear changtsan, > > okay, next try: > > LD_LIBRARY_PATH=/home/changtsl/lapackpp_lib/lib ./make.exe > > With regards > Dominik > > -------- Original-Nachricht -------- > Betreff: Re: [Lapackpp-devel] question of including lapack++ in my makefile > Von: Abraham Chang-Tsan Lu <cha...@cm...> > An: lap...@li... > Datum: 16.11.2011 20:29 > >> Dear Dominik, >> >> >> I really appreciate your help. I follow what you indicated, it shows >> >> >> [changtsl@cee-changtsl EIG]$ ./makefile >> g++: unrecognized option '-R/home/changtsl/lapackpp_lib/lib' >> Wed Nov 16 13:24:07 EST 2011 >> ./main.exe: error while loading shared libraries: liblapackpp.so.14: >> cannot open shared object file: No such file or directory finished >> >> and >> >> [changtsl@cee-changtsl EIG]$ ./makefile >> g++: unrecognized option '-R.' >> Wed Nov 16 13:14:45 EST 2011 >> ./main.exe: error while loading shared libraries: liblapackpp.so.14: >> cannot open shared object file: No such file or directory finished >> >> It seems that my machine doesn't recognize the command -R. The OS on my >> machine is RedHat linux. Thank you. >> >> Sincerely, >> changtsan >> >> >> >> On Wed, November 16, 2011 12:50, Dee wrote: >> Dear changtsan, >> >> >> the path in the makefile (behind the -L) is not important for the >> execution of the program. >> >> But because of the "exe" I thought you are using Windows. But as I see >> now you use Linux or something like it. So you need to tell the application >> where the library is located because Linux does not search in the current >> directory as default (and you shouldn't change it for security reasons). >> >> There are some ways to solve this problem. See >> http://www.eyrie.org/~eagle/notes/rpath.html for example in using the >> "-R" option when linking the binary (the line with the -L in it): >> >> >> g++ -R/home/changtsl/lapackpp_lib/lib -L/home/changtsl/lapackpp_lib/lib >> -llapackpp main.o -o main.exe >> >> >> But pay attention, that the main.exe will only work on your system (or >> at least on any system that has the library in this path or in the global >> path defined by LD_LIBRARY_PATH). >> >> So you could also link the main.exe via >> >> >> g++ -R. -L/home/changtsl/lapackpp_lib/lib -llapackpp main.o -o main.exe >> >> so the library will first be searched in the local directory. (You need to >> copy the so-files in the same directory as the main.exe of course.) >> >> With regards >> Dominik >> >> >> >> -------- Original-Nachricht -------- >> Betreff: Re: [Lapackpp-devel] question of including lapack++ in my >> makefile Von: Abraham Chang-Tsan Lu <cha...@cm...> >> An: lap...@li... >> Datum: 16.11.2011 18:34 >> >> >>> Dear Dominik, >>> >>> >>> >>> I copy the whole file folder "lapackpp_lib" to the directory where >>> main.exe is, but the same error message is shown. Do I have to change >>> the path of lapackpp_lib in the makefile? Thank you. >>> >>> >>> Sincerely, >>> changtsan >>> >>> >>> >>> On Wed, November 16, 2011 11:28, Dee wrote: >>> Dear changtsan, >>> >>> >>> >>> You link lapackpp-Library dynamically to your main.exe. This means >>> everybody who wants to start main.exe needs to have the lapackpp-Lib >>> somewhere in his execution path. >>> >>> The easiest way tol solve this is to copy the library in the same >>> directory as the exe. Then the programm should execute fine. >>> >>> With regards >>> Dominik >>> >>> >>> >>> >>> -------- Original-Nachricht -------- >>> Betreff: Re: [Lapackpp-devel] question of including lapack++ in my >>> makefile Von: Abraham Chang-Tsan Lu <cha...@cm...> An: >>> lap...@li... Datum: 16.11.2011 17:25 >>> >>> >>> >>>> Hi Dominik, >>>> >>>> >>>> >>>> >>>> Thank you very much. I try to follow your indication, so now the >>>> content of my makefile now is >>>> >>>> g++ -c -I/home/changtsl/lapackpp_lib/include/lapackpp main.cpp g++ >>>> -L/home/changtsl/lapackpp_lib/lib -llapackpp main.o -o main.exe >>>> >>>> >>>> >>>> >>>> I think the file "main.o" and "main.exe" are produced successfully. >>>> But >>>> when I execut "main.exe", the error message shows >>>> >>>> [changtsl@cee-changtsl EIG]$ ./main.exe >>>> ./main.exe: error while loading shared libraries: liblapackpp.so.14: >>>> cannot open shared object file: No such file or directory >>>> >>>> What should I do then? Thank you very much. >>>> >>>> >>>> >>>> >>>> Sincerely, >>>> changtsan >>>> >>>> >>>> >>>> On Tue, November 15, 2011 16:04, Dee wrote: >>>> Dear changtsan, >>>> >>>> >>>> >>>> >>>> first: Please do not write directly to the responder but to the >>>> mailing list so that everyone can read your further questions. >>>> (Usually you >>>> set the responder as CC, if you wish to.) >>>> >>>> Concerning your question: It's better to link the library when >>>> building the exe: >>>> >>>> g++ -L/home/changtsl/lapackpp_lib/lib -llapackpp main.o -o main.exe >>>> >>>> So you should delete the second g++-line in your makefile and change >>>> the third to the one above. >>>> >>>> With regards >>>> Dominik >>>> >>>> >>>> >>>> >>>> -------- Original-Nachricht -------- >>>> Betreff: Re: [Lapackpp-devel] question of including lapack++ in my >>>> makefile Von: Abraham Chang-Tsan Lu <cha...@cm...> An: Dee >>>> <de...@de...> >>>> Datum: 14.11.2011 16:24 >>>> >>>> >>>> >>>> >>>>> Hi Dominik, >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> Thank you for your reply, and I am sorry to bother you again. I >>>>> don't know much about makefile, so the questions I am going to ask >>>>> below may be stupid. >>>>> >>>>> From the website you indicated, I see one line saying >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> gcc -L/usr/local/lib -llapackpp foo.o >>>>> >>>>> Does the "lib" here refers to the "lib" under /lapackpp_lib? >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> I have attached the updated makefile and error. >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> Thank you very much. >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> Sincerely, >>>>> changtsan >>>>> >>>>> >>>>> >>>>> On Sat, November 12, 2011 02:18, Dee wrote: >>>>> Hello, >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> you forgot to link the Lapack-library in your Makefile. Please see >>>>> chapter "Library Usage" on http://lapackpp.sourceforge.net/ >>>>> >>>>> >>>>> >>>>> With regards >>>>> Dominik >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> -------- Original-Nachricht -------- >>>>> Betreff: [Lapackpp-devel] question of including lapack++ in my >>>>> makefile Von: Abraham Chang-Tsan Lu <cha...@cm...> An: >>>>> lap...@li... Datum: 12.11.2011 00:18 >>>>> >>>>> >>>>> >>>>> >>>>> >>>>>> Dear Lapack++ Developer, >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> I have some trouble in including lapack++ in my makefile. >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> On my machine, Lapack++ is under the directory of >>>>>> /home/changtsl/lapackpp-2.5.4 >>>>>> and /home/changtsl/lapackpp_lib. >>>>>> >>>>>> >>>>>> I have attached my code, makefile, and the error message given in >>>>>> the terminal. The code is very short and only for testing. Would >>>>>> you please help me to solve the problem? Thank you very much. >>>>>> >>>>>> Sincerely, >>>>>> changtsan >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> ----------------------------------------------------------------- >>>>>> -- >>>>>> -- >>>>>> -- >>>>>> -- >>>>>> ----- >>>>>> RSA(R) Conference 2012 >>>>>> Save $700 by Nov 18 >>>>>> Register now >>>>>> http://p.sf.net/sfu/rsa-sfdev2dev1 >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> lapackpp-devel mailing list lap...@li... >>>>>> https://lists.sourceforge.net/lists/listinfo/lapackpp-devel >>>>> >>>>> >>>>> >>>>> >>>> >>>> >>>> >>>> >>> >>> >>> >>> >> >> >> >> > > > > |