Intel Fortran and OpenMP Error for Mex on Windows

2 views (last 30 days)
I am trying to add an openmp speed up to a loop in a Fortran mex file. On compiling, I get the following error:
error LNK2019: unresolved external symbol omp_get_num_threads referenced in function MEXFUNCTION
My compiler command is: mex FFLAGS="\$FFLAGS -ffree-line-length-none /Qopenmp -heap-arrays -O3" LDFLAGS="\$LDFLAGS /Qopenmp -heap-arrays /iface:cvf" file_name.f90
In the subroutine, I use omp_lib and call omp_get_num_threads as follows: !$OMP PARALLEL SHARED(var_names), PRIVATE(pp), NUM_THREADS(4)
pp = OMP_GET_NUM_THREADS()
My Matlab version is R2012a with Intel Visual Fortran 12 (with Microsoft Software Development Kit (SDK) linker)
Does anyone know what the issue is?
Thanks

Answers (0)

Categories

Find more on Fortran with MATLAB in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!