I've freshly installed the Intel® Parallel Studio XE Composer Edition for Fortran OS X* (student version). It comes with the Math Kernel Library, which is why I bought it. I'm having a hard time getting started with MKL though. Here's what I've done step-by-step. (sorry for the beginner question, this is probably really obvious to everyone else here).
1) Installed Intel® Parallel Studio XE Composer Edition for Fortran OS X* (no problem). I can run a 'hello world' script using ifort and throw the -mkl link command on at the end with no problem (not calling any mkl commands just yet).
2) Following these instructions I set my environment variables using a script provided by intel (located in opt/intel/bin to be precise). I have the intel 64-bit architecture (according to ifort -V) so I navigate to opt/intel/mkl/bin and run bash mklvars.sh intel64 mod ilp64. It runs without error (or any output, I assume it's working).
3) I write the following code to use MKL's gemm command for fortran95. Just multiplying 2 matrices.
program test implicit none real, dimension(2,2) :: testA, testB, testC testA = 1 testB = 1 testC = 0 ! I don't think I need this line, but it shouldn't matter call gemm(testA, testB, testC) write(*,*) testC end program test
4) I compile with ifort test_mkl.f90 -o test -mkl. I get the following error:
Undefined symbols for architecture x86_64:"_gemm_", referenced from: _MAIN__ in ifortSTVOrB.o ld: symbol(s) not found for architecture x86_64
5) I try ifort test_mkl.f90 -o test -L/opt/intel/mkl/lib -mkl and get the same result.
6) If I add the line USE mkl95_blas, ONLY: gemm, above implicit none in both of the above examples I get:
test_mkl.f90(4): error #7002: Error in opening the compiled module file. Check INCLUDE paths. [MKL95_BLAS] USE mkl95_blas, ONLY: gemm --------^ test_mkl.f90(12): error #6406: Conflicting attributes or multiple declaration of name. [GEMM] call gemm(testA, testB, testC ) ---------^ test_mkl.f90(4): error #6580: Name in only-list does not exist. [GEMM] USE mkl95_blas, ONLY: gemm --------------------------^ compilation aborted for test_mkl.f90 (code 1)
If your curious, I have successfully run this example script in XCODE using MKL, so it's definitely something I'm doing and not my installation. Specifically, my .mod files are built and are in the directories in the Include statement below (generate the same error as above).
ifort test_mkl.f90 -I/opt/intel/mkl/include/intel64/ilp64 -L/opt/intel/mkl/lib/ -mkl -lmkl_blas95
ifort test_mkl.f90 -I/opt/intel/composer_xe_2015.3.187/mkl/include/intel64/ilp64 -L/opt/intel/composer_xe_2015.3.187/mkl/lib/
ifort test_mkl.f90 -I/opt/intel/composer_xe_2015.3.187/mkl/inlcude/intel64/ilp64 -L/opt/intel/composer_xe_2015.3.187/mkl/lib/ -mkl -lmkl_blas95