- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm very new to MKL and I'm trying to get a very basic C program (using MKL)to compile and link under Linux (Redhat RHEL 4 Update 7) - see attached
But try as I have I can't get it to link (see makefile below) - already run mklvars32.sh - this should be easy.
------------------------START MAKEFILE--------------------------------
CC = icc
XLD_LIBRARY_PATH="/opt/intel/mkl/10.0.011/lib/32"
XMKLINC=-I"/opt/intel/mkl/10.0.011/include"
MKLLIB=/opt/intel/mkl/10.0.011/lib/32/libmkl_intel.a \
/opt/intel/mkl/10.0.011/lib/32/libmkl_core.a
matrix: mkl_lab_solution.c
$(CC) mkl_lab_solution.c -I$(INCLUDE) -L$(MKLLIB)
clean:
rm *.o matrix
---------------------END MAKEFILE-----------------------------
So what do I need to include in the makefile to get this simple C program to compile and use MKL?
output from make:
icc mkl_lab_solution.c -I/opt/intel/mkl/10.0.011/include -L/opt/intel/mkl/10.0.011/lib/32/libmkl_intel.a /opt/intel/mkl/10.0.011/lib/32/libmkl_core.a
/tmp/icc7nJbz4.o(.text+0x49b): In function `main':
: undefined reference to `cblas_ddot'
/tmp/icc7nJbz4.o(.text+0x7b7): In function `main':
: undefined reference to `cblas_dgemv'
/tmp/icc7nJbz4.o(.text+0x9fb): In function `main':
: undefined reference to `cblas_dgemm'
/tmp/icc7nJbz4.o(.text+0xcb9): In function `Dgemm_multiply':
: undefined reference to `cblas_dgemm'
/tmp/icc7nJbz4.o(.text+0xd40): In function `Dgemv_multiply':
: undefined reference to `cblas_dgemv'
/tmp/icc7nJbz4.o(.text+0xde9): In function `Ddot_Multiply':
: undefined reference to `cblas_ddot'
make: *** [matrix] Error 1
But try as I have I can't get it to link (see makefile below) - already run mklvars32.sh - this should be easy.
------------------------START MAKEFILE--------------------------------
CC = icc
XLD_LIBRARY_PATH="/opt/intel/mkl/10.0.011/lib/32"
XMKLINC=-I"/opt/intel/mkl/10.0.011/include"
MKLLIB=/opt/intel/mkl/10.0.011/lib/32/libmkl_intel.a \
/opt/intel/mkl/10.0.011/lib/32/libmkl_core.a
matrix: mkl_lab_solution.c
$(CC) mkl_lab_solution.c -I$(INCLUDE) -L$(MKLLIB)
clean:
rm *.o matrix
---------------------END MAKEFILE-----------------------------
So what do I need to include in the makefile to get this simple C program to compile and use MKL?
output from make:
icc mkl_lab_solution.c -I/opt/intel/mkl/10.0.011/include -L/opt/intel/mkl/10.0.011/lib/32/libmkl_intel.a /opt/intel/mkl/10.0.011/lib/32/libmkl_core.a
/tmp/icc7nJbz4.o(.text+0x49b): In function `main':
: undefined reference to `cblas_ddot'
/tmp/icc7nJbz4.o(.text+0x7b7): In function `main':
: undefined reference to `cblas_dgemv'
/tmp/icc7nJbz4.o(.text+0x9fb): In function `main':
: undefined reference to `cblas_dgemm'
/tmp/icc7nJbz4.o(.text+0xcb9): In function `Dgemm_multiply':
: undefined reference to `cblas_dgemm'
/tmp/icc7nJbz4.o(.text+0xd40): In function `Dgemv_multiply':
: undefined reference to `cblas_dgemv'
/tmp/icc7nJbz4.o(.text+0xde9): In function `Ddot_Multiply':
: undefined reference to `cblas_ddot'
make: *** [matrix] Error 1
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - jaewonj
The best way may be to open the MKl userguide for Linux and refer to page 49 ~ 50 (5-7 ~ 5-8).
agree with jaewonj's advice: this is really the best way. You can find there Syntax of Linkig command and a lot of examples for IA32 and intel64 architectures.
The second way - visit the Linker Adviser KB article: "http://software.intel.com/en-us/articles/intel-mkl-link-line-advisor/".
--Gennady
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The best way may be to open the MKl userguide for Linux and refer to page 49 ~ 50 (5-7 ~ 5-8).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - jaewonj
The best way may be to open the MKl userguide for Linux and refer to page 49 ~ 50 (5-7 ~ 5-8).
agree with jaewonj's advice: this is really the best way. You can find there Syntax of Linkig command and a lot of examples for IA32 and intel64 architectures.
The second way - visit the Linker Adviser KB article: "http://software.intel.com/en-us/articles/intel-mkl-link-line-advisor/".
--Gennady
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