- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Using MKL on Linux for IA-32:
I need myprog.f90 to be statically linked; it makes a call to the LAPACK subroutine gels() using the LAPACK95 interface.
I have spent a lot of time looking at documentation, examples and similar questions on this forum; but after much experimentation I still can't get this to compile. So I appologize but I must go ahead and ask again.
My best attempt based on Intel's Link Advisor:
ifort -L/opt/intel/mkl/10.2.1.017/lib/32 -lmkl_blas95 -lmkl_lapack95 -lmkl_intel -lmkl_core -lmkl_sequential -lpthread -static myprog.f90
Result:
/tmp/ifortJnhkQs.o: In function `MAIN__':
myprog.f90:(.text+0x375): undefined reference to `sgels1_mkl95_'
I have built the interface *.mod and *.a files for LAPACK95.
Do I have the wrong compiler command?
I can compile from the MKL LAPACK95 included examples (using the makefile) so I guess the problem is not some environmental variable. I don't know enough to extract the technique from the example makefile.
I need myprog.f90 to be statically linked; it makes a call to the LAPACK subroutine gels() using the LAPACK95 interface.
I have spent a lot of time looking at documentation, examples and similar questions on this forum; but after much experimentation I still can't get this to compile. So I appologize but I must go ahead and ask again.
My best attempt based on Intel's Link Advisor:
ifort -L/opt/intel/mkl/10.2.1.017/lib/32 -lmkl_blas95 -lmkl_lapack95 -lmkl_intel -lmkl_core -lmkl_sequential -lpthread -static myprog.f90
Result:
/tmp/ifortJnhkQs.o: In function `MAIN__':
myprog.f90:(.text+0x375): undefined reference to `sgels1_mkl95_'
I have built the interface *.mod and *.a files for LAPACK95.
Do I have the wrong compiler command?
I can compile from the MKL LAPACK95 included examples (using the makefile) so I guess the problem is not some environmental variable. I don't know enough to extract the technique from the example makefile.
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I based the following on the makefile output when compiling the example file for the gels routine. It seems to work; there is probably some extra stuff in there.
ifort -xK -O3 -static -I /opt/intel/Compiler/11.1/046/mkl/include/32 -w myprog.f90 /opt/intel/Compiler/11.1/046/mkl/lib/32/libmkl_lapack95.a "/opt/intel/Compiler/11.1/046/mkl/lib/32"/libmkl_intel.a -Wl,--start-group "/opt/intel/Compiler/11.1/046/mkl/lib/32"/libmkl_intel_thread.a "/opt/intel/Compiler/11.1/046/mkl/lib/32"/libmkl_core.a -Wl,--end-group -L"/opt/intel/Compiler/11.1/046/mkl/lib/32" -openmp -liomp5 -lpthread -o myprog.out
ifort -xK -O3 -static -I /opt/intel/Compiler/11.1/046/mkl/include/32 -w myprog.f90 /opt/intel/Compiler/11.1/046/mkl/lib/32/libmkl_lapack95.a "/opt/intel/Compiler/11.1/046/mkl/lib/32"/libmkl_intel.a -Wl,--start-group "/opt/intel/Compiler/11.1/046/mkl/lib/32"/libmkl_intel_thread.a "/opt/intel/Compiler/11.1/046/mkl/lib/32"/libmkl_core.a -Wl,--end-group -L"/opt/intel/Compiler/11.1/046/mkl/lib/32" -openmp -liomp5 -lpthread -o myprog.out
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - sarah_a
I based the following on the makefile output when compiling the example file for the gels routine. It seems to work; there is probably some extra stuff in there.
ifort -xK -O3 -static -I /opt/intel/Compiler/11.1/046/mkl/include/32 -w myprog.f90 /opt/intel/Compiler/11.1/046/mkl/lib/32/libmkl_lapack95.a "/opt/intel/Compiler/11.1/046/mkl/lib/32"/libmkl_intel.a -Wl,--start-group "/opt/intel/Compiler/11.1/046/mkl/lib/32"/libmkl_intel_thread.a "/opt/intel/Compiler/11.1/046/mkl/lib/32"/libmkl_core.a -Wl,--end-group -L"/opt/intel/Compiler/11.1/046/mkl/lib/32" -openmp -liomp5 -lpthread -o myprog.out
ifort -xK -O3 -static -I /opt/intel/Compiler/11.1/046/mkl/include/32 -w myprog.f90 /opt/intel/Compiler/11.1/046/mkl/lib/32/libmkl_lapack95.a "/opt/intel/Compiler/11.1/046/mkl/lib/32"/libmkl_intel.a -Wl,--start-group "/opt/intel/Compiler/11.1/046/mkl/lib/32"/libmkl_intel_thread.a "/opt/intel/Compiler/11.1/046/mkl/lib/32"/libmkl_core.a -Wl,--end-group -L"/opt/intel/Compiler/11.1/046/mkl/lib/32" -openmp -liomp5 -lpthread -o myprog.out
Yes, there is duplication; the -L path should already be set by the ifortvars script, and -liomp5 -lpthread are already include in -openmp.

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