File tree Expand file tree Collapse file tree 5 files changed +13
-16
lines changed
Expand file tree Collapse file tree 5 files changed +13
-16
lines changed Original file line number Diff line number Diff line change @@ -124,11 +124,8 @@ endif ()
124124set (OPENMP_TEST_Fortran_COMPILER "${OPENMP_TEST_Fortran_COMPILER_default} " CACHE STRING
125125 "Fortran compiler to use for testing OpenMP runtime libraries." )
126126
127- if (LLVM_RUNTIMES_BUILD)
128- set (LIBOMP_FORTRAN_MODULES "${RUNTIMES_FLANG_MODULES_ENABLED} " CACHE BOOL
129- "Create Fortran module files? (requires fortran compiler)" )
130- else ()
131- set (LIBOMP_FORTRAN_MODULES FALSE )
127+ if (CMAKE_Fortran_COMPILER AND NOT LLVM_RUNTIMES_BUILD)
128+ message (WARNING "Building omp_lib.mod requires using LLVM_ENABLE_RUNTIMES=flang-rt\\\; openmp" )
132129endif ()
133130
134131# Set up testing infrastructure.
@@ -163,10 +160,10 @@ else()
163160 get_clang_resource_dir(LIBOMP_HEADERS_INSTALL_PATH SUBDIR include )
164161endif ()
165162
166- if (LIBOMP_FORTRAN_MODULES )
163+ if (LIBOMP_FORTRUNTIMES_FLANG_MODULES_ENABLEDRAN_MODULES )
167164 add_subdirectory (module)
168165else ()
169- message (STATUS "Building omp_lib.mod disabled by LIBOMP_FORTRAN_MODULES ='${LIBOMP_FORTRAN_MODULES } '; libomp-mod does nothing" )
166+ message (STATUS "Building omp_lib.mod disabled by RUNTIMES_FLANG_MODULES_ENABLED ='${RUNTIMES_FLANG_MODULES_ENABLED } '; libomp-mod does nothing" )
170167 add_custom_target (libomp-mod)
171168endif ()
172169
Original file line number Diff line number Diff line change @@ -96,7 +96,7 @@ variable.
9696
9797**CMAKE_Fortran_COMPILER ** = <Fortran compiler name>
9898 Specify the Fortran compiler. This option is only needed when
99- **LIBOMP_FORTRAN_MODULES ** is ``ON `` (see below) . So typically, a Fortran
99+ **RUNTIMES_FLANG_MODULES_ENABLED ** is ``ON ``. So typically, a Fortran
100100 compiler is not needed during the build.
101101
102102**CMAKE_ASM_MASM_COMPILER ** = ``ml|ml64 ``
@@ -166,9 +166,6 @@ Options for ``libomp``
166166
167167 Static libraries are not supported on Windows*.
168168
169- **LIBOMP_FORTRAN_MODULES ** = ``OFF|ON ``
170- Create the Fortran modules (requires Fortran compiler).
171-
172169macOS* Fat Libraries
173170""""""""""""""""""""
174171On macOS* machines, it is possible to build universal (or fat) libraries which
@@ -343,7 +340,7 @@ Advanced Builds with Various Options
343340
344341 .. code-block :: console
345342
346- $ cmake -DCMAKE_C_COMPILER=icc -DCMAKE_CXX_COMPILER=icpc -DCMAKE_Fortran_COMPILER=ifort -DLIBOMP_FORTRAN_MODULES =on ..
343+ $ cmake -DCMAKE_C_COMPILER=icc -DCMAKE_CXX_COMPILER=icpc -DCMAKE_Fortran_COMPILER=ifort -DRUNTIMES_FLANG_MODULES_ENABLED =on ..
347344
348345 - Have CMake find the C/C++ compiler and specify additional flags for the
349346 preprocessor and C++ compiler.
Original file line number Diff line number Diff line change @@ -21,9 +21,12 @@ add_library(libomp-mod OBJECT
2121)
2222set_target_properties (libomp-mod PROPERTIES FOLDER "OpenMP/Fortran Modules" )
2323
24+ # The following requests explicit building of the Fortran module files
25+ # Workaround for gfortran to build modules with the
26+ # omp_sched_monotonic integer parameter
2427if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" )
25- target_compile_options (libomp-mod PRIVATE -fno-range-check)
26- endif ()
28+ target_compile_options (libomp-mod PRIVATE -fno-range-check)
29+ endif ()
2730
2831flang_module_target(libomp-mod PUBLIC )
2932if (FORTRAN_MODULE_DEPS)
Original file line number Diff line number Diff line change @@ -422,7 +422,7 @@ if(${OPENMP_STANDALONE_BUILD})
422422 libomp_say("Build Type -- ${CMAKE_BUILD_TYPE} " )
423423 libomp_say("Library Kind -- ${LIBOMP_LIBRARY_KIND} " )
424424 libomp_say("Library Type -- ${LIBOMP_LIB_TYPE} " )
425- libomp_say("Fortran Modules -- ${LIBOMP_FORTRAN_MODULES } " )
425+ libomp_say("Fortran Modules -- ${RUNTIMES_FLANG_MODULES_ENABLED } " )
426426 # will say development if all zeros
427427 if (${LIBOMP_VERSION_BUILD} STREQUAL 00000000)
428428 set (LIBOMP_BUILD Development)
Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ if(${LIBOMP_OMPT_SUPPORT})
6464 COMMAND ${CMAKE_COMMAND} -E copy omp-tools.h ${LIBOMP_EXPORTS_CMN_DIR}
6565 )
6666endif ()
67- if (${LIBOMP_FORTRAN_MODULES} )
67+ if (RUNTIMES_FLANG_MODULES_ENABLED )
6868 # We cannot attach a POST_BUILD command to libomp-mod, so instead attach it
6969 # to omp and ensure that libomp-mod is built before by adding a dependency
7070 add_custom_command (TARGET omp POST_BUILD
You can’t perform that action at this time.
0 commit comments