Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28445 Discussions

OpenMP settings in VS2017: no /QOpenmp without additional suffix | /Qopenmp-offload fails

Johannes_Rieke
New Contributor III
999 Views

In a newly created project I cannot choose /Qopenmp from drop down list anymore for VS2017 (PSXE 2020 u2, 19.1.2.254):

PSXE2020 update 2/ VS2017 15.9.26PSXE2020 update 2/ VS2017 15.9.26

The new(?) compiler option /Qopenmp-offload or /Qopenmp-offload:host creates a link error, which does not occur, if I'm using /Qopenmp:

1>------ Build started: Project: PSXE2020U2_OMP_bug, Configuration: Debug x64 ------
1>Compiling with Intel(R) Visual Fortran Compiler 19.1.2.254 [Intel(R) 64]...
1>main.f90
1>D:\02_Fortran\99_test\PSXE2020U2_OMP_bug\PSXE2020U2_OMP_bug\main.f90(29): remark #8711: OpenMP* directive disabled via command line.
1>D:\02_Fortran\99_test\PSXE2020U2_OMP_bug\PSXE2020U2_OMP_bug\main.f90(35): remark #8711: OpenMP* directive disabled via command line.
1>D:\02_Fortran\99_test\PSXE2020U2_OMP_bug\PSXE2020U2_OMP_bug\main.f90(27): remark #7712: This variable has not been used.   [J]
1>Linking...
1>main.obj : error LNK2019: unresolved external symbol __kmpc_begin referenced in function MAIN__
1>main.obj : error LNK2019: unresolved external symbol omp_get_thread_num referenced in function MAIN__
1>main.obj : error LNK2019: unresolved external symbol __kmpc_end referenced in function MAIN__
1>x64\Debug\PSXE2020U2_OMP_bug.exe : fatal error LNK1120: 3 unresolved externals

The warnings 8711 are strange too, because I do not get them with /Qopenmp. I've used the example for testing provided by Paul in this thread (in line 29 and 35 are the !$omp direcetives).

Is this a bug or did I made an error?

BR, Johannes

0 Kudos
1 Solution
Johannes_Rieke
New Contributor III
996 Views

My fault. I found /Qopenmp under 'Language' and misunderstood the /Qopenmp-offload, which is an additional parameter and no replcement for /Qopenmp. Setting both /Qopenmp AND /Qopenmp-offload works fine!

View solution in original post

0 Kudos
1 Reply
Johannes_Rieke
New Contributor III
997 Views

My fault. I found /Qopenmp under 'Language' and misunderstood the /Qopenmp-offload, which is an additional parameter and no replcement for /Qopenmp. Setting both /Qopenmp AND /Qopenmp-offload works fine!

0 Kudos
Reply