Thread: [Lapackpp-devel] undefined reference problem
Status: Beta
Brought to you by:
cstim
From: Andrew O. <end...@gm...> - 2006-05-23 04:23:19
Attachments:
test.cc
|
Hey I tried compiling a simple "hello world" program and I get these errors: tg-login1 /users/aoh> g++ test.cc -I/usr/local/apps/mpich-gm/include -L/usr/local/apps/mpich-gm/lib -lmpich -I/usr/local/apps/lapackpp-2.4.8/include/lapackpp -L/usr/local/apps/lapackpp-2.4.8/lib -llapackpp -I/users/aoh/random/include In file included from /usr/include/g++/backward/iostream.h:31, from test.cc:7: /usr/include/g++/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <sstream> instead of the deprecated header <strstream.h>. To disable this warning use -Wno-deprecated. /usr/local/apps/intel/compiler8/lib/libimf.so.6: warning: log2l is not implemented and will always fail /usr/local/apps/intel/compiler8/lib/libimf.so.6: warning: exp2l is not implemented and will always fail /usr/local/apps/intel/compiler8/lib/libcxa.so.6: undefined reference to `__ashldi3' /usr/lib/liblapack.so.3: undefined reference to `z_abs' /usr/lib/liblapack.so.3: undefined reference to `c_sqrt' /usr/lib/liblapack.so.3: undefined reference to `f_cpstr' /usr/lib/liblapack.so.3: undefined reference to `f_iob' /usr/lib/liblapack.so.3: undefined reference to `f_cpystr' /usr/lib/liblapack.so.3: undefined reference to `f_concat' /usr/lib/liblapack.so.3: undefined reference to `f_stop' /usr/lib/liblapack.so.3: undefined reference to `z_exp' /usr/local/apps/intel/compiler8/lib/libcxa.so.6: undefined reference to `__ashrdi3' /usr/lib/liblapack.so.3: undefined reference to `c_exp' /usr/lib/liblapack.so.3: undefined reference to `z_sqrt' /usr/lib/liblapack.so.3: undefined reference to `c_abs' /usr/local/apps/intel/compiler8/lib/libcxa.so.6: undefined reference to `__muldi3' collect2: ld returned 1 exit status --- I attached the simple program. All I do is include some lapack++ header files. Thanks for your help!! Andy |
From: Christian S. <sti...@tu...> - 2006-05-23 08:07:33
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Your commands look fine, but they will work only in the simple case. You specify "-llapackpp" on the gcc line so that your test.cc links against liblapackpp.so. Obviously liblapackpp.so needs to link against more libraries, which is why liblapack.so (without the pp) is linked in. This one in turn needs to link against yet more libraries - on my system it requires -lblas and -lg2c; maybe you should add these arguments to gcc as well. I don't specify the gcc line directly in my programs; instead, I let libtool/automake generate that for me, and this will usually find the appropriate linker flags automatically from the lib*.la files. In your case the problem only is that some linker flags are missing but which are required for your liblapack.so library. BTW for future bugreports please remember to specify your compiler version number and your OS (linux? bsd? amd64?). Christian Andrew Oh schrieb: > Hey > > > I tried compiling a simple "hello world" program and I get these errors: > > > tg-login1 /users/aoh> g++ test.cc -I/usr/local/apps/mpich-gm/include > -L/usr/local/apps/mpich-gm/lib -lmpich > -I/usr/local/apps/lapackpp-2.4.8/include/lapackpp > -L/usr/local/apps/lapackpp-2.4.8/lib -llapackpp > -I/users/aoh/random/include > > In file included from /usr/include/g++/backward/iostream.h:31, > from test.cc:7: > /usr/include/g++/backward/backward_warning.h:32:2: warning: #warning > This file includes at least one deprecated or antiquated header. > Please consider using one of the 32 headers found in section 17.4.1.2 > of the C++ standard. Examples include substituting the <X> header for > the <X.h> header for C++ includes, or <sstream> instead of the > deprecated header <strstream.h>. To disable this warning use > -Wno-deprecated. > /usr/local/apps/intel/compiler8/lib/libimf.so.6: warning: log2l is not > implemented and will always fail > /usr/local/apps/intel/compiler8/lib/libimf.so.6: warning: exp2l is not > implemented and will always fail > /usr/local/apps/intel/compiler8/lib/libcxa.so.6: undefined reference > to `__ashldi3' > /usr/lib/liblapack.so.3: undefined reference to `z_abs' > /usr/lib/liblapack.so.3: undefined reference to `c_sqrt' -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.1 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQCVAwUBRHLDW2XAi+BfhivFAQLRhgQAt9hcEG7eT8bTtiJy/RscjmPlf4suQ52n NAkaUD6aE5x/PruIPx6hzPl1Tq4tu7mQNUeZDqGiJmWbp+xly1AuOQhlmxJvwyKy 06vU5dlPdNEA0nUfIE5EhvnQDwnz4B2Mm/TNVdBpE9Wcm6aGrm5OuwtqEhEr7GJq Jgja/OoVlYg= =e7P6 -----END PGP SIGNATURE----- |
From: Andrew O. <end...@gm...> - 2006-05-23 20:18:41
|
Hey I added -lblas -lg2c and -llapack to the linker flags and my errors have been reduced to this: /usr/local/apps/intel/compiler8/lib/libimf.so.6: warning: log2l is not implemented and will always fail /usr/local/apps/intel/compiler8/lib/libimf.so.6: warning: exp2l is not implemented and will always fail /usr/lib/liblapack.so: undefined reference to `f_cpstr' /usr/lib/libblas.so: undefined reference to `f_iob' /usr/lib/liblapack.so: undefined reference to `f_cpystr' /usr/lib/liblapack.so: undefined reference to `f_concat' /usr/lib/libblas.so: undefined reference to `f_stop' Is there anyway I can find out which linker flags I need to add so that the undefined references go away? I'm really sorry but I don't know how to use automake, autoconfig or libtool... I guess I should start reading up on tutorials =[. This is specs for machine I am trying to build on http://www.sdsc.edu/user_services/ia64/tech-summary.html Andy On 5/23/06, Christian Stimming <sti...@tu...> wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Your commands look fine, but they will work only in the simple case. You > specify "-llapackpp" on the gcc line so that your test.cc links against > liblapackpp.so. Obviously liblapackpp.so needs to link against more > libraries, which is why liblapack.so (without the pp) is linked in. This > one in turn needs to link against yet more libraries - on my system it > requires -lblas and -lg2c; maybe you should add these arguments to gcc > as well. > > I don't specify the gcc line directly in my programs; instead, I let > libtool/automake generate that for me, and this will usually find the > appropriate linker flags automatically from the lib*.la files. In your > case the problem only is that some linker flags are missing but which > are required for your liblapack.so library. > > BTW for future bugreports please remember to specify your compiler > version number and your OS (linux? bsd? amd64?). > > Christian > > Andrew Oh schrieb: > > Hey > > > > > > I tried compiling a simple "hello world" program and I get these errors: > > > > > > tg-login1 /users/aoh> g++ test.cc -I/usr/local/apps/mpich-gm/include > > -L/usr/local/apps/mpich-gm/lib -lmpich > > -I/usr/local/apps/lapackpp-2.4.8/include/lapackpp > > -L/usr/local/apps/lapackpp-2.4.8/lib -llapackpp > > -I/users/aoh/random/include > > > > In file included from /usr/include/g++/backward/iostream.h:31, > > from test.cc:7: > > /usr/include/g++/backward/backward_warning.h:32:2: warning: #warning > > This file includes at least one deprecated or antiquated header. > > Please consider using one of the 32 headers found in section 17.4.1.2 > > of the C++ standard. Examples include substituting the <X> header for > > the <X.h> header for C++ includes, or <sstream> instead of the > > deprecated header <strstream.h>. To disable this warning use > > -Wno-deprecated. > > /usr/local/apps/intel/compiler8/lib/libimf.so.6: warning: log2l is not > > implemented and will always fail > > /usr/local/apps/intel/compiler8/lib/libimf.so.6: warning: exp2l is not > > implemented and will always fail > > /usr/local/apps/intel/compiler8/lib/libcxa.so.6: undefined reference > > to `__ashldi3' > > /usr/lib/liblapack.so.3: undefined reference to `z_abs' > > /usr/lib/liblapack.so.3: undefined reference to `c_sqrt' > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.2.1 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iQCVAwUBRHLDW2XAi+BfhivFAQLRhgQAt9hcEG7eT8bTtiJy/RscjmPlf4suQ52n > NAkaUD6aE5x/PruIPx6hzPl1Tq4tu7mQNUeZDqGiJmWbp+xly1AuOQhlmxJvwyKy > 06vU5dlPdNEA0nUfIE5EhvnQDwnz4B2Mm/TNVdBpE9Wcm6aGrm5OuwtqEhEr7GJq > Jgja/OoVlYg= > =e7P6 > -----END PGP SIGNATURE----- > |
From: Christian S. <sti...@tu...> - 2006-05-24 08:22:16
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, Andrew Oh schrieb: > > I added -lblas -lg2c and -llapack to the linker flags and my errors > have been reduced to this: > > /usr/local/apps/intel/compiler8/lib/libimf.so.6: warning: log2l is not > implemented and will always fail > /usr/local/apps/intel/compiler8/lib/libimf.so.6: warning: exp2l is not > implemented and will always fail ^^^^ those can be ignored > /usr/lib/liblapack.so: undefined reference to `f_cpstr' > /usr/lib/libblas.so: undefined reference to `f_iob' > /usr/lib/liblapack.so: undefined reference to `f_cpystr' > /usr/lib/liblapack.so: undefined reference to `f_concat' > /usr/lib/libblas.so: undefined reference to `f_stop' > > Is there anyway I can find out which linker flags I need to add so > that the undefined references go away? I'm really sorry but I don't > know how to use automake, autoconfig or libtool... I guess I should > start reading up on tutorials =[. Sigh... obviously you also need to link against some fortran library, but I can't tell the name as this depends on your system. Hm... have you been able to compile the lapackpp tarball completely? Can you also run "make check" in the tarball? The command "make check" will compile several executables, e. g. in the testing/ directory. During "make check", you can look at the commands and see which additional linker flags are being used. Or in the file ./config.status, look for the line that contains @FLIBS@ and this should tell you the library flags as well. Christian -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.1 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQCVAwUBRHQYO2XAi+BfhivFAQJ4eAP/cfzH/F91husnqAhZFxqXiy90Avyp/379 8nGKuGcN6sOZNmB+LULb9Pk3jiRCMg7UV5NsHzYMLaUPVCbUjeke+nduflwS6S+6 24RpVvS39go41uL37H9XCwCdCeDm8JB6OpQUI7gXYxFmo+OmuP+0GGO7Z5aO9CCA YSDY0eKQq4Q= =0Fo/ -----END PGP SIGNATURE----- |