[C++20] [Modules] Treat in class defined member functions in language linkage as...
[llvm-project.git] / openmp / runtime / CMakeLists.txt
blobbcae02eba6a59497acf6d3a4f982f4c7cf33a5a7
2 #//===----------------------------------------------------------------------===//
3 #//
4 #// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5 #// See https://llvm.org/LICENSE.txt for license information.
6 #// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 #//
8 #//===----------------------------------------------------------------------===//
11 if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")
12   message(FATAL_ERROR "Direct configuration not supported, please use parent directory!")
13 endif()
15 # Add cmake directory to search for custom cmake functions
16 set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
18 # Set libomp version
19 set(LIBOMP_VERSION_MAJOR 5)
20 set(LIBOMP_VERSION_MINOR 0)
22 # These include files are in the cmake/ subdirectory
23 include(LibompUtils)
24 include(LibompGetArchitecture)
25 include(LibompHandleFlags)
26 include(LibompDefinitions)
28 # Determine the target architecture
29 if(${OPENMP_STANDALONE_BUILD})
30   # If adding a new architecture, take a look at cmake/LibompGetArchitecture.cmake
31   libomp_get_architecture(LIBOMP_DETECTED_ARCH)
32   set(LIBOMP_ARCH ${LIBOMP_DETECTED_ARCH} CACHE STRING
33     "The architecture to build for (x86_64/i386/arm/ppc/ppc64/ppc64le/aarch64/aarch64_32/mic/mips/mips64/riscv64/loongarch64/ve/s390x/wasm32).")
34   # Should assertions be enabled?  They are on by default.
35   set(LIBOMP_ENABLE_ASSERTIONS TRUE CACHE BOOL
36     "enable assertions?")
37   string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE)
38 else() # Part of LLVM build
39   # Determine the native architecture from LLVM.
40   string(TOLOWER "${LLVM_TARGET_ARCH}" LIBOMP_NATIVE_ARCH)
41   if( LIBOMP_NATIVE_ARCH STREQUAL "host" )
42     string(REGEX MATCH "^[^-]*" LIBOMP_NATIVE_ARCH ${LLVM_HOST_TRIPLE})
43   endif ()
44   if(LIBOMP_NATIVE_ARCH MATCHES "i[2-6]86")
45     set(LIBOMP_ARCH i386)
46   elseif(LIBOMP_NATIVE_ARCH STREQUAL "x86")
47     set(LIBOMP_ARCH i386)
48   elseif(LIBOMP_NATIVE_ARCH STREQUAL "amd64")
49     set(LIBOMP_ARCH x86_64)
50   elseif(LIBOMP_NATIVE_ARCH STREQUAL "x86_64")
51     set(LIBOMP_ARCH x86_64)
52   elseif(LIBOMP_NATIVE_ARCH MATCHES "powerpc64le")
53     set(LIBOMP_ARCH ppc64le)
54   elseif(LIBOMP_NATIVE_ARCH MATCHES "powerpc64")
55     set(LIBOMP_ARCH ppc64)
56   elseif(LIBOMP_NATIVE_ARCH MATCHES "powerpc")
57     set(LIBOMP_ARCH ppc)
58   elseif(LIBOMP_NATIVE_ARCH MATCHES "aarch64_32")
59     set(LIBOMP_ARCH aarch64_32)
60   elseif(LIBOMP_NATIVE_ARCH MATCHES "aarch64")
61     set(LIBOMP_ARCH aarch64)
62   elseif(LIBOMP_NATIVE_ARCH MATCHES "arm64")
63     set(LIBOMP_ARCH aarch64)
64   elseif(LIBOMP_NATIVE_ARCH MATCHES "arm")
65     set(LIBOMP_ARCH arm)
66   elseif(LIBOMP_NATIVE_ARCH MATCHES "riscv64")
67     set(LIBOMP_ARCH riscv64)
68   elseif(LIBOMP_NATIVE_ARCH MATCHES "loongarch64")
69     set(LIBOMP_ARCH loongarch64)
70   elseif(LIBOMP_NATIVE_ARCH MATCHES "ve")
71     set(LIBOMP_ARCH ve)
72   elseif(LIBOMP_NATIVE_ARCH MATCHES "s390x")
73     set(LIBOMP_ARCH s390x)
74   elseif(LIBOMP_NATIVE_ARCH MATCHES "wasm")
75     set(LIBOMP_ARCH wasm32)
76   else()
77     # last ditch effort
78     libomp_get_architecture(LIBOMP_ARCH)
79   endif ()
80   set(LIBOMP_ENABLE_ASSERTIONS ${LLVM_ENABLE_ASSERTIONS})
81 endif()
83 # Time profiling support
84 set(LIBOMP_PROFILING_SUPPORT ${OPENMP_ENABLE_LIBOMP_PROFILING})
86 # FUJITSU A64FX is a special processor because its cache line size is 256.
87 # We need to pass this information into kmp_config.h.
88 if(LIBOMP_ARCH STREQUAL "aarch64")
89   libomp_is_aarch64_a64fx(LIBOMP_DETECT_AARCH64_A64FX)
90   if (LIBOMP_DETECT_AARCH64_A64FX)
91     set(LIBOMP_ARCH "aarch64_a64fx")
92     set(LIBOMP_ARCH_AARCH64_A64FX TRUE)
93   endif()
94 endif()
96 libomp_check_variable(LIBOMP_ARCH 32e x86_64 32 i386 arm ppc ppc64 ppc64le aarch64 aarch64_32 aarch64_a64fx mic mips mips64 riscv64 loongarch64 ve s390x wasm32)
98 set(LIBOMP_LIB_TYPE normal CACHE STRING
99   "Performance,Profiling,Stubs library (normal/profile/stubs)")
100 libomp_check_variable(LIBOMP_LIB_TYPE normal profile stubs)
101 # Set the OpenMP Year and Month associated with version
102 set(LIBOMP_OMP_YEAR_MONTH 201611)
103 set(LIBOMP_MIC_ARCH knc CACHE STRING
104   "Intel(R) Many Integrated Core Architecture (Intel(R) MIC Architecture) (knf/knc).  Ignored if not Intel(R) MIC Architecture build.")
105 if("${LIBOMP_ARCH}" STREQUAL "mic")
106   libomp_check_variable(LIBOMP_MIC_ARCH knf knc)
107 endif()
108 set(LIBOMP_FORTRAN_MODULES FALSE CACHE BOOL
109   "Create Fortran module files? (requires fortran compiler)")
111 # - Support for universal fat binary builds on Mac
112 # - Having this extra variable allows people to build this library as a universal library
113 #   without forcing a universal build of the llvm/clang compiler.
114 set(LIBOMP_OSX_ARCHITECTURES "${CMAKE_OSX_ARCHITECTURES}" CACHE STRING
115   "For Mac builds, semicolon separated list of architectures to build for universal fat binary.")
116 set(CMAKE_OSX_ARCHITECTURES ${LIBOMP_OSX_ARCHITECTURES})
118 # Should @rpath be used for dynamic libraries on Mac?
119 # The if(NOT DEFINED) is there to guard a cached value of the variable if one
120 # exists so there is no interference with what the user wants.  Also, no cache entry
121 # is created so there are no inadvertant effects on other parts of LLVM.
122 if(NOT DEFINED CMAKE_MACOSX_RPATH)
123   set(CMAKE_MACOSX_RPATH TRUE)
124 endif()
126 # User specified flags.  These are appended to the configured flags.
127 set(LIBOMP_CXXFLAGS "" CACHE STRING
128   "Appended user specified C++ compiler flags.")
129 set(LIBOMP_CPPFLAGS "" CACHE STRING
130   "Appended user specified C preprocessor flags.")
131 set(LIBOMP_ASMFLAGS "" CACHE STRING
132   "Appended user specified assembler flags.")
133 set(LIBOMP_LDFLAGS "" CACHE STRING
134   "Appended user specified linker flags.")
135 if(${CMAKE_SYSTEM_NAME} MATCHES "AIX")
136   set(LIBOMP_LIBFLAGS "-lperfstat" CACHE STRING
137     "Appended user specified linked libs flags. (e.g., -lm)")
138   if("${LIBOMP_ARCH}" STREQUAL "ppc")
139     # PPC (32-bit) on AIX needs libatomic for __atomic_load_8, etc.
140     set(LIBOMP_LIBFLAGS "${LIBOMP_LIBFLAGS} -latomic")
141   endif()
142 else()
143   set(LIBOMP_LIBFLAGS "" CACHE STRING
144     "Appended user specified linked libs flags. (e.g., -lm)")
145 endif()
146 set(LIBOMP_FFLAGS "" CACHE STRING
147   "Appended user specified Fortran compiler flags.  These are only used if LIBOMP_FORTRAN_MODULES==TRUE.")
149 # Should the libomp library and generated headers be copied into the original source exports/ directory
150 # Turning this to FALSE aids parallel builds to not interfere with each other.
151 # Currently, the testsuite module expects the just built OpenMP library to be located inside the exports/
152 # directory.  TODO: have testsuite run under llvm-lit directly.  We can then get rid of copying to exports/
153 set(LIBOMP_COPY_EXPORTS FALSE CACHE STRING
154   "Should exports be copied into source exports/ directory?")
156 # HWLOC-support
157 set(LIBOMP_USE_HWLOC FALSE CACHE BOOL
158   "Use Hwloc (http://www.open-mpi.org/projects/hwloc/) library for affinity?")
159 set(LIBOMP_HWLOC_INSTALL_DIR /usr/local CACHE PATH
160   "Install path for hwloc library")
162 # Get the build number from kmp_version.cpp
163 libomp_get_build_number("${CMAKE_CURRENT_SOURCE_DIR}" LIBOMP_VERSION_BUILD)
164 math(EXPR LIBOMP_VERSION_BUILD_YEAR "${LIBOMP_VERSION_BUILD}/10000")
165 math(EXPR LIBOMP_VERSION_BUILD_MONTH_DAY "${LIBOMP_VERSION_BUILD}%10000")
167 # Currently don't record any timestamps
168 set(LIBOMP_BUILD_DATE "No_Timestamp")
170 # Architecture
171 set(IA32 FALSE)
172 set(INTEL64 FALSE)
173 set(ARM FALSE)
174 set(AARCH64 FALSE)
175 set(AARCH64_32 FALSE)
176 set(AARCH64_A64FX FALSE)
177 set(PPC64BE FALSE)
178 set(PPC64LE FALSE)
179 set(PPC64 FALSE)
180 set(MIC FALSE)
181 set(MIPS64 FALSE)
182 set(MIPS FALSE)
183 set(RISCV64 FALSE)
184 set(LOONGARCH64 FALSE)
185 set(VE FALSE)
186 set(S390X FALSE)
187 set(WASM FALSE)
188 set(PPC FALSE)
189 if("${LIBOMP_ARCH}" STREQUAL "i386" OR "${LIBOMP_ARCH}" STREQUAL "32")    # IA-32 architecture
190   set(IA32 TRUE)
191 elseif("${LIBOMP_ARCH}" STREQUAL "x86_64" OR "${LIBOMP_ARCH}" STREQUAL "32e") # Intel(R) 64 architecture
192   set(INTEL64 TRUE)
193 elseif("${LIBOMP_ARCH}" STREQUAL "arm") # ARM architecture
194   set(ARM TRUE)
195 elseif("${LIBOMP_ARCH}" STREQUAL "ppc") # PPC32 architecture
196   set(PPC TRUE)
197 elseif("${LIBOMP_ARCH}" STREQUAL "ppc64") # PPC64BE architecture
198   set(PPC64BE TRUE)
199   set(PPC64 TRUE)
200 elseif("${LIBOMP_ARCH}" STREQUAL "ppc64le") # PPC64LE architecture
201   set(PPC64LE TRUE)
202   set(PPC64 TRUE)
203 elseif("${LIBOMP_ARCH}" STREQUAL "aarch64") # AARCH64 architecture
204   set(AARCH64 TRUE)
205 elseif("${LIBOMP_ARCH}" STREQUAL "aarch64_32") # AARCH64_32 architecture
206   set(AARCH64_32 TRUE)
207 elseif("${LIBOMP_ARCH}" STREQUAL "aarch64_a64fx") # AARCH64_A64FX architecture
208   set(AARCH64_A64FX TRUE)
209 elseif("${LIBOMP_ARCH}" STREQUAL "mic") # Intel(R) Many Integrated Core Architecture
210   set(MIC TRUE)
211 elseif("${LIBOMP_ARCH}" STREQUAL "mips") # MIPS architecture
212     set(MIPS TRUE)
213 elseif("${LIBOMP_ARCH}" STREQUAL "mips64") # MIPS64 architecture
214     set(MIPS64 TRUE)
215 elseif("${LIBOMP_ARCH}" STREQUAL "riscv64") # RISCV64 architecture
216     set(RISCV64 TRUE)
217 elseif("${LIBOMP_ARCH}" STREQUAL "loongarch64") # LoongArch64 architecture
218     set(LOONGARCH64 TRUE)
219 elseif("${LIBOMP_ARCH}" STREQUAL "ve") # VE architecture
220     set(VE TRUE)
221 elseif("${LIBOMP_ARCH}" STREQUAL "s390x") # S390x (Z) architecture
222     set(S390X TRUE)
223 elseif("${LIBOMP_ARCH}" STREQUAL "wasm32") # WebAssembly architecture
224     set(WASM TRUE)
225 endif()
227 # Set some flags based on build_type
228 set(RELEASE_BUILD FALSE)
229 set(DEBUG_BUILD FALSE)
230 set(RELWITHDEBINFO_BUILD FALSE)
231 set(MINSIZEREL_BUILD FALSE)
232 if("${uppercase_CMAKE_BUILD_TYPE}" STREQUAL "RELEASE")
233   set(RELEASE_BUILD TRUE)
234 elseif("${uppercase_CMAKE_BUILD_TYPE}" STREQUAL "DEBUG")
235   set(DEBUG_BUILD TRUE)
236 elseif("${uppercase_CMAKE_BUILD_TYPE}" STREQUAL "RELWITHDEBINFO")
237   set(RELWITHDEBINFO_BUILD TRUE)
238 elseif("${uppercase_CMAKE_BUILD_TYPE}" STREQUAL "MINSIZEREL")
239   set(MINSIZEREL_BUILD TRUE)
240 endif()
242 # Include itt notify interface?
243 set(LIBOMP_USE_ITT_NOTIFY TRUE CACHE BOOL
244   "Enable ITT notify?")
246 # normal, profile, stubs library.
247 set(NORMAL_LIBRARY FALSE)
248 set(STUBS_LIBRARY FALSE)
249 set(PROFILE_LIBRARY FALSE)
250 if("${LIBOMP_LIB_TYPE}" STREQUAL "normal")
251   set(NORMAL_LIBRARY TRUE)
252 elseif("${LIBOMP_LIB_TYPE}" STREQUAL "profile")
253   set(PROFILE_LIBRARY TRUE)
254 elseif("${LIBOMP_LIB_TYPE}" STREQUAL "stubs")
255   set(STUBS_LIBRARY TRUE)
256 endif()
258 # Setting directory names
259 set(LIBOMP_BASE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
260 set(LIBOMP_SRC_DIR ${LIBOMP_BASE_DIR}/src)
261 set(LIBOMP_TOOLS_DIR ${LIBOMP_BASE_DIR}/tools)
262 set(LIBOMP_INC_DIR ${LIBOMP_SRC_DIR}/include)
263 set(LIBOMP_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
265 # Enabling Fortran if it is needed
266 if(${LIBOMP_FORTRAN_MODULES})
267   enable_language(Fortran)
268 endif()
269 # Enable MASM Compiler if it is needed (Windows only)
270 if(WIN32)
271   enable_language(ASM_MASM)
272 endif()
274 # Getting legal type/arch
275 libomp_get_legal_type(LIBOMP_LEGAL_TYPE)
276 libomp_get_legal_arch(LIBOMP_LEGAL_ARCH)
278 # Compiler flag checks, library checks, threading check, etc.
279 include(config-ix)
281 # Is there a quad precision data type available?
282 # TODO: Make this a real feature check
283 set(LIBOMP_USE_QUAD_PRECISION "${LIBOMP_HAVE_QUAD_PRECISION}" CACHE BOOL
284   "Should 128-bit precision entry points be built?")
285 if(LIBOMP_USE_QUAD_PRECISION AND (NOT LIBOMP_HAVE_QUAD_PRECISION))
286   libomp_error_say("128-bit quad precision functionality requested but not available")
287 endif()
289 # libgomp drop-in compatibility requires versioned symbols
290 set(LIBOMP_USE_VERSION_SYMBOLS "${LIBOMP_HAVE_VERSION_SYMBOLS}" CACHE BOOL
291   "Should version symbols be used? These provide binary compatibility with libgomp.")
292 if(LIBOMP_USE_VERSION_SYMBOLS AND (NOT LIBOMP_HAVE_VERSION_SYMBOLS))
293   libomp_error_say("Version symbols functionality requested but not available")
294 endif()
296 # On multinode systems, larger alignment is desired to avoid false sharing
297 set(LIBOMP_USE_INTERNODE_ALIGNMENT FALSE CACHE BOOL
298   "Should larger alignment (4096 bytes) be used for some locks and data structures?")
300 # Build code that allows the OpenMP library to conveniently interface with debuggers
301 set(LIBOMP_USE_DEBUGGER FALSE CACHE BOOL
302   "Enable debugger interface code?")
304 # Should we link to C++ library?
305 set(LIBOMP_USE_STDCPPLIB FALSE CACHE BOOL
306   "Should we link to C++ library?")
308 # Intel(R) Transactional Synchronization Extensions (Intel(R) TSX) based locks have
309 # __asm code which can be troublesome for some compilers.  This feature is also x86 specific.
310 # TODO: Make this a real feature check
311 set(LIBOMP_USE_ADAPTIVE_LOCKS "${LIBOMP_HAVE_ADAPTIVE_LOCKS}" CACHE BOOL
312   "Should Intel(R) TSX lock be compiled (adaptive lock in kmp_lock.cpp).  These are x86 specific.")
313 if(LIBOMP_USE_ADAPTIVE_LOCKS AND (NOT LIBOMP_HAVE_ADAPTIVE_LOCKS))
314   libomp_error_say("Adaptive locks (Intel(R) TSX) functionality is only supported on x86 Architecture")
315 endif()
317 # - stats-gathering enables OpenMP stats where things like the number of
318 # parallel regions, clock ticks spent in particular openmp regions are recorded.
319 set(LIBOMP_STATS FALSE CACHE BOOL
320   "Stats-Gathering functionality?")
321 if(LIBOMP_STATS AND (NOT LIBOMP_HAVE_STATS))
322   libomp_error_say("Stats-gathering functionality requested but not available")
323 endif()
324 # The stats functionality requires the std c++ library
325 if(LIBOMP_STATS)
326   set(LIBOMP_USE_STDCPPLIB TRUE)
327 endif()
329 # Shared library can be switched to a static library
330 set(LIBOMP_ENABLE_SHARED TRUE CACHE BOOL
331   "Shared library instead of static library?")
333 if(WASM)
334   libomp_warning_say("The WebAssembly build currently only supports static libraries; forcing LIBOMP_ENABLE_SHARED to false")
335   set(LIBOMP_ENABLE_SHARED FALSE)
336 endif()
338 if(WIN32 AND NOT LIBOMP_ENABLE_SHARED)
339   libomp_error_say("Static libraries requested but not available on Windows")
340 endif()
342 if(LIBOMP_USE_ITT_NOTIFY AND NOT LIBOMP_ENABLE_SHARED)
343   message(STATUS "ITT Notify not supported for static libraries - forcing ITT Notify off")
344   set(LIBOMP_USE_ITT_NOTIFY FALSE)
345 endif()
347 if(LIBOMP_USE_VERSION_SYMBOLS AND (NOT LIBOMP_ENABLE_SHARED) )
348   message(STATUS "Version symbols not supported for static libraries - forcing Version symbols functionality off")
349   set (LIBOMP_USE_VERSION_SYMBOLS FALSE)
350 endif()
352 # OMPT-support defaults to ON for OpenMP 5.0+ and if the requirements in
353 # cmake/config-ix.cmake are fulfilled.
354 set(OMPT_DEFAULT FALSE)
355 if ((LIBOMP_HAVE_OMPT_SUPPORT) AND (NOT WIN32))
356   set(OMPT_DEFAULT TRUE)
357 endif()
358 set(LIBOMP_OMPT_SUPPORT ${OMPT_DEFAULT} CACHE BOOL
359   "OMPT-support?")
361 set(LIBOMP_OMPT_DEBUG FALSE CACHE BOOL
362   "Trace OMPT initialization?")
363 set(LIBOMP_OMPT_OPTIONAL TRUE CACHE BOOL
364   "OMPT-optional?")
365 if(LIBOMP_OMPT_SUPPORT AND (NOT LIBOMP_HAVE_OMPT_SUPPORT))
366   libomp_error_say("OpenMP Tools Interface requested but not available in this implementation")
367 endif()
369 # OMPD-support
370 # Enable if OMPT SUPPORT is ON
371 set(OMPD_DEFAULT FALSE)
372 if (LIBOMP_HAVE_OMPT_SUPPORT AND ("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux"))
373   set(OMPD_DEFAULT TRUE)
374 endif()
376 set(LIBOMP_OMPD_SUPPORT ${OMPD_DEFAULT} CACHE BOOL
377   "OMPD-support?")
379 if(LIBOMP_OMPD_SUPPORT AND ((NOT LIBOMP_OMPT_SUPPORT) OR (NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")))
380   libomp_warning_say("OpenMP Debug Interface(OMPD) requested but not available in this implementation")
381   set(LIBOMP_OMPD_SUPPORT FALSE)
382 endif()
384 # OMPX Taskgraph support
385 # Whether to build with OMPX Taskgraph (e.g. task record & replay)
386 set(LIBOMP_OMPX_TASKGRAPH FALSE CACHE BOOL "OMPX-taskgraph (task record & replay)?")
388 # Error check hwloc support after config-ix has run
389 if(LIBOMP_USE_HWLOC AND (NOT LIBOMP_HAVE_HWLOC))
390   libomp_error_say("Hwloc requested but not available")
391 endif()
393 # Hierarchical scheduling support
394 set(LIBOMP_USE_HIER_SCHED FALSE CACHE BOOL
395   "Hierarchical scheduling support?")
397 # Setting final library name
398 set(LIBOMP_DEFAULT_LIB_NAME libomp)
399 if(${PROFILE_LIBRARY})
400   set(LIBOMP_DEFAULT_LIB_NAME ${LIBOMP_DEFAULT_LIB_NAME}prof)
401 endif()
402 if(${STUBS_LIBRARY})
403   set(LIBOMP_DEFAULT_LIB_NAME ${LIBOMP_DEFAULT_LIB_NAME}stubs)
404 endif()
405 set(LIBOMP_LIB_NAME ${LIBOMP_DEFAULT_LIB_NAME} CACHE STRING "Base OMP library name")
406 if (OPENMP_MSVC_NAME_SCHEME)
407   # MSVC_TOOLS_VERSION corresponds to the version of the VC++ toolset.
408   set(MSVC_TOOLS_VERSION 140)
409   set(LIBOMP_LIB_NAME ${LIBOMP_LIB_NAME}${MSVC_TOOLS_VERSION}.${LIBOMP_ARCH})
410 endif()
412 if(${LIBOMP_ENABLE_SHARED})
413   set(LIBOMP_LIBRARY_SUFFIX ${CMAKE_SHARED_LIBRARY_SUFFIX})
414   set(LIBOMP_LIBRARY_KIND SHARED)
415   set(LIBOMP_INSTALL_KIND LIBRARY)
416 else()
417   set(LIBOMP_LIBRARY_SUFFIX ${CMAKE_STATIC_LIBRARY_SUFFIX})
418   set(LIBOMP_LIBRARY_KIND STATIC)
419   set(LIBOMP_INSTALL_KIND ARCHIVE)
420 endif()
422 set(LIBOMP_LIB_FILE ${LIBOMP_LIB_NAME}${LIBOMP_LIBRARY_SUFFIX})
424 # Optional backwards compatibility aliases.
425 set(LIBOMP_INSTALL_ALIASES TRUE CACHE BOOL
426   "Install libgomp and libiomp5 library aliases for backwards compatibility")
428 # Print configuration after all variables are set.
429 if(${OPENMP_STANDALONE_BUILD})
430   libomp_say("Operating System     -- ${CMAKE_SYSTEM_NAME}")
431   libomp_say("Target Architecture  -- ${LIBOMP_ARCH}")
432   if(${MIC})
433     libomp_say("Intel(R) MIC Architecture    -- ${LIBOMP_MIC_ARCH}")
434   endif()
435   libomp_say("Build Type           -- ${CMAKE_BUILD_TYPE}")
436   libomp_say("Library Kind         -- ${LIBOMP_LIBRARY_KIND}")
437   libomp_say("Library Type         -- ${LIBOMP_LIB_TYPE}")
438   libomp_say("Fortran Modules      -- ${LIBOMP_FORTRAN_MODULES}")
439   # will say development if all zeros
440   if(${LIBOMP_VERSION_BUILD} STREQUAL 00000000)
441     set(LIBOMP_BUILD Development)
442   else()
443     set(LIBOMP_BUILD ${LIBOMP_VERSION_BUILD})
444   endif()
445   libomp_say("Build                -- ${LIBOMP_BUILD}")
446   libomp_say("Use Stats-gathering  -- ${LIBOMP_STATS}")
447   libomp_say("Use Debugger-support -- ${LIBOMP_USE_DEBUGGER}")
448   libomp_say("Use ITT notify       -- ${LIBOMP_USE_ITT_NOTIFY}")
449   libomp_say("Use OMPT-support     -- ${LIBOMP_OMPT_SUPPORT}")
450   if(${LIBOMP_OMPT_SUPPORT})
451     libomp_say("Use OMPT-optional  -- ${LIBOMP_OMPT_OPTIONAL}")
452   endif()
453   libomp_say("Use OMPD-support     -- ${LIBOMP_OMPD_SUPPORT}")
454   libomp_say("Use Adaptive locks   -- ${LIBOMP_USE_ADAPTIVE_LOCKS}")
455   libomp_say("Use quad precision   -- ${LIBOMP_USE_QUAD_PRECISION}")
456   libomp_say("Use Hwloc library    -- ${LIBOMP_USE_HWLOC}")
457   libomp_say("Use OMPX-taskgraph   -- ${LIBOMP_OMPX_TASKGRAPH}")
458 endif()
460 add_subdirectory(src)
461 add_subdirectory(test)
463 # make these variables available for tools:
464 set(LIBOMP_LIBRARY_DIR ${LIBOMP_LIBRARY_DIR} PARENT_SCOPE)
465 set(LIBOMP_INCLUDE_DIR ${LIBOMP_INCLUDE_DIR} PARENT_SCOPE)
466 set(LIBOMP_OMP_TOOLS_INCLUDE_DIR ${LIBOMP_OMP_TOOLS_INCLUDE_DIR} PARENT_SCOPE)
467 # make these variables available for tools/libompd:
468 set(LIBOMP_SRC_DIR ${LIBOMP_SRC_DIR} PARENT_SCOPE)
469 set(LIBOMP_OMPD_SUPPORT ${LIBOMP_OMPD_SUPPORT} PARENT_SCOPE)