aboutsummaryrefslogtreecommitdiff
path: root/openmp/cmake
AgeCommit message (Collapse)AuthorFilesLines
2024-05-24[OpenMP][AIX] Extend LIT test timeout limit (#93319)Xing Xue1-1/+1
When buildbots are crowded, the libomp LIT tests may hit timeouts so extend the limit from 1800 to 3000 seconds.
2024-02-11[OpenMP] Remove -Wno-enum-constexpr-conversion (#81318)Carlos Galvez2-2/+0
This effectively reverts commit 9ff0cc7e0fa7e99163610d2fcb58e96f3315e343. For some reason "git revert" lead to "no changes" after fixing conflicts, so a clean revert was not possible. The original issue (#57022) is no longer reproducible even with this patch, so we can remove the suppression. This is in line with our goal to make -Wenum-constexpr-conversion a non-downgradeable error, see #59036. Co-authored-by: Carlos Gálvez <carlos.galvez@zenseact.com>
2024-02-08[OpenMP] [cmake] Don't use -fno-semantic-interposition on Windows (#81113)Martin Storsjö1-1/+5
This was added in 4b7beab4187ab0766c3d7b272511d5751431a8da. When the flag was added implicitly elsewhere, it was added via llvm/cmake/modules/HandleLLVMOptions.cmake, where it wasn't added on Windows/Cygwin targets. This avoids one warning per object file in OpenMP.
2024-02-08[OpenMP] [cmake] In standalone mode, make Python3_EXECUTABLE available (#80828)Martin Storsjö1-0/+2
When running the tests, we try to invoke them as "${Python3_EXECUTABLE} ${OPENMP_LLVM_LIT_EXECUTABLE}", but when running "find_package(Python3)" within the function "find_standalone_test_dependencies", the variable "Python3_EXECUTABLE" only gets set within the function scope. Tests have worked regardless of this in many cases, where executing the python script directly succeeds. But for consistency, and for working in cases when the python script can't be executed as such, make the Python3_EXECUTABLE variable available as intended.
2024-02-01[openmp] On Windows, fix standalone cmake build (#80174)Alexandre Ganea1-0/+8
This fixes: https://github.com/llvm/llvm-project/issues/80117
2024-01-23Re-land [openmp] Fix warnings when building on Windows with latest MSVC or ↵Alexandre Ganea1-0/+9
Clang ToT (#77853) The reverts 94f960925b7f609636fc2ffd83053814d5e45ed1 and fixes it.
2024-01-23Revert 10f3296dd7d74c975f208a8569221dc8f96d1db1 - [openmp] Fix warnings when ↵Alexandre Ganea1-9/+0
building on Windows with latest MSVC or Clang ToT (#77853) It broke the AMDGPU buildbot: https://lab.llvm.org/buildbot/#/builders/193/builds/45378
2024-01-23[openmp] Fix warnings when building on Windows with latest MSVC or Clang ToT ↵Alexandre Ganea1-0/+9
(#77853) There were quite a few compilation warnings when building openmp on Windows with the latest Visual Studios 2022 version 17.8.4. Some other warnings were visible with the latest Clang at tip. This commit fixes all of them.
2024-01-08[openmp][AIX]Initial changes for porting to AIX (#76841)Xing Xue1-0/+3
This PR contains initial changes for building and testing libomp on AIX. More changes will follow. - `KMP_OS_AIX` is defined for the AIX platform - `KMP_ARCH_PPC` is defined for 32-bit PPC - `KMP_ARCH_PPC_XCOFF` and `KMP_ARCH_PPC64_XCOFF` are for 32- and 64-bit XCOFF object formats respectively - Assembly file `z_AIX_asm.S` is used for AIX specific assembly code and will be added in a separate PR - The target library is disabled because AIX does not have the device support - OMPT is temporarily disabled
2023-11-27[OpenMP] Add back implicit flags manuallyJoseph Huber2-0/+13
Summary: We used to inherit these flags from the LLVM options in a runtimes build. This patch adds them back in manually as they are helpful for diagnostics and optimizing the created binary.
2023-11-27[OpenMP] Fix missing CMake function in runtimes buildJoseph Huber1-1/+1
Summary: We borrowed this function from LLVM, my previous patch removed that. Now we redefine it if it's not present.
2023-05-27Reland "[CMake] Bumps minimum version to 3.20.0.Mark de Wever1-1/+1
This reverts commit d763c6e5e2d0a6b34097aa7dabca31e9aff9b0b6. Adds the patch by @hans from https://github.com/llvm/llvm-project/issues/62719 This patch fixes the Windows build. d763c6e5e2d0a6b34097aa7dabca31e9aff9b0b6 reverted the reviews D144509 [CMake] Bumps minimum version to 3.20.0. This partly undoes D137724. This change has been discussed on discourse https://discourse.llvm.org/t/rfc-upgrading-llvms-minimum-required-cmake-version/66193 Note this does not remove work-arounds for older CMake versions, that will be done in followup patches. D150532 [OpenMP] Compile assembly files as ASM, not C Since CMake 3.20, CMake explicitly passes "-x c" (or equivalent) when compiling a file which has been set as having the language C. This behaviour change only takes place if "cmake_minimum_required" is set to 3.20 or newer, or if the policy CMP0119 is set to new. Attempting to compile assembly files with "-x c" fails, however this is workarounded in many cases, as OpenMP overrides this with "-x assembler-with-cpp", however this is only added for non-Windows targets. Thus, after increasing cmake_minimum_required to 3.20, this breaks compiling the GNU assembly for Windows targets; the GNU assembly is used for ARM and AArch64 Windows targets when building with Clang. This patch unbreaks that. D150688 [cmake] Set CMP0091 to fix Windows builds after the cmake_minimum_required bump The build uses other mechanism to select the runtime. Fixes #62719 Reviewed By: #libc, Mordante Differential Revision: https://reviews.llvm.org/D151344
2023-05-17Revert "Reland "[CMake] Bumps minimum version to 3.20.0.""Nico Weber1-1/+1
This reverts commit 65429b9af6a2c99d340ab2dcddd41dab201f399c. Broke several projects, see https://reviews.llvm.org/D144509#4347562 onwards. Also reverts follow-up commit "[OpenMP] Compile assembly files as ASM, not C" This reverts commit 4072c8aee4c89c4457f4f30d01dc9bb4dfa52559. Also reverts fix attempt "[cmake] Set CMP0091 to fix Windows builds after the cmake_minimum_required bump" This reverts commit 7d47dac5f828efd1d378ba44a97559114f00fb64.
2023-05-16[OpenMP] Use CMAKE_CXX_STANDARD for setting the C++ versionMartin Storsjö2-4/+0
Previously, we tried to check whether the -std=c++17 option was supported and manually add the flag. That doesn't work for compilers that do support C++17 but use a different option syntax, like clang-cl. OpenMP itself probably doesn't specifically require C++17, therefore CXX_STANDARD_REQUIRED is left off, but in some cases, we may have code that only works in C++17 mode. In particular, 46262cab24312c71717ca70a9d0700481aa59152 made a refactoring that works when built with Clang in C++17 mode, but not in C++14 mode. MSVC accepts the construct in both language modes. For libomptarget, we've had specific checks that require C++17 (or the -std=c++17 option) to be supported. It's doubtful that libomptarget has got any code which more specifically requires C++17; this seems to be a remnant from when libomptarget was added originally in 2467df6e4f04e3d0e8e78d662473ba1b87c0a885 / D14031. At that point, the rest of OpenMP didn't require C++11, while libomptarget did require it. Now, it's unlikely that anyone attempts building it with a toolchain that doesn't support C++11. At this point, we could also probably just set CXX_STANDARD_REQUIRED to true, requiring C++17 as baseline for all the OpenMP libraries. This fixes building OpenMP with clang-cl after 46262cab24312c71717ca70a9d0700481aa59152. Differential Revision: https://reviews.llvm.org/D149726
2023-05-13Reland "[CMake] Bumps minimum version to 3.20.0."Mark de Wever1-1/+1
The owner of the last two failing buildbots updated CMake. This reverts commit e8e8707b4aa6e4cc04c0cffb2de01d2de71165fc.
2023-05-06Revert "Reland "[CMake] Bumps minimum version to 3.20.0.""Mark de Wever1-1/+1
Unfortunatly not all buildbots are updated. This reverts commit ffb807ab5375b3f78df198dc5d4302b3b552242f.
2023-05-06Reland "[CMake] Bumps minimum version to 3.20.0."Mark de Wever1-1/+1
All build bots should be updated now. This reverts commit 44d38022ab29a3156349602733b3459df5beef93.
2023-04-15Revert "Revert "Revert "[CMake] Bumps minimum version to 3.20.0."""Mark de Wever1-1/+1
This reverts commit 1ef4c3c859728008cf707cad8d67f45ae5070ae1. Two buildbots still haven't been updated.
2023-04-15Revert "Revert "[CMake] Bumps minimum version to 3.20.0.""Mark de Wever1-1/+1
This reverts commit 92523a35a827539db8557bbc3ecab7f9ea3f6ade. Reland to see whether CIs are updated.
2023-03-18Revert "Reland "[CMake] Bumps minimum version to 3.20.0.""Mark de Wever1-1/+1
This reverts commit a72165e5df59032cdd54dcb18155f2630d73abd1. Some buildbots have not been updated yet.
2023-03-18Reland "[CMake] Bumps minimum version to 3.20.0."Mark de Wever1-1/+1
This reverts commit 92523a35a827539db8557bbc3ecab7f9ea3f6ade. Test whether all CI runners are updated.
2023-03-04Revert "[CMake] Bumps minimum version to 3.20.0."Mark de Wever1-1/+1
Some build bots have not been updated to the new minimal CMake version. Reverting for now and ping the buildbot owners. This reverts commit 44c6b905f8527635e49bb3ea97dea315f92d38ec.
2023-03-04[CMake] Bumps minimum version to 3.20.0.Mark de Wever1-1/+1
This partly undoes D137724. This change has been discussed on discourse https://discourse.llvm.org/t/rfc-upgrading-llvms-minimum-required-cmake-version/66193 Note this does not remove work-arounds for older CMake versions, that will be done in followup patches. Reviewed By: mehdi_amini, MaskRay, ChuanqiXu, to268, thieta, tschuett, phosek, #libunwind, #libc_vendors, #libc, #libc_abi, sivachandra, philnik, zibi Differential Revision: https://reviews.llvm.org/D144509
2022-12-26[RFC][OpenMP] Update to Python3 for lit testShilei Tian1-3/+3
I think it's reasonable to upgrade to Python 3 for LIT test requirement because `lit` itself (`llvm/utils/lit/lit.py`) already switched to Python 3. In addition, LLVM already requires Python 3.6 to be the minimum version (https://llvm.org/docs/GettingStarted.html#software). Reviewed By: jdoerfert, jhuber6 Differential Revision: https://reviews.llvm.org/D139855
2022-12-14[OpenMP] Fix detecting warning options for GCCMartin Storsjö2-8/+20
If testing for a warning option like -Wno-<foo> with GCC, GCC won't print any diagnostic at all, leading to the options being accepted incorrectly. However later, if compiling a file that actually prints another warning, GCC will also print warnings about these -Wno-<foo> options being unrecognized. This avoids warning spam like this, for every OpenMP source file that produces build warnings with GCC: cc1plus: warning: unrecognized command line option ‘-Wno-int-to-void-pointer-cast’ cc1plus: warning: unrecognized command line option ‘-Wno-return-type-c-linkage’ cc1plus: warning: unrecognized command line option ‘-Wno-covered-switch-default’ cc1plus: warning: unrecognized command line option ‘-Wno-enum-constexpr-conversion’ This matches how such warning options are detected and added in llvm/cmake/modules/HandleLLVMOptions.cmake, e.g. like this: check_cxx_compiler_flag("-Wclass-memaccess" CXX_SUPPORTS_CLASS_MEMACCESS_FLAG) append_if(CXX_SUPPORTS_CLASS_MEMACCESS_FLAG "-Wno-class-memaccess" CMAKE_CXX_FLAGS) This also matches how LLDB warning options were restructured for GCC compatibility in e546bbfda0ab91cf78c096d8c035851cc7c3b9f3. Differential Revision: https://reviews.llvm.org/D139922
2022-11-29Reapply [openmp] [test] XFAIL many-microtask-args.c on ARMMartin Storsjö1-1/+16
On ARM, a C fallback version of __kmp_invoke_microtask is used, which only handles up to a fixed number of arguments - while many-microtask-args.c tests that the function can handle an arbitrarily large number of arguments (the testcase produces 17 arguments). On the CMake level, we can't add ${LIBOMP_ARCH} directly to OPENMP_TEST_COMPILER_FEATURES in OpenMPTesting.cmake, since that file is parsed before LIBOMP_ARCH is set. Instead convert the feature list into a proper CMake list, and append ${LIBOMP_ARCH} into it before serializing it to an Python array. Reapply: Make sure OPENMP_TEST_COMPILER_FEATURES is defined properly in all other test subdirectories other than runtime/test too. Differential Revision: https://reviews.llvm.org/D138738
2022-11-28Revert "[openmp] [test] XFAIL many-microtask-args.c on ARM"Martin Storsjö1-1/+1
This reverts commit 03bf001b6d95f7c6a88a2b95f3cad752b9d1ed45. This commit broke a number of OpenMP buildbots, e.g. https://lab.llvm.org/buildbot#builders/84/builds/31839, where the build ends up with errors like this: [0/1] Running OpenMP tests llvm-lit: /b/1/openmp-clang-x86_64-linux-debian/llvm.src/llvm/utils/lit/lit/TestingConfig.py:140: fatal: unable to parse config file '/b/1/openmp-clang-x86_64-linux-debian/llvm.build/projects/openmp/libomptarget/test/x86_64-pc-linux-gnu/lit.site.cfg', traceback: Traceback (most recent call last): File "/b/1/openmp-clang-x86_64-linux-debian/llvm.src/llvm/utils/lit/lit/TestingConfig.py", line 129, in load_from_path exec(compile(data, path, 'exec'), cfg_globals, None) File "/b/1/openmp-clang-x86_64-linux-debian/llvm.build/projects/openmp/libomptarget/test/x86_64-pc-linux-gnu/lit.site.cfg", line 6 config.test_compiler_features = ^ SyntaxError: invalid syntax
2022-11-28[openmp] [test] XFAIL many-microtask-args.c on ARMMartin Storsjö1-1/+1
On ARM, a C fallback version of __kmp_invoke_microtask is used, which only handles up to a fixed number of arguments - while many-microtask-args.c tests that the function can handle an arbitrarily large number of arguments (the testcase produces 17 arguments). On the CMake level, we can't add ${LIBOMP_ARCH} directly to OPENMP_TEST_COMPILER_FEATURES in OpenMPTesting.cmake, since that file is parsed before LIBOMP_ARCH is set. Instead convert the feature list into a proper CMake list, and append ${LIBOMP_ARCH} into it before serializing it to an Python array. Differential Revision: https://reviews.llvm.org/D138738
2022-11-16OpenMP: Remove -fno-experimental-isel flag from testingMatt Arsenault2-16/+1
This effectively reverts 6f9e25d3824fb7b03dc6a403e1962d80a9c88ebe. I didn't follow the complete history, but it seems this was added due to AArch64's output changing in some fallback. Blockaddress definitely works now, so just remove this.
2022-08-09[openmp] Fix enumeration build issue for openmp libraryRon Lieberman2-0/+2
integer value 40962 is outside the valid range of values [0, 31] for this enumeration type [-Wenum-constexpr-conversion]` (Issue #57022) turn on -Wno-enum-constexpr-conversion to buy some time to fix the more egregious issue in hsa_agent_into_t and hsa_amd_agent_info_t interfaces. relates to https://reviews.llvm.org/D131307/new/ Differential Revision: https://reviews.llvm.org/D131477
2022-08-08Rename OPENMP_HAVE_STD_CPP14_FLAG to match c++17Jon Chesterfield2-2/+2
2022-08-08Move openmp from -std=c++14 to -std=c++17Ron Lieberman2-2/+2
2022-08-02[OpenMP][libomp] Detect if test compiler has omp.hJonathan Peyton2-1/+14
omp50_taskdep_depobj.c relies on the test compiler's omp.h file. If the test compiler does not have an omp.h file, then use the one within the build tree. Fixes: https://github.com/llvm/llvm-project/issues/56820 Differential Revision: https://reviews.llvm.org/D131000
2022-02-14[OpenMP][libomp] Introduce oneAPI compiler supportJonathan Peyton3-0/+24
Introduce KMP_COMPILER_ICX macro to represent compilation with oneAPI compiler. Fixup flag detection and compiler ID detection in CMake. Older CMake's detect IntelLLVM as Clang. Fix compiler warnings. Fixup many of the tests to have non-empty parallel regions as they are elided by oneAPI compiler.
2021-12-12[OpenMP] Add "not" to test dependencies.Michael Kruse1-2/+2
The `not` program is used to test executions prefixed with `%libomptarget-run-fail-`. Currently `not` is not used for libomp tests, but might be used in the future and its dependency does not add any additional burden over the already established `FileCheck` dependency. Required to add libomptarget testing to the Phabricator pre-merge check (see https://github.com/google/llvm-premerge-checks/issues/368) Reviewed By: jdenny, JonChesterfield Differential Revision: https://reviews.llvm.org/D115454
2021-07-23[OpenMP] always compile with c++14 instead of gnu++14Ye Luo2-5/+1
Fixes PR 51174. c++14 should be a more portable option than gnu++14. Reviewed By: tianshilei1992 Differential Revision: https://reviews.llvm.org/D106632
2021-02-24[OpenMP][Tests][NFC] lit might also be known as llvm-lit.pyJoachim Protze1-1/+1
2021-02-01[OpenMP] Disable tests if FileCheck is not available in in-tree buildingShilei Tian1-1/+7
FileCheck is required for OpenMP tests. The current detection can fail if building OpenMP in-tree when user sets `LLVM_INSTALL_TOOLCHAIN_ONLY=ON`. As a result, CMake will raise an error and the compilation will be broken. This patch fixed the issue. When `FileCheck` is not a target, tests will just be skipped. Reviewed By: jdoerfert, JonChesterfield Differential Revision: https://reviews.llvm.org/D95689
2021-01-10[OpenMP] Not set OPENMP_STANDALONE_BUILD=ON when building OpenMP along with LLVMShilei Tian1-2/+2
For now, `*_STANDALONE_BUILD` is set to ON even if they're built along with LLVM because of issues mentioned in the comments. This can cause some issues. For example, if we build OpenMP along with LLVM, we'd like to copy those OpenMP headers to `<prefix>/lib/clang/<version>/include` such that `clang` can find those headers without using `-I <prefix>/include` because those headers will be copied to `<prefix>/include` if it is built standalone. In this patch, we fixed the dependence issue in OpenMP such that it can be built correctly even with `OPENMP_STANDALONE_BUILD=OFF`. The issue is in the call to `add_lit_testsuite`, where `clang` and `clang-resource-headers` are passed as `DEPENDS`. Since we're building OpenMP along with LLVM, `clang` is set by CMake to be the C/C++ compiler, therefore these two dependences are no longer needed, where caused the dependence issue. Reviewed By: jdoerfert Differential Revision: https://reviews.llvm.org/D93738
2020-09-07[CMake][OpenMP] Remove old dead CMake codeRaul Tambre1-8/+1
LLVM requires CMake 3.13.4 so remove code behind checks for an older version. Reviewed By: phosek Differential Revision: https://reviews.llvm.org/D87191
2020-07-22[CMake] Bump CMake minimum version to 3.13.4Louis Dionne1-1/+1
This upgrade should be friction-less because we've already been ensuring that CMake >= 3.13.4 is used. This is part of the effort discussed on llvm-dev here: http://lists.llvm.org/pipermail/llvm-dev/2020-April/140578.html Differential Revision: https://reviews.llvm.org/D78648
2020-07-02[OpenMP][CMake] Fix version detection of testing compilerJonas Hahnfeld1-2/+2
When configuring in-tree, the correct names are LLVM_VERSION_MAJOR and LLVM_VERSION_MINOR. This has been wrong since the code was added in commits fc473dee98 and 821649229e.
2020-04-21[OpenMP] Add scaffolding for negative runtime testsJoel E. Denny1-0/+12
Without this patch, the openmp project's test suites do not appear to have support for negative tests. However, D78170 needs to add a test that an expected runtime failure occurs. This patch makes `not` visible in all of the openmp project's test suites. In all but `libomptarget/test`, it should be possible for a test author to insert `not` before a use of the lit substitution for running a test program. In `libomptarget/test`, that substitution is target-specific, and its value is `echo` when the target is not available. In that case, inserting `not` before a lit substitution would expect an `echo` fail, so this patch instead defines a separate lit substitution for expected runtime fails. Reviewed By: jdoerfert, Hahnfeld Differential Revision: https://reviews.llvm.org/D78566
2020-02-13[openmp][cmake] passing option argument correctlyYuanfang Chen1-7/+16
From the context, it looks like the test should not be run with `check-all`, but it does. It turns out option argument resolving to True/False which could not be passed down as is. There is one such example in AddLLVM.cmake.
2020-02-11[OpenMP] Switch default C++ standard to C++ 14Johannes Doerfert2-5/+5
Reviewed By: JonChesterfield Differential Revision: https://reviews.llvm.org/D74258
2020-02-06[CMake] Rename EXCLUDE_FROM_ALL and make it an argument to add_lit_testsuiteJonas Devlieghere1-5/+5
EXCLUDE_FROM_ALL means something else for add_lit_testsuite as it does for something like add_executable. Distinguish between the two by renaming the variable and making it an argument to add_lit_testsuite. Differential revision: https://reviews.llvm.org/D74168
2020-01-13[OpenMP][Tool] Make tests for archer dependent on TSanJoachim Protze2-0/+13
If the openmp project is built standalone, the test compiler is feature tested for an available -fsanitize=thread flag. If the openmp project is built as part of llvm, the target tsan is needed to test archer. An additional line (requires tsan) was introduced to the tests, this patch updates the line numbers for the race. Follow-up for 77ad98c Reviewed By: jdoerfert Differential Revision: https://reviews.llvm.org/D71914
2019-08-15[OpenMP] Enable warning about "implicit fallthrough"Jonas Hahnfeld2-0/+2
Fix last warned location in ittnotify_static.cpp using the defined macro KMP_FALLTHROUGH(). Differential Revision: https://reviews.llvm.org/D65871 llvm-svn: 369003
2019-08-15[OpenMP] Turn on -Wall compiler warnings by defaultJonas Hahnfeld2-4/+29
Instead, maintain a list of disabled options to still build libomp and libomptarget without warnings. This includes -Wno-error and -Wno-pedantic to silence warnings that LLVM enables when building in-tree. I tested the following compilers: * Clang 6.0, 7.0, 8.0 * GCC 4.8.5 (CentOS 7), GCC 6, 7, 8, 9 * Intel Compiler 16, 17, 18, 19 RFC thread on openmp-dev mailing list: http://lists.llvm.org/pipermail/openmp-dev/2019-August/002668.html Differential Revision: https://reviews.llvm.org/D65867 llvm-svn: 368999
2019-04-05After rL357618, quote ${CMAKE_THREAD_LIBS_INIT} so CMake does notDimitry Andric1-1/+1
complain when the variable is empty. Fixes PR 41401. llvm-svn: 357828