diff --git a/offload/CMakeLists.txt b/offload/CMakeLists.txt index 6e801b1d47011..bcf7f57c8bedc 100644 --- a/offload/CMakeLists.txt +++ b/offload/CMakeLists.txt @@ -4,14 +4,6 @@ cmake_minimum_required(VERSION 3.20.0) set(LLVM_SUBPROJECT_TITLE "liboffload") -# Permit redefining OPENMP_STANDALONE_BUILD when doing a runtimes build. -if (OPENMP_STANDALONE_BUILD OR "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}") - set(OPENMP_STANDALONE_BUILD TRUE) - project(offload C CXX ASM) -else() - set(OPENMP_STANDALONE_BUILD FALSE) -endif() - # Check that the library can actually be built. if(APPLE OR WIN32 OR WASM) message(WARNING "libomptarget cannot be built on Windows and MacOS X!") @@ -26,20 +18,13 @@ endif() set(OFFLOAD_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) -if(OPENMP_STANDALONE_BUILD) - set(OFFLOAD_LIBDIR_SUFFIX "" CACHE STRING - "Suffix of lib installation directory, e.g. 64 => lib64") - set(OFFLOAD_INSTALL_LIBDIR "lib${OFFLOAD_LIBDIR_SUFFIX}" CACHE STRING - "Path where built offload libraries should be installed.") +# When building in tree we install the runtime according to the LLVM settings. +if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE) + set(OFFLOAD_INSTALL_LIBDIR lib${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE} CACHE STRING + "Path where built offload libraries should be installed.") else() - # When building in tree we install the runtime according to the LLVM settings. - if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE) - set(OFFLOAD_INSTALL_LIBDIR lib${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE} CACHE STRING - "Path where built offload libraries should be installed.") - else() - set(OFFLOAD_INSTALL_LIBDIR "lib${LLVM_LIBDIR_SUFFIX}" CACHE STRING - "Path where built offload libraries should be installed.") - endif() + set(OFFLOAD_INSTALL_LIBDIR "lib${LLVM_LIBDIR_SUFFIX}" CACHE STRING + "Path where built offload libraries should be installed.") endif() set(LLVM_COMMON_CMAKE_UTILS ${CMAKE_CURRENT_SOURCE_DIR}/../cmake) @@ -55,69 +40,38 @@ list(INSERT CMAKE_MODULE_PATH 0 "${LLVM_COMMON_CMAKE_UTILS}/Modules" ) -if (OPENMP_STANDALONE_BUILD) - # CMAKE_BUILD_TYPE was not set, default to Release. - if (NOT CMAKE_BUILD_TYPE) - set(CMAKE_BUILD_TYPE Release) - endif() +set(OPENMP_ENABLE_WERROR ${LLVM_ENABLE_WERROR}) +# If building in tree, we honor the same install suffix LLVM uses. +set(OPENMP_INSTALL_LIBDIR "lib${LLVM_LIBDIR_SUFFIX}") - # Group common settings. - set(OPENMP_ENABLE_WERROR FALSE CACHE BOOL - "Enable -Werror flags to turn warnings into errors for supporting compilers.") - set(OPENMP_LIBDIR_SUFFIX "" CACHE STRING - "Suffix of lib installation directory, e.g. 64 => lib64") - # Do not use OPENMP_LIBDIR_SUFFIX directly, use OPENMP_INSTALL_LIBDIR. - set(OPENMP_INSTALL_LIBDIR "lib${OPENMP_LIBDIR_SUFFIX}") - - # Used by llvm_add_tool() and tests. - set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_CURRENT_BINARY_DIR}) - - # Group test settings. - set(OPENMP_TEST_C_COMPILER ${CMAKE_C_COMPILER} CACHE STRING - "C compiler to use for testing OpenMP runtime libraries.") - set(OPENMP_TEST_CXX_COMPILER ${CMAKE_CXX_COMPILER} CACHE STRING - "C++ compiler to use for testing OpenMP runtime libraries.") - set(OPENMP_TEST_Fortran_COMPILER ${CMAKE_Fortran_COMPILER} CACHE STRING - "FORTRAN compiler to use for testing OpenMP runtime libraries.") - set(OPENMP_LLVM_TOOLS_DIR "" CACHE PATH "Path to LLVM tools for testing.") - - set(CMAKE_CXX_STANDARD 17 CACHE STRING "C++ standard to conform to") - set(CMAKE_CXX_STANDARD_REQUIRED NO) - set(CMAKE_CXX_EXTENSIONS NO) +if (NOT MSVC) + set(OPENMP_TEST_C_COMPILER ${LLVM_TOOLS_BINARY_DIR}/clang) + set(OPENMP_TEST_CXX_COMPILER ${LLVM_TOOLS_BINARY_DIR}/clang++) else() - set(OPENMP_ENABLE_WERROR ${LLVM_ENABLE_WERROR}) - # If building in tree, we honor the same install suffix LLVM uses. - set(OPENMP_INSTALL_LIBDIR "lib${LLVM_LIBDIR_SUFFIX}") - - if (NOT MSVC) - set(OPENMP_TEST_C_COMPILER ${LLVM_TOOLS_BINARY_DIR}/clang) - set(OPENMP_TEST_CXX_COMPILER ${LLVM_TOOLS_BINARY_DIR}/clang++) - else() - set(OPENMP_TEST_C_COMPILER ${LLVM_TOOLS_BINARY_DIR}/clang.exe) - set(OPENMP_TEST_CXX_COMPILER ${LLVM_TOOLS_BINARY_DIR}/clang++.exe) - endif() - - # Check for flang - if (NOT MSVC) - set(OPENMP_TEST_Fortran_COMPILER ${LLVM_TOOLS_BINARY_DIR}/flang) - else() - set(OPENMP_TEST_Fortran_COMPILER ${LLVM_TOOLS_BINARY_DIR}/flang.exe) - endif() + set(OPENMP_TEST_C_COMPILER ${LLVM_TOOLS_BINARY_DIR}/clang.exe) + set(OPENMP_TEST_CXX_COMPILER ${LLVM_TOOLS_BINARY_DIR}/clang++.exe) +endif() - # Set fortran test compiler if flang is found - if (EXISTS "${OPENMP_TEST_Fortran_COMPILER}") - message("Using local flang build at ${OPENMP_TEST_Fortran_COMPILER}") - else() - unset(OPENMP_TEST_Fortran_COMPILER) - endif() +# Check for flang +if (NOT MSVC) + set(OPENMP_TEST_Fortran_COMPILER ${LLVM_TOOLS_BINARY_DIR}/flang) +else() + set(OPENMP_TEST_Fortran_COMPILER ${LLVM_TOOLS_BINARY_DIR}/flang.exe) +endif() - # If not standalone, set CMAKE_CXX_STANDARD but don't set the global cache value, - # only set it locally for OpenMP. - set(CMAKE_CXX_STANDARD 17) - set(CMAKE_CXX_STANDARD_REQUIRED NO) - set(CMAKE_CXX_EXTENSIONS NO) +# Set fortran test compiler if flang is found +if (EXISTS "${OPENMP_TEST_Fortran_COMPILER}") + message("Using local flang build at ${OPENMP_TEST_Fortran_COMPILER}") +else() + unset(OPENMP_TEST_Fortran_COMPILER) endif() +# If not standalone, set CMAKE_CXX_STANDARD but don't set the global cache value, +# only set it locally for OpenMP. +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED NO) +set(CMAKE_CXX_EXTENSIONS NO) + # Set the path of all resulting libraries to a unified location so that it can # be used for testing. set(LIBOMPTARGET_LIBRARY_DIR ${CMAKE_CURRENT_BINARY_DIR}) @@ -125,7 +79,7 @@ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LIBOMPTARGET_LIBRARY_DIR}) set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LIBOMPTARGET_LIBRARY_DIR}) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${LIBOMPTARGET_LIBRARY_DIR}) -if(NOT LLVM_LIBRARY_OUTPUT_INTDIR) +if(NOT LLVM_LIBRARY_OUTPUT_INTDIR OR NOT TARGET Clang) set(LIBOMPTARGET_INTDIR ${LIBOMPTARGET_LIBRARY_DIR}) else() set(LIBOMPTARGET_INTDIR ${LLVM_LIBRARY_OUTPUT_INTDIR}) @@ -260,65 +214,6 @@ if (LIBOMPTARGET_USE_LTO) list(APPEND offload_link_flags ${CMAKE_CXX_COMPILE_OPTIONS_IPO}) endif() -if(OPENMP_STANDALONE_BUILD) - if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") - execute_process( - OUTPUT_STRIP_TRAILING_WHITESPACE - COMMAND ${CMAKE_CXX_COMPILER} --print-resource-dir - RESULT_VARIABLE COMMAND_RETURN_CODE - OUTPUT_VARIABLE COMPILER_RESOURCE_DIR - ) - endif() - - set(LIBOMP_HAVE_OMPT_SUPPORT FALSE) - set(LIBOMP_OMPT_SUPPORT FALSE) - - find_path ( - LIBOMP_OMP_TOOLS_INCLUDE_DIR - NAMES - omp-tools.h - HINTS - ${COMPILER_RESOURCE_DIR}/include - ${CMAKE_INSTALL_PREFIX}/include - ) - - if(LIBOMP_OMP_TOOLS_INCLUDE_DIR) - set(LIBOMP_HAVE_OMPT_SUPPORT TRUE) - set(LIBOMP_OMPT_SUPPORT TRUE) - endif() - - # LLVM_LIBRARY_DIRS set by find_package(LLVM) in LibomptargetGetDependencies - find_library ( - LIBOMP_STANDALONE - NAMES - omp - HINTS - ${CMAKE_INSTALL_PREFIX}/lib - ${LLVM_LIBRARY_DIRS} - REQUIRED - ) - - find_path ( - LIBOMP_INCLUDE_DIR - NAMES - omp.h - HINTS - ${COMPILER_RESOURCE_DIR}/include - ${CMAKE_INSTALL_PREFIX}/include - ) - - get_filename_component(LIBOMP_LIBRARY_DIR ${LIBOMP_STANDALONE} DIRECTORY) - - set(OPENMP_TEST_FLAGS "" CACHE STRING - "Extra compiler flags to send to the test compiler.") - set(OPENMP_TEST_OPENMP_FLAGS ${OPENMP_TEST_COMPILER_OPENMP_FLAGS} CACHE STRING - "OpenMP compiler flag to use for testing OpenMP runtime libraries.") - set(LIBOMPTARGET_OPENMP_HEADER_FOLDER "${LIBOMP_INCLUDE_DIR}" CACHE STRING - "Path to folder containing omp.h") - set(LIBOMPTARGET_OPENMP_HOST_RTL_FOLDER "${LIBOMP_LIBRARY_DIR}" CACHE STRING - "Path to folder containing libomp.so, and libLLVMSupport.so with profiling enabled") -endif() - macro(pythonize_bool var) if (${var}) set(${var} True) diff --git a/offload/cmake/Modules/LibomptargetGetDependencies.cmake b/offload/cmake/Modules/LibomptargetGetDependencies.cmake index 2a8bdebf2c1dd..d11d32004614f 100644 --- a/offload/cmake/Modules/LibomptargetGetDependencies.cmake +++ b/offload/cmake/Modules/LibomptargetGetDependencies.cmake @@ -9,32 +9,16 @@ include (FindPackageHandleStandardArgs) ################################################################################ # Looking for LLVM... ################################################################################ - -if (OPENMP_STANDALONE_BUILD) - # Complete LLVM package is required for building libomptarget - # in an out-of-tree mode. - find_package(LLVM REQUIRED) - message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}") - message(STATUS "Using LLVM in: ${LLVM_DIR}") - list(APPEND LIBOMPTARGET_LLVM_INCLUDE_DIRS ${LLVM_INCLUDE_DIRS}) - list(APPEND CMAKE_MODULE_PATH ${LLVM_CMAKE_DIR}) - include(AddLLVM) - if(TARGET omptarget) - message(FATAL_ERROR "CMake target 'omptarget' already exists. " - "Use an LLVM installation that doesn't expose its 'omptarget' target.") - endif() -else() - # Note that OPENMP_STANDALONE_BUILD is FALSE, when - # openmp is built with -DLLVM_ENABLE_RUNTIMES="openmp" vs - # -DLLVM_ENABLE_PROJECTS="openmp", but openmp build - # is actually done as a standalone project build with many - # LLVM CMake variables propagated to it. - list(APPEND LIBOMPTARGET_LLVM_INCLUDE_DIRS - ${LLVM_MAIN_INCLUDE_DIR} ${LLVM_BINARY_DIR}/include - ) - message(STATUS - "Using LLVM include directories: ${LIBOMPTARGET_LLVM_INCLUDE_DIRS}") -endif() +# Note that OPENMP_STANDALONE_BUILD is FALSE, when +# openmp is built with -DLLVM_ENABLE_RUNTIMES="openmp" vs +# -DLLVM_ENABLE_PROJECTS="openmp", but openmp build +# is actually done as a standalone project build with many +# LLVM CMake variables propagated to it. +list(APPEND LIBOMPTARGET_LLVM_INCLUDE_DIRS + ${LLVM_MAIN_INCLUDE_DIR} ${LLVM_BINARY_DIR}/include + ) +message(STATUS + "Using LLVM include directories: ${LIBOMPTARGET_LLVM_INCLUDE_DIRS}") ################################################################################ # Looking for libffi... diff --git a/offload/cmake/OpenMPTesting.cmake b/offload/cmake/OpenMPTesting.cmake index b564e46b7b193..0ff4391f98dc1 100644 --- a/offload/cmake/OpenMPTesting.cmake +++ b/offload/cmake/OpenMPTesting.cmake @@ -49,28 +49,27 @@ function(find_standalone_test_dependencies) endif() endfunction() -if (${OPENMP_STANDALONE_BUILD}) - find_standalone_test_dependencies() - - # Set lit arguments. - set(DEFAULT_LIT_ARGS "-sv --show-unsupported --show-xfail") - if (MSVC OR XCODE) - set(DEFAULT_LIT_ARGS "${DEFAULT_LIT_ARGS} --no-progress-bar") - endif() - if ("${CMAKE_SYSTEM_NAME}" MATCHES "AIX") - set(DEFAULT_LIT_ARGS "${DEFAULT_LIT_ARGS} --time-tests --timeout=1800") - endif() - set(OPENMP_LIT_ARGS "${DEFAULT_LIT_ARGS}" CACHE STRING "Options for lit.") - separate_arguments(OPENMP_LIT_ARGS) +if (TARGET FileCheck) + set(OPENMP_FILECHECK_EXECUTABLE ${LLVM_RUNTIME_OUTPUT_INTDIR}/FileCheck) + set(OPENMP_NOT_EXECUTABLE ${LLVM_RUNTIME_OUTPUT_INTDIR}/not) else() - if (NOT TARGET "FileCheck") + find_standalone_test_dependencies() + if(OPENMP_FILECHECK_EXECUTABLE) + # Set lit arguments. + set(DEFAULT_LIT_ARGS "-sv --show-unsupported --show-xfail") + if (MSVC OR XCODE) + set(DEFAULT_LIT_ARGS "${DEFAULT_LIT_ARGS} --no-progress-bar") + endif() + if ("${CMAKE_SYSTEM_NAME}" MATCHES "AIX") + set(DEFAULT_LIT_ARGS "${DEFAULT_LIT_ARGS} --time-tests --timeout=1800") + endif() + set(OPENMP_LIT_ARGS "${DEFAULT_LIT_ARGS}" CACHE STRING "Options for lit.") + separate_arguments(OPENMP_LIT_ARGS) + else() message(STATUS "Cannot find 'FileCheck'.") message(WARNING "The check targets will not be available!") set(ENABLE_CHECK_TARGETS FALSE) - else() - set(OPENMP_FILECHECK_EXECUTABLE ${LLVM_TOOLS_BINARY_DIR}/FileCheck) endif() - set(OPENMP_NOT_EXECUTABLE ${LLVM_TOOLS_BINARY_DIR}/not) endif() set(OFFLOAD_DEVICE_INFO_EXECUTABLE ${LLVM_RUNTIME_OUTPUT_INTDIR}/llvm-offload-device-info) set(OFFLOAD_TBLGEN_EXECUTABLE ${LLVM_RUNTIME_OUTPUT_INTDIR}/offload-tblgen) @@ -211,7 +210,7 @@ function(add_offload_testsuite target comment) set_property(GLOBAL APPEND PROPERTY OPENMP_LIT_DEPENDS ${ARG_DEPENDS}) endif() - if (${OPENMP_STANDALONE_BUILD}) + if (NOT TARGET Clang) set(LIT_ARGS ${OPENMP_LIT_ARGS} ${ARG_ARGS}) add_custom_target(${target} COMMAND ${Python3_EXECUTABLE} ${OPENMP_LLVM_LIT_EXECUTABLE} ${LIT_ARGS} ${ARG_UNPARSED_ARGUMENTS} diff --git a/offload/test/CMakeLists.txt b/offload/test/CMakeLists.txt index 711621de9075d..40da2a7d573ee 100644 --- a/offload/test/CMakeLists.txt +++ b/offload/test/CMakeLists.txt @@ -12,7 +12,7 @@ else() set(LIBOMPTARGET_DEBUG False) endif() -if (NOT OPENMP_STANDALONE_BUILD AND "compiler-rt" IN_LIST LLVM_ENABLE_RUNTIMES) +if ("compiler-rt" IN_LIST LLVM_ENABLE_RUNTIMES) set(LIBOMPTARGET_TEST_GPU_PGO True) else() set(LIBOMPTARGET_TEST_GPU_PGO False) diff --git a/openmp/CMakeLists.txt b/openmp/CMakeLists.txt index 44cef3fb3f413..d485bac10bae1 100644 --- a/openmp/CMakeLists.txt +++ b/openmp/CMakeLists.txt @@ -9,89 +9,50 @@ list(INSERT CMAKE_MODULE_PATH 0 "${LLVM_COMMON_CMAKE_UTILS}/Modules" ) -# llvm/runtimes/ will set OPENMP_STANDALONE_BUILD. -if (OPENMP_STANDALONE_BUILD OR "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}") - set(OPENMP_STANDALONE_BUILD TRUE) - project(openmp C CXX ASM) -else() - set(OPENMP_STANDALONE_BUILD FALSE) -endif() - # Must go below project(..) include(GNUInstallDirs) -if (OPENMP_STANDALONE_BUILD) - set(LLVM_TREE_AVAILABLE False) +# Usually /runtimes/CMakeLists.txt sets LLVM_TREE_AVAILABLE and +# we assume it is not available otherwise. The exception is that we are in an +# LLVM_ENABLE_PROJECTS=openmp build, the LLVM tree is actually available. +# Note that this build mode has been deprecated. +# See https://github.com/llvm/llvm-project/issues/124014 +if (NOT LLVM_RUNTIMES_BUILD AND "openmp" IN_LIST LLVM_ENABLE_PROJECTS) + set(LLVM_TREE_AVAILABLE True) +endif () - # CMAKE_BUILD_TYPE was not set, default to Release. - if (NOT CMAKE_BUILD_TYPE) - set(CMAKE_BUILD_TYPE Release) - endif() +set(OPENMP_ENABLE_WERROR ${LLVM_ENABLE_WERROR}) - # Group common settings. - set(OPENMP_ENABLE_WERROR FALSE CACHE BOOL - "Enable -Werror flags to turn warnings into errors for supporting compilers.") - set(OPENMP_LIBDIR_SUFFIX "" CACHE STRING - "Suffix of lib installation directory, e.g. 64 => lib64") - # Do not use OPENMP_LIBDIR_SUFFIX directly, use OPENMP_INSTALL_LIBDIR. - set(OPENMP_INSTALL_LIBDIR "lib${OPENMP_LIBDIR_SUFFIX}" CACHE STRING +# When building in tree we install the runtime according to the LLVM settings. +if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE) + set(OPENMP_INSTALL_LIBDIR lib${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE} CACHE STRING + "Path where built openmp libraries should be installed.") +else() + set(OPENMP_INSTALL_LIBDIR "lib${LLVM_LIBDIR_SUFFIX}" CACHE STRING "Path where built OpenMP libraries should be installed.") +endif() - # Group test settings. - set(OPENMP_TEST_C_COMPILER ${CMAKE_C_COMPILER} CACHE STRING - "C compiler to use for testing OpenMP runtime libraries.") - set(OPENMP_TEST_CXX_COMPILER ${CMAKE_CXX_COMPILER} CACHE STRING - "C++ compiler to use for testing OpenMP runtime libraries.") - set(OPENMP_TEST_Fortran_COMPILER ${CMAKE_Fortran_COMPILER} CACHE STRING - "FORTRAN compiler to use for testing OpenMP runtime libraries.") - set(OPENMP_LLVM_TOOLS_DIR "" CACHE PATH "Path to LLVM tools for testing.") - - set(CMAKE_CXX_STANDARD 17 CACHE STRING "C++ standard to conform to") - set(CMAKE_CXX_STANDARD_REQUIRED NO) - set(CMAKE_CXX_EXTENSIONS NO) +if (NOT MSVC) + set(OPENMP_TEST_C_COMPILER ${LLVM_TOOLS_BINARY_DIR}/clang) + set(OPENMP_TEST_CXX_COMPILER ${LLVM_TOOLS_BINARY_DIR}/clang++) else() - # Usually /runtimes/CMakeLists.txt sets LLVM_TREE_AVAILABLE and - # we assume it is not available otherwise. The exception is that we are in an - # LLVM_ENABLE_PROJECTS=openmp build, the LLVM tree is actually available. - # Note that this build mode has been deprecated. - # See https://github.com/llvm/llvm-project/issues/124014 - if (NOT LLVM_RUNTIMES_BUILD AND "openmp" IN_LIST LLVM_ENABLE_PROJECTS) - set(LLVM_TREE_AVAILABLE True) - endif () - - set(OPENMP_ENABLE_WERROR ${LLVM_ENABLE_WERROR}) - - # When building in tree we install the runtime according to the LLVM settings. - if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE) - set(OPENMP_INSTALL_LIBDIR lib${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE} CACHE STRING - "Path where built openmp libraries should be installed.") - else() - set(OPENMP_INSTALL_LIBDIR "lib${LLVM_LIBDIR_SUFFIX}" CACHE STRING - "Path where built OpenMP libraries should be installed.") - endif() - - if (NOT MSVC) - set(OPENMP_TEST_C_COMPILER ${LLVM_TOOLS_BINARY_DIR}/clang) - set(OPENMP_TEST_CXX_COMPILER ${LLVM_TOOLS_BINARY_DIR}/clang++) - else() - set(OPENMP_TEST_C_COMPILER ${LLVM_TOOLS_BINARY_DIR}/clang.exe) - set(OPENMP_TEST_CXX_COMPILER ${LLVM_TOOLS_BINARY_DIR}/clang++.exe) - endif() - - # Set fortran test compiler if flang is found - if (EXISTS "${OPENMP_TEST_Fortran_COMPILER}") - message("Using local flang build at ${OPENMP_TEST_Fortran_COMPILER}") - else() - unset(OPENMP_TEST_Fortran_COMPILER) - endif() + set(OPENMP_TEST_C_COMPILER ${LLVM_TOOLS_BINARY_DIR}/clang.exe) + set(OPENMP_TEST_CXX_COMPILER ${LLVM_TOOLS_BINARY_DIR}/clang++.exe) +endif() - # If not standalone, set CMAKE_CXX_STANDARD but don't set the global cache value, - # only set it locally for OpenMP. - set(CMAKE_CXX_STANDARD 17) - set(CMAKE_CXX_STANDARD_REQUIRED NO) - set(CMAKE_CXX_EXTENSIONS NO) +# Set fortran test compiler if flang is found +if (EXISTS "${OPENMP_TEST_Fortran_COMPILER}") + message("Using local flang build at ${OPENMP_TEST_Fortran_COMPILER}") +else() + unset(OPENMP_TEST_Fortran_COMPILER) endif() +# If not standalone, set CMAKE_CXX_STANDARD but don't set the global cache value, +# only set it locally for OpenMP. +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED NO) +set(CMAKE_CXX_EXTENSIONS NO) + # Check and set up common compiler flags. include(config-ix) include(HandleOpenMPOptions) @@ -155,11 +116,8 @@ else() add_subdirectory(tools) endif() - # Propagate OMPT support to offload - if(NOT ${OPENMP_STANDALONE_BUILD}) - set(LIBOMP_HAVE_OMPT_SUPPORT ${LIBOMP_HAVE_OMPT_SUPPORT} PARENT_SCOPE) - set(LIBOMP_OMP_TOOLS_INCLUDE_DIR ${LIBOMP_OMP_TOOLS_INCLUDE_DIR} PARENT_SCOPE) - endif() + set(LIBOMP_HAVE_OMPT_SUPPORT ${LIBOMP_HAVE_OMPT_SUPPORT} PARENT_SCOPE) + set(LIBOMP_OMP_TOOLS_INCLUDE_DIR ${LIBOMP_OMP_TOOLS_INCLUDE_DIR} PARENT_SCOPE) option(OPENMP_MSVC_NAME_SCHEME "Build dll with MSVC naming scheme." OFF) diff --git a/openmp/cmake/OpenMPTesting.cmake b/openmp/cmake/OpenMPTesting.cmake index 262ea968c8351..92d07f69563ba 100644 --- a/openmp/cmake/OpenMPTesting.cmake +++ b/openmp/cmake/OpenMPTesting.cmake @@ -49,28 +49,27 @@ function(find_standalone_test_dependencies) endif() endfunction() -if (${OPENMP_STANDALONE_BUILD}) - find_standalone_test_dependencies() - - # Set lit arguments. - set(DEFAULT_LIT_ARGS "-sv --show-unsupported --show-xfail") - if (MSVC OR XCODE) - set(DEFAULT_LIT_ARGS "${DEFAULT_LIT_ARGS} --no-progress-bar") - endif() - if ("${CMAKE_SYSTEM_NAME}" MATCHES "AIX") - set(DEFAULT_LIT_ARGS "${DEFAULT_LIT_ARGS} --time-tests --timeout=3000") - endif() - set(OPENMP_LIT_ARGS "${DEFAULT_LIT_ARGS}" CACHE STRING "Options for lit.") - separate_arguments(OPENMP_LIT_ARGS) +if(TARGET FileCheck) + set(OPENMP_FILECHECK_EXECUTABLE ${LLVM_RUNTIME_OUTPUT_INTDIR}/FileCheck) + set(OPENMP_NOT_EXECUTABLE ${LLVM_RUNTIME_OUTPUT_INTDIR}/not) else() - if (NOT TARGET "FileCheck") + find_standalone_test_dependencies() + if(OPENMP_FILECHECK_EXECUTABLE) + # Set lit arguments. + set(DEFAULT_LIT_ARGS "-sv --show-unsupported --show-xfail") + if (MSVC OR XCODE) + set(DEFAULT_LIT_ARGS "${DEFAULT_LIT_ARGS} --no-progress-bar") + endif() + if ("${CMAKE_SYSTEM_NAME}" MATCHES "AIX") + set(DEFAULT_LIT_ARGS "${DEFAULT_LIT_ARGS} --time-tests --timeout=3000") + endif() + set(OPENMP_LIT_ARGS "${DEFAULT_LIT_ARGS}" CACHE STRING "Options for lit.") + separate_arguments(OPENMP_LIT_ARGS) + else() message(STATUS "Cannot find 'FileCheck'.") message(WARNING "The check targets will not be available!") set(ENABLE_CHECK_TARGETS FALSE) - else() - set(OPENMP_FILECHECK_EXECUTABLE ${LLVM_TOOLS_BINARY_DIR}/FileCheck) endif() - set(OPENMP_NOT_EXECUTABLE ${LLVM_TOOLS_BINARY_DIR}/not) endif() # Macro to extract information about compiler from file. (no own scope) @@ -118,50 +117,28 @@ function(set_test_compiler_information dir) endif() endfunction() -if (${OPENMP_STANDALONE_BUILD}) - # Detect compiler that should be used for testing. - # We cannot use ExternalProject_Add() because its configuration runs when this - # project is built which is too late for detecting the compiler... - file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/DetectTestCompiler) - execute_process( - COMMAND ${CMAKE_COMMAND} -G${CMAKE_GENERATOR} ${CMAKE_CURRENT_LIST_DIR}/DetectTestCompiler - -DCMAKE_C_COMPILER=${OPENMP_TEST_C_COMPILER} - -DCMAKE_CXX_COMPILER=${OPENMP_TEST_CXX_COMPILER} - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/DetectTestCompiler - OUTPUT_VARIABLE DETECT_COMPILER_OUT - ERROR_VARIABLE DETECT_COMPILER_ERR - RESULT_VARIABLE DETECT_COMPILER_RESULT) - if (DETECT_COMPILER_RESULT) - message(STATUS "Could not detect test compilers.") - message(WARNING "The check targets will not be available!") - set(ENABLE_CHECK_TARGETS FALSE) - else() - set_test_compiler_information(${CMAKE_CURRENT_BINARY_DIR}/DetectTestCompiler) - endif() +# Set the information that we know. +set(OPENMP_TEST_COMPILER_ID "Clang") +# Cannot use CLANG_VERSION because we are not guaranteed that this is already set. +set(OPENMP_TEST_COMPILER_VERSION "${LLVM_VERSION}") +set(OPENMP_TEST_COMPILER_VERSION_MAJOR "${LLVM_VERSION_MAJOR}") +set(OPENMP_TEST_COMPILER_VERSION_MAJOR_MINOR "${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}") +# Unfortunately the top-level cmake/config-ix.cmake file mangles CMake's +# CMAKE_THREAD_LIBS_INIT variable from the FindThreads package, so work +# around that, until it is fixed there. +if("${CMAKE_THREAD_LIBS_INIT}" STREQUAL "-lpthread") + set(OPENMP_TEST_COMPILER_THREAD_FLAGS "-pthread") else() - # Set the information that we know. - set(OPENMP_TEST_COMPILER_ID "Clang") - # Cannot use CLANG_VERSION because we are not guaranteed that this is already set. - set(OPENMP_TEST_COMPILER_VERSION "${LLVM_VERSION}") - set(OPENMP_TEST_COMPILER_VERSION_MAJOR "${LLVM_VERSION_MAJOR}") - set(OPENMP_TEST_COMPILER_VERSION_MAJOR_MINOR "${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}") - # Unfortunately the top-level cmake/config-ix.cmake file mangles CMake's - # CMAKE_THREAD_LIBS_INIT variable from the FindThreads package, so work - # around that, until it is fixed there. - if("${CMAKE_THREAD_LIBS_INIT}" STREQUAL "-lpthread") - set(OPENMP_TEST_COMPILER_THREAD_FLAGS "-pthread") - else() - set(OPENMP_TEST_COMPILER_THREAD_FLAGS "${CMAKE_THREAD_LIBS_INIT}") - endif() - if(TARGET tsan) - set(OPENMP_TEST_COMPILER_HAS_TSAN_FLAGS 1) - else() - set(OPENMP_TEST_COMPILER_HAS_TSAN_FLAGS 0) - endif() - set(OPENMP_TEST_COMPILER_HAS_OMP_H 1) - set(OPENMP_TEST_COMPILER_OPENMP_FLAGS "-fopenmp ${OPENMP_TEST_COMPILER_THREAD_FLAGS}") - set(OPENMP_TEST_COMPILER_HAS_OMIT_FRAME_POINTER_FLAGS 1) + set(OPENMP_TEST_COMPILER_THREAD_FLAGS "${CMAKE_THREAD_LIBS_INIT}") +endif() +if(TARGET tsan) + set(OPENMP_TEST_COMPILER_HAS_TSAN_FLAGS 1) +else() + set(OPENMP_TEST_COMPILER_HAS_TSAN_FLAGS 0) endif() +set(OPENMP_TEST_COMPILER_HAS_OMP_H 1) +set(OPENMP_TEST_COMPILER_OPENMP_FLAGS "-fopenmp ${OPENMP_TEST_COMPILER_THREAD_FLAGS}") +set(OPENMP_TEST_COMPILER_HAS_OMIT_FRAME_POINTER_FLAGS 1) set(OPENMP_TEST_ENABLE_TSAN "${OPENMP_TEST_COMPILER_HAS_TSAN_FLAGS}" CACHE BOOL "Whether to enable tests using tsan") @@ -212,7 +189,7 @@ function(add_openmp_testsuite target comment) set_property(GLOBAL APPEND PROPERTY OPENMP_LIT_DEPENDS ${ARG_DEPENDS}) endif() - if (${OPENMP_STANDALONE_BUILD}) + if (NOT TARGET Clang) set(LIT_ARGS ${OPENMP_LIT_ARGS} ${ARG_ARGS}) add_custom_target(${target} COMMAND ${Python3_EXECUTABLE} ${OPENMP_LLVM_LIT_EXECUTABLE} ${LIT_ARGS} ${ARG_UNPARSED_ARGUMENTS} diff --git a/openmp/docs/SupportAndFAQ.rst b/openmp/docs/SupportAndFAQ.rst index f5a84784c8de8..83a6f62fd8e1f 100644 --- a/openmp/docs/SupportAndFAQ.rst +++ b/openmp/docs/SupportAndFAQ.rst @@ -90,6 +90,22 @@ invocation. For Nvidia offload, please see :ref:`build_nvidia_offload_capable_compiler`. For AMDGPU offload, please see :ref:`build_amdgpu_offload_capable_compiler`. +For a standalone build, users are expected to use the LLVM runtimes directory. + +.. code-block:: sh + + $> cd llvm-project # The llvm-project checkout + $> mkdir build + $> cd build + $> cmake ../runtimes -G Ninja \ + -DLLVM_BINARY_DIR="${PATH_TO_LLVM}" + -DLLVM_ENABLE_RUNTIMES="openmp;offload" + -DLIBOMPTEST_BUILD_STANDALONE=1 + -DCMAKE_BUILD_TYPE= \ # Select build type + -DCMAKE_INSTALL_PREFIX= \ # Where the libraries will live + -DOPENMP_LLVM_TOOLS_DIR= \ # Where FileCheck and lit testing tools live. + $> ninja install + .. note:: The compiler that generates the offload code should be the same (version) as the compiler that builds the OpenMP device runtimes. The OpenMP host runtime diff --git a/openmp/runtime/CMakeLists.txt b/openmp/runtime/CMakeLists.txt index 93eb14f10a50a..e7c566e6f6c83 100644 --- a/openmp/runtime/CMakeLists.txt +++ b/openmp/runtime/CMakeLists.txt @@ -25,64 +25,52 @@ include(LibompGetArchitecture) include(LibompHandleFlags) include(LibompDefinitions) -# Determine the target architecture -if(${OPENMP_STANDALONE_BUILD}) - # If adding a new architecture, take a look at cmake/LibompGetArchitecture.cmake - libomp_get_architecture(LIBOMP_DETECTED_ARCH) - set(LIBOMP_ARCH ${LIBOMP_DETECTED_ARCH} CACHE STRING - "The architecture to build for (x86_64/i386/arm/ppc/ppc64/ppc64le/aarch64/aarch64_32/mic/mips/mips64/riscv64/loongarch64/ve/s390x/sparc/sparcv9/wasm32).") - # Should assertions be enabled? They are on by default. - set(LIBOMP_ENABLE_ASSERTIONS TRUE CACHE BOOL - "enable assertions?") - string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE) -else() # Part of LLVM build - # Determine the native architecture from LLVM. - string(TOLOWER "${LLVM_TARGET_ARCH}" LIBOMP_NATIVE_ARCH) - if( LIBOMP_NATIVE_ARCH STREQUAL "host" ) - string(REGEX MATCH "^[^-]*" LIBOMP_NATIVE_ARCH ${LLVM_HOST_TRIPLE}) - endif () - if(LIBOMP_NATIVE_ARCH MATCHES "i[2-6]86") - set(LIBOMP_ARCH i386) - elseif(LIBOMP_NATIVE_ARCH STREQUAL "x86") - set(LIBOMP_ARCH i386) - elseif(LIBOMP_NATIVE_ARCH STREQUAL "amd64") - set(LIBOMP_ARCH x86_64) - elseif(LIBOMP_NATIVE_ARCH STREQUAL "x86_64") - set(LIBOMP_ARCH x86_64) - elseif(LIBOMP_NATIVE_ARCH MATCHES "powerpc64le") - set(LIBOMP_ARCH ppc64le) - elseif(LIBOMP_NATIVE_ARCH MATCHES "powerpc64") - set(LIBOMP_ARCH ppc64) - elseif(LIBOMP_NATIVE_ARCH MATCHES "powerpc") - set(LIBOMP_ARCH ppc) - elseif(LIBOMP_NATIVE_ARCH MATCHES "aarch64_32") - set(LIBOMP_ARCH aarch64_32) - elseif(LIBOMP_NATIVE_ARCH MATCHES "aarch64") - set(LIBOMP_ARCH aarch64) - elseif(LIBOMP_NATIVE_ARCH MATCHES "arm64") - set(LIBOMP_ARCH aarch64) - elseif(LIBOMP_NATIVE_ARCH MATCHES "arm") - set(LIBOMP_ARCH arm) - elseif(LIBOMP_NATIVE_ARCH MATCHES "riscv64") - set(LIBOMP_ARCH riscv64) - elseif(LIBOMP_NATIVE_ARCH MATCHES "loongarch64") - set(LIBOMP_ARCH loongarch64) - elseif(LIBOMP_NATIVE_ARCH MATCHES "ve") - set(LIBOMP_ARCH ve) - elseif(LIBOMP_NATIVE_ARCH MATCHES "s390x") - set(LIBOMP_ARCH s390x) - elseif(LIBOMP_NATIVE_ARCH MATCHES "sparcv9") - set(LIBOMP_ARCH sparcv9) - elseif(LIBOMP_NATIVE_ARCH MATCHES "sparc") - set(LIBOMP_ARCH sparc) - elseif(LIBOMP_NATIVE_ARCH MATCHES "wasm") - set(LIBOMP_ARCH wasm32) - else() - # last ditch effort - libomp_get_architecture(LIBOMP_ARCH) - endif () - set(LIBOMP_ENABLE_ASSERTIONS ${LLVM_ENABLE_ASSERTIONS}) -endif() +# Determine the native architecture from LLVM. +string(TOLOWER "${LLVM_TARGET_ARCH}" LIBOMP_NATIVE_ARCH) +if( LIBOMP_NATIVE_ARCH STREQUAL "host" ) + string(REGEX MATCH "^[^-]*" LIBOMP_NATIVE_ARCH ${LLVM_HOST_TRIPLE}) +endif () +if(LIBOMP_NATIVE_ARCH MATCHES "i[2-6]86") + set(LIBOMP_ARCH i386) +elseif(LIBOMP_NATIVE_ARCH STREQUAL "x86") + set(LIBOMP_ARCH i386) +elseif(LIBOMP_NATIVE_ARCH STREQUAL "amd64") + set(LIBOMP_ARCH x86_64) +elseif(LIBOMP_NATIVE_ARCH STREQUAL "x86_64") + set(LIBOMP_ARCH x86_64) +elseif(LIBOMP_NATIVE_ARCH MATCHES "powerpc64le") + set(LIBOMP_ARCH ppc64le) +elseif(LIBOMP_NATIVE_ARCH MATCHES "powerpc64") + set(LIBOMP_ARCH ppc64) +elseif(LIBOMP_NATIVE_ARCH MATCHES "powerpc") + set(LIBOMP_ARCH ppc) +elseif(LIBOMP_NATIVE_ARCH MATCHES "aarch64_32") + set(LIBOMP_ARCH aarch64_32) +elseif(LIBOMP_NATIVE_ARCH MATCHES "aarch64") + set(LIBOMP_ARCH aarch64) +elseif(LIBOMP_NATIVE_ARCH MATCHES "arm64") + set(LIBOMP_ARCH aarch64) +elseif(LIBOMP_NATIVE_ARCH MATCHES "arm") + set(LIBOMP_ARCH arm) +elseif(LIBOMP_NATIVE_ARCH MATCHES "riscv64") + set(LIBOMP_ARCH riscv64) +elseif(LIBOMP_NATIVE_ARCH MATCHES "loongarch64") + set(LIBOMP_ARCH loongarch64) +elseif(LIBOMP_NATIVE_ARCH MATCHES "ve") + set(LIBOMP_ARCH ve) +elseif(LIBOMP_NATIVE_ARCH MATCHES "s390x") + set(LIBOMP_ARCH s390x) +elseif(LIBOMP_NATIVE_ARCH MATCHES "sparcv9") + set(LIBOMP_ARCH sparcv9) +elseif(LIBOMP_NATIVE_ARCH MATCHES "sparc") + set(LIBOMP_ARCH sparc) +elseif(LIBOMP_NATIVE_ARCH MATCHES "wasm") + set(LIBOMP_ARCH wasm32) +else() + # last ditch effort + libomp_get_architecture(LIBOMP_ARCH) +endif () +set(LIBOMP_ENABLE_ASSERTIONS ${LLVM_ENABLE_ASSERTIONS}) # Time profiling support set(LIBOMP_PROFILING_SUPPORT ${OPENMP_ENABLE_LIBOMP_PROFILING}) @@ -435,38 +423,6 @@ set(LIBOMP_LIB_FILE ${LIBOMP_LIB_NAME}${LIBOMP_LIBRARY_SUFFIX}) set(LIBOMP_INSTALL_ALIASES TRUE CACHE BOOL "Install libgomp and libiomp5 library aliases for backwards compatibility") -# Print configuration after all variables are set. -if(${OPENMP_STANDALONE_BUILD}) - libomp_say("Operating System -- ${CMAKE_SYSTEM_NAME}") - libomp_say("Target Architecture -- ${LIBOMP_ARCH}") - if(${MIC}) - libomp_say("Intel(R) MIC Architecture -- ${LIBOMP_MIC_ARCH}") - endif() - libomp_say("Build Type -- ${CMAKE_BUILD_TYPE}") - libomp_say("Library Kind -- ${LIBOMP_LIBRARY_KIND}") - libomp_say("Library Type -- ${LIBOMP_LIB_TYPE}") - libomp_say("Fortran Modules -- ${LIBOMP_FORTRAN_MODULES}") - # will say development if all zeros - if(${LIBOMP_VERSION_BUILD} STREQUAL 00000000) - set(LIBOMP_BUILD Development) - else() - set(LIBOMP_BUILD ${LIBOMP_VERSION_BUILD}) - endif() - libomp_say("Build -- ${LIBOMP_BUILD}") - libomp_say("Use Stats-gathering -- ${LIBOMP_STATS}") - libomp_say("Use Debugger-support -- ${LIBOMP_USE_DEBUGGER}") - libomp_say("Use ITT notify -- ${LIBOMP_USE_ITT_NOTIFY}") - libomp_say("Use OMPT-support -- ${LIBOMP_OMPT_SUPPORT}") - if(${LIBOMP_OMPT_SUPPORT}) - libomp_say("Use OMPT-optional -- ${LIBOMP_OMPT_OPTIONAL}") - endif() - libomp_say("Use OMPD-support -- ${LIBOMP_OMPD_SUPPORT}") - libomp_say("Use Adaptive locks -- ${LIBOMP_USE_ADAPTIVE_LOCKS}") - libomp_say("Use quad precision -- ${LIBOMP_USE_QUAD_PRECISION}") - libomp_say("Use Hwloc library -- ${LIBOMP_USE_HWLOC}") - libomp_say("Use OMPX-taskgraph -- ${LIBOMP_OMPX_TASKGRAPH}") -endif() - add_subdirectory(src) add_subdirectory(test) diff --git a/openmp/runtime/src/CMakeLists.txt b/openmp/runtime/src/CMakeLists.txt index 3202bdcd13524..2b5c829cb7d59 100644 --- a/openmp/runtime/src/CMakeLists.txt +++ b/openmp/runtime/src/CMakeLists.txt @@ -178,7 +178,7 @@ libomp_get_ldflags(LIBOMP_CONFIGURED_LDFLAGS) libomp_get_libflags(LIBOMP_CONFIGURED_LIBFLAGS) # Build libomp library. Add LLVMSupport dependency if building in-tree with libomptarget profiling enabled. -if(OPENMP_STANDALONE_BUILD OR (NOT OPENMP_ENABLE_LIBOMP_PROFILING)) +if(NOT OPENMP_ENABLE_LIBOMP_PROFILING) add_library(omp ${LIBOMP_LIBRARY_KIND} ${LIBOMP_SOURCE_FILES}) set_property(TARGET omp PROPERTY FOLDER "OpenMP/Libraries") # Linking command will include libraries in LIBOMP_CONFIGURED_LIBFLAGS @@ -444,10 +444,8 @@ add_dependencies(libomp-micro-tests libomp-test-deps) # `omp` needs to be exported if in-tree build. set(export_to_llvmexports) -if (NOT OPENMP_STANDALONE_BUILD) - get_target_export_arg(omp LLVM export_to_llvmexports) - set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS omp) -endif() +get_target_export_arg(omp LLVM export_to_llvmexports) +set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS omp) # Install rules # We want to install libomp in ${DESTDIR}/${CMAKE_INSTALL_FULL_LIBDIR} diff --git a/openmp/runtime/test/CMakeLists.txt b/openmp/runtime/test/CMakeLists.txt index 9ee3be6939811..cbcd0c155f062 100644 --- a/openmp/runtime/test/CMakeLists.txt +++ b/openmp/runtime/test/CMakeLists.txt @@ -33,7 +33,6 @@ pythonize_bool(LIBOMP_OMPT_OPTIONAL) pythonize_bool(LIBOMP_OMPX_TASKGRAPH) pythonize_bool(LIBOMP_HAVE_LIBM) pythonize_bool(LIBOMP_HAVE_LIBATOMIC) -pythonize_bool(OPENMP_STANDALONE_BUILD) pythonize_bool(OPENMP_TEST_COMPILER_HAS_OMIT_FRAME_POINTER_FLAGS) pythonize_bool(OPENMP_TEST_COMPILER_HAS_OMP_H) diff --git a/openmp/runtime/test/lit.cfg b/openmp/runtime/test/lit.cfg index 72da1ba1411f8..d4053da3044aa 100644 --- a/openmp/runtime/test/lit.cfg +++ b/openmp/runtime/test/lit.cfg @@ -212,7 +212,7 @@ config.substitutions.append(("%clang", config.test_c_compiler)) config.substitutions.append(("%openmp_flags", config.test_openmp_flags)) # %flags-use-compiler-omp-h allows us to use the test compiler's omp.h file which # may have different definitions of structures than our omp.h file. -if config.is_standalone_build and config.test_compiler_has_omp_h: +if config.test_compiler_has_omp_h: config.substitutions.append(("%flags-use-compiler-omp-h", config.test_flags_use_compiler_omp_h)) else: diff --git a/openmp/runtime/test/lit.site.cfg.in b/openmp/runtime/test/lit.site.cfg.in index cc8b3b252d7d1..7a51545b86fe1 100644 --- a/openmp/runtime/test/lit.site.cfg.in +++ b/openmp/runtime/test/lit.site.cfg.in @@ -20,7 +20,6 @@ config.has_ompt = @LIBOMP_OMPT_SUPPORT@ and @LIBOMP_OMPT_OPTIONAL@ config.has_ompx_taskgraph = @LIBOMP_OMPX_TASKGRAPH@ config.has_libm = @LIBOMP_HAVE_LIBM@ config.has_libatomic = @LIBOMP_HAVE_LIBATOMIC@ -config.is_standalone_build = @OPENMP_STANDALONE_BUILD@ config.has_omit_frame_pointer_flag = @OPENMP_TEST_COMPILER_HAS_OMIT_FRAME_POINTER_FLAGS@ config.target_arch = "@LIBOMP_ARCH@" config.compiler_frontend_variant = "@CMAKE_C_COMPILER_FRONTEND_VARIANT@" diff --git a/openmp/tools/omptest/CMakeLists.txt b/openmp/tools/omptest/CMakeLists.txt index b313f223c354c..b04cb3a056cf5 100644 --- a/openmp/tools/omptest/CMakeLists.txt +++ b/openmp/tools/omptest/CMakeLists.txt @@ -9,7 +9,7 @@ project(omptest LANGUAGES CXX) option(LIBOMPTEST_BUILD_STANDALONE "Build ompTest 'standalone', i.e. w/o GoogleTest." - ${OPENMP_STANDALONE_BUILD}) + OFF) option(LIBOMPTEST_BUILD_UNITTESTS "Build ompTest's unit tests, requires GoogleTest." OFF) option(LIBOMPTEST_INSTALL_COMPONENTS