- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm compiling a program that uses LAPACK and BLAS routines, but I keep getting errors about not being able to find the references.
The code compiles properly to .o files, but linking produces the following errors:
Schur_st.o: In function `eigen_schur_':
Schur_st.f:(.text+0x126b): undefined reference to `dgemm_'
Schur_st.f:(.text+0x1517): undefined reference to `dgemm_'
Schur_st.o: In function `normeigenvector_.':
Schur_st.f:(.text+0x1de8): undefined reference to `dnrm2_'
Schur_st.f:(.text+0x1e07): undefined reference to `dnrm2_'
Schur_st.f:(.text+0x1e3f): undefined reference to `dscal_'
Schur_st.f:(.text+0x1e57): undefined reference to `dscal_'
Schur_st.f:(.text+0x1ed0): undefined reference to `idamax_'
Schur_st.f:(.text+0x1f27): undefined reference to `drot_'
...
/opt/intel/mkl/9.1.021/lib/32/libmkl_lapack.so: undefined reference to `slartv'
/opt/intel/mkl/9.1.021/lib/32/libmkl_lapack.so: undefined reference to `zscal'
/opt/intel/mkl/9.1.021/lib/32/libmkl_lapack.so: undefined reference to `zhpr'
/opt/intel/mkl/9.1.021/lib/32/libmkl_lapack.so: undefined reference to `zgeru'
/opt/intel/mkl/9.1.021/lib/32/libmkl_lapack.so: undefined reference to `ssyrk'
/opt/intel/mkl/9.1.021/lib/32/libmkl_lapack.so: undefined reference to `ssyr2k'
....and so on
My linker command is:
localhost src # ifort -L/opt/intel/mkl/9.1.021/lib/32 -static-intel -lmkl_ia32 -lmkl_lapack -lguide *.o -o SIMILAR-linux
and environment variables are:
LIBRARY_PATH=/opt/intel/mkl/9.1.021/lib/32
FPATH=/opt/intel/mkl/9.1.021/include
LD_LIBRARY_PATH=/opt/intel/mkl/9.1.021/lib/32:/opt/intel/fc/10.0.023/lib:/opt/intel/fc/10.0.023/lib
CPATH=/opt/intel/mkl/9.1.021/include
INCLUDE=/opt/intel/mkl/9.1.021/include
advice would be much appreciated.
The code compiles properly to .o files, but linking produces the following errors:
Schur_st.o: In function `eigen_schur_':
Schur_st.f:(.text+0x126b): undefined reference to `dgemm_'
Schur_st.f:(.text+0x1517): undefined reference to `dgemm_'
Schur_st.o: In function `normeigenvector_.':
Schur_st.f:(.text+0x1de8): undefined reference to `dnrm2_'
Schur_st.f:(.text+0x1e07): undefined reference to `dnrm2_'
Schur_st.f:(.text+0x1e3f): undefined reference to `dscal_'
Schur_st.f:(.text+0x1e57): undefined reference to `dscal_'
Schur_st.f:(.text+0x1ed0): undefined reference to `idamax_'
Schur_st.f:(.text+0x1f27): undefined reference to `drot_'
...
/opt/intel/mkl/9.1.021/lib/32/libmkl_lapack.so: undefined reference to `slartv'
/opt/intel/mkl/9.1.021/lib/32/libmkl_lapack.so: undefined reference to `zscal'
/opt/intel/mkl/9.1.021/lib/32/libmkl_lapack.so: undefined reference to `zhpr'
/opt/intel/mkl/9.1.021/lib/32/libmkl_lapack.so: undefined reference to `zgeru'
/opt/intel/mkl/9.1.021/lib/32/libmkl_lapack.so: undefined reference to `ssyrk'
/opt/intel/mkl/9.1.021/lib/32/libmkl_lapack.so: undefined reference to `ssyr2k'
....and so on
My linker command is:
localhost src # ifort -L/opt/intel/mkl/9.1.021/lib/32 -static-intel -lmkl_ia32 -lmkl_lapack -lguide *.o -o SIMILAR-linux
and environment variables are:
LIBRARY_PATH=/opt/intel/mkl/9.1.021/lib/32
FPATH=/opt/intel/mkl/9.1.021/include
LD_LIBRARY_PATH=/opt/intel/mkl/9.1.021/lib/32:/opt/intel/fc/10.0.023/lib:/opt/intel/fc/10.0.023/lib
CPATH=/opt/intel/mkl/9.1.021/include
INCLUDE=/opt/intel/mkl/9.1.021/include
advice would be much appreciated.
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
After changing the order of the link command (-lmkl_lapack going before -lmkl_ia32) the errors have reduced, but all DSS_ functions are still unresolved:
localhost src # ifort -L/opt/intel/mkl/9.1.021/lib/32 -static-intel -lmkl_lapack -lmkl_ia32 -lguide *.o -o SIMILAR-linux
MTXINIOP.f:(.text+0xc39): undefined reference to `dss_create_'
MTXINIOP.f:(.text+0xc71): undefined reference to `dss_define_structure_'
MTXINIOP.f:(.text+0xc98): undefined reference to `dss_define_structure_'
MTXINIOP.f:(.text+0xcba): undefined reference to `dss_define_structure_'
MTXINIOP.f:(.text+0xce1): undefined reference to `dss_reorder_'
MTXINIOP.f:(.text+0xd0c): undefined reference to `dss_factor_real_'
MTXINIOP.f:(.text+0xeb1): undefined reference to `dss_solve_real_'
MTXINIOP.f:(.text+0xf24): undefined reference to `dss_delete_'
MTXINIOP.f:(.text+0xf56): undefined reference to `dss_factor_real_'
....
and so on.
MTXINIOP.f has the line "use mkl_dss" and compiles to .o properly, but as you can see linking is a problem.
regards,
Arthur
localhost src # ifort -L/opt/intel/mkl/9.1.021/lib/32 -static-intel -lmkl_lapack -lmkl_ia32 -lguide *.o -o SIMILAR-linux
MTXINIOP.f:(.text+0xc39): undefined reference to `dss_create_'
MTXINIOP.f:(.text+0xc71): undefined reference to `dss_define_structure_'
MTXINIOP.f:(.text+0xc98): undefined reference to `dss_define_structure_'
MTXINIOP.f:(.text+0xcba): undefined reference to `dss_define_structure_'
MTXINIOP.f:(.text+0xce1): undefined reference to `dss_reorder_'
MTXINIOP.f:(.text+0xd0c): undefined reference to `dss_factor_real_'
MTXINIOP.f:(.text+0xeb1): undefined reference to `dss_solve_real_'
MTXINIOP.f:(.text+0xf24): undefined reference to `dss_delete_'
MTXINIOP.f:(.text+0xf56): undefined reference to `dss_factor_real_'
....
and so on.
MTXINIOP.f has the line "use mkl_dss" and compiles to .o properly, but as you can see linking is a problem.
regards,
Arthur
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You should link *.o before the libraries, so that all unreferenced symbols are seen before libraries are searched. Sorry about not pointing it out before.
![](/skins/images/BC9A7A3465121B56B278007F4EE8899F/responsive_peak/images/icon_anonymous_message.png)
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page