blob: 1d814f022eefa77a885d03b77e07047dd1460b37 [file] [log] [blame]
Jim Cownie3b81ce62014-08-05 09:32:281#
2#//===----------------------------------------------------------------------===//
3#//
4#// The LLVM Compiler Infrastructure
5#//
6#// This file is dual licensed under the MIT and the University of Illinois Open
7#// Source Licenses. See LICENSE.txt for details.
8#//
9#//===----------------------------------------------------------------------===//
10#
Alp Toker7198f522014-06-01 18:01:3311
Jonathan Peyton227e1ae2015-06-01 03:05:1312# CMAKE libomp
Jim Cownie3b81ce62014-08-05 09:32:2813cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
Alp Toker7198f522014-06-01 18:01:3314
Jim Cownie3b81ce62014-08-05 09:32:2815# Add cmake directory to search for custom cmake functions
16set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
17
Andrey Churbanov648467e2015-05-05 20:02:5218# Standalone build or part of LLVM?
Jonathan Peyton7979a072015-05-20 22:33:2419set(LIBOMP_STANDALONE_BUILD FALSE)
Jonathan Peyton2e013352015-07-15 16:05:3020if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}" OR
Andrey Churbanov648467e2015-05-05 20:02:5221 "${CMAKE_SOURCE_DIR}/runtime" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")
Jonathan Peyton5b4acbd2015-07-15 16:57:1922 project(libomp C CXX)
23 set(LIBOMP_STANDALONE_BUILD TRUE)
Andrey Churbanov648467e2015-05-05 20:02:5224endif()
25
Jonathan Peyton2e013352015-07-15 16:05:3026# These include files are in the cmake/ subdirectory
27include(LibompUtils)
28include(LibompGetArchitecture)
29include(LibompHandleFlags)
30include(LibompDefinitions)
Jim Cownie3b81ce62014-08-05 09:32:2831
Jonathan Peyton2e013352015-07-15 16:05:3032# Determine the target architecture
33if(${LIBOMP_STANDALONE_BUILD})
Jonathan Peyton5b4acbd2015-07-15 16:57:1934 # If adding a new architecture, take a look at cmake/LibompGetArchitecture.cmake
35 libomp_get_architecture(LIBOMP_DETECTED_ARCH)
36 set(LIBOMP_ARCH ${LIBOMP_DETECTED_ARCH} CACHE STRING
37 "The architecture to build for (x86_64/i386/arm/ppc64/ppc64le/aarch64/mic).")
38 # Allow user to choose a suffix for the installation directory.
39 set(LIBOMP_LIBDIR_SUFFIX "" CACHE STRING
40 "suffix of lib installation directory e.g., 64 => lib64")
41 # Should assertions be enabled? They are on by default.
42 set(LIBOMP_ENABLE_ASSERTIONS TRUE CACHE BOOL
43 "enable assertions?")
Chandler Carruth51451562015-07-18 03:14:0244 set(LIBOMP_ENABLE_WERROR FALSE CACHE BOOL
45 "Enable -Werror flags to turn warnings into errors for supporting compilers.")
Jonathan Peyton5b4acbd2015-07-15 16:57:1946 # CMAKE_BUILD_TYPE was not defined, set default to Release
47 if(NOT CMAKE_BUILD_TYPE)
48 set(CMAKE_BUILD_TYPE Release)
49 endif()
Jonathan Peyton2e013352015-07-15 16:05:3050else() # Part of LLVM build
Jonathan Peyton5b4acbd2015-07-15 16:57:1951 # Determine the native architecture from LLVM.
52 string(TOLOWER "${LLVM_TARGET_ARCH}" LIBOMP_NATIVE_ARCH)
53 if( LIBOMP_NATIVE_ARCH STREQUAL "host" )
54 string(REGEX MATCH "^[^-]*" LIBOMP_NATIVE_ARCH ${LLVM_HOST_TRIPLE})
55 endif ()
56 if(LIBOMP_NATIVE_ARCH MATCHES "i[2-6]86")
57 set(LIBOMP_ARCH i386)
58 elseif(LIBOMP_NATIVE_ARCH STREQUAL "x86")
59 set(LIBOMP_ARCH i386)
60 elseif(LIBOMP_NATIVE_ARCH STREQUAL "amd64")
61 set(LIBOMP_ARCH x86_64)
62 elseif(LIBOMP_NATIVE_ARCH STREQUAL "x86_64")
63 set(LIBOMP_ARCH x86_64)
64 elseif(LIBOMP_NATIVE_ARCH MATCHES "powerpc")
65 set(LIBOMP_ARCH ppc64)
66 elseif(LIBOMP_NATIVE_ARCH MATCHES "aarch64")
67 set(LIBOMP_ARCH aarch64)
68 elseif(LIBOMP_NATIVE_ARCH MATCHES "arm64")
69 set(LIBOMP_ARCH aarch64)
70 elseif(LIBOMP_NATIVE_ARCH MATCHES "arm")
71 set(LIBOMP_ARCH arm)
72 else()
73 # last ditch effort
74 libomp_get_architecture(LIBOMP_ARCH)
75 endif ()
76 set(LIBOMP_LIBDIR_SUFFIX ${LLVM_LIBDIR_SUFFIX})
77 set(LIBOMP_ENABLE_ASSERTIONS ${LLVM_ENABLE_ASSERTIONS})
Chandler Carruth51451562015-07-18 03:14:0278 set(LIBOMP_ENABLE_WERROR ${LLVM_ENABLE_WERROR})
Jim Cownie3b81ce62014-08-05 09:32:2879endif()
Jonathan Peyton2e013352015-07-15 16:05:3080libomp_check_variable(LIBOMP_ARCH 32e x86_64 32 i386 arm ppc64 ppc64le aarch64 mic)
Jim Cownie3b81ce62014-08-05 09:32:2881
Jonathan Peytonfbb15142015-05-26 17:27:0182set(LIBOMP_LIB_TYPE normal CACHE STRING
Jonathan Peyton5b4acbd2015-07-15 16:57:1983 "Performance,Profiling,Stubs library (normal/profile/stubs)")
Jonathan Peyton2e013352015-07-15 16:05:3084libomp_check_variable(LIBOMP_LIB_TYPE normal profile stubs)
85set(LIBOMP_VERSION 5 CACHE STRING
Jonathan Peyton5b4acbd2015-07-15 16:57:1986 "Produce libguide (version 4) or libomp (version 5)")
Jonathan Peyton2e013352015-07-15 16:05:3087set(LIBOMP_OMP_VERSION 41 CACHE STRING
Jonathan Peyton5b4acbd2015-07-15 16:57:1988 "The OpenMP version (41/40/30)")
Jonathan Peyton2e013352015-07-15 16:05:3089libomp_check_variable(LIBOMP_OMP_VERSION 41 40 30)
90set(LIBOMP_MIC_ARCH knc CACHE STRING
Jonathan Peyton5b4acbd2015-07-15 16:57:1991 "Intel(R) Many Integrated Core Architecture (Intel(R) MIC Architecture) (knf/knc). Ignored if not Intel(R) MIC Architecture build.")
Jonathan Peyton2e013352015-07-15 16:05:3092if("${LIBOMP_ARCH}" STREQUAL "mic")
Jonathan Peyton5b4acbd2015-07-15 16:57:1993 libomp_check_variable(LIBOMP_MIC_ARCH knf knc)
Jonathan Peyton2e013352015-07-15 16:05:3094endif()
95set(LIBOMP_FORTRAN_MODULES FALSE CACHE BOOL
Jonathan Peyton5b4acbd2015-07-15 16:57:1996 "Create Fortran module files? (requires fortran compiler)")
Jim Cownie3b81ce62014-08-05 09:32:2897
Jonathan Peyton92907c22015-05-29 16:13:5698# - Support for universal fat binary builds on Mac
Jonathan Peyton2e013352015-07-15 16:05:3099# - Having this extra variable allows people to build this library as a universal library
Jonathan Peyton92907c22015-05-29 16:13:56100# without forcing a universal build of the llvm/clang compiler.
101set(LIBOMP_OSX_ARCHITECTURES "${CMAKE_OSX_ARCHITECTURES}" CACHE STRING
Jonathan Peyton5b4acbd2015-07-15 16:57:19102 "For Mac builds, semicolon separated list of architectures to build for universal fat binary.")
Jonathan Peyton92907c22015-05-29 16:13:56103set(CMAKE_OSX_ARCHITECTURES ${LIBOMP_OSX_ARCHITECTURES})
104
Jonathan Peyton2e013352015-07-15 16:05:30105# User specified flags. These are appended to the configured flags.
Jonathan Peytonfbb15142015-05-26 17:27:01106set(LIBOMP_CFLAGS "" CACHE STRING
Jonathan Peyton5b4acbd2015-07-15 16:57:19107 "Appended user specified C compiler flags.")
Jonathan Peytonfbb15142015-05-26 17:27:01108set(LIBOMP_CXXFLAGS "" CACHE STRING
Jonathan Peyton5b4acbd2015-07-15 16:57:19109 "Appended user specified C++ compiler flags.")
Jonathan Peytonfbb15142015-05-26 17:27:01110set(LIBOMP_CPPFLAGS "" CACHE STRING
Jonathan Peyton5b4acbd2015-07-15 16:57:19111 "Appended user specified C preprocessor flags.")
Jonathan Peytonfbb15142015-05-26 17:27:01112set(LIBOMP_ASMFLAGS "" CACHE STRING
Jonathan Peyton5b4acbd2015-07-15 16:57:19113 "Appended user specified assembler flags.")
Jonathan Peytonfbb15142015-05-26 17:27:01114set(LIBOMP_LDFLAGS "" CACHE STRING
Jonathan Peyton5b4acbd2015-07-15 16:57:19115 "Appended user specified linker flags.")
Jonathan Peytonfbb15142015-05-26 17:27:01116set(LIBOMP_LIBFLAGS "" CACHE STRING
Jonathan Peyton5b4acbd2015-07-15 16:57:19117 "Appended user specified linked libs flags. (e.g., -lm)")
Jonathan Peyton2e013352015-07-15 16:05:30118set(LIBOMP_FFLAGS "" CACHE STRING
Jonathan Peyton5b4acbd2015-07-15 16:57:19119 "Appended user specified Fortran compiler flags. These are only used if LIBOMP_FORTRAN_MODULES==TRUE.")
Jim Cownie3b81ce62014-08-05 09:32:28120
Jonathan Peyton227e1ae2015-06-01 03:05:13121# Should the libomp library and generated headers be copied into the original source exports/ directory
Jonathan Peyton2e013352015-07-15 16:05:30122# Turning this to FALSE aids parallel builds to not interfere with each other.
123# Currently, the testsuite module expects the just built OpenMP library to be located inside the exports/
124# directory. TODO: have testsuite run under llvm-lit directly. We can then get rid of copying to exports/
125set(LIBOMP_COPY_EXPORTS TRUE CACHE STRING
Jonathan Peyton5b4acbd2015-07-15 16:57:19126 "Should exports be copied into source exports/ directory?")
Andrey Churbanov708fa8e2015-05-14 12:54:08127
Jim Cownie3b81ce62014-08-05 09:32:28128# Get the build number from kmp_version.c
Jonathan Peyton2e013352015-07-15 16:05:30129libomp_get_build_number("${CMAKE_CURRENT_SOURCE_DIR}" LIBOMP_BUILD_NUMBER)
Jim Cownie3b81ce62014-08-05 09:32:28130
Jonathan Peyton2e013352015-07-15 16:05:30131# Currently don't record any timestamps
132set(LIBOMP_DATE "No_Timestamp")
Jim Cownie3b81ce62014-08-05 09:32:28133
134# Architecture
135set(IA32 FALSE)
136set(INTEL64 FALSE)
137set(ARM FALSE)
Andrey Churbanovcbda8682015-01-13 14:43:35138set(AARCH64 FALSE)
Andrey Churbanovd1c55042015-01-19 18:29:35139set(PPC64BE FALSE)
140set(PPC64LE FALSE)
Jim Cownie3051f972014-08-07 10:12:54141set(PPC64 FALSE)
Jonathan Peyton2e013352015-07-15 16:05:30142set(MIC FALSE)
Jonathan Peyton5b4acbd2015-07-15 16:57:19143if("${LIBOMP_ARCH}" STREQUAL "i386" OR "${LIBOMP_ARCH}" STREQUAL "32") # IA-32 architecture
144 set(IA32 TRUE)
Jonathan Peyton2e013352015-07-15 16:05:30145elseif("${LIBOMP_ARCH}" STREQUAL "x86_64" OR "${LIBOMP_ARCH}" STREQUAL "32e") # Intel(R) 64 architecture
Jonathan Peyton5b4acbd2015-07-15 16:57:19146 set(INTEL64 TRUE)
Jonathan Peyton7979a072015-05-20 22:33:24147elseif("${LIBOMP_ARCH}" STREQUAL "arm") # ARM architecture
Jonathan Peyton5b4acbd2015-07-15 16:57:19148 set(ARM TRUE)
Jonathan Peyton7979a072015-05-20 22:33:24149elseif("${LIBOMP_ARCH}" STREQUAL "ppc64") # PPC64BE architecture
Jonathan Peyton5b4acbd2015-07-15 16:57:19150 set(PPC64BE TRUE)
151 set(PPC64 TRUE)
Jonathan Peyton7979a072015-05-20 22:33:24152elseif("${LIBOMP_ARCH}" STREQUAL "ppc64le") # PPC64LE architecture
Jonathan Peyton5b4acbd2015-07-15 16:57:19153 set(PPC64LE TRUE)
154 set(PPC64 TRUE)
Jonathan Peyton7979a072015-05-20 22:33:24155elseif("${LIBOMP_ARCH}" STREQUAL "aarch64") # AARCH64 architecture
Jonathan Peyton5b4acbd2015-07-15 16:57:19156 set(AARCH64 TRUE)
Jonathan Peyton7979a072015-05-20 22:33:24157elseif("${LIBOMP_ARCH}" STREQUAL "mic") # Intel(R) Many Integrated Core Architecture
Jonathan Peyton5b4acbd2015-07-15 16:57:19158 set(MIC TRUE)
Jim Cownie3b81ce62014-08-05 09:32:28159endif()
160
161# Set some flags based on build_type
Jonathan Peytonfbb15142015-05-26 17:27:01162set(RELEASE_BUILD FALSE)
163set(DEBUG_BUILD FALSE)
Jim Cownie3b81ce62014-08-05 09:32:28164set(RELWITHDEBINFO_BUILD FALSE)
Jonathan Peyton2e013352015-07-15 16:05:30165set(MINSIZEREL_BUILD FALSE)
166string(TOLOWER "${CMAKE_BUILD_TYPE}" libomp_build_type_lowercase)
167if("${libomp_build_type_lowercase}" STREQUAL "release")
Jonathan Peyton5b4acbd2015-07-15 16:57:19168 set(RELEASE_BUILD TRUE)
Jonathan Peyton2e013352015-07-15 16:05:30169elseif("${libomp_build_type_lowercase}" STREQUAL "debug")
Jonathan Peyton5b4acbd2015-07-15 16:57:19170 set(DEBUG_BUILD TRUE)
Jonathan Peyton2e013352015-07-15 16:05:30171elseif("${libomp_build_type_lowercase}" STREQUAL "relwithdebinfo")
Jonathan Peyton5b4acbd2015-07-15 16:57:19172 set(RELWITHDEBINFO_BUILD TRUE)
Jonathan Peyton2e013352015-07-15 16:05:30173elseif("${libomp_build_type_lowercase}" STREQUAL "minsizerel")
Jonathan Peyton5b4acbd2015-07-15 16:57:19174 set(MINSIZEREL_BUILD TRUE)
Jim Cownie3b81ce62014-08-05 09:32:28175endif()
176
Jim Cownie3b81ce62014-08-05 09:32:28177# Include itt notify interface? Right now, always.
Jonathan Peyton7979a072015-05-20 22:33:24178set(LIBOMP_USE_ITT_NOTIFY TRUE)
Jim Cownie3b81ce62014-08-05 09:32:28179
180# normal, profile, stubs library.
181set(NORMAL_LIBRARY FALSE)
182set(STUBS_LIBRARY FALSE)
183set(PROFILE_LIBRARY FALSE)
Jonathan Peyton7979a072015-05-20 22:33:24184if("${LIBOMP_LIB_TYPE}" STREQUAL "normal")
Jonathan Peyton5b4acbd2015-07-15 16:57:19185 set(NORMAL_LIBRARY TRUE)
Jonathan Peyton7979a072015-05-20 22:33:24186elseif("${LIBOMP_LIB_TYPE}" STREQUAL "profile")
Jonathan Peyton5b4acbd2015-07-15 16:57:19187 set(PROFILE_LIBRARY TRUE)
Jonathan Peyton7979a072015-05-20 22:33:24188elseif("${LIBOMP_LIB_TYPE}" STREQUAL "stubs")
Jonathan Peyton5b4acbd2015-07-15 16:57:19189 set(STUBS_LIBRARY TRUE)
Jim Cownie3b81ce62014-08-05 09:32:28190endif()
191
Jonathan Peyton2e013352015-07-15 16:05:30192# Setting directory names
193set(LIBOMP_BASE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
194set(LIBOMP_SRC_DIR ${LIBOMP_BASE_DIR}/src)
195set(LIBOMP_TOOLS_DIR ${LIBOMP_BASE_DIR}/tools)
196set(LIBOMP_INC_DIR ${LIBOMP_SRC_DIR}/include/${LIBOMP_OMP_VERSION})
Jim Cownie3b81ce62014-08-05 09:32:28197
Jonathan Peyton2e013352015-07-15 16:05:30198# Enabling Fortran if it is needed
Jonathan Peyton2e013352015-07-15 16:05:30199if(${LIBOMP_FORTRAN_MODULES})
Jonathan Peyton5b4acbd2015-07-15 16:57:19200 enable_language(Fortran)
Jonathan Peyton2e013352015-07-15 16:05:30201endif()
Jonathan Peyton5b4acbd2015-07-15 16:57:19202# Enable MASM Compiler if it is needed (Windows only)
Jonathan Peyton2e013352015-07-15 16:05:30203if(WIN32)
Jonathan Peyton5b4acbd2015-07-15 16:57:19204 enable_language(ASM_MASM)
Jonathan Peyton2e013352015-07-15 16:05:30205endif()
Jim Cownie3b81ce62014-08-05 09:32:28206
Jonathan Peyton2e013352015-07-15 16:05:30207# Getting legal type/arch
208libomp_get_legal_type(LIBOMP_LEGAL_TYPE)
209libomp_get_legal_arch(LIBOMP_LEGAL_ARCH)
Jim Cownie3b81ce62014-08-05 09:32:28210
Jonathan Peyton2e013352015-07-15 16:05:30211# Compiler flag checks, library checks, threading check, etc.
212include(config-ix)
Jim Cownie3b81ce62014-08-05 09:32:28213
Jonathan Peyton2e013352015-07-15 16:05:30214# Is there a quad precision data type available?
215# TODO: Make this a real feature check
216set(LIBOMP_USE_QUAD_PRECISION "${LIBOMP_HAVE_QUAD_PRECISION}" CACHE BOOL
Jonathan Peyton5b4acbd2015-07-15 16:57:19217 "Should 128-bit precision entry points be built?")
Jonathan Peyton2e013352015-07-15 16:05:30218if(LIBOMP_USE_QUAD_PRECISION AND (NOT LIBOMP_HAVE_QUAD_PRECISION))
Jonathan Peyton5b4acbd2015-07-15 16:57:19219 libomp_error_say("128-bit quad precision functionality requested but not available")
Jonathan Peyton2e013352015-07-15 16:05:30220endif()
221
222# libgomp drop-in compatibility requires versioned symbols
223set(LIBOMP_USE_VERSION_SYMBOLS "${LIBOMP_HAVE_VERSION_SYMBOLS}" CACHE BOOL
Jonathan Peyton5b4acbd2015-07-15 16:57:19224 "Should version symbols be used? These provide binary compatibility with libgomp.")
Jonathan Peyton2e013352015-07-15 16:05:30225if(LIBOMP_USE_VERSION_SYMBOLS AND (NOT LIBOMP_HAVE_VERSION_SYMBOLS))
Jonathan Peyton5b4acbd2015-07-15 16:57:19226 libomp_error_say("Version symbols functionality requested but not available")
Jonathan Peyton2e013352015-07-15 16:05:30227endif()
228
229# On multinode systems, larger alignment is desired to avoid false sharing
230set(LIBOMP_USE_INTERNODE_ALIGNMENT FALSE CACHE BOOL
Jonathan Peyton5b4acbd2015-07-15 16:57:19231 "Should larger alignment (4096 bytes) be used for some locks and data structures?")
Jim Cownie4cc4bb42014-10-07 16:25:50232
Jonathan Peyton2e013352015-07-15 16:05:30233# Build code that allows the OpenMP library to conveniently interface with debuggers
234set(LIBOMP_USE_DEBUGGER FALSE CACHE BOOL
Jonathan Peyton5b4acbd2015-07-15 16:57:19235 "Enable debugger interface code?")
Jonathan Peyton2e013352015-07-15 16:05:30236
237# Should we link to C++ library?
238set(LIBOMP_USE_STDCPPLIB FALSE CACHE BOOL
Jonathan Peyton5b4acbd2015-07-15 16:57:19239 "Should we link to C++ library?")
Jonathan Peyton2e013352015-07-15 16:05:30240
241# TSX (x86) based locks have __asm code which can be troublesome for some compilers.
242# TODO: Make this a real feature check
243set(LIBOMP_USE_ADAPTIVE_LOCKS "${LIBOMP_HAVE_ADAPTIVE_LOCKS}" CACHE BOOL
Jonathan Peyton5b4acbd2015-07-15 16:57:19244 "Should TSX-based lock be compiled (adaptive lock in kmp_lock.cpp). These are x86 specific.")
Jonathan Peyton2e013352015-07-15 16:05:30245if(LIBOMP_USE_ADAPTIVE_LOCKS AND (NOT LIBOMP_HAVE_ADAPTIVE_LOCKS))
Jonathan Peyton5b4acbd2015-07-15 16:57:19246 libomp_error_say("Adaptive locks (TSX) functionality requested but not available")
Jim Cownie4cc4bb42014-10-07 16:25:50247endif()
248
Jonathan Peyton2e013352015-07-15 16:05:30249# - stats-gathering enables OpenMP stats where things like the number of
250# parallel regions, clock ticks spent in particular openmp regions are recorded.
251# TODO: Make this a real feature check
252set(LIBOMP_STATS FALSE CACHE BOOL
Jonathan Peyton5b4acbd2015-07-15 16:57:19253 "Stats-Gathering functionality?")
Jonathan Peyton2e013352015-07-15 16:05:30254if(LIBOMP_STATS AND (NOT LIBOMP_HAVE_STATS))
Jonathan Peyton5b4acbd2015-07-15 16:57:19255 libomp_error_say("Stats-gathering functionality requested but not available")
Jim Cownie3b81ce62014-08-05 09:32:28256endif()
Jonathan Peyton45be4502015-08-11 21:36:41257# The stats functionality requires the std c++ library
258if(LIBOMP_STATS)
259 set(LIBOMP_USE_STDCPPLIB TRUE)
260endif()
Jim Cownie3b81ce62014-08-05 09:32:28261
Jonathan Peyton2e013352015-07-15 16:05:30262# OMPT-support
263# TODO: Make this a real feature check
264set(LIBOMP_OMPT_SUPPORT FALSE CACHE BOOL
Jonathan Peyton5b4acbd2015-07-15 16:57:19265 "OMPT-support?")
Jonathan Peyton2e013352015-07-15 16:05:30266set(LIBOMP_OMPT_BLAME TRUE CACHE BOOL
Jonathan Peyton5b4acbd2015-07-15 16:57:19267 "OMPT-blame?")
Jonathan Peyton2e013352015-07-15 16:05:30268set(LIBOMP_OMPT_TRACE TRUE CACHE BOOL
Jonathan Peyton5b4acbd2015-07-15 16:57:19269 "OMPT-trace?")
Jonathan Peyton2e013352015-07-15 16:05:30270if(LIBOMP_OMPT_SUPPORT AND (NOT LIBOMP_HAVE_OMPT_SUPPORT))
Jonathan Peyton5b4acbd2015-07-15 16:57:19271 libomp_error_say("OpenMP Tools Interface requested but not available")
Jonathan Peytonb689ded2015-06-17 15:43:34272endif()
Jim Cownie3b81ce62014-08-05 09:32:28273
Jim Cownie3b81ce62014-08-05 09:32:28274# Setting final library name
Jonathan Peyton2e013352015-07-15 16:05:30275set(LIBOMP_DEFAULT_LIB_NAME libomp)
Jim Cownie3b81ce62014-08-05 09:32:28276if(${PROFILE_LIBRARY})
Jonathan Peyton5b4acbd2015-07-15 16:57:19277 set(LIBOMP_DEFAULT_LIB_NAME ${LIBOMP_DEFAULT_LIB_NAME}prof)
Jim Cownie3b81ce62014-08-05 09:32:28278endif()
279if(${STUBS_LIBRARY})
Jonathan Peyton5b4acbd2015-07-15 16:57:19280 set(LIBOMP_DEFAULT_LIB_NAME ${LIBOMP_DEFAULT_LIB_NAME}stubs)
Jim Cownie3b81ce62014-08-05 09:32:28281endif()
Jonathan Peyton2e013352015-07-15 16:05:30282set(LIBOMP_LIB_NAME ${LIBOMP_DEFAULT_LIB_NAME} CACHE STRING "Base OMP library name")
283set(LIBOMP_LIB_FILE ${LIBOMP_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX})
Jim Cownie3b81ce62014-08-05 09:32:28284
Jim Cownie3b81ce62014-08-05 09:32:28285# Print configuration after all variables are set.
Jonathan Peyton7979a072015-05-20 22:33:24286if(${LIBOMP_STANDALONE_BUILD})
Jonathan Peyton5b4acbd2015-07-15 16:57:19287 libomp_say("Operating System -- ${CMAKE_SYSTEM_NAME}")
288 libomp_say("Target Architecture -- ${LIBOMP_ARCH}")
289 if(${MIC})
290 libomp_say("Intel(R) MIC Architecture -- ${LIBOMP_MIC_ARCH}")
291 endif()
292 libomp_say("Build Type -- ${CMAKE_BUILD_TYPE}")
293 libomp_say("OpenMP Version -- ${LIBOMP_OMP_VERSION}")
294 libomp_say("Lib Type -- ${LIBOMP_LIB_TYPE}")
295 libomp_say("Fortran Modules -- ${LIBOMP_FORTRAN_MODULES}")
296 # will say development if all zeros
297 if(${LIBOMP_BUILD_NUMBER} STREQUAL 00000000)
298 set(LIBOMP_BUILD Development)
299 else()
300 set(LIBOMP_BUILD ${LIBOMP_BUILD_NUMBER})
301 endif()
302 libomp_say("Build -- ${LIBOMP_BUILD}")
303 libomp_say("Use Stats-gathering -- ${LIBOMP_STATS}")
304 libomp_say("Use Debugger-support -- ${LIBOMP_USE_DEBUGGER}")
305 libomp_say("Use OMPT-support -- ${LIBOMP_OMPT_SUPPORT}")
306 if(${LIBOMP_OMPT_SUPPORT})
307 libomp_say("Use OMPT-blame -- ${LIBOMP_OMPT_BLAME}")
308 libomp_say("Use OMPT-trace -- ${LIBOMP_OMPT_TRACE}")
309 endif()
310 libomp_say("Use Adaptive locks -- ${LIBOMP_USE_ADAPTIVE_LOCKS}")
311 libomp_say("Use quad precision -- ${LIBOMP_USE_QUAD_PRECISION}")
Jim Cownie3b81ce62014-08-05 09:32:28312endif()
Andrey Churbanov648467e2015-05-05 20:02:52313
Jonathan Peyton52158902015-06-11 17:23:57314add_subdirectory(src)
Jim Cownie3b81ce62014-08-05 09:32:28315