undefined reference to `parse_opts'

Open discussion for MAGMA library (Matrix Algebra on GPU and Multicore Architectures)
Post Reply
K_Synnott
Posts: 15
Joined: Fri Jun 27, 2014 10:45 am

undefined reference to `parse_opts'

Post by K_Synnott » Thu Jul 03, 2014 9:19 am

Hi all,

I am trying to write my own magma file. I pass the following through the terminal:

Code: Select all

nvcc AA_TriEigenSolve.cpp libmagma.so  -o AA_TriEigenSolve -I/usr/local/magma/include -lgfortran -lm -lcublas -DHAVE_CUBLAS -DNOCHANGE -lstdc++ -ldl -L/usr/lib/atlas-base 
And get these errors:

Code: Select all

AA_TriEigenSolve.cpp:(.text+0x91): undefined reference to `dlamch'
AA_TriEigenSolve.cpp:(.text+0xb4): undefined reference to `parse_opts'
AA_TriEigenSolve.cpp:(.text+0xce): undefined reference to `dlamch'
AA_TriEigenSolve.cpp:(.text+0xf5): undefined reference to `dlamch'
collect2: ld returned 1 exit status
Can anybody help?

K_Synnott
Posts: 15
Joined: Fri Jun 27, 2014 10:45 am

Re: undefined reference to `parse_opts'

Post by K_Synnott » Thu Jul 03, 2014 11:51 am

Okay have gotten past the previous error. My new input is:

Code: Select all

nvcc AA_TriEigenSolve.cpp testing_util.cpp libmagma.so /usr/lib/atlas-base/liblapack_atlas.a -o AA_TriEigenSolve -I/usr/local/magma/include -lgfortran -lm -lcublas  -DHAVE_CUBLAS -DNOCHANGE -lstdc++
And I am getting a new error of:

Code: Select all

/usr/bin/ld: libmagma.so: undefined reference to symbol 'xerbla_'
/usr/bin/ld: note: 'xerbla_' is defined in DSO /usr/lib/liblapack.so.3gf so try adding it to the linker command line
/usr/lib/liblapack.so.3gf: could not read symbols: Invalid operation
collect2: ld returned 1 exit status
Any help is appriciated

K_Synnott
Posts: 15
Joined: Fri Jun 27, 2014 10:45 am

Re: undefined reference to `parse_opts'

Post by K_Synnott » Fri Jul 04, 2014 5:50 am

Okay I'm down to this

Code: Select all

nvcc AA_TriEigenSolve.cpp testing_util.cpp libmagma.so /usr/lib/lapack/liblapack.a /usr/lib/openblas-base/libopenblas.a  /usr/lib/atlas-base/liblapack_atlas.a -o AA_TriEigenSolve -I/usr/local/magma/include -lgfortran -lm -lcublas -DHAVE_CUBLAS -DNOCHANGE -lstdc++ -ldl -L /usr/lib/lapack/liblapack.so -L /usr/lib/openblas-base/libopenblas.so


And have to following error:

Code: Select all

/tmp/tmpxft_00004e57_00000000-1_AA_TriEigenSolve.o: In function `main':
AA_TriEigenSolve.cpp:(.text+0x91): undefined reference to `dlamch'
AA_TriEigenSolve.cpp:(.text+0xce): undefined reference to `dlamch'
AA_TriEigenSolve.cpp:(.text+0xf5): undefined reference to `dlamch'
collect2: ld returned 1 exit status
Please help.

K_Synnott
Posts: 15
Joined: Fri Jun 27, 2014 10:45 am

Re: undefined reference to `parse_opts'

Post by K_Synnott » Fri Jul 04, 2014 11:21 am

This works for all those interested

[/code]
gcc -fPIC -O3 -DADD_ -fopenmp -DMAGMA_SETAFFINITY -DHAVE_CUBLAS -DMIN_CUDA_ARCH=100 -I/usr/local/cuda-5.5//include -I../include -I../control -c AA_TriEigenSolve.cpp -o AA_TriEigenSolve.o ; gcc -fPIC -fopenmp AA_TriEigenSolve.o -o AA_TriEigenSolve libtest.a lin/liblapacktest.a -L../lib -lmagma -L/usr/lib/lapack -L/usr/lib/atlas-base/lib -L/usr/local/cuda-5.5//lib64 -llapack -lblas -lcublas -lcudart -lstdc++ -lm -lgfortran
[/code]

mgates3
Posts: 918
Joined: Fri Jan 06, 2012 2:13 pm

Re: undefined reference to `parse_opts'

Post by mgates3 » Thu Jul 10, 2014 10:26 am

I'm glad that you figured out a link line that works.

The parse_opts function is used in the MAGMA testers and found in libtest.a library; you are of course welcome to use it, but it isn't required to use the MAGMA library. Likewise, the functions that the MAGMA testers use to verify the solution are in liblapacktets.a, which again you can use, but shouldn't be required to use the MAGMA library.

-mark

Post Reply