Re: [Lapackpp-devel] question of including lapack++ in my makefile
Status: Beta
Brought to you by:
cstim
From: Dee <de...@de...> - 2011-11-17 04:51:34
|
Dear changtsan, The "not found" indicates that liblapackpp.so.14 is not in the default library path defined by LD_LIBRARY_PATH. If you call "ldd" with the PATH-variable set before it should find it. The same is true for the other machine. The folder /usr/local/packages/lapackpp is usually not in the path. You can see the path via $ echo $LD_LIBRARY_PATH If you want to start main.exe on the other machine you should do: $ LD_LIBRARY_PATH=/usr/local/packages/lapackpp:$LD_LIBRARY_PATH ./main.exe (I forgot the :$LD_LIBRARY_PATH above, even if it works for you.) The other solution is to extend LD_LIBRARY_PATH in the .bashrc, see http://www.warp1337.com/content/ubuntu-910-extend-set-configure-ldlibrarypath-path-howto 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 22:28 > Dear Dominik, > > I try what you indicate, it works on my machine! However, the following > shows that main.exe cannot find liblapackpp.so.14. > > [changtsl@cee-changtsl EIG]$ ldd main.exe > linux-vdso.so.1 => (0x00007fff2e7fd000) > liblapackpp.so.14 => not found > libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x000000375a400000) > libm.so.6 => /lib64/libm.so.6 (0x0000003753c00000) > libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x0000003759c00000) > libc.so.6 => /lib64/libc.so.6 (0x0000003753800000) > /lib64/ld-linux-x86-64.so.2 (0x0000003753400000) > > But when listing the content of /lib, it is obvious that > "liblapackpp.so.14" exists. "liblapackpp.so.14" is actually a link to > "liblapackpp.so.14.2.0". > > [changtsl@cee-changtsl EIG]$ ls /home/changtsl/lapackpp_lib/lib > liblapackpp.la liblapackpp.so.14 pkgconfig > liblapackpp.so liblapackpp.so.14.2.0 > > How come main.exe cannot find "liblapackpp.so.14"? > > > I try the same thing on another machine where lapackpp is located in > > /usr/local/packages/lapackpp > > by > > $ g++ -c -I/usr/local/packages/lapackpp/include/lapackpp main.cpp > $ g++ -L/usr/local/packages/lapackpp/lib -llapackpp main.o -o main.exe > $ LD_LIBRARY_PATH=/usr/local/packages/lapackpp/lib ./main.exe > > then it shows > > ./main.exe: error while loading shared libraries: libmkl_intel_ilp64.so: > cannot open shared object file: No such file or directory > > The libraries that main.exe can search are > > linux-vdso.so.1 => (0x00007fff6f9ff000) > liblapackpp.so.14 => not found > libstdc++.so.6 => /usr/X11R6/lib64/libstdc++.so.6 (0x00007ffa83942000) > libm.so.6 => /lib64/libm.so.6 (0x00007ffa836ec000) > libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007ffa834d5000) > libc.so.6 => /lib64/libc.so.6 (0x00007ffa83177000) > /lib64/ld-linux-x86-64.so.2 (0x00007ffa83c4d000) > > I am wondering, on both machines, "liblapackpp.so.14" indeed exists in the > appropriate directories, but the "main.exe"s cannot find it out? > I am also wondering why the "LD_LIBRARY_PATH=" command works on my own > machine but doesn't work on the other machine? > > Thank you very much. > > Sincerely, > changtsan > > > > > > > On Wed, November 16, 2011 15:47, Dee wrote: > 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 >>>>>> >>>>>> >>>>>> >>>>>> >>>>> >>>>> >>>>> >>>>> >>>> >>>> >>>> >>>> >>> >>> >>> >>> >> >> >> >> > > > > |