Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

error in including library vslf

fymaterials
Beginner
822 Views
Hi, guys:
I want to use vslf packages.
The mkl library is under directory: /home/fengy/mkl/10.0.3.020/

The makefile is like this:
# application name
APP = test

# list of source files
SRC = test.f90

# list of object files
OBJ = test.o

# list of include directory
DIR1 = /home/fengy/mkl/10.0.3.020/include
DIR2 = /home/fengy/mkl/10.0.3.020/examples/vslf/source

# define libraries needed by the linker
LIBS = -L/home/fengy/mkl/10.0.3.020/lib/em64t /home/fengy/mkl/10.0.3.020/lib/em64t/libmkl_intel_lp64.a -Wl,--start-group /home/fengy/mkl/10.0.3.020/lib/em64t/libmkl_intel_thread.a /home/fengy/mkl/10.0.3.020/lib/em64t/libmkl_core.a -Wl,--end-group /home/fengy/mkl/10.0.3.020/lib/em64t/libguide.a -lpthread

# compiler options for debugging
FC_DEBUG = ifort -I ${DIR1} -I ${DIR2} -g -debug all -check all -implicitnone -warn all

# compiler options for optmized running
FC_OPT = ifort --I ${DIR1} -I ${DIR2} O3 -xO -ipo -no-prec-div -static


# build rules

.SUFFIXES: .f90 .o .mod
.f90.o:
${FC_DEBUG} -c INCLUDE '/home/fengy/mkl/10.0.3.020/include/mkl_vkl.fi'
INCLUDE '/home/fengy/mkl/10.0.3.020/example/vslf/errcheck.inc'

!INCLUDE 'mkl_vkl.fi'
!INCLUDE 'errcheck.inc'

PROGRAM test_g_r
USE MKL_VSL_TYPE
USE MKL_VSL

IMPLICIT NONE

INTEGER(KIND=4) i, nn
INTEGER n
INTEGER(KIND=4) errcode

INTEGER brng, method, seed

TYPE(VSL_STREAM_STATE) :: stream
REAL a, sigma
REAL, DIMENSION(1) :: r



n=1
brng = VSL_BRNG_MCG31
method = 0
seed = 777

errcode = vslnewstream(stream, brng, seed)
CALL CheckVslError(errcode)

errcode = vsrnggaussian(method, stream, n, r, a, sigma)
CALL CheckVslError(errcode)

WRITE(*,*) 'now r is: ', r(1)
END PROGRAM test_g_rlt;

debug: ${OBJ} ${SRC}
${FC_DEBUG} -o ${APP} ${OBJ} ${LIBS}

opt: ${SRC}
${FC_OPT} -o ${APP} ${SRC} ${LIBS}

clean:
rm -f *.mod *.o ${APP}

And the source file test.f90 is:
INCLUDE '/home/fengy/mkl/10.0.3.020/include/mkl_vkl.fi'
INCLUDE '/home/fengy/mkl/10.0.3.020/example/vslf/errcheck.inc'

!INCLUDE 'mkl_vkl.fi'
!INCLUDE 'errcheck.inc'

PROGRAM test_g_r
USE MKL_VSL_TYPE
USE MKL_VSL

IMPLICIT NONE

INTEGER(KIND=4) i, nn
INTEGER n
INTEGER(KIND=4) errcode

INTEGER brng, method, seed

TYPE(VSL_STREAM_STATE) :: stream
REAL a, sigma
REAL, DIMENSION(1) :: r



n=1
brng = VSL_BRNG_MCG31
method = 0
seed = 777

errcode = vslnewstream(stream, brng, seed)
CALL CheckVslError(errcode)

errcode = vsrnggaussian(method, stream, n, r, a, sigma)
CALL CheckVslError(errcode)

WRITE(*,*) 'now r is: ', r(1)
END PROGRAM test_g_r

When I type make -debug, an error message appears: Cannot open include file '/home/fengy/mkl/10.0.3.020/include/mkl_vkl.fi

but mkl_vki is uder directory /home/fengy/mkl/10.0.3.020/include/mkl_vkl.fi

Could you help me to figure it out what wrong with my code?

Thanks!
Arthur
0 Kudos
3 Replies
Andrey_N_Intel
Employee
822 Views

Can you replace mkl_vkl.fi with mkl_vsl.fieverywhere in your example and let me know how it works? Andrey
0 Kudos
fymaterials
Beginner
822 Views

Can you replace mkl_vkl.fi with mkl_vsl.fieverywhere in your example and let me know how it works? Andrey
Thanks, Andrey, now it is working. But I get a warning message: Warning: /home/fengy/mkl/10.0.3.020/include/mkl_vsl.fi, line 297: This name has not been given an explicit type. [VSL_USER_INIT_DIRECTION_NUMBERS]
PARAMETER (VSL_USER_INIT_DIRECTION_NUMBERS = 2)

Is it normal?

Arthur

0 Kudos
Andrey_N_Intel
Employee
822 Views

This is not normal, thank you for letting us know. The issue will be fixed in future versions of the library. Andrey
0 Kudos
Reply