diff options
100 files changed, 1330 insertions, 343 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 680d77b..672df5a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -91,46 +91,69 @@ build:fedora33-sphinx: # Linux builds -build:centos6-release: +build:centos6-x86_64: extends: - - .release_linux - - .cmake_build_release_linux + - .linux_release_x86_64 + - .cmake_build_linux_release - .cmake_release_artifacts - .linux_builder_tags - .run_manually +build:centos7-aarch64: + extends: + - .linux_release_aarch64 + - .cmake_build_linux_release + - .cmake_release_artifacts + - .linux_builder_tags_aarch64 + - .run_manually + variables: + CMAKE_CI_NO_MR: "true" + test:debian10-ninja: extends: - .debian10_ninja - - .cmake_test_linux_package + - .cmake_test_linux_release - .linux_builder_tags_qt - .run_dependent dependencies: - - build:centos6-release + - build:centos6-x86_64 needs: - - build:centos6-release + - build:centos6-x86_64 + +test:debian10-aarch64-ninja: + extends: + - .debian10_aarch64_ninja + - .cmake_test_linux_release + - .linux_builder_tags_aarch64_qt + - .run_dependent + dependencies: + - build:centos7-aarch64 + needs: + - build:centos7-aarch64 + variables: + CMAKE_CI_NO_MR: "true" test:fedora33-makefiles: extends: - .fedora33_makefiles - - .cmake_test_linux_package + - .cmake_test_linux_release - .linux_builder_tags_qt - .run_dependent dependencies: - - build:centos6-release + - build:centos6-x86_64 needs: - - build:centos6-release + - build:centos6-x86_64 test:cuda10.2-nvidia: extends: - .cuda10.2_nvidia - - .cmake_test_linux_package + - .cmake_test_linux_release - .linux_builder_tags_cuda - .run_dependent dependencies: - - build:centos6-release + - build:centos6-x86_64 needs: - - build:centos6-release + - build:centos6-x86_64 build:fedora33-ninja: extends: @@ -165,8 +188,9 @@ test:fedora33-ninja-multi: build:linux-x86_64-package: extends: - - .linux_package_x86_64 - - .cmake_build_linux_package + - .linux_package + - .linux_release_x86_64 + - .cmake_build_linux_release - .cmake_release_artifacts - .linux_builder_tags - .run_only_for_package @@ -188,8 +212,9 @@ upload:linux-x86_64-package: build:linux-aarch64-package: extends: - - .linux_package_aarch64 - - .cmake_build_linux_package + - .linux_package + - .linux_release_aarch64 + - .cmake_build_linux_release - .cmake_release_artifacts - .linux_builder_tags_aarch64 - .run_only_for_package diff --git a/.gitlab/ci/cmake.ps1 b/.gitlab/ci/cmake.ps1 index e7b4de7..c5bf958 100755 --- a/.gitlab/ci/cmake.ps1 +++ b/.gitlab/ci/cmake.ps1 @@ -1,7 +1,7 @@ $erroractionpreference = "stop" -$version = "3.19.0" -$sha256sum = "67BBDA67C98C5F0789199FE1DB650F12274A6AD40FD8CAE88D208029AC618905" +$version = "3.19.3" +$sha256sum = "3838E11A0DB08F97D687F061882A1E52807010A313F3AC716015B3587CA3F20E" $filename = "cmake-$version-win64-x64" $tarball = "$filename.zip" diff --git a/.gitlab/ci/cmake.sh b/.gitlab/ci/cmake.sh index 2547663..e02eb8a 100755 --- a/.gitlab/ci/cmake.sh +++ b/.gitlab/ci/cmake.sh @@ -2,21 +2,26 @@ set -e -readonly version="3.19.0" +readonly version="3.19.3" -case "$( uname -s )" in - Linux) +case "$(uname -s)-$(uname -m)" in + Linux-x86_64) shatool="sha256sum" - sha256sum="5446cdee900e906e46162a5a7be9b4542bb5e886041cf8cffeda62aae2696ccf" - platform="Linux" + sha256sum="c18b65697e9679e5c88dccede08c323cd3d3730648e59048047bba82097e0ffc" + platform="Linux-x86_64" ;; - Darwin) + Linux-aarch64) + shatool="sha256sum" + sha256sum="66e507c97ffb586d7ca6567890808b792c8eb004b645706df6fbf27826a395a2" + platform="Linux-aarch64" + ;; + Darwin-*) shatool="shasum -a 256" - sha256sum="315eb5500753f797075b6ea43189420e97b0b9f32c8fc87ec94ba1d80b72eb7f" - platform="Darwin" + sha256sum="a6b79ad05f89241a05797510e650354d74ff72cc988981cdd1eb2b3b2bda66ac" + platform="macos-universal" ;; *) - echo "Unrecognized platform $( uname -s )" + echo "Unrecognized platform $(uname -s)-$(uname -m)" exit 1 ;; esac @@ -24,7 +29,7 @@ readonly shatool readonly sha256sum readonly platform -readonly filename="cmake-$version-$platform-x86_64" +readonly filename="cmake-$version-$platform" readonly tarball="$filename.tar.gz" cd .gitlab diff --git a/.gitlab/ci/configure_debian10_aarch64_ninja.cmake b/.gitlab/ci/configure_debian10_aarch64_ninja.cmake new file mode 100644 index 0000000..12d0e02 --- /dev/null +++ b/.gitlab/ci/configure_debian10_aarch64_ninja.cmake @@ -0,0 +1,65 @@ +set(CMake_TEST_FindALSA "ON" CACHE BOOL "") +set(CMake_TEST_FindBLAS "ON" CACHE BOOL "") +set(CMake_TEST_FindBoost "ON" CACHE BOOL "") +set(CMake_TEST_FindBoost_Python "ON" CACHE BOOL "") +set(CMake_TEST_FindBZip2 "ON" CACHE BOOL "") +set(CMake_TEST_FindCups "ON" CACHE BOOL "") +set(CMake_TEST_FindCURL "ON" CACHE BOOL "") +set(CMake_TEST_FindDoxygen_Dot "ON" CACHE BOOL "") +set(CMake_TEST_FindDoxygen "ON" CACHE BOOL "") +set(CMake_TEST_FindEXPAT "ON" CACHE BOOL "") +set(CMake_TEST_FindFontconfig "ON" CACHE BOOL "") +set(CMake_TEST_FindFreetype "ON" CACHE BOOL "") +set(CMake_TEST_FindGDAL "ON" CACHE BOOL "") +set(CMake_TEST_FindGIF "ON" CACHE BOOL "") +set(CMake_TEST_FindGit "ON" CACHE BOOL "") +set(CMake_TEST_FindGLEW "ON" CACHE BOOL "") +set(CMake_TEST_FindGnuTLS "ON" CACHE BOOL "") +set(CMake_TEST_FindGSL "ON" CACHE BOOL "") +set(CMake_TEST_FindGTest "ON" CACHE BOOL "") +set(CMake_TEST_FindGTK2 "ON" CACHE BOOL "") +set(CMake_TEST_FindIconv "ON" CACHE BOOL "") +set(CMake_TEST_FindIntl "ON" CACHE BOOL "") +set(CMake_TEST_FindJPEG "ON" CACHE BOOL "") +set(CMake_TEST_FindJsonCpp "ON" CACHE BOOL "") +set(CMake_TEST_FindLAPACK "ON" CACHE BOOL "") +set(CMake_TEST_FindLibArchive "ON" CACHE BOOL "") +set(CMake_TEST_FindLibinput "ON" CACHE BOOL "") +set(CMake_TEST_FindLibLZMA "ON" CACHE BOOL "") +set(CMake_TEST_FindLibUV "ON" CACHE BOOL "") +set(CMake_TEST_FindLibXml2 "ON" CACHE BOOL "") +set(CMake_TEST_FindLibXslt "ON" CACHE BOOL "") +set(CMake_TEST_FindMPI_C "ON" CACHE BOOL "") +set(CMake_TEST_FindMPI_CXX "ON" CACHE BOOL "") +set(CMake_TEST_FindMPI_Fortran "ON" CACHE BOOL "") +set(CMake_TEST_FindMPI "ON" CACHE BOOL "") +set(CMake_TEST_FindODBC "ON" CACHE BOOL "") +set(CMake_TEST_FindOpenACC "ON" CACHE BOOL "") +set(CMake_TEST_FindOpenGL "ON" CACHE BOOL "") +set(CMake_TEST_FindOpenMP_C "ON" CACHE BOOL "") +set(CMake_TEST_FindOpenMP_CXX "ON" CACHE BOOL "") +set(CMake_TEST_FindOpenMP_Fortran "ON" CACHE BOOL "") +set(CMake_TEST_FindOpenMP "ON" CACHE BOOL "") +set(CMake_TEST_FindOpenSSL "ON" CACHE BOOL "") +set(CMake_TEST_FindPatch "ON" CACHE BOOL "") +set(CMake_TEST_FindPNG "ON" CACHE BOOL "") +set(CMake_TEST_FindPostgreSQL "ON" CACHE BOOL "") +set(CMake_TEST_FindProtobuf "ON" CACHE BOOL "") +set(CMake_TEST_FindPython "ON" CACHE BOOL "") +set(CMake_TEST_FindPython_NumPy "ON" CACHE BOOL "") +set(CMake_TEST_FindPython_PyPy "ON" CACHE BOOL "") +set(CMake_TEST_FindRuby "ON" CACHE BOOL "") +set(CMake_TEST_FindSDL "ON" CACHE BOOL "") +set(CMake_TEST_FindSQLite3 "ON" CACHE BOOL "") +set(CMake_TEST_FindTIFF "ON" CACHE BOOL "") +set(CMake_TEST_FindX11 "ON" CACHE BOOL "") +set(CMake_TEST_FindXalanC "ON" CACHE BOOL "") +set(CMake_TEST_FindXercesC "ON" CACHE BOOL "") +set(CMake_TEST_Fortran_SUBMODULES "ON" CACHE BOOL "") +set(CMake_TEST_IPO_WORKS_C "ON" CACHE BOOL "") +set(CMake_TEST_IPO_WORKS_CXX "ON" CACHE BOOL "") +set(CMake_TEST_IPO_WORKS_Fortran "ON" CACHE BOOL "") +set(CMake_TEST_Qt5 "ON" CACHE BOOL "") +set(CMake_TEST_UseSWIG "ON" CACHE BOOL "") + +include("${CMAKE_CURRENT_LIST_DIR}/configure_external_test.cmake") diff --git a/.gitlab/ci/docker/debian10-aarch64/Dockerfile b/.gitlab/ci/docker/debian10-aarch64/Dockerfile new file mode 100644 index 0000000..2079795 --- /dev/null +++ b/.gitlab/ci/docker/debian10-aarch64/Dockerfile @@ -0,0 +1,5 @@ +FROM arm64v8/debian:10 +MAINTAINER Brad King <brad.king@kitware.com> + +COPY install_deps.sh /root/install_deps.sh +RUN sh /root/install_deps.sh diff --git a/.gitlab/ci/docker/debian10-aarch64/install_deps.sh b/.gitlab/ci/docker/debian10-aarch64/install_deps.sh new file mode 100755 index 0000000..3fc67e8 --- /dev/null +++ b/.gitlab/ci/docker/debian10-aarch64/install_deps.sh @@ -0,0 +1,71 @@ +#!/bin/sh + +set -e + +apt-get update + +# Install build requirements. +apt-get install -y \ + libssl-dev + +# Install development tools. +apt-get install -y \ + g++ \ + curl \ + git + +# Install iwyu runtime deps. +apt-get install -y \ + clang-6.0 \ + libncurses6 + +# Packages needed to test find modules. +apt-get install -y \ + alsa-utils \ + doxygen graphviz \ + gnutls-dev \ + libarchive-dev \ + libblas-dev \ + libboost-dev \ + libboost-filesystem-dev \ + libboost-program-options-dev \ + libboost-python-dev \ + libboost-thread-dev \ + libbz2-dev \ + libcups2-dev \ + libcurl4-gnutls-dev \ + libfontconfig1-dev \ + libfreetype6-dev \ + libgdal-dev \ + libgif-dev \ + libgl1-mesa-dev \ + libglew-dev \ + libgsl-dev \ + libgtest-dev \ + libgtk2.0-dev \ + libinput-dev \ + libjpeg-dev \ + libjsoncpp-dev \ + liblapack-dev \ + liblzma-dev \ + libopenmpi-dev openmpi-bin \ + libpng-dev \ + libpq-dev postgresql-server-dev-11 \ + libprotobuf-dev libprotobuf-c-dev libprotoc-dev protobuf-compiler \ + libsdl-dev \ + libsqlite3-dev \ + libtiff-dev \ + libuv1-dev \ + libx11-dev \ + libxalan-c-dev \ + libxerces-c-dev \ + libxml2-dev libxml2-utils \ + libxslt-dev xsltproc \ + python2 python2-dev python-numpy pypy pypy-dev \ + python3 python3-dev python3-numpy pypy3 pypy3-dev python3-venv \ + qtbase5-dev qtbase5-dev-tools \ + ruby ruby-dev \ + swig \ + unixodbc-dev + +apt-get clean diff --git a/.gitlab/ci/docker/ninja/centos7-aarch64.bash b/.gitlab/ci/docker/ninja/centos7-aarch64.bash new file mode 100755 index 0000000..d24967c --- /dev/null +++ b/.gitlab/ci/docker/ninja/centos7-aarch64.bash @@ -0,0 +1,20 @@ +#!/usr/bin/env bash + +set -e +set -x + +cleanup() { + docker container rm -fv "$build_container" >/dev/null 2>&1 || true + docker image rm -f "$build_image" >/dev/null 2>&1 || true +} + +readonly suffix="-$(date -u +%Y-%m-%d)-${RANDOM}" +readonly build_container="ninja-build-linux-aarch64$suffix" +readonly build_image="ninja:build-linux-aarch64$suffix" +readonly git_tag="${1-v1.10.2}" + +trap "cleanup" EXIT INT TERM + +docker image build --build-arg GIT_TAG="$git_tag" --tag="$build_image" "${BASH_SOURCE%/*}/centos7-aarch64" +docker container create --name "$build_container" "$build_image" +docker cp "$build_container:/ninja/ninja" "ninja" diff --git a/.gitlab/ci/docker/ninja/centos7-aarch64/Dockerfile b/.gitlab/ci/docker/ninja/centos7-aarch64/Dockerfile new file mode 100644 index 0000000..d9e1cc6 --- /dev/null +++ b/.gitlab/ci/docker/ninja/centos7-aarch64/Dockerfile @@ -0,0 +1,7 @@ +FROM kitware/cmake:build-linux-aarch64-base-2020-12-21 +MAINTAINER Brad King <brad.king@kitware.com> + +ARG GIT_TAG=v1.10.2 + +COPY build_ninja.sh /root/build_ninja.sh +RUN scl enable devtoolset-7 -- sh /root/build_ninja.sh $GIT_TAG diff --git a/.gitlab/ci/docker/ninja/centos7-aarch64/build_ninja.sh b/.gitlab/ci/docker/ninja/centos7-aarch64/build_ninja.sh new file mode 100755 index 0000000..7e2602c --- /dev/null +++ b/.gitlab/ci/docker/ninja/centos7-aarch64/build_ninja.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +set -e + +git clone https://github.com/ninja-build/ninja.git +cd ninja +git checkout "${1-v1.10.2}" +./configure.py --bootstrap +./ninja all +./ninja_test +strip ninja diff --git a/.gitlab/ci/ninja.sh b/.gitlab/ci/ninja.sh index 9011bbc..8ead670 100755 --- a/.gitlab/ci/ninja.sh +++ b/.gitlab/ci/ninja.sh @@ -3,33 +3,39 @@ set -e readonly version="1.10.2" +baseurl="https://github.com/ninja-build/ninja/releases/download/v$version" -case "$( uname -s )" in - Linux) +case "$(uname -s)-$(uname -m)" in + Linux-x86_64) shatool="sha256sum" sha256sum="763464859c7ef2ea3a0a10f4df40d2025d3bb9438fcb1228404640410c0ec22d" - platform="linux" + filename="ninja-linux" ;; - Darwin) + Linux-aarch64) + shatool="sha256sum" + sha256sum="c0c29925fd7f0f24981b3b9d18353c7111c9af59eb6e6b0ffc0c4914cdc7999c" + # Use binary built by adjacent 'docker/ninja/centos7-aarch64.bash' script. + baseurl="https://cmake.org/files/dependencies" + filename="ninja-$version-1-linux-aarch64" + ;; + Darwin-*) shatool="shasum -a 256" sha256sum="6fa359f491fac7e5185273c6421a000eea6a2f0febf0ac03ac900bd4d80ed2a5" - platform="mac" + filename="ninja-mac" ;; *) - echo "Unrecognized platform $( uname -s )" + echo "Unrecognized platform $(uname -s)-$(uname -m)" exit 1 ;; esac readonly shatool readonly sha256sum -readonly platform -readonly filename="ninja-$platform" readonly tarball="$filename.zip" cd .gitlab echo "$sha256sum $tarball" > ninja.sha256sum -curl -OL "https://github.com/ninja-build/ninja/releases/download/v$version/$tarball" +curl -OL "$baseurl/$tarball" $shatool --check ninja.sha256sum ./cmake/bin/cmake -E tar xf "$tarball" diff --git a/.gitlab/os-linux.yml b/.gitlab/os-linux.yml index 66a2666..e36d97d 100644 --- a/.gitlab/os-linux.yml +++ b/.gitlab/os-linux.yml @@ -4,20 +4,13 @@ ### Release -.release_linux: - image: "kitware/cmake:build-linux-x86_64-deps-2020-04-02@sha256:77e9ab183f34680990db9da5945473e288f0d6556bce79ecc1589670d656e157" - - variables: - GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci" - LAUNCHER: "scl enable devtoolset-6 rh-python36 --" - .linux_prep_source: image: "fedora:33" variables: GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci" -.linux_package_x86_64: +.linux_release_x86_64: image: "kitware/cmake:build-linux-x86_64-deps-2020-04-02@sha256:77e9ab183f34680990db9da5945473e288f0d6556bce79ecc1589670d656e157" variables: @@ -25,7 +18,7 @@ LAUNCHER: "scl enable devtoolset-6 rh-python36 --" CMAKE_ARCH: x86_64 -.linux_package_aarch64: +.linux_release_aarch64: image: "kitware/cmake:build-linux-aarch64-deps-2020-12-21@sha256:0bd7dfe4e45593b04e39cd21e44011034610cfd376900558c5ef959bb1af15af" variables: @@ -33,6 +26,10 @@ LAUNCHER: "scl enable devtoolset-7 --" CMAKE_ARCH: aarch64 +.linux_package: + variables: + BOOTSTRAP_ARGS: '-- "-DCMake_DOC_ARTIFACT_PREFIX=$CI_PROJECT_DIR/build/install-doc"' + ### Debian .debian10: @@ -40,6 +37,7 @@ variables: GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci" + CMAKE_ARCH: x86_64 .debian10_iwyu: extends: .debian10 @@ -49,6 +47,13 @@ CTEST_NO_WARNINGS_ALLOWED: 1 CMake_SKIP_INSTALL: 1 +.debian10_aarch64: + image: "kitware/cmake:ci-debian10-aarch64-2021-01-26" + + variables: + GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci" + CMAKE_ARCH: aarch64 + ### Fedora .fedora33: @@ -56,6 +61,7 @@ variables: GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci/long file name for testing purposes" + CMAKE_ARCH: x86_64 #### Lint builds @@ -92,6 +98,13 @@ CMAKE_CONFIGURATION: debian10_ninja CTEST_NO_WARNINGS_ALLOWED: 1 +.debian10_aarch64_ninja: + extends: .debian10_aarch64 + + variables: + CMAKE_CONFIGURATION: debian10_aarch64_ninja + CTEST_NO_WARNINGS_ALLOWED: 1 + .fedora33_ninja: extends: .fedora33 @@ -122,6 +135,7 @@ variables: GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci" + CMAKE_ARCH: x86_64 CTEST_LABELS: "CUDA" .cuda10.2_nvidia: @@ -170,6 +184,14 @@ - docker - linux-aarch64 +.linux_builder_tags_aarch64_qt: + tags: + - cmake + - build + - docker + - linux-aarch64 + - linux-3.17 # Needed to be able to load Fedora's Qt libraries. + ## Linux-specific scripts .before_script_linux: &before_script_linux @@ -225,11 +247,12 @@ interruptible: true -.cmake_build_linux_package: +.cmake_build_linux_release: stage: build script: # Bootstrap. + - mkdir -p build/ - cp -v Utilities/Release/linux/$CMAKE_ARCH/cache.txt build/CMakeCache.txt # Make sccache available. - .gitlab/ci/sccache.sh @@ -248,44 +271,7 @@ - git reset --hard # Bootstrap - cd build/ - - '$LAUNCHER ../bootstrap --parallel=$(nproc) --docdir=doc/cmake -- "-DCMake_DOC_ARTIFACT_PREFIX=$CI_PROJECT_DIR/build/install-doc"' - # FIXME: When CTest can drive an external CMake for the build as well, - # use the scripts here. - - "$LAUNCHER make -j$(nproc)" - # NOTE: This regex matches that used in the release build. - - "$LAUNCHER bin/ctest --output-on-failure -j$(nproc) -R '^(CMake\\.|CMakeLib\\.|CMakeServerLib\\.|RunCMake\\.ctest_memcheck)'" - # Make a package. - - bin/cpack -G TGZ - - bin/cpack -G STGZ - - sccache --show-stats - - interruptible: true - -.cmake_build_release_linux: - stage: build - - script: - # Bootstrap. - - mkdir build/ - - cp -v Utilities/Release/linux/x86_64/cache.txt build/CMakeCache.txt - # Make sccache available. - - .gitlab/ci/sccache.sh - - export PATH=$PWD/.gitlab:$PATH - # Append sccache settings to the cache. - - echo "CMAKE_C_COMPILER_LAUNCHER:STRING=sccache" >> build/CMakeCache.txt - - echo "CMAKE_CXX_COMPILER_LAUNCHER:STRING=sccache" >> build/CMakeCache.txt - # CI settings. - - echo "CMake_TEST_INSTALL:BOOL=OFF" >> build/CMakeCache.txt - - echo "CMAKE_INSTALL_PREFIX:PATH=$PWD/build/install" >> build/CMakeCache.txt - - echo "CMAKE_SKIP_INSTALL_ALL_DEPENDENCY:BOOL=ON" >> build/CMakeCache.txt - # Appease Git. The Git in this container is old (1.7) and doesn't - # understand some things. But, it doesn't need to, so make it blind. - - mkdir -p .git/info - - echo "* -crlf" >> .git/info/attributes - - git reset --hard - # Bootstrap - - cd build/ - - "$LAUNCHER ../bootstrap --parallel=$(nproc) --docdir=doc/cmake" + - '$LAUNCHER ../bootstrap --parallel=$(nproc) --docdir=doc/cmake $BOOTSTRAP_ARGS' # FIXME: When CTest can drive an external CMake for the build as well, # use the scripts here. - "$LAUNCHER make -j$(nproc)" @@ -298,14 +284,14 @@ interruptible: true -.cmake_test_linux_package: +.cmake_test_linux_release: stage: test-ext script: - *before_script_linux # Make the CMake package available. - mkdir -p build/install - - tar -C build/install --strip-components=1 -xzf build/cmake-*-linux-x86_64.tar.gz + - tar -C build/install --strip-components=1 -xzf build/cmake-*-linux-$CMAKE_ARCH.tar.gz - .gitlab/ci/sccache.sh - sccache --start-server - sccache --show-stats diff --git a/.gitlab/rules.yml b/.gitlab/rules.yml index 5ee8333..e8c527d 100644 --- a/.gitlab/rules.yml +++ b/.gitlab/rules.yml @@ -9,6 +9,8 @@ - if: '($CMAKE_CI_PROJECT_CONTINUOUS_BRANCH != "" && $CI_COMMIT_BRANCH == $CMAKE_CI_PROJECT_CONTINUOUS_BRANCH && $CMAKE_CI_JOB_CONTINUOUS == "true")' when: delayed start_in: 5 minutes + - if: '($CMAKE_CI_NO_MR == "true" && $CI_MERGE_REQUEST_ID)' + when: never - if: '$CI_MERGE_REQUEST_ID' when: manual - if: '$CI_PROJECT_PATH == "cmake/cmake"' @@ -24,6 +26,8 @@ when: on_success - if: '($CMAKE_CI_PROJECT_CONTINUOUS_BRANCH != "" && $CI_COMMIT_BRANCH == $CMAKE_CI_PROJECT_CONTINUOUS_BRANCH && $CMAKE_CI_JOB_CONTINUOUS == "true")' when: on_success + - if: '($CMAKE_CI_NO_MR == "true" && $CI_MERGE_REQUEST_ID)' + when: never - if: '$CI_MERGE_REQUEST_ID' when: on_success - if: '$CI_PROJECT_PATH == "cmake/cmake"' @@ -36,6 +40,8 @@ when: never - if: '$CMAKE_CI_NIGHTLY == "true"' when: on_success + - if: '($CMAKE_CI_NO_MR == "true" && $CI_MERGE_REQUEST_ID)' + when: never - if: '$CI_MERGE_REQUEST_ID' when: on_success - if: '$CI_PROJECT_PATH == "cmake/cmake"' diff --git a/Help/release/dev/nvhpc-compiler.rst b/Help/release/dev/nvhpc-compiler.rst new file mode 100644 index 0000000..f1f60ae --- /dev/null +++ b/Help/release/dev/nvhpc-compiler.rst @@ -0,0 +1,4 @@ +nvhpc-compiler +-------------- + +* The NVIDIA HPC SDK compilers are now supported with compiler id ``NVHPC``. diff --git a/Help/variable/CMAKE_LANG_COMPILER_ID.rst b/Help/variable/CMAKE_LANG_COMPILER_ID.rst index 8eb4fb6..89d9e27 100644 --- a/Help/variable/CMAKE_LANG_COMPILER_ID.rst +++ b/Help/variable/CMAKE_LANG_COMPILER_ID.rst @@ -25,7 +25,9 @@ include: HP = Hewlett-Packard Compiler (hp.com) IAR = IAR Systems (iar.com) Intel = Intel Compiler (intel.com) + IntelLLVM = Intel LLVM-Based Compiler (intel.com) MSVC = Microsoft Visual Studio (microsoft.com) + NVHPC = NVIDIA HPC SDK Compiler (nvidia.com) NVIDIA = NVIDIA CUDA Compiler (nvidia.com) OpenWatcom = Open Watcom (openwatcom.org) PGI = The Portland Group (pgroup.com) diff --git a/Modules/CMakeCompilerIdDetection.cmake b/Modules/CMakeCompilerIdDetection.cmake index a0f0dfa..214d58a 100644 --- a/Modules/CMakeCompilerIdDetection.cmake +++ b/Modules/CMakeCompilerIdDetection.cmake @@ -49,6 +49,7 @@ function(compiler_id_detection outvar lang) endif() list(APPEND ordered_compilers Intel + IntelLLVM PathScale Embarcadero Borland @@ -61,6 +62,7 @@ function(compiler_id_detection outvar lang) XLClang XL VisualAge + NVHPC PGI Cray TI diff --git a/Modules/CMakeDetermineASMCompiler.cmake b/Modules/CMakeDetermineASMCompiler.cmake index a3e5a12..e8b9db7 100644 --- a/Modules/CMakeDetermineASMCompiler.cmake +++ b/Modules/CMakeDetermineASMCompiler.cmake @@ -78,6 +78,10 @@ if(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER_ID) set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_Intel "--version") set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_Intel "(ICC)") + list(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS IntelLLVM ) + set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_IntelLLVM "--version") + set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_IntelLLVM "(Intel[^\n]+oneAPI)") + list(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS SunPro ) set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_SunPro "-V") set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_SunPro "Sun C") diff --git a/Modules/CMakeDetermineCCompiler.cmake b/Modules/CMakeDetermineCCompiler.cmake index ab33b40..59c0574 100644 --- a/Modules/CMakeDetermineCCompiler.cmake +++ b/Modules/CMakeDetermineCCompiler.cmake @@ -59,7 +59,7 @@ else() # finally list compilers to try if(NOT CMAKE_C_COMPILER_INIT) - set(CMAKE_C_COMPILER_LIST ${_CMAKE_TOOLCHAIN_PREFIX}cc ${_CMAKE_TOOLCHAIN_PREFIX}gcc cl bcc xlc clang) + set(CMAKE_C_COMPILER_LIST ${_CMAKE_TOOLCHAIN_PREFIX}cc ${_CMAKE_TOOLCHAIN_PREFIX}gcc cl bcc xlc icx clang) endif() _cmake_find_compiler(C) @@ -134,7 +134,8 @@ else() # variable but are not aware of CMAKE_C_COMPILER_FRONTEND_VARIANT. # They pre-date our support for the GNU-like variant targeting the # MSVC ABI so we do not consider that here. - if(CMAKE_C_COMPILER_ID STREQUAL "Clang") + if(CMAKE_C_COMPILER_ID STREQUAL "Clang" + OR "x${CMAKE_${lang}_COMPILER_ID" STREQUAL "xIntelLLVM") if("x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC") set(CMAKE_C_COMPILER_FRONTEND_VARIANT "MSVC") else() diff --git a/Modules/CMakeDetermineCXXCompiler.cmake b/Modules/CMakeDetermineCXXCompiler.cmake index 7283bc2..fd07a5c 100644 --- a/Modules/CMakeDetermineCXXCompiler.cmake +++ b/Modules/CMakeDetermineCXXCompiler.cmake @@ -58,7 +58,7 @@ else() # finally list compilers to try if(NOT CMAKE_CXX_COMPILER_INIT) - set(CMAKE_CXX_COMPILER_LIST CC ${_CMAKE_TOOLCHAIN_PREFIX}c++ ${_CMAKE_TOOLCHAIN_PREFIX}g++ aCC cl bcc xlC clang++) + set(CMAKE_CXX_COMPILER_LIST CC ${_CMAKE_TOOLCHAIN_PREFIX}c++ ${_CMAKE_TOOLCHAIN_PREFIX}g++ aCC cl bcc xlC icpx icx clang++) endif() _cmake_find_compiler(CXX) @@ -131,7 +131,8 @@ else() # variable but are not aware of CMAKE_CXX_COMPILER_FRONTEND_VARIANT. # They pre-date our support for the GNU-like variant targeting the # MSVC ABI so we do not consider that here. - if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" + OR "x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xIntelLLVM") if("x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC") set(CMAKE_CXX_COMPILER_FRONTEND_VARIANT "MSVC") else() diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake index d07db70..90697f0 100644 --- a/Modules/CMakeDetermineCompilerId.cmake +++ b/Modules/CMakeDetermineCompilerId.cmake @@ -164,7 +164,8 @@ function(CMAKE_DETERMINE_COMPILER_ID lang flagvar src) endif() set(_variant "") - if("x${CMAKE_${lang}_COMPILER_ID}" STREQUAL "xClang") + if("x${CMAKE_${lang}_COMPILER_ID}" STREQUAL "xClang" + OR "x${CMAKE_${lang}_COMPILER_ID}" STREQUAL "xIntelLLVM") if("x${CMAKE_${lang}_SIMULATE_ID}" STREQUAL "xMSVC") if(CMAKE_GENERATOR MATCHES "Visual Studio") set(CMAKE_${lang}_COMPILER_FRONTEND_VARIANT "MSVC") diff --git a/Modules/CMakeDetermineFortranCompiler.cmake b/Modules/CMakeDetermineFortranCompiler.cmake index 8a57408..d7d032c 100644 --- a/Modules/CMakeDetermineFortranCompiler.cmake +++ b/Modules/CMakeDetermineFortranCompiler.cmake @@ -59,6 +59,8 @@ else() # af77: Apogee F77 compiler for Intergraph hardware running CLIX # epcf90: "Edinburgh Portable Compiler" F90 # fort: Compaq (now HP) Fortran 90/95 compiler for Tru64 and Linux/Alpha + # ifx: Intel Fortran LLVM-based compiler + # ifort: Intel Classic Fortran compiler # ifc: Intel Fortran 95 compiler for Linux/x86 # efc: Intel Fortran 95 compiler for IA64 # nagfor: NAG Fortran compiler @@ -68,14 +70,14 @@ else() # so if you paid for a compiler it is picked by default. if(CMAKE_HOST_WIN32) set(CMAKE_Fortran_COMPILER_LIST - ifort pgf95 pgfortran lf95 fort + ifort ifx pgf95 pgfortran lf95 fort flang gfortran gfortran-4 g95 f90 pgf90 pgf77 g77 f77 nag ) else() set(CMAKE_Fortran_COMPILER_LIST ftn - ifort ifc efc pgf95 pgfortran lf95 xlf95 fort + ifort ifc ifx efc pgf95 pgfortran lf95 xlf95 fort flang gfortran gfortran-4 g95 f90 pgf90 frt pgf77 xlf g77 f77 nag ) @@ -83,7 +85,7 @@ else() # Vendor-specific compiler names. set(_Fortran_COMPILER_NAMES_GNU gfortran gfortran-4 g95 g77) - set(_Fortran_COMPILER_NAMES_Intel ifort ifc efc) + set(_Fortran_COMPILER_NAMES_Intel ifort ifc efc ifx) set(_Fortran_COMPILER_NAMES_Absoft af95 af90 af77) set(_Fortran_COMPILER_NAMES_PGI pgf95 pgfortran pgf90 pgf77) set(_Fortran_COMPILER_NAMES_Flang flang) diff --git a/Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake b/Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake index 11f4a29..f90301b 100644 --- a/Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake +++ b/Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake @@ -88,7 +88,7 @@ set(ENV{LANG} C) # Now check for C, works for gcc and Intel compiler at least if (NOT CMAKE_EXTRA_GENERATOR_C_SYSTEM_INCLUDE_DIRS) - if (CMAKE_C_COMPILER_ID MATCHES GNU OR CMAKE_C_COMPILER_ID MATCHES Intel OR CMAKE_C_COMPILER_ID MATCHES Clang) + if (CMAKE_C_COMPILER_ID MATCHES GNU OR CMAKE_C_COMPILER_ID MATCHES "Intel" OR CMAKE_C_COMPILER_ID MATCHES Clang) _DETERMINE_GCC_SYSTEM_INCLUDE_DIRS(c _dirs _defines) set(CMAKE_EXTRA_GENERATOR_C_SYSTEM_INCLUDE_DIRS "${_dirs}" CACHE INTERNAL "C compiler system include directories") set(CMAKE_EXTRA_GENERATOR_C_SYSTEM_DEFINED_MACROS "${_defines}" CACHE INTERNAL "C compiler system defined macros") @@ -99,7 +99,7 @@ endif () # And now the same for C++ if (NOT CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_INCLUDE_DIRS) - if ("${CMAKE_CXX_COMPILER_ID}" MATCHES GNU OR "${CMAKE_CXX_COMPILER_ID}" MATCHES Intel OR "${CMAKE_CXX_COMPILER_ID}" MATCHES Clang) + if ("${CMAKE_CXX_COMPILER_ID}" MATCHES GNU OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Intel" OR "${CMAKE_CXX_COMPILER_ID}" MATCHES Clang) _DETERMINE_GCC_SYSTEM_INCLUDE_DIRS(c++ _dirs _defines) set(CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_INCLUDE_DIRS "${_dirs}" CACHE INTERNAL "CXX compiler system include directories") set(CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_DEFINED_MACROS "${_defines}" CACHE INTERNAL "CXX compiler system defined macros") diff --git a/Modules/CMakeFortranCompilerId.F.in b/Modules/CMakeFortranCompilerId.F.in index 7e8828b..1cc08df 100644 --- a/Modules/CMakeFortranCompilerId.F.in +++ b/Modules/CMakeFortranCompilerId.F.in @@ -22,7 +22,21 @@ PRINT *, 'INFO:simulate_version[013.00]' # endif #endif -#if defined(__INTEL_COMPILER) || defined(__ICC) +#if defined(__INTEL_LLVM_COMPILER) + PRINT *, 'INFO:compiler[IntelLLVM]' +! __INTEL_LLVM_COMPILER = VVVVRP prior to 2021.2.0, VVVVRRPP for 2021.2.0 and +! later. Look for 6 digit vs. 8 digit version number to decide encoding. +! VVVV is no smaller than the current year when a versio is released. +# if __INTEL_LLVM_COMPILER < 1000000 +# define COMPILER_VERSION_MAJOR DEC(__INTEL_LLVM_COMPILER/100) +# define COMPILER_VERSION_MINOR DEC(__INTEL_LLVM_COMPILER/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__INTEL_LLVM_COMPILER % 10) +# else +# define COMPILER_VERSION_MAJOR DEC(__INTEL_LLVM_COMPILER/10000) +# define COMPILER_VERSION_MINOR DEC(__INTEL_LLVM_COMPILER/100 % 100) +# define COMPILER_VERSION_PATCH DEC(__INTEL_LLVM_COMPILER % 100) +# endif +#elif defined(__INTEL_COMPILER) || defined(__ICC) PRINT *, 'INFO:compiler[Intel]' # define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100) # define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10) @@ -82,6 +96,23 @@ # define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) # define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) # endif +#elif defined(__NVCOMPILER) || defined(__NVCOMPILER_LLVM__) + PRINT *, 'INFO:compiler[NVHPC]' +# if defined(__NVCOMPILER_MAJOR__) +# define COMPILER_VERSION_MAJOR DEC(__NVCOMPILER_MAJOR__) +# else +# define COMPILER_VERSION_MAJOR DEC(__PGIC__) +# endif +# if defined(__NVCOMPILER_MINOR__) +# define COMPILER_VERSION_MINOR DEC(__NVCOMPILER_MINOR__) +# else +# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__) +# endif +# if defined(__NVCOMPILER_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__NVCOMPILER_PATCHLEVEL__) +# elif defined(__PGIC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__) +# endif #elif defined(__PGI) PRINT *, 'INFO:compiler[PGI]' # define COMPILER_VERSION_MAJOR DEC(__PGIC__) diff --git a/Modules/CMakeTestGNU.c b/Modules/CMakeTestGNU.c index 933e5a2..7dcafde 100644 --- a/Modules/CMakeTestGNU.c +++ b/Modules/CMakeTestGNU.c @@ -1,4 +1,5 @@ -#if defined(__GNUC__) && !defined(__INTEL_COMPILER) +#if defined(__GNUC__) && \ + !(defined(__INTEL_COMPILER) || defined(__INTEL_LLVM_COMPILER)) void THIS_IS_GNU(); #endif #ifdef __MINGW32__ diff --git a/Modules/Compiler/IntelLLVM-ASM.cmake b/Modules/Compiler/IntelLLVM-ASM.cmake new file mode 100644 index 0000000..c258a0a --- /dev/null +++ b/Modules/Compiler/IntelLLVM-ASM.cmake @@ -0,0 +1,12 @@ +include(Compiler/IntelLLVM) +__compiler_intel_llvm(ASM) + +string(APPEND CMAKE_ASM_FLAGS_MINSIZEREL_INIT " -DNDEBUG") +string(APPEND CMAKE_ASM_FLAGS_RELEASE_INIT " -DNDEBUG") +string(APPEND CMAKE_ASM_FLAGS_RELWITHDEBINFO_INIT " -DNDEBUG") + +if(UNIX) + set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS s;S) +else() + set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS asm) +endif() diff --git a/Modules/Compiler/IntelLLVM-C.cmake b/Modules/Compiler/IntelLLVM-C.cmake new file mode 100644 index 0000000..0ad2f0d --- /dev/null +++ b/Modules/Compiler/IntelLLVM-C.cmake @@ -0,0 +1,63 @@ +include(Compiler/IntelLLVM) +__compiler_intel_llvm(C) + +if("x${CMAKE_C_COMPILER_FRONTEND_VARIANT}" STREQUAL "xMSVC") + set(CMAKE_C_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -TC) + set(CMAKE_C_CLANG_TIDY_DRIVER_MODE "cl") + if((NOT DEFINED CMAKE_DEPENDS_USE_COMPILER OR CMAKE_DEPENDS_USE_COMPILER) + AND CMAKE_GENERATOR MATCHES "Makefiles|WMake" + AND CMAKE_DEPFILE_FLAGS_C) + set(CMAKE_C_DEPENDS_USE_COMPILER TRUE) + endif() +else() + set(CMAKE_C_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c) + if((NOT DEFINED CMAKE_DEPENDS_USE_COMPILER OR CMAKE_DEPENDS_USE_COMPILER) + AND CMAKE_GENERATOR MATCHES "Makefiles|WMake" + AND CMAKE_DEPFILE_FLAGS_C) + # dependencies are computed by the compiler itself + set(CMAKE_C_DEPFILE_FORMAT gcc) + set(CMAKE_C_DEPENDS_USE_COMPILER TRUE) + endif() + + string(APPEND CMAKE_C_FLAGS_MINSIZEREL_INIT " -DNDEBUG") + string(APPEND CMAKE_C_FLAGS_RELEASE_INIT " -DNDEBUG") + string(APPEND CMAKE_C_FLAGS_RELWITHDEBINFO_INIT " -DNDEBUG") +endif() + +set(CMAKE_C90_STANDARD__HAS_FULL_SUPPORT ON) +set(CMAKE_C99_STANDARD__HAS_FULL_SUPPORT ON) +set(CMAKE_C11_STANDARD__HAS_FULL_SUPPORT ON) +set(CMAKE_C17_STANDARD__HAS_FULL_SUPPORT ON) + +if(NOT "x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC") + set(CMAKE_C90_STANDARD_COMPILE_OPTION "-std=c90") + set(CMAKE_C90_EXTENSION_COMPILE_OPTION "-std=gnu90") + + set(CMAKE_C99_STANDARD_COMPILE_OPTION "-std=c99") + set(CMAKE_C99_EXTENSION_COMPILE_OPTION "-std=gnu99") + + set(CMAKE_C11_STANDARD_COMPILE_OPTION "-std=c11") + set(CMAKE_C11_EXTENSION_COMPILE_OPTION "-std=gnu11") + + set(CMAKE_C17_STANDARD_COMPILE_OPTION "-std=c17") + set(CMAKE_C17_EXTENSION_COMPILE_OPTION "-std=gnu17") +else() + # clang-cl doesn't have any of these + set(CMAKE_C90_STANDARD_COMPILE_OPTION "") + set(CMAKE_C90_EXTENSION_COMPILE_OPTION "") + + set(CMAKE_C99_STANDARD_COMPILE_OPTION "") + set(CMAKE_C99_EXTENSION_COMPILE_OPTION "") + + set(CMAKE_C11_STANDARD_COMPILE_OPTION "") + set(CMAKE_C11_EXTENSION_COMPILE_OPTION "") + + set(CMAKE_C17_STANDARD_COMPILE_OPTION "") + set(CMAKE_C17_EXTENSION_COMPILE_OPTION "") +endif() + +if(NOT "x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC") + __compiler_check_default_language_standard(C 2020 17) +else() + set(CMAKE_C_STANDARD_DEFAULT "") +endif() diff --git a/Modules/Compiler/IntelLLVM-CXX.cmake b/Modules/Compiler/IntelLLVM-CXX.cmake new file mode 100644 index 0000000..4c0c26e --- /dev/null +++ b/Modules/Compiler/IntelLLVM-CXX.cmake @@ -0,0 +1,69 @@ +include(Compiler/IntelLLVM) +__compiler_intel_llvm(CXX) + +if("x${CMAKE_CXX_COMPILER_FRONTEND_VARIANT}" STREQUAL "xMSVC") + set(CMAKE_CXX_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -TP) + set(CMAKE_CXX_CLANG_TIDY_DRIVER_MODE "cl") + if((NOT DEFINED CMAKE_DEPENDS_USE_COMPILER OR CMAKE_DEPENDS_USE_COMPILER) + AND CMAKE_GENERATOR MATCHES "Makefiles|WMake" + AND CMAKE_DEPFILE_FLAGS_CXX) + set(CMAKE_CXX_DEPENDS_USE_COMPILER TRUE) + endif() +else() + set(CMAKE_CXX_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c++) + if((NOT DEFINED CMAKE_DEPENDS_USE_COMPILER OR CMAKE_DEPENDS_USE_COMPILER) + AND CMAKE_GENERATOR MATCHES "Makefiles|WMake" + AND CMAKE_DEPFILE_FLAGS_CXX) + # dependencies are computed by the compiler itself + set(CMAKE_CXX_DEPFILE_FORMAT gcc) + set(CMAKE_CXX_DEPENDS_USE_COMPILER TRUE) + endif() + + set(CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN "-fvisibility-inlines-hidden") + + string(APPEND CMAKE_CXX_FLAGS_MINSIZEREL_INIT " -DNDEBUG") + string(APPEND CMAKE_CXX_FLAGS_RELEASE_INIT " -DNDEBUG") + string(APPEND CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT " -DNDEBUG") +endif() + +set(CMAKE_CXX98_STANDARD__HAS_FULL_SUPPORT ON) +set(CMAKE_CXX11_STANDARD__HAS_FULL_SUPPORT ON) +set(CMAKE_CXX14_STANDARD__HAS_FULL_SUPPORT ON) + +if(NOT "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC") + set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "-std=c++98") + set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "-std=gnu++98") + + set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++11") + set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=gnu++11") + + set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "-std=c++14") + set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "-std=gnu++14") + + set(CMAKE_CXX17_STANDARD_COMPILE_OPTION "-std=c++17") + set(CMAKE_CXX17_EXTENSION_COMPILE_OPTION "-std=gnu++17") + + set(CMAKE_CXX20_STANDARD_COMPILE_OPTION "-std=c++20") + set(CMAKE_CXX20_EXTENSION_COMPILE_OPTION "-std=gnu++20") +else() + set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "") + set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "") + + set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-Qstd=c++11") + set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-Qstd=c++11") + + set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "-Qstd=c++14") + set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "-Qstd=c++14") + + set(CMAKE_CXX17_STANDARD_COMPILE_OPTION "-Qstd=c++17") + set(CMAKE_CXX17_EXTENSION_COMPILE_OPTION "-Qstd=c++17") + + set(CMAKE_CXX20_STANDARD_COMPILE_OPTION "-Qstd=c++20") + set(CMAKE_CXX20_EXTENSION_COMPILE_OPTION "-Qstd=c++20") +endif() + +if(NOT "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC") + __compiler_check_default_language_standard(CXX 2020 14) +else() + set(CMAKE_CXX_STANDARD_DEFAULT "") +endif() diff --git a/Modules/Compiler/IntelLLVM-DetermineCompiler.cmake b/Modules/Compiler/IntelLLVM-DetermineCompiler.cmake new file mode 100644 index 0000000..124dafe --- /dev/null +++ b/Modules/Compiler/IntelLLVM-DetermineCompiler.cmake @@ -0,0 +1,41 @@ + +set(_compiler_id_pp_test "(defined(__clang__) && defined(__INTEL_CLANG_COMPILER)) || defined(__INTEL_LLVM_COMPILER)") + +set(_compiler_id_version_compute " +/* __INTEL_LLVM_COMPILER = VVVVRP prior to 2021.2.0, VVVVRRPP for 2021.2.0 and + * later. Look for 6 digit vs. 8 digit version number to decide encoding. + * VVVV is no smaller than the current year when a versio is released. + */ +#if __INTEL_LLVM_COMPILER < 1000000L +# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(__INTEL_LLVM_COMPILER/100) +# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(__INTEL_LLVM_COMPILER/10 % 10) +# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__INTEL_LLVM_COMPILER % 10) +#else +# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(__INTEL_LLVM_COMPILER/10000) +# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(__INTEL_LLVM_COMPILER/100 % 100) +# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__INTEL_LLVM_COMPILER % 100) +#endif +#if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define @PREFIX@SIMULATE_VERSION_MAJOR @MACRO_DEC@(_MSC_VER / 100) +# define @PREFIX@SIMULATE_VERSION_MINOR @MACRO_DEC@(_MSC_VER % 100) +#endif +#if defined(__GNUC__) +# define @PREFIX@SIMULATE_VERSION_MAJOR @MACRO_DEC@(__GNUC__) +#elif defined(__GNUG__) +# define @PREFIX@SIMULATE_VERSION_MAJOR @MACRO_DEC@(__GNUG__) +#endif +#if defined(__GNUC_MINOR__) +# define @PREFIX@SIMULATE_VERSION_MINOR @MACRO_DEC@(__GNUC_MINOR__) +#endif +#if defined(__GNUC_PATCHLEVEL__) +# define @PREFIX@SIMULATE_VERSION_PATCH @MACRO_DEC@(__GNUC_PATCHLEVEL__) +#endif") + +set(_compiler_id_simulate " +#if defined(_MSC_VER) +# define @PREFIX@SIMULATE_ID \"MSVC\" +#endif +#if defined(__GNUC__) +# define @PREFIX@SIMULATE_ID \"GNU\" +#endif") diff --git a/Modules/Compiler/IntelLLVM-Fortran.cmake b/Modules/Compiler/IntelLLVM-Fortran.cmake new file mode 100644 index 0000000..3dfa099 --- /dev/null +++ b/Modules/Compiler/IntelLLVM-Fortran.cmake @@ -0,0 +1,19 @@ +include(Compiler/IntelLLVM) +__compiler_intel_llvm(Fortran) + +set(CMAKE_Fortran_SUBMODULE_SEP "@") +set(CMAKE_Fortran_SUBMODULE_EXT ".smod") + +set(CMAKE_Fortran_MODDIR_FLAG "-module ") +set(CMAKE_Fortran_FORMAT_FIXED_FLAG "-fixed") +set(CMAKE_Fortran_FORMAT_FREE_FLAG "-free") + +set(CMAKE_Fortran_COMPILE_WITH_DEFINES 1) + +set(CMAKE_Fortran_CREATE_PREPROCESSED_SOURCE "<CMAKE_Fortran_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>") +set(CMAKE_Fortran_CREATE_ASSEMBLY_SOURCE "<CMAKE_Fortran_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>") + +set(CMAKE_Fortran_PREPROCESS_SOURCE + "<CMAKE_Fortran_COMPILER> -fpp <DEFINES> <INCLUDES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>") +set(CMAKE_Fortran_COMPILE_OPTIONS_PREPROCESS_ON "-fpp") +set(CMAKE_Fortran_COMPILE_OPTIONS_PREPROCESS_OFF "-nofpp") diff --git a/Modules/Compiler/IntelLLVM.cmake b/Modules/Compiler/IntelLLVM.cmake new file mode 100644 index 0000000..43eb13a --- /dev/null +++ b/Modules/Compiler/IntelLLVM.cmake @@ -0,0 +1,93 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + + +# This module is shared by multiple languages; use include blocker. +if(__COMPILER_LLVM_INTEL) + return() +endif() +set(__COMPILER_LLVM_INTEL 1) + +include(Compiler/CMakeCommonCompilerMacros) + +set(__pch_header_C "c-header") +set(__pch_header_CXX "c++-header") +set(__pch_header_OBJC "objective-c-header") +set(__pch_header_OBJCXX "objective-c++-header") + +if(CMAKE_HOST_WIN32) + # MSVC-like + macro(__compiler_intel_llvm lang) + set(CMAKE_INCLUDE_SYSTEM_FLAG_${lang} "-imsvc ") + if(NOT "x${lang}" STREQUAL "xFortran") + set(CMAKE_${lang}_COMPILE_OPTIONS_INVALID_PCH -Winvalid-pch) + endif() + endmacro() +else() + # GNU-like + macro(__compiler_intel_llvm lang) + set(CMAKE_${lang}_VERBOSE_FLAG "-v") + + string(APPEND CMAKE_${lang}_FLAGS_INIT " ") + string(APPEND CMAKE_${lang}_FLAGS_DEBUG_INIT " -g") + string(APPEND CMAKE_${lang}_FLAGS_MINSIZEREL_INIT " -Os") + string(APPEND CMAKE_${lang}_FLAGS_RELEASE_INIT " -O3") + string(APPEND CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT " -O2 -g") + + set(_CMAKE_${lang}_PIE_MAY_BE_SUPPORTED_BY_LINKER YES) + set(CMAKE_${lang}_COMPILE_OPTIONS_PIC "-fPIC") + set(CMAKE_${lang}_COMPILE_OPTIONS_PIE "-fPIE") + set(CMAKE_${lang}_LINK_OPTIONS_PIE ${CMAKE_${lang}_COMPILE_OPTIONS_PIE} "-pie") + set(CMAKE_${lang}_LINK_OPTIONS_NO_PIE "-no-pie") + + set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "-fPIC") + set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-shared") + + set(CMAKE_${lang}_LINKER_WRAPPER_FLAG "-Wl,") + set(CMAKE_${lang}_LINKER_WRAPPER_FLAG_SEP ",") + + # distcc does not transform -o to -MT when invoking the preprocessor + # internally, as it ought to. Work around this bug by setting -MT here + # even though it isn't strictly necessary. + set(CMAKE_DEPFILE_FLAGS_${lang} "-MD -MT <DEP_TARGET> -MF <DEP_FILE>") + + set(CMAKE_INCLUDE_SYSTEM_FLAG_${lang} "-isystem ") + set(CMAKE_${lang}_COMPILE_OPTIONS_VISIBILITY "-fvisibility=") + set(CMAKE_${lang}_COMPILE_OPTIONS_TARGET "--target=") + set(CMAKE_${lang}_COMPILE_OPTIONS_SYSROOT "--sysroot=") + set(CMAKE_${lang}_COMPILE_OPTIONS_EXTERNAL_TOOLCHAIN "--gcc-toolchain=") + set(CMAKE_${lang}_LINKER_WRAPPER_FLAG "-Xlinker" " ") + set(CMAKE_${lang}_LINKER_WRAPPER_FLAG_SEP) + + set(_CMAKE_${lang}_IPO_SUPPORTED_BY_CMAKE YES) + set(_CMAKE_${lang}_IPO_MAY_BE_SUPPORTED_BY_COMPILER YES) + set(CMAKE_${lang}_COMPILE_OPTIONS_IPO "-flto=thin") + set(CMAKE_${lang}_ARCHIVE_CREATE_IPO "\"${CMAKE_${lang}_COMPILER_AR}\" cr <TARGET> <LINK_FLAGS> <OBJECTS>") + set(CMAKE_${lang}_ARCHIVE_APPEND_IPO "\"${CMAKE_${lang}_COMPILER_AR}\" r <TARGET> <LINK_FLAGS> <OBJECTS>") + set(CMAKE_${lang}_ARCHIVE_FINISH_IPO "\"${CMAKE_${lang}_COMPILER_RANLIB}\" <TARGET>") + + set(CMAKE_${lang}_CREATE_PREPROCESSED_SOURCE "<CMAKE_${lang}_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>") + set(CMAKE_${lang}_CREATE_ASSEMBLY_SOURCE "<CMAKE_${lang}_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>") + + set(CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND "${CMAKE_${lang}_COMPILER}") + if(CMAKE_${lang}_COMPILER_ARG1) + separate_arguments(_COMPILER_ARGS NATIVE_COMMAND "${CMAKE_${lang}_COMPILER_ARG1}") + list(APPEND CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND ${_COMPILER_ARGS}) + unset(_COMPILER_ARGS) + endif() + list(APPEND CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND "-dM" "-E" "-c" "${CMAKE_ROOT}/Modules/CMakeCXXCompilerABI.cpp") + if(CMAKE_${lang}_COMPILER_TARGET) + list(APPEND CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND "--target=${CMAKE_${lang}_COMPILER_TARGET}") + endif() + + if(NOT "x${lang}" STREQUAL "xFortran") + # Precompile Headers + set(CMAKE_PCH_EXTENSION .pch) + set(CMAKE_PCH_PROLOGUE "#pragma clang system_header") + set(CMAKE_${lang}_COMPILE_OPTIONS_INSTANTIATE_TEMPLATES_PCH -fpch-instantiate-templates) + set(CMAKE_${lang}_COMPILE_OPTIONS_INVALID_PCH -Winvalid-pch) + set(CMAKE_${lang}_COMPILE_OPTIONS_USE_PCH -Xclang -include-pch -Xclang <PCH_FILE> -Xclang -include -Xclang <PCH_HEADER>) + set(CMAKE_${lang}_COMPILE_OPTIONS_CREATE_PCH -Xclang -emit-pch -Xclang -include -Xclang <PCH_HEADER> -x ${__pch_header_${lang}}) + endif() + endmacro() +endif() diff --git a/Modules/Compiler/NVHPC-C.cmake b/Modules/Compiler/NVHPC-C.cmake new file mode 100644 index 0000000..d16c72b --- /dev/null +++ b/Modules/Compiler/NVHPC-C.cmake @@ -0,0 +1,3 @@ +include(Compiler/PGI-C) +include(Compiler/NVHPC) +__compiler_nvhpc(C) diff --git a/Modules/Compiler/NVHPC-CXX.cmake b/Modules/Compiler/NVHPC-CXX.cmake new file mode 100644 index 0000000..18ace8b --- /dev/null +++ b/Modules/Compiler/NVHPC-CXX.cmake @@ -0,0 +1,3 @@ +include(Compiler/PGI-CXX) +include(Compiler/NVHPC) +__compiler_nvhpc(CXX) diff --git a/Modules/Compiler/NVHPC-DetermineCompiler.cmake b/Modules/Compiler/NVHPC-DetermineCompiler.cmake new file mode 100644 index 0000000..45b69e1 --- /dev/null +++ b/Modules/Compiler/NVHPC-DetermineCompiler.cmake @@ -0,0 +1,9 @@ + +set(_compiler_id_pp_test "defined(__NVCOMPILER)") + +set(_compiler_id_version_compute " +# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(__NVCOMPILER_MAJOR__) +# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(__NVCOMPILER_MINOR__) +# if defined(__NVCOMPILER_PATCHLEVEL__) +# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__NVCOMPILER_PATCHLEVEL__) +# endif") diff --git a/Modules/Compiler/NVHPC-Fortran.cmake b/Modules/Compiler/NVHPC-Fortran.cmake new file mode 100644 index 0000000..59755b3 --- /dev/null +++ b/Modules/Compiler/NVHPC-Fortran.cmake @@ -0,0 +1,3 @@ +include(Compiler/PGI-Fortran) +include(Compiler/NVHPC) +__compiler_nvhpc(Fortran) diff --git a/Modules/Compiler/NVHPC.cmake b/Modules/Compiler/NVHPC.cmake new file mode 100644 index 0000000..7048670 --- /dev/null +++ b/Modules/Compiler/NVHPC.cmake @@ -0,0 +1,15 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + + +# This module is shared by multiple languages; use include blocker. +if(__COMPILER_NVHPC) + return() +endif() +set(__COMPILER_NVHPC 1) + +include(Compiler/PGI) + +macro(__compiler_nvhpc lang) + # Logic specific to NVHPC. +endmacro() diff --git a/Modules/ExternalProject-gitupdate.cmake.in b/Modules/ExternalProject-gitupdate.cmake.in index eff39c1..7033918 100644 --- a/Modules/ExternalProject-gitupdate.cmake.in +++ b/Modules/ExternalProject-gitupdate.cmake.in @@ -3,214 +3,275 @@ cmake_minimum_required(VERSION 3.5) -execute_process( - COMMAND "@git_EXECUTABLE@" rev-list --max-count=1 HEAD - WORKING_DIRECTORY "@work_dir@" - RESULT_VARIABLE error_code - OUTPUT_VARIABLE head_sha - OUTPUT_STRIP_TRAILING_WHITESPACE +function(get_hash_for_ref ref out_var err_var) + execute_process( + COMMAND "@git_EXECUTABLE@" rev-parse "${ref}" + WORKING_DIRECTORY "@work_dir@" + RESULT_VARIABLE error_code + OUTPUT_VARIABLE ref_hash + ERROR_VARIABLE error_msg + OUTPUT_STRIP_TRAILING_WHITESPACE ) -if(error_code) - message(FATAL_ERROR "Failed to get the hash for HEAD") + if(error_code) + set(${out_var} "" PARENT_SCOPE) + else() + set(${out_var} "${ref_hash}" PARENT_SCOPE) + endif() + set(${err_var} "${error_msg}" PARENT_SCOPE) +endfunction() + +get_hash_for_ref(HEAD head_sha error_msg) +if(head_sha STREQUAL "") + message(FATAL_ERROR "Failed to get the hash for HEAD:\n${error_msg}") endif() + execute_process( COMMAND "@git_EXECUTABLE@" show-ref "@git_tag@" WORKING_DIRECTORY "@work_dir@" OUTPUT_VARIABLE show_ref_output - ) -# If a remote ref is asked for, which can possibly move around, -# we must always do a fetch and checkout. -if("${show_ref_output}" MATCHES "remotes") - set(is_remote_ref 1) -else() - set(is_remote_ref 0) -endif() +) +if(show_ref_output MATCHES "^[a-z0-9]+[ \\t]+refs/remotes/") + # Given a full remote/branch-name and we know about it already. Since + # branches can move around, we always have to fetch. + set(fetch_required YES) + set(checkout_name "@git_tag@") + +elseif(show_ref_output MATCHES "^[a-z0-9]+[ \\t]+refs/tags/") + # Given a tag name that we already know about. We don't know if the tag we + # have matches the remote though (tags can move), so we should fetch. + set(fetch_required YES) + set(checkout_name "@git_tag@") + + # Special case to preserve backward compatibility: if we are already at the + # same commit as the tag we hold locally, don't do a fetch and assume the tag + # hasn't moved on the remote. + # FIXME: We should provide an option to always fetch for this case + get_hash_for_ref("@git_tag@" tag_sha error_msg) + if(tag_sha STREQUAL head_sha) + message(VERBOSE "Already at requested tag: ${tag_sha}") + return() + endif() + +elseif(show_ref_output MATCHES "^[a-z0-9]+[ \\t]+refs/heads/") + # Given a branch name without any remote and we already have a branch by that + # name. We might already have that branch checked out or it might be a + # different branch. It isn't safe to use a bare branch name without the + # remote, so do a fetch and replace the ref with one that includes the remote. + set(fetch_required YES) + set(checkout_name "@git_remote_name@/@git_tag@") -# Tag is in the form <remote>/<tag> (i.e. origin/master) we must strip -# the remote from the tag. -if("${show_ref_output}" MATCHES "refs/remotes/@git_tag@") - string(REGEX MATCH "^([^/]+)/(.+)$" _unused "@git_tag@") - set(git_remote "${CMAKE_MATCH_1}") - set(git_tag "${CMAKE_MATCH_2}") else() - set(git_remote "@git_remote_name@") - set(git_tag "@git_tag@") + get_hash_for_ref("@git_tag@" tag_sha error_msg) + if(tag_sha STREQUAL head_sha) + # Have the right commit checked out already + message(VERBOSE "Already at requested ref: ${tag_sha}") + return() + + elseif(tag_sha STREQUAL "") + # We don't know about this ref yet, so we have no choice but to fetch. + # We deliberately swallow any error message at the default log level + # because it can be confusing for users to see a failed git command. + # That failure is being handled here, so it isn't an error. + set(fetch_required YES) + set(checkout_name "@git_tag@") + if(NOT error_msg STREQUAL "") + message(VERBOSE "${error_msg}") + endif() + + else() + # We have the commit, so we know we were asked to find a commit hash + # (otherwise it would have been handled further above), but we don't + # have that commit checked out yet + set(fetch_required NO) + set(checkout_name "@git_tag@") + if(NOT error_msg STREQUAL "") + message(WARNING "${error_msg}") + endif() + + endif() endif() -# This will fail if the tag does not exist (it probably has not been fetched -# yet). -execute_process( - COMMAND "@git_EXECUTABLE@" rev-list --max-count=1 "${git_tag}" - WORKING_DIRECTORY "@work_dir@" - RESULT_VARIABLE error_code - OUTPUT_VARIABLE tag_sha - OUTPUT_STRIP_TRAILING_WHITESPACE +if(fetch_required) + message(VERBOSE "Fetching latest from the remote @git_remote_name@") + execute_process( + COMMAND "@git_EXECUTABLE@" fetch --tags --force "@git_remote_name@" + WORKING_DIRECTORY "@work_dir@" + COMMAND_ERROR_IS_FATAL ANY ) +endif() -# Is the hash checkout out that we want? -if(error_code OR is_remote_ref OR NOT ("${tag_sha}" STREQUAL "${head_sha}")) +set(git_update_strategy "@git_update_strategy@") +if(git_update_strategy STREQUAL "") + # Backward compatibility requires REBASE as the default behavior + set(git_update_strategy REBASE) +endif() + +if(git_update_strategy MATCHES "^REBASE(_CHECKOUT)?$") + # Asked to potentially try to rebase first, maybe with fallback to checkout. + # We can't if we aren't already on a branch and we shouldn't if that local + # branch isn't tracking the one we want to checkout. execute_process( - COMMAND "@git_EXECUTABLE@" fetch + COMMAND "@git_EXECUTABLE@" symbolic-ref -q HEAD WORKING_DIRECTORY "@work_dir@" - RESULT_VARIABLE error_code - ) - if(error_code) - message(FATAL_ERROR "Failed to fetch repository '@git_repository@'") - endif() + OUTPUT_VARIABLE current_branch + OUTPUT_STRIP_TRAILING_WHITESPACE + # Don't test for an error. If this isn't a branch, we get a non-zero error + # code but empty output. + ) - if(is_remote_ref) - # Check if stash is needed + if(current_branch STREQUAL "") + # Not on a branch, checkout is the only sensible option since any rebase + # would always fail (and backward compatibility requires us to checkout in + # this situation) + set(git_update_strategy CHECKOUT) + + else() execute_process( - COMMAND "@git_EXECUTABLE@" status --porcelain + COMMAND "@git_EXECUTABLE@" for-each-ref "--format='%(upstream:short)'" "${current_branch}" WORKING_DIRECTORY "@work_dir@" - RESULT_VARIABLE error_code - OUTPUT_VARIABLE repo_status - ) - if(error_code) - message(FATAL_ERROR "Failed to get the status") + OUTPUT_VARIABLE upstream_branch + OUTPUT_STRIP_TRAILING_WHITESPACE + COMMAND_ERROR_IS_FATAL ANY # There is no error if no upstream is set + ) + if(NOT upstream_branch STREQUAL checkout_name) + # Not safe to rebase when asked to checkout a different branch to the one + # we are tracking. If we did rebase, we could end up with arbitrary + # commits added to the ref we were asked to checkout if the current local + # branch happens to be able to rebase onto the target branch. There would + # be no error message and the user wouldn't know this was occurring. + set(git_update_strategy CHECKOUT) endif() - string(LENGTH "${repo_status}" need_stash) - # If not in clean state, stash changes in order to be able to perform a - # rebase or checkout without losing those changes permanently - if(need_stash) - execute_process( - COMMAND "@git_EXECUTABLE@" stash save @git_stash_save_options@ - WORKING_DIRECTORY "@work_dir@" - RESULT_VARIABLE error_code - ) - if(error_code) - message(FATAL_ERROR "Failed to stash changes") - endif() - endif() + endif() +elseif(NOT git_update_strategy STREQUAL "CHECKOUT") + message(FATAL_ERROR "Unsupported git update strategy: ${git_update_strategy}") +endif() - if("@git_update_strategy@" STREQUAL "CHECKOUT") - execute_process( - COMMAND "@git_EXECUTABLE@" checkout "${git_remote}/${git_tag}" - WORKING_DIRECTORY "@work_dir@" - RESULT_VARIABLE error_code - ) - if(error_code) - message(FATAL_ERROR "Failed to checkout tag: '${git_remote}/${git_tag}'") - endif() - else() - # Pull changes from the remote branch - execute_process( - COMMAND "@git_EXECUTABLE@" rebase "${git_remote}/${git_tag}" - WORKING_DIRECTORY "@work_dir@" - RESULT_VARIABLE error_code - OUTPUT_VARIABLE rebase_output - ERROR_VARIABLE rebase_output - ) - if(error_code) - # Rebase failed, undo the rebase attempt before continuing - execute_process( - COMMAND "@git_EXECUTABLE@" rebase --abort - WORKING_DIRECTORY "@work_dir@" - ) - - if(NOT "@git_update_strategy@" STREQUAL "REBASE_CHECKOUT") - # Not allowed to do a checkout as a fallback, so cannot proceed - if(need_stash) - execute_process( - COMMAND "@git_EXECUTABLE@" stash pop --index --quiet - WORKING_DIRECTORY "@work_dir@" - ) - endif() - message(FATAL_ERROR "\nFailed to rebase in: '@work_dir@'." - "\nOutput from the attempted rebase follows:" - "\n${rebase_output}" - "\n\nYou will have to resolve the conflicts manually") - endif() - - # Fall back to checkout. We create an annotated tag so that the user - # can manually inspect the situation and revert if required. - # We can't log the failed rebase output because MSVC sees it and - # intervenes, causing the build to fail even though it completes. - # Write it to a file instead. - string(TIMESTAMP tag_timestamp "%Y%m%dT%H%M%S" UTC) - set(tag_name _cmake_ExternalProject_moved_from_here_${tag_timestamp}Z) - set(error_log_file ${CMAKE_CURRENT_LIST_DIR}/rebase_error_${tag_timestamp}Z.log) - file(WRITE ${error_log_file} "${rebase_output}") - message(WARNING "Rebase failed, output has been saved to ${error_log_file}" - "\nFalling back to checkout, previous commit tagged as ${tag_name}") - execute_process( - COMMAND "@git_EXECUTABLE@" tag -a - -m "ExternalProject attempting to move from here to ${git_remote}/${git_tag}" - ${tag_name} - WORKING_DIRECTORY "@work_dir@" - RESULT_VARIABLE error_code - ) - if(error_code) - message(FATAL_ERROR "Failed to add marker tag") - endif() - execute_process( - COMMAND "@git_EXECUTABLE@" checkout "${git_remote}/${git_tag}" - WORKING_DIRECTORY "@work_dir@" - RESULT_VARIABLE error_code - ) - if(error_code) - message(FATAL_ERROR "Failed to checkout : '${git_remote}/${git_tag}'") - endif() +# Check if stash is needed +execute_process( + COMMAND "@git_EXECUTABLE@" status --porcelain + WORKING_DIRECTORY "@work_dir@" + RESULT_VARIABLE error_code + OUTPUT_VARIABLE repo_status +) +if(error_code) + message(FATAL_ERROR "Failed to get the status") +endif() +string(LENGTH "${repo_status}" need_stash) - endif() - endif() +# If not in clean state, stash changes in order to be able to perform a +# rebase or checkout without losing those changes permanently +if(need_stash) + execute_process( + COMMAND "@git_EXECUTABLE@" stash save @git_stash_save_options@ + WORKING_DIRECTORY "@work_dir@" + COMMAND_ERROR_IS_FATAL ANY + ) +endif() - if(need_stash) - execute_process( - COMMAND "@git_EXECUTABLE@" stash pop --index --quiet - WORKING_DIRECTORY "@work_dir@" - RESULT_VARIABLE error_code - ) - if(error_code) - # Stash pop --index failed: Try again dropping the index - execute_process( - COMMAND "@git_EXECUTABLE@" reset --hard --quiet - WORKING_DIRECTORY "@work_dir@" - RESULT_VARIABLE error_code - ) +if(git_update_strategy STREQUAL "CHECKOUT") + execute_process( + COMMAND "@git_EXECUTABLE@" checkout "${checkout_name}" + WORKING_DIRECTORY "@work_dir@" + COMMAND_ERROR_IS_FATAL ANY + ) +else() + execute_process( + COMMAND "@git_EXECUTABLE@" rebase "${checkout_name}" + WORKING_DIRECTORY "@work_dir@" + RESULT_VARIABLE error_code + OUTPUT_VARIABLE rebase_output + ERROR_VARIABLE rebase_output + ) + if(error_code) + # Rebase failed, undo the rebase attempt before continuing + execute_process( + COMMAND "@git_EXECUTABLE@" rebase --abort + WORKING_DIRECTORY "@work_dir@" + ) + + if(NOT git_update_strategy STREQUAL "REBASE_CHECKOUT") + # Not allowed to do a checkout as a fallback, so cannot proceed + if(need_stash) execute_process( - COMMAND "@git_EXECUTABLE@" stash pop --quiet + COMMAND "@git_EXECUTABLE@" stash pop --index --quiet WORKING_DIRECTORY "@work_dir@" - RESULT_VARIABLE error_code - ) - if(error_code) - # Stash pop failed: Restore previous state. - execute_process( - COMMAND "@git_EXECUTABLE@" reset --hard --quiet ${head_sha} - WORKING_DIRECTORY "@work_dir@" - ) - execute_process( - COMMAND "@git_EXECUTABLE@" stash pop --index --quiet - WORKING_DIRECTORY "@work_dir@" ) - message(FATAL_ERROR "\nFailed to unstash changes in: '@work_dir@'." - "\nYou will have to resolve the conflicts manually") - endif() endif() + message(FATAL_ERROR "\nFailed to rebase in: '@work_dir@'." + "\nOutput from the attempted rebase follows:" + "\n${rebase_output}" + "\n\nYou will have to resolve the conflicts manually") endif() - else() + + # Fall back to checkout. We create an annotated tag so that the user + # can manually inspect the situation and revert if required. + # We can't log the failed rebase output because MSVC sees it and + # intervenes, causing the build to fail even though it completes. + # Write it to a file instead. + string(TIMESTAMP tag_timestamp "%Y%m%dT%H%M%S" UTC) + set(tag_name _cmake_ExternalProject_moved_from_here_${tag_timestamp}Z) + set(error_log_file ${CMAKE_CURRENT_LIST_DIR}/rebase_error_${tag_timestamp}Z.log) + file(WRITE ${error_log_file} "${rebase_output}") + message(WARNING "Rebase failed, output has been saved to ${error_log_file}" + "\nFalling back to checkout, previous commit tagged as ${tag_name}") execute_process( - COMMAND "@git_EXECUTABLE@" checkout "${git_tag}" + COMMAND "@git_EXECUTABLE@" tag -a + -m "ExternalProject attempting to move from here to ${checkout_name}" + ${tag_name} WORKING_DIRECTORY "@work_dir@" - RESULT_VARIABLE error_code - ) - if(error_code) - message(FATAL_ERROR "Failed to checkout tag: '${git_tag}'") - endif() + COMMAND_ERROR_IS_FATAL ANY + ) + + execute_process( + COMMAND "@git_EXECUTABLE@" checkout "${checkout_name}" + WORKING_DIRECTORY "@work_dir@" + COMMAND_ERROR_IS_FATAL ANY + ) endif() +endif() - set(init_submodules "@init_submodules@") - if(init_submodules) +if(need_stash) + # Put back the stashed changes + execute_process( + COMMAND "@git_EXECUTABLE@" stash pop --index --quiet + WORKING_DIRECTORY "@work_dir@" + RESULT_VARIABLE error_code + ) + if(error_code) + # Stash pop --index failed: Try again dropping the index + execute_process( + COMMAND "@git_EXECUTABLE@" reset --hard --quiet + WORKING_DIRECTORY "@work_dir@" + ) execute_process( - COMMAND "@git_EXECUTABLE@" submodule update @git_submodules_recurse@ --init @git_submodules@ + COMMAND "@git_EXECUTABLE@" stash pop --quiet WORKING_DIRECTORY "@work_dir@" RESULT_VARIABLE error_code + ) + if(error_code) + # Stash pop failed: Restore previous state. + execute_process( + COMMAND "@git_EXECUTABLE@" reset --hard --quiet ${head_sha} + WORKING_DIRECTORY "@work_dir@" ) + execute_process( + COMMAND "@git_EXECUTABLE@" stash pop --index --quiet + WORKING_DIRECTORY "@work_dir@" + ) + message(FATAL_ERROR "\nFailed to unstash changes in: '@work_dir@'." + "\nYou will have to resolve the conflicts manually") + endif() endif() - if(error_code) - message(FATAL_ERROR "Failed to update submodules in: '@work_dir@'") - endif() +endif() + +set(init_submodules "@init_submodules@") +if(init_submodules) + execute_process( + COMMAND "@git_EXECUTABLE@" submodule update @git_submodules_recurse@ --init @git_submodules@ + WORKING_DIRECTORY "@work_dir@" + COMMAND_ERROR_IS_FATAL ANY + ) endif() diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake index 29cfba9..903dd57 100644 --- a/Modules/ExternalProject.cmake +++ b/Modules/ExternalProject.cmake @@ -2671,6 +2671,10 @@ function(_ep_add_download_command name) get_property(git_progress TARGET ${name} PROPERTY _EP_GIT_PROGRESS) get_property(git_config TARGET ${name} PROPERTY _EP_GIT_CONFIG) + # Make checkouts quiet when checking out a git hash (this avoids the + # very noisy detached head message) + list(PREPEND git_config advice.detachedHead=false) + # For the download step, and the git clone operation, only the repository # should be recorded in a configured RepositoryInfo file. If the repo # changes, the clone script should be run again. But if only the tag diff --git a/Modules/FindBLAS.cmake b/Modules/FindBLAS.cmake index 01d0236..4cf812b 100644 --- a/Modules/FindBLAS.cmake +++ b/Modules/FindBLAS.cmake @@ -842,6 +842,9 @@ if(BLA_VENDOR MATCHES "ACML" OR BLA_VENDOR STREQUAL "All") if(CMAKE_Fortran_COMPILER_ID STREQUAL "Intel") set(_ACML_COMPILER32 "ifort32") set(_ACML_COMPILER64 "ifort64") + elseif(CMAKE_Fortran_COMPILER_ID STREQUAL "IntelLLVM") + # 32-bit not supported + set(_ACML_COMPILER64 "ifx") elseif(CMAKE_Fortran_COMPILER_ID STREQUAL "SunPro") set(_ACML_COMPILER32 "sun32") set(_ACML_COMPILER64 "sun64") diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake index e41e864..6ee425b 100644 --- a/Modules/FindBoost.cmake +++ b/Modules/FindBoost.cmake @@ -853,7 +853,8 @@ endfunction() # Guesses Boost's compiler prefix used in built library names # Returns the guess by setting the variable pointed to by _ret function(_Boost_GUESS_COMPILER_PREFIX _ret) - if("x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xIntel") + if("x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xIntel" + OR "x${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "xIntelLLVM") if(WIN32) set (_boost_COMPILER "-iw") else() @@ -1891,7 +1892,8 @@ endif() if(WIN32 AND Boost_USE_DEBUG_RUNTIME) if("x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xMSVC" OR "x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xClang" - OR "x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xIntel") + OR "x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xIntel" + OR "x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xIntelLLVM") string(APPEND _boost_DEBUG_ABI_TAG "g") endif() endif() diff --git a/Modules/FindMPI.cmake b/Modules/FindMPI.cmake index 8476823..8cc39ac 100644 --- a/Modules/FindMPI.cmake +++ b/Modules/FindMPI.cmake @@ -294,6 +294,11 @@ if(WIN32) set(_MPI_Intel_CXX_COMPILER_NAMES mpiicpc.bat) set(_MPI_Intel_Fortran_COMPILER_NAMES mpiifort.bat mpif77.bat mpif90.bat) + # Intel MPI compiler names + set(_MPI_IntelLLVM_C_COMPILER_NAMES mpiicc.bat) + set(_MPI_IntelLLVM_CXX_COMPILER_NAMES mpiicpc.bat) + set(_MPI_IntelLLVM_Fortran_COMPILER_NAMES mpiifort.bat mpif77.bat mpif90.bat) + # Intel MPI compiler names for MSMPI set(_MPI_MSVC_C_COMPILER_NAMES mpicl.bat) set(_MPI_MSVC_CXX_COMPILER_NAMES mpicl.bat) @@ -302,6 +307,11 @@ else() set(_MPI_Intel_C_COMPILER_NAMES mpiicc) set(_MPI_Intel_CXX_COMPILER_NAMES mpiicpc mpiicxx mpiic++) set(_MPI_Intel_Fortran_COMPILER_NAMES mpiifort mpiif95 mpiif90 mpiif77) + + # Intel compiler names + set(_MPI_IntelLLVM_C_COMPILER_NAMES mpiicc) + set(_MPI_IntelLLVM_CXX_COMPILER_NAMES mpiicpc mpiicxx mpiic++) + set(_MPI_IntelLLVM_Fortran_COMPILER_NAMES mpiifort mpiif95 mpiif90 mpiif77) endif() # PGI compiler names @@ -327,7 +337,7 @@ set(_MPI_XL_Fortran_COMPILER_NAMES mpixlf95 mpixlf95_r mpxlf95 mpxlf95 # pick up the right settings for it. foreach (LANG IN ITEMS C CXX Fortran) set(_MPI_${LANG}_COMPILER_NAMES "") - foreach (id IN ITEMS GNU Intel MSVC PGI XL) + foreach (id IN ITEMS GNU Intel IntelLLVM MSVC PGI XL) if (NOT CMAKE_${LANG}_COMPILER_ID OR CMAKE_${LANG}_COMPILER_ID STREQUAL id) foreach(_COMPILER_NAME IN LISTS _MPI_${id}_${LANG}_COMPILER_NAMES) list(APPEND _MPI_${LANG}_COMPILER_NAMES ${_COMPILER_NAME}${MPI_EXECUTABLE_SUFFIX}) diff --git a/Modules/FindOpenACC.cmake b/Modules/FindOpenACC.cmake index da050cd..cf58f3b 100644 --- a/Modules/FindOpenACC.cmake +++ b/Modules/FindOpenACC.cmake @@ -12,7 +12,7 @@ Detect OpenACC support by the compiler. This module can be used to detect OpenACC support in a compiler. If the compiler supports OpenACC, the flags required to compile with OpenACC support are returned in variables for the different languages. -Currently, only PGI, GNU and Cray compilers are supported. +Currently, only NVHPC, PGI, GNU and Cray compilers are supported. Imported Targets ^^^^^^^^^^^^^^^^ @@ -139,6 +139,7 @@ endfunction() function(_OPENACC_GET_FLAGS_CANDIDATE LANG FLAG_VAR) + set(ACC_FLAG_NVHPC "-acc") set(ACC_FLAG_PGI "-acc") set(ACC_FLAG_GNU "-fopenacc") set(ACC_FLAG_Cray "-h acc") @@ -155,6 +156,7 @@ endfunction() function(_OPENACC_GET_ACCEL_TARGET_FLAG LANG TARGET FLAG_VAR) # Find target accelerator flags. + set(ACC_TARGET_FLAG_NVHPC "-ta") set(ACC_TARGET_FLAG_PGI "-ta") if(DEFINED ACC_TARGET_FLAG_${CMAKE_${LANG}_COMPILER_ID}) set("${FLAG_VAR}" "${ACC_TARGET_FLAG_${CMAKE_${LANG}_COMPILER_ID}}=${TARGET}" PARENT_SCOPE) @@ -164,6 +166,7 @@ endfunction() function(_OPENACC_GET_VERBOSE_FLAG LANG FLAG_VAR) # Find compiler's verbose flag for OpenACC. + set(ACC_VERBOSE_FLAG_NVHPC "-Minfo=accel") set(ACC_VERBOSE_FLAG_PGI "-Minfo=accel") if(DEFINED ACC_VERBOSE_FLAG_${CMAKE_${LANG}_COMPILER_ID}) set("${FLAG_VAR}" "${ACC_VERBOSE_FLAG_${CMAKE_${LANG}_COMPILER_ID}}" PARENT_SCOPE) diff --git a/Modules/FindOpenMP.cmake b/Modules/FindOpenMP.cmake index fc5bffa..a1ffc25 100644 --- a/Modules/FindOpenMP.cmake +++ b/Modules/FindOpenMP.cmake @@ -113,10 +113,12 @@ function(_OPENMP_FLAG_CANDIDATES LANG) else() set(OMP_FLAG_Intel "-qopenmp") endif() + set(OMP_FLAG_IntelLLVM "-fiopenmp") set(OMP_FLAG_MSVC "-openmp") set(OMP_FLAG_PathScale "-openmp") set(OMP_FLAG_NAG "-openmp") set(OMP_FLAG_Absoft "-openmp") + set(OMP_FLAG_NVHPC "-mp") set(OMP_FLAG_PGI "-mp") set(OMP_FLAG_Flang "-fopenmp") set(OMP_FLAG_SunPro "-xopenmp") diff --git a/Modules/GenerateExportHeader.cmake b/Modules/GenerateExportHeader.cmake index bc1eb17..a9a9c59 100644 --- a/Modules/GenerateExportHeader.cmake +++ b/Modules/GenerateExportHeader.cmake @@ -221,7 +221,7 @@ macro(_test_compiler_hidden_visibility) set(GCC_TOO_OLD TRUE) elseif(CMAKE_COMPILER_IS_GNUCC AND CMAKE_C_COMPILER_VERSION VERSION_LESS "4.2") set(GCC_TOO_OLD TRUE) - elseif(CMAKE_CXX_COMPILER_ID MATCHES Intel AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "12.0") + elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Intel" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "12.0") set(_INTEL_TOO_OLD TRUE) endif() @@ -232,7 +232,7 @@ macro(_test_compiler_hidden_visibility) AND NOT WIN32 AND NOT CYGWIN AND NOT CMAKE_CXX_COMPILER_ID MATCHES XL - AND NOT CMAKE_CXX_COMPILER_ID MATCHES PGI + AND NOT CMAKE_CXX_COMPILER_ID MATCHES "^(PGI|NVHPC)$" AND NOT CMAKE_CXX_COMPILER_ID MATCHES Watcom) if (CMAKE_CXX_COMPILER_LOADED) check_cxx_compiler_flag(-fvisibility=hidden COMPILER_HAS_HIDDEN_VISIBILITY) @@ -254,7 +254,7 @@ macro(_test_compiler_has_deprecated) OR CMAKE_CXX_COMPILER_ID MATCHES Embarcadero OR CMAKE_CXX_COMPILER_ID MATCHES HP OR GCC_TOO_OLD - OR CMAKE_CXX_COMPILER_ID MATCHES PGI + OR CMAKE_CXX_COMPILER_ID MATCHES "^(PGI|NVHPC)$" OR CMAKE_CXX_COMPILER_ID MATCHES Watcom) set(COMPILER_HAS_DEPRECATED "" CACHE INTERNAL "Compiler support for a deprecated attribute") diff --git a/Modules/InstallRequiredSystemLibraries.cmake b/Modules/InstallRequiredSystemLibraries.cmake index a39393dc..2d08e08 100644 --- a/Modules/InstallRequiredSystemLibraries.cmake +++ b/Modules/InstallRequiredSystemLibraries.cmake @@ -71,7 +71,7 @@ cmake_policy(SET CMP0054 NEW) # if() quoted variables not dereferenced set(_IRSL_HAVE_Intel FALSE) set(_IRSL_HAVE_MSVC FALSE) foreach(LANG IN ITEMS C CXX Fortran) - if("${CMAKE_${LANG}_COMPILER_ID}" STREQUAL "Intel") + if("${CMAKE_${LANG}_COMPILER_ID}" MATCHES "Intel") if(NOT _IRSL_HAVE_Intel) get_filename_component(_Intel_basedir "${CMAKE_${LANG}_COMPILER}" PATH) if(CMAKE_SIZEOF_VOID_P EQUAL 8) @@ -637,10 +637,10 @@ if(_IRSL_HAVE_Intel) list(APPEND __install_libs "${_Intel_redistdir}/${__Intel_lib}") endforeach() - if(CMAKE_C_COMPILER_ID STREQUAL Intel OR CMAKE_CXX_COMPILER_ID STREQUAL Intel) + if(CMAKE_C_COMPILER_ID MATCHES Intel OR CMAKE_CXX_COMPILER_ID MATCHES Intel) list(APPEND __install_libs "${_Intel_redistdir}/libgfxoffload.dll") endif() - if(CMAKE_Fortran_COMPILER_ID STREQUAL Intel) + if(CMAKE_Fortran_COMPILER_ID MATCHES Intel) foreach(__Intel_lib IN ITEMS ifdlg100.dll libicaf.dll libifcoremd.dll libifcoremdd.dll libifcorert.dll libifcorertd.dll libifportmd.dll) list(APPEND __install_libs "${_Intel_redistdir}/${__Intel_lib}") @@ -650,12 +650,12 @@ if(_IRSL_HAVE_Intel) foreach(__Intel_lib IN ITEMS libchkp.dylib libcilkrts.5.dylib libcilkrts.dylib libimf.dylib libintlc.dylib libirc.dylib libirng.dylib libsvml.dylib) list(APPEND __install_libs "${_Intel_redistdir}/${__Intel_lib}") endforeach() - if(CMAKE_C_COMPILER_ID STREQUAL Intel OR CMAKE_CXX_COMPILER_ID STREQUAL Intel) + if(CMAKE_C_COMPILER_ID MATCHES Intel OR CMAKE_CXX_COMPILER_ID MATCHES Intel) if(_Intel_compiler_ver VERSION_LESS 17) list(APPEND __install_libs "${_Intel_redistdir}/libistrconv.dylib") endif() endif() - if(CMAKE_Fortran_COMPILER_ID STREQUAL Intel) + if(CMAKE_Fortran_COMPILER_ID MATCHES Intel) foreach(__Intel_lib IN ITEMS libifcore.dylib libifcoremt.dylib libifport.dylib libifportmt.dylib) list(APPEND __install_libs "${_Intel_redistdir}/${__Intel_lib}") @@ -672,7 +672,7 @@ if(_IRSL_HAVE_Intel) list(APPEND __install_libs "${_Intel_redistdir}/${__Intel_lib}") endforeach() endif() - if(CMAKE_C_COMPILER_ID STREQUAL Intel OR CMAKE_CXX_COMPILER_ID STREQUAL Intel) + if(CMAKE_C_COMPILER_ID MATCHES Intel OR CMAKE_CXX_COMPILER_ID MATCHES Intel) set(__install_dirs "${_Intel_redistdir}/irml") list(APPEND __install_libs "${_Intel_redistdir}/cilk_db.so") if(_Intel_compiler_ver VERSION_GREATER_EQUAL 15) @@ -691,7 +691,7 @@ if(_IRSL_HAVE_Intel) list(APPEND __install_libs "${_Intel_redistdir}/${__Intel_lib}") endforeach() endif() - if(CMAKE_Fortran_COMPILER_ID STREQUAL Intel) + if(CMAKE_Fortran_COMPILER_ID MATCHES Intel) foreach(__Intel_lib IN ITEMS libicaf.so libifcore.so libifcore.so.5 libifcoremt.so libifcoremt.so.5 libifport.so libifport.so.5) list(APPEND __install_libs "${_Intel_redistdir}/${__Intel_lib}") diff --git a/Modules/Platform/Apple-IntelLLVM-C.cmake b/Modules/Platform/Apple-IntelLLVM-C.cmake new file mode 100644 index 0000000..8e74729 --- /dev/null +++ b/Modules/Platform/Apple-IntelLLVM-C.cmake @@ -0,0 +1,2 @@ +include(Platform/Apple-IntelLLVM) +__apple_compiler_intel_llvm(C) diff --git a/Modules/Platform/Apple-IntelLLVM-CXX.cmake b/Modules/Platform/Apple-IntelLLVM-CXX.cmake new file mode 100644 index 0000000..38640e1 --- /dev/null +++ b/Modules/Platform/Apple-IntelLLVM-CXX.cmake @@ -0,0 +1,2 @@ +include(Platform/Apple-IntelLLVM) +__apple_compiler_intel_llvm(CXX) diff --git a/Modules/Platform/Apple-IntelLLVM-Fortran.cmake b/Modules/Platform/Apple-IntelLLVM-Fortran.cmake new file mode 100644 index 0000000..d0486ed --- /dev/null +++ b/Modules/Platform/Apple-IntelLLVM-Fortran.cmake @@ -0,0 +1,8 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Apple-IntelLLVM) +__apple_compiler_intel_llvm(Fortran) + +set(CMAKE_Fortran_OSX_COMPATIBILITY_VERSION_FLAG "-compatibility_version ") +set(CMAKE_Fortran_OSX_CURRENT_VERSION_FLAG "-current_version ") diff --git a/Modules/Platform/Apple-IntelLLVM.cmake b/Modules/Platform/Apple-IntelLLVM.cmake new file mode 100644 index 0000000..2f9f0ca --- /dev/null +++ b/Modules/Platform/Apple-IntelLLVM.cmake @@ -0,0 +1,17 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + + +# This module is shared by multiple languages; use include blocker. +include_guard() + +macro(__apple_compiler_intel_llvm lang) + set(CMAKE_${lang}_VERBOSE_FLAG "-v -Wl,-v") # also tell linker to print verbose output + set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-dynamiclib -Wl,-headerpad_max_install_names") + set(CMAKE_SHARED_MODULE_CREATE_${lang}_FLAGS "-bundle -Wl,-headerpad_max_install_names") + + set(CMAKE_${lang}_LINKER_WRAPPER_FLAG "-Wl,") + set(CMAKE_${lang}_LINKER_WRAPPER_FLAG_SEP ",") + + set(CMAKE_${lang}_COMPILE_OPTIONS_VISIBILITY "-fvisibility=") +endmacro() diff --git a/Modules/Platform/Linux-IntelLLVM-C.cmake b/Modules/Platform/Linux-IntelLLVM-C.cmake new file mode 100644 index 0000000..5356c4f --- /dev/null +++ b/Modules/Platform/Linux-IntelLLVM-C.cmake @@ -0,0 +1,3 @@ +include(Platform/Linux-IntelLLVM) +__linux_compiler_intel_llvm(C) +set(CMAKE_INCLUDE_SYSTEM_FLAG_C "-isystem ") diff --git a/Modules/Platform/Linux-IntelLLVM-CXX.cmake b/Modules/Platform/Linux-IntelLLVM-CXX.cmake new file mode 100644 index 0000000..44ce0e8 --- /dev/null +++ b/Modules/Platform/Linux-IntelLLVM-CXX.cmake @@ -0,0 +1,3 @@ +include(Platform/Linux-IntelLLVM) +__linux_compiler_intel_llvm(CXX) +set(CMAKE_INCLUDE_SYSTEM_FLAG_CXX "-isystem ") diff --git a/Modules/Platform/Linux-IntelLLVM-Fortran.cmake b/Modules/Platform/Linux-IntelLLVM-Fortran.cmake new file mode 100644 index 0000000..1cd9b1f --- /dev/null +++ b/Modules/Platform/Linux-IntelLLVM-Fortran.cmake @@ -0,0 +1,4 @@ +include(Platform/Linux-IntelLLVM) +__linux_compiler_intel_llvm(Fortran) +string(APPEND CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS " -nofor-main") +set(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS "") diff --git a/Modules/Platform/Linux-IntelLLVM.cmake b/Modules/Platform/Linux-IntelLLVM.cmake new file mode 100644 index 0000000..1363b44 --- /dev/null +++ b/Modules/Platform/Linux-IntelLLVM.cmake @@ -0,0 +1,55 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + + +# This module is shared by multiple languages; use include blocker. +if(__LINUX_COMPILER_INTEL_LLVM) + return() +endif() +set(__LINUX_COMPILER_INTEL_LLVM 1) + +if(NOT XIAR) + set(_intel_xiar_hints) + foreach(lang C CXX Fortran) + if(IS_ABSOLUTE "${CMAKE_${lang}_COMPILER}") + get_filename_component(_hint "${CMAKE_${lang}_COMPILER}" PATH) + list(APPEND _intel_xiar_hints ${_hint}) + endif() + endforeach() + find_program(XIAR NAMES xiar HINTS ${_intel_xiar_hints}) + mark_as_advanced(XIAR) +endif() + +macro(__linux_compiler_intel_llvm lang) + set(CMAKE_${lang}_COMPILE_OPTIONS_PIC "-fPIC") + set(CMAKE_${lang}_COMPILE_OPTIONS_PIE "-fPIE") + set(_CMAKE_${lang}_PIE_MAY_BE_SUPPORTED_BY_LINKER NO) + set(_CMAKE_${lang}_PIE_MAY_BE_SUPPORTED_BY_LINKER YES) + set(CMAKE_${lang}_LINK_OPTIONS_PIE ${CMAKE_${lang}_COMPILE_OPTIONS_PIE} "-pie") + set(CMAKE_${lang}_LINK_OPTIONS_NO_PIE "-no-pie") + set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "-fPIC") + set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-shared") + + # We pass this for historical reasons. Projects may have + # executables that use dlopen but do not set ENABLE_EXPORTS. + set(CMAKE_SHARED_LIBRARY_LINK_${lang}_FLAGS "-rdynamic") + + set(CMAKE_${lang}_LINKER_WRAPPER_FLAG "-Wl,") + set(CMAKE_${lang}_LINKER_WRAPPER_FLAG_SEP ",") + + set(_CMAKE_${lang}_IPO_SUPPORTED_BY_CMAKE YES) + + if(XIAR) + # INTERPROCEDURAL_OPTIMIZATION + set(CMAKE_${lang}_COMPILE_OPTIONS_IPO -ipo) + set(CMAKE_${lang}_CREATE_STATIC_LIBRARY_IPO + "${XIAR} cr <TARGET> <LINK_FLAGS> <OBJECTS> " + "${XIAR} -s <TARGET> ") + set(_CMAKE_${lang}_IPO_MAY_BE_SUPPORTED_BY_COMPILER YES) + set(_CMAKE_${lang}_IPO_LEGACY_BEHAVIOR YES) + else() + set(_CMAKE_${lang}_IPO_MAY_BE_SUPPORTED_BY_COMPILER NO) + endif() + + set(CMAKE_${lang}_COMPILE_OPTIONS_VISIBILITY "-fvisibility=") +endmacro() diff --git a/Modules/Platform/Linux-NVHPC-C.cmake b/Modules/Platform/Linux-NVHPC-C.cmake new file mode 100644 index 0000000..4aab327 --- /dev/null +++ b/Modules/Platform/Linux-NVHPC-C.cmake @@ -0,0 +1,2 @@ +include(Platform/Linux-NVHPC) +__linux_compiler_nvhpc(C) diff --git a/Modules/Platform/Linux-NVHPC-CXX.cmake b/Modules/Platform/Linux-NVHPC-CXX.cmake new file mode 100644 index 0000000..57380eb --- /dev/null +++ b/Modules/Platform/Linux-NVHPC-CXX.cmake @@ -0,0 +1,2 @@ +include(Platform/Linux-NVHPC) +__linux_compiler_nvhpc(CXX) diff --git a/Modules/Platform/Linux-NVHPC-Fortran.cmake b/Modules/Platform/Linux-NVHPC-Fortran.cmake new file mode 100644 index 0000000..c68430c --- /dev/null +++ b/Modules/Platform/Linux-NVHPC-Fortran.cmake @@ -0,0 +1,2 @@ +include(Platform/Linux-NVHPC) +__linux_compiler_nvhpc(Fortran) diff --git a/Modules/Platform/Linux-NVHPC.cmake b/Modules/Platform/Linux-NVHPC.cmake new file mode 100644 index 0000000..aad17f1 --- /dev/null +++ b/Modules/Platform/Linux-NVHPC.cmake @@ -0,0 +1,15 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + + +# This module is shared by multiple languages; use include blocker. +if(__LINUX_COMPILER_NVIDIA) + return() +endif() +set(__LINUX_COMPILER_NVIDIA 1) + +include(Platform/Linux-PGI) + +macro(__linux_compiler_nvhpc lang) + __linux_compiler_pgi(${lang}) +endmacro() diff --git a/Modules/Platform/Windows-IntelLLVM-ASM.cmake b/Modules/Platform/Windows-IntelLLVM-ASM.cmake new file mode 100644 index 0000000..f355e49 --- /dev/null +++ b/Modules/Platform/Windows-IntelLLVM-ASM.cmake @@ -0,0 +1,2 @@ +include(Platform/Windows-IntelLLVM) +__windows_compiler_intel(ASM) diff --git a/Modules/Platform/Windows-IntelLLVM-C.cmake b/Modules/Platform/Windows-IntelLLVM-C.cmake new file mode 100644 index 0000000..93c3364 --- /dev/null +++ b/Modules/Platform/Windows-IntelLLVM-C.cmake @@ -0,0 +1,2 @@ +include(Platform/Windows-IntelLLVM) +__windows_compiler_intel(C) diff --git a/Modules/Platform/Windows-IntelLLVM-CXX.cmake b/Modules/Platform/Windows-IntelLLVM-CXX.cmake new file mode 100644 index 0000000..4667895 --- /dev/null +++ b/Modules/Platform/Windows-IntelLLVM-CXX.cmake @@ -0,0 +1,3 @@ +include(Platform/Windows-IntelLLVM) +set(_COMPILE_CXX " /TP") +__windows_compiler_intel(CXX) diff --git a/Modules/Platform/Windows-IntelLLVM-Fortran.cmake b/Modules/Platform/Windows-IntelLLVM-Fortran.cmake new file mode 100644 index 0000000..06d0a00 --- /dev/null +++ b/Modules/Platform/Windows-IntelLLVM-Fortran.cmake @@ -0,0 +1,44 @@ +include(Platform/Windows-IntelLLVM) +set(CMAKE_BUILD_TYPE_INIT Debug) +set(_COMPILE_Fortran " /fpp") +set(CMAKE_Fortran_MODDIR_FLAG "-module:") +set(CMAKE_Fortran_STANDARD_LIBRARIES_INIT "user32.lib") +__windows_compiler_intel(Fortran) +if(CMAKE_MSVC_RUNTIME_LIBRARY_DEFAULT) + set(_LIBSDLL "") + set(_DBGLIBS "") + set(_THREADS "") +else() + set(_LIBSDLL " /libs:dll") + set(_DBGLIBS " /dbglibs") + set(_THREADS " /threads") +endif() + +cmake_policy(GET CMP0092 _cmp0092) +if(NOT _cmp0092 STREQUAL "NEW") + string(APPEND CMAKE_Fortran_FLAGS_INIT " /W1") +endif() +unset(_cmp0092) + +string(APPEND CMAKE_Fortran_FLAGS_INIT " /nologo /fpp${_LIBSDLL}${_THREADS}") +string(APPEND CMAKE_Fortran_FLAGS_DEBUG_INIT " /Od /debug:full${_DBGLIBS}") +string(APPEND CMAKE_Fortran_FLAGS_MINSIZEREL_INIT " /O1 /DNDEBUG") +string(APPEND CMAKE_Fortran_FLAGS_RELEASE_INIT " /O2 /DNDEBUG") +string(APPEND CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT " /O2 /debug:full /DNDEBUG") +unset(_LIBSDLL) +unset(_DBGLIBS) +unset(_THREADS) + +set(CMAKE_Fortran_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreaded -threads -libs:static) +set(CMAKE_Fortran_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDLL -threads -libs:dll) +set(CMAKE_Fortran_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebug -threads -libs:static -dbglibs) +set(CMAKE_Fortran_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebugDLL -threads -libs:dll -dbglibs) + +# Intel Fortran for Windows supports single-threaded RTL but it is +# not implemented by the Visual Studio integration. +if(NOT CMAKE_GENERATOR MATCHES "Visual Studio") + set(CMAKE_Fortran_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_SingleThreaded -libs:static) + set(CMAKE_Fortran_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_SingleThreadedDLL -libs:dll) + set(CMAKE_Fortran_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_SingleThreadedDebug -libs:static -dbglibs) + set(CMAKE_Fortran_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_SingleThreadedDebugDLL -libs:dll -dbglibs) +endif() diff --git a/Modules/Platform/Windows-IntelLLVM.cmake b/Modules/Platform/Windows-IntelLLVM.cmake new file mode 100644 index 0000000..b9ea037 --- /dev/null +++ b/Modules/Platform/Windows-IntelLLVM.cmake @@ -0,0 +1,17 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + + +# This module is shared by multiple languages; use include blocker. +if(__WINDOWS_INTEL) + return() +endif() +set(__WINDOWS_INTEL 1) + +include(Platform/Windows-MSVC) +macro(__windows_compiler_intel lang) + __windows_compiler_msvc(${lang}) + + set(CMAKE_DEPFILE_FLAGS_${lang} "-QMMD -QMT <DEP_TARGET> -QMF <DEP_FILE>") + set(CMAKE_${lang}_DEPFILE_FORMAT gcc) +endmacro() diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index dca94ee..b3d8369 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -46,6 +46,8 @@ if(NOT CMake_DEFAULT_RECURSION_LIMIT) set(CMake_DEFAULT_RECURSION_LIMIT 100) elseif(MINGW) set(CMake_DEFAULT_RECURSION_LIMIT 400) + elseif(WIN32 AND CMAKE_C_COMPILER_ID STREQUAL "IntelLLVM") + set(CMake_DEFAULT_RECURSION_LIMIT 600) else() set(CMake_DEFAULT_RECURSION_LIMIT 1000) endif() diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 2480380..0487c2c 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,7 +1,7 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 19) -set(CMake_VERSION_PATCH 20210127) +set(CMake_VERSION_PATCH 20210129) #set(CMake_VERSION_RC 0) set(CMake_VERSION_IS_DIRTY 0) diff --git a/Source/CursesDialog/form/CMakeLists.txt b/Source/CursesDialog/form/CMakeLists.txt index 21c499e..8f26b9a 100644 --- a/Source/CursesDialog/form/CMakeLists.txt +++ b/Source/CursesDialog/form/CMakeLists.txt @@ -5,7 +5,7 @@ project(CMAKE_FORM) # Disable warnings to avoid changing 3rd party code. if(CMAKE_C_COMPILER_ID MATCHES - "^(GNU|Clang|AppleClang|XLClang|XL|VisualAge|SunPro|HP|Intel)$") + "^(GNU|Clang|AppleClang|XLClang|XL|VisualAge|SunPro|HP|Intel|IntelLLVM)$") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w") elseif(CMAKE_C_COMPILER_ID STREQUAL "PathScale") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -woffall") diff --git a/Tests/Assembler/CMakeLists.txt b/Tests/Assembler/CMakeLists.txt index a574c4e..0a2c819 100644 --- a/Tests/Assembler/CMakeLists.txt +++ b/Tests/Assembler/CMakeLists.txt @@ -9,7 +9,7 @@ set(SRCS) # and also generate assembler files from C: if("${CMAKE_GENERATOR}" MATCHES "Makefile|Xcode|Ninja" AND NOT CMAKE_OSX_ARCHITECTURES MATCHES ";") - if((CMAKE_C_COMPILER_ID MATCHES "^(GNU|Clang|AppleClang|HP|SunPro|XL)$") OR (CMAKE_C_COMPILER_ID STREQUAL "Intel" AND UNIX) + if((CMAKE_C_COMPILER_ID MATCHES "^(GNU|Clang|AppleClang|HP|SunPro|XL)$") OR (CMAKE_C_COMPILER_ID MATCHES "Intel" AND UNIX) AND NOT (CMAKE_C_COMPILER_ID STREQUAL "Clang" AND "x${CMAKE_C_COMPILER_FRONTEND_VARIANT}" STREQUAL "xMSVC")) set(C_FLAGS "${CMAKE_C_FLAGS}") separate_arguments(C_FLAGS) diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index d28d89f..4ed902c 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -429,6 +429,10 @@ if(BUILD_TESTING) set(CMAKE_SKIP_VSGNUFortran TRUE) endif() endif() + if(CMAKE_Fortran_COMPILER_ID STREQUAL IntelLLVM) + message(STATUS "Skip VSGNUFortran for ifx until DLLEXPORT support is implemented") + set(CMAKE_SKIP_VSGNUFortran TRUE) + endif() if((CMAKE_C_COMPILER MATCHES lsb) AND (CMAKE_Fortran_COMPILER MATCHES ifort)) message(STATUS "Skip VSGNUFortran for ifort and lsb compilers") @@ -1948,7 +1952,7 @@ if(BUILD_TESTING) if(NOT CMAKE_C_COMPILER_ID STREQUAL "Clang" OR NOT "x${CMAKE_C_COMPILER_FRONTEND_VARIANT}" STREQUAL "xGNU") ADD_TEST_MACRO(ForceInclude foo) endif() - if(NOT CMAKE_C_COMPILER_ID STREQUAL "Clang") + if(NOT CMAKE_C_COMPILER_ID STREQUAL "Clang" AND NOT CMAKE_C_COMPILER_ID STREQUAL "IntelLLVM") ADD_TEST_MACRO(PrecompiledHeader foo) endif() set(MSVCRuntimeLibrary_BUILD_OPTIONS -DCMake_TEST_CUDA=${CMake_TEST_CUDA}) @@ -2014,12 +2018,19 @@ if(BUILD_TESTING) endif() endif() - # For the Watcom WMake generator, avoid the MFC test by default. if(CTEST_RUN_MFC) + # For the Watcom WMake generator, avoid the MFC test by default. if("${CMAKE_GENERATOR}" MATCHES "WMake") message(STATUS "using the Watcom WMake generator, avoiding MFC test") set(CTEST_RUN_MFC OFF) + elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "IntelLLVM") + # clang-cl cannot deal with implicit dependencies in UTF16 files + # (see #18311). IntelLLVM inherits this behavior from Clang. + # TODO: maybe clang should also skip the MFC test + message(STATUS + "using generator other than Visual Studio with clang-cl, avoiding MFC test") + set(CTEST_RUN_MFC OFF) endif() endif() diff --git a/Tests/CTestCoverageCollectGCOV/test.cmake.in b/Tests/CTestCoverageCollectGCOV/test.cmake.in index 1818888..a36f374 100644 --- a/Tests/CTestCoverageCollectGCOV/test.cmake.in +++ b/Tests/CTestCoverageCollectGCOV/test.cmake.in @@ -29,6 +29,20 @@ set(expected_out uncovered/uncovered2.cpp ) +# A symbolic link in the path can cause tar to put an equivalent, but not +# minimal file name to some files in the tar file. Convert paths to absolute +# then back to relative to get them in canonical form (or maybe this is a bug +# in how the tarball is generated?) +function(to_relative_paths real_paths paths) + foreach(file ${paths}) + file(REAL_PATH "${file}" real_path BASE_DIRECTORY "${CTEST_BINARY_DIRECTORY}") + file(RELATIVE_PATH relative_path "${CTEST_BINARY_DIRECTORY}" "${real_path}") + list(APPEND local_real_paths "${relative_path}") + message(DEBUG "${file} -> ${real_path} -> ${relative_path}") + endforeach() + set("${real_paths}" "${local_real_paths}" PARENT_SCOPE) +endfunction() + #------------------------------------------------------------------------------# # Test 1: with standard arguments #------------------------------------------------------------------------------# @@ -50,6 +64,7 @@ execute_process(COMMAND ) string(REPLACE "\n" ";" out "${out}") +to_relative_paths(out "${out}") list(SORT out) if("${out}" STREQUAL "${expected_out}") @@ -80,6 +95,7 @@ execute_process(COMMAND ) string(REPLACE "\n" ";" out "${out}") +to_relative_paths(out "${out}") list(SORT out) if("${out}" STREQUAL "${expected_out}") @@ -110,6 +126,7 @@ execute_process(COMMAND ) string(REPLACE "\n" ";" out "${out}") +to_relative_paths(out "${out}") list(SORT out) if("${out}" STREQUAL "${expected_out}") @@ -140,6 +157,7 @@ execute_process(COMMAND ) string(REPLACE "\n" ";" out "${out}") +to_relative_paths(out "${out}") list(SORT out) if("${out}" STREQUAL "${expected_out}") @@ -170,6 +188,7 @@ execute_process(COMMAND ) string(REPLACE "\n" ";" out "${out}") +to_relative_paths(out "${out}") list(SORT out) if("${out}" STREQUAL "${expected_out}") diff --git a/Tests/CTestUpdateCVS.cmake.in b/Tests/CTestUpdateCVS.cmake.in index 5389bdf..8e0b611 100644 --- a/Tests/CTestUpdateCVS.cmake.in +++ b/Tests/CTestUpdateCVS.cmake.in @@ -17,21 +17,11 @@ message("Using CVS tools:") set(CVS "@CVS_EXECUTABLE@") message(" cvs = ${CVS}") -set(REPO ${TOP}/repo) - -# The MSYS cvs tool interprets "c:/" as a "machine:" name for SSH. -# Detect the MSYS cvs and convert the repo path to an MSYS path. -if(WIN32) - if(EXISTS "${CVS}") - file(STRINGS "${CVS}" cvs_is_msys LIMIT_COUNT 1 REGEX "[Mm][Ss][Yy][Ss]") - if(cvs_is_msys) - message(" '${CVS}' is from MSYS (contains '${cvs_is_msys}')") - string(REGEX REPLACE "^([A-Za-z]):" "/\\1" REPO "${REPO}") - endif() - endif() -endif() +# Pre-pending :local: prevents cvs from trying to interpret Windows drive +# letters, like "C:", as host names. +set(REPO ":local:${TOP}/repo") -set(CVSCMD ${CVS} -d${REPO}) +set(CVSCMD ${CVS} -d "${REPO}") # CVSNT requires an extra option to 'cvs init'. set(CVS_INIT_OPT) diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt index 0838532..cff98e3 100644 --- a/Tests/CompileFeatures/CMakeLists.txt +++ b/Tests/CompileFeatures/CMakeLists.txt @@ -4,9 +4,12 @@ cmake_policy(SET CMP0057 NEW) project(CompileFeatures) +set(ext_C c) +set(ext_CXX cpp) + macro(run_test feature lang) if (${feature} IN_LIST CMAKE_${lang}_COMPILE_FEATURES) - add_library(test_${feature} OBJECT ${feature}) + add_library(test_${feature} OBJECT ${feature}.${ext_${lang}}) set_property(TARGET test_${feature} PROPERTY COMPILE_FEATURES "${feature}" ) @@ -15,7 +18,7 @@ macro(run_test feature lang) endif() endmacro() -if(NOT CMAKE_C_COMPILER_ID MATCHES "^(Cray|PGI|XL|XLClang)$") +if(NOT CMAKE_C_COMPILER_ID MATCHES "^(Cray|PGI|NVHPC|XL|XLClang|IntelLLVM)$") get_property(c_features GLOBAL PROPERTY CMAKE_C_KNOWN_FEATURES) list(FILTER c_features EXCLUDE REGEX "^c_std_[0-9][0-9]") foreach(feature ${c_features}) @@ -23,7 +26,7 @@ if(NOT CMAKE_C_COMPILER_ID MATCHES "^(Cray|PGI|XL|XLClang)$") endforeach() endif() -if(NOT CMAKE_CXX_COMPILER_ID MATCHES "^(Cray|PGI|XL|XLClang)$") +if(NOT CMAKE_CXX_COMPILER_ID MATCHES "^(Cray|PGI|NVHPC|XL|XLClang|IntelLLVM)$") get_property(cxx_features GLOBAL PROPERTY CMAKE_CXX_KNOWN_FEATURES) list(FILTER cxx_features EXCLUDE REGEX "^cxx_std_[0-9][0-9]") foreach(feature ${cxx_features}) diff --git a/Tests/ExternalProject/CMakeLists.txt b/Tests/ExternalProject/CMakeLists.txt index 132abf4..59e3bcc 100644 --- a/Tests/ExternalProject/CMakeLists.txt +++ b/Tests/ExternalProject/CMakeLists.txt @@ -161,7 +161,7 @@ if(do_cvs_tests) # set(proj TutorialStep1-CVS-20090626) ExternalProject_Add(${proj} - CVS_REPOSITORY "${local_cvs_repo}" + CVS_REPOSITORY ":local:${local_cvs_repo}" CVS_MODULE "TutorialStep1" CVS_TAG "-D2009-06-26 16:50:00 UTC" UPDATE_COMMAND "" @@ -176,7 +176,7 @@ if(do_cvs_tests) # set(proj TutorialStep1-CVS-testtag1) ExternalProject_Add(${proj} - CVS_REPOSITORY "${local_cvs_repo}" + CVS_REPOSITORY ":local:${local_cvs_repo}" CVS_MODULE "TutorialStep1" CVS_TAG -rtesttag1 UPDATE_COMMAND "" @@ -191,7 +191,7 @@ if(do_cvs_tests) # set(proj TutorialStep1-CVS-HEAD) ExternalProject_Add(${proj} - CVS_REPOSITORY "${local_cvs_repo}" + CVS_REPOSITORY ":local:${local_cvs_repo}" CVS_MODULE "TutorialStep1" CMAKE_GENERATOR "${CMAKE_GENERATOR}" CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> diff --git a/Tests/ExternalProjectUpdate/CMakeLists.txt b/Tests/ExternalProjectUpdate/CMakeLists.txt index b31a38b..6f8a7b1 100644 --- a/Tests/ExternalProjectUpdate/CMakeLists.txt +++ b/Tests/ExternalProjectUpdate/CMakeLists.txt @@ -2,6 +2,11 @@ cmake_minimum_required(VERSION 2.8.12) project(ExternalProjectUpdateTest NONE) if(CMAKE_XCODE_BUILD_SYSTEM VERSION_GREATER_EQUAL 12) cmake_policy(SET CMP0114 NEW) +else() + # This test is very noisy with warnings about this policy if we don't + # explicitly set it. Projects shouldn't do this, but for test code this + # is reasonable. + cmake_policy(SET CMP0114 OLD) endif() cmake_policy(GET CMP0114 cmp0114) diff --git a/Tests/ExternalProjectUpdate/ExternalProjectUpdateTest.cmake b/Tests/ExternalProjectUpdate/ExternalProjectUpdateTest.cmake index aaa05d7..394df87 100644 --- a/Tests/ExternalProjectUpdate/ExternalProjectUpdateTest.cmake +++ b/Tests/ExternalProjectUpdate/ExternalProjectUpdateTest.cmake @@ -185,7 +185,6 @@ if(do_git_tests) # 'git fetch' check_a_tag(tag1 d1970730310fe8bc07e73f15dc570071f9f9654a 0 REBASE) check_a_tag(tag2 5842b503ba4113976d9bb28d57b5aee1ad2736b7 1 REBASE) - check_a_tag(d19707303 d1970730310fe8bc07e73f15dc570071f9f9654a 1 REBASE) check_a_tag(d19707303 d1970730310fe8bc07e73f15dc570071f9f9654a 0 REBASE) check_a_tag(origin/master b5752a26ae448410926b35c275af3c192a53722e 1 REBASE) # This is a remote symbolic ref, so it will always trigger a 'git fetch' diff --git a/Tests/Fortran/CMakeLists.txt b/Tests/Fortran/CMakeLists.txt index 929fa4d..1868892 100644 --- a/Tests/Fortran/CMakeLists.txt +++ b/Tests/Fortran/CMakeLists.txt @@ -120,7 +120,7 @@ endfunction() # if the id's match or the compilers are compatible, then # call the test_fortran_c_interface_module function if("${CMAKE_Fortran_COMPILER_ID}:${CMAKE_C_COMPILER_ID}" MATCHES - "(Intel:MSVC|Absoft:GNU)" + "(Intel(LLVM)?:MSVC|Absoft:GNU)" OR ("${CMAKE_Fortran_COMPILER_ID}" STREQUAL "${CMAKE_C_COMPILER_ID}" )) test_fortran_c_interface_module() else() diff --git a/Tests/Fortran/myc.c b/Tests/Fortran/myc.c index efd9b68..1a4d5a4 100644 --- a/Tests/Fortran/myc.c +++ b/Tests/Fortran/myc.c @@ -1,6 +1,6 @@ #include "foo.h" -extern F_test_mod_sub(void); -extern F_mysub(void); +extern void F_test_mod_sub(void); +extern void F_mysub(void); int myc(void) { F_mysub(); diff --git a/Tests/FortranOnly/CMakeLists.txt b/Tests/FortranOnly/CMakeLists.txt index 637f581..b5b5e56 100644 --- a/Tests/FortranOnly/CMakeLists.txt +++ b/Tests/FortranOnly/CMakeLists.txt @@ -111,7 +111,7 @@ endif() # Test that with Intel Fortran we always compile with preprocessor # defines even if splitting the preprocessing and compilation steps. -if(CMAKE_Fortran_COMPILER_ID STREQUAL "Intel") +if(CMAKE_Fortran_COMPILER_ID MATCHES "Intel") add_executable(IntelIfDef IntelIfDef.f) set_property(TARGET IntelIfDef PROPERTY Fortran_FORMAT FIXED) target_compile_definitions(IntelIfDef PRIVATE SOME_DEF) @@ -146,13 +146,13 @@ set_property(SOURCE no_preprocess_source_lower.f PROPERTY Fortran_PREPROCESS OFF # Test that we can explicitly not preprocess a target or source. # This will not work on certain compilers due to either missing a # "don't preprocess" flag, or due to choice of file extension. -if(test_pp_flags AND NOT CMAKE_Fortran_COMPILER_ID MATCHES "(Flang|NAG|PGI|SunPro|XL)") +if(test_pp_flags AND NOT CMAKE_Fortran_COMPILER_ID MATCHES "(Flang|NAG|PGI|NVHPC|SunPro|XL)") add_library(no_preprocess_target STATIC no_preprocess_target_upper.F) target_compile_options(no_preprocess_target PRIVATE -DINTEGER=nonsense) add_library(no_preprocess_source STATIC no_preprocess_source_upper.F) target_compile_options(no_preprocess_source PRIVATE -DINTEGER=nonsense) if(NOT CMAKE_Fortran_COMPILER_ID STREQUAL "Cray" - AND NOT "${CMAKE_Fortran_COMPILER_ID};${CMAKE_Fortran_SIMULATE_ID}" STREQUAL "Intel;MSVC") + AND NOT "${CMAKE_Fortran_COMPILER_ID};${CMAKE_Fortran_SIMULATE_ID}" MATCHES "Intel(LLVM)?;MSVC") target_sources(no_preprocess_target PRIVATE no_preprocess_target_fpp.fpp) target_sources(no_preprocess_source PRIVATE no_preprocess_source_fpp.fpp) endif() diff --git a/Tests/MSVCRuntimeLibrary/Fortran/CMakeLists.txt b/Tests/MSVCRuntimeLibrary/Fortran/CMakeLists.txt index 27838a4..41bd6f5 100644 --- a/Tests/MSVCRuntimeLibrary/Fortran/CMakeLists.txt +++ b/Tests/MSVCRuntimeLibrary/Fortran/CMakeLists.txt @@ -6,8 +6,9 @@ foreach(t MultiThreaded SingleThreaded) foreach(dbg "" Debug) foreach(dll "" DLL) set(var "CMAKE_Fortran_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_${t}${dbg}${dll}") - if(CMAKE_Fortran_COMPILER_ID STREQUAL "Intel") - # ifort does not actually define these, so inject them + if(CMAKE_Fortran_COMPILER_ID STREQUAL "Intel" + OR CMAKE_Fortran_COMPILER_ID STREQUAL "IntelLLVM") + # ifort and ifx do not actually define these, so inject them string(REPLACE "-threads" "-threads;-D_MT" "${var}" "${${var}}") string(REPLACE "-dbglibs" "-dbglibs;-D_DEBUG" "${var}" "${${var}}") elseif(CMAKE_Fortran_COMPILER_ID STREQUAL "Flang") diff --git a/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt b/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt index cffef5a..0cf74bf 100644 --- a/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt +++ b/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt @@ -52,7 +52,7 @@ endmacro() # detailed features tables, not just meta-features if (CMAKE_C_COMPILE_FEATURES) - if(NOT CMAKE_C_COMPILER_ID MATCHES "^(Cray|PGI|XL|XLClang)$") + if(NOT CMAKE_C_COMPILER_ID MATCHES "^(Cray|PGI|NVHPC|XL|XLClang|IntelLLVM)$") set(C_expected_features ${CMAKE_C_COMPILE_FEATURES}) list(FILTER C_expected_features EXCLUDE REGEX "^c_std_[0-9][0-9]") endif() @@ -95,7 +95,7 @@ if (C_expected_features) endif() if (CMAKE_CXX_COMPILE_FEATURES) - if(NOT CMAKE_CXX_COMPILER_ID MATCHES "^(Cray|PGI|XL|XLClang)$") + if(NOT CMAKE_CXX_COMPILER_ID MATCHES "^(Cray|PGI|NVHPC|XL|XLClang|IntelLLVM)$") set(CXX_expected_features ${CMAKE_CXX_COMPILE_FEATURES}) list(FILTER CXX_expected_features EXCLUDE REGEX "^cxx_std_[0-9][0-9]") endif() diff --git a/Tests/PDBDirectoryAndName/CMakeLists.txt b/Tests/PDBDirectoryAndName/CMakeLists.txt index 95aa351..5aa2459 100644 --- a/Tests/PDBDirectoryAndName/CMakeLists.txt +++ b/Tests/PDBDirectoryAndName/CMakeLists.txt @@ -9,8 +9,9 @@ endif() # Intel 11.1 does not support /Fd but Intel 14.0 does. # TODO: Did a version in between these add it? -if(CMAKE_C_COMPILER_ID STREQUAL Intel AND - CMAKE_C_COMPILER_VERSION VERSION_LESS 14.0) +if((CMAKE_C_COMPILER_ID STREQUAL Intel AND + CMAKE_C_COMPILER_VERSION VERSION_LESS 14.0) OR + CMAKE_C_COMPILER_ID STREQUAL "IntelLLVM") set(NO_COMPILE_PDB 1) endif() diff --git a/Tests/Preprocess/CMakeLists.txt b/Tests/Preprocess/CMakeLists.txt index bce1b3f..bf2af64 100644 --- a/Tests/Preprocess/CMakeLists.txt +++ b/Tests/Preprocess/CMakeLists.txt @@ -147,8 +147,13 @@ endif() # - NMake is okay with just \\\" # - The XL compiler does not re-escape \\\" when launching an # internal tool to do preprocessing . +# - The IntelLLVM C and C++ compiler drivers do not re-escape the \\\" when +# launching the underlying compiler. FIXME: this bug is expected to be fixed +# in a future release. if((PP_NMAKE OR PP_UMAKE) AND - NOT CMAKE_C_COMPILER_ID STREQUAL "XL") + NOT CMAKE_C_COMPILER_ID STREQUAL "XL" AND + NOT CMAKE_C_COMPILER_ID STREQUAL "IntelLLVM" AND + NOT CMAKE_CXX_COMPILER_ID STREQUAL "IntelLLVM") string(APPEND STRING_EXTRA "\\\"") endif() diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index bd08dd9..323306a 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -268,7 +268,7 @@ add_RunCMake_test(Graphviz) add_RunCMake_test(TargetPropertyGeneratorExpressions) add_RunCMake_test(Languages) add_RunCMake_test(LinkStatic) -if(CMAKE_CXX_COMPILER_ID MATCHES "^(Cray|PGI|XL|XLClang)$") +if(CMAKE_CXX_COMPILER_ID MATCHES "^(Cray|PGI|NVHPC|XL|XLClang)$") add_RunCMake_test(MetaCompileFeatures) endif() if(MSVC) diff --git a/Tests/RunCMake/CPack/VerifyResult.cmake b/Tests/RunCMake/CPack/VerifyResult.cmake index 345b37f..0ab545a 100644 --- a/Tests/RunCMake/CPack/VerifyResult.cmake +++ b/Tests/RunCMake/CPack/VerifyResult.cmake @@ -79,6 +79,11 @@ if(NOT EXPECTED_FILES_COUNT EQUAL 0) "which does not match:${msg_expected}\n" "${output_error_message}") endif() + elseif(foundFilescount_ EQUAL 0) + message(FATAL_ERROR + "Found no files for file No. '${file_no_}'!" + " Globbing expression: '${EXPECTED_FILE_${file_no_}}'" + "${output_error_message}") else() message(FATAL_ERROR "Found more than one file for file No. '${file_no_}'!" diff --git a/Tests/RunCMake/CPack/tests/DEBUGINFO/test.cmake b/Tests/RunCMake/CPack/tests/DEBUGINFO/test.cmake index d270005..9ff1f8a 100644 --- a/Tests/RunCMake/CPack/tests/DEBUGINFO/test.cmake +++ b/Tests/RunCMake/CPack/tests/DEBUGINFO/test.cmake @@ -1,7 +1,7 @@ set(CMAKE_BUILD_WITH_INSTALL_RPATH 1) -# PGI compiler doesn't add build id to binaries by default -if(CMAKE_CXX_COMPILER_ID STREQUAL "PGI") +# Some compilers do not add build id to binaries by default. +if(CMAKE_CXX_COMPILER_ID MATCHES "^(IntelLLVM|PGI|NVHPC)$") string(APPEND CMAKE_EXE_LINKER_FLAGS "-Wl,--build-id") string(APPEND CMAKE_SHARED_LINKER_FLAGS "-Wl,--build-id") endif() diff --git a/Tests/RunCMake/DependencyGraph/RunCMakeTest.cmake b/Tests/RunCMake/DependencyGraph/RunCMakeTest.cmake index cb0d541..891e138 100644 --- a/Tests/RunCMake/DependencyGraph/RunCMakeTest.cmake +++ b/Tests/RunCMake/DependencyGraph/RunCMakeTest.cmake @@ -10,7 +10,8 @@ function(check_files dir) set(actual) foreach(i IN LISTS glob) if(NOT i MATCHES "(\\.manifest$)|(\\.exp$)|(\\.tds$)") - list(APPEND actual ${i}) + get_filename_component(real_path ${i} REALPATH) + list(APPEND actual ${real_path}) endif() endforeach() list(REMOVE_DUPLICATES actual) diff --git a/Tests/RunCMake/ExternalProject/FetchGitTags.cmake b/Tests/RunCMake/ExternalProject/FetchGitTags.cmake new file mode 100644 index 0000000..37d1b40 --- /dev/null +++ b/Tests/RunCMake/ExternalProject/FetchGitTags.cmake @@ -0,0 +1,67 @@ +find_package(Git QUIET REQUIRED) + +include(ExternalProject) + +set(srcRepo ${CMAKE_CURRENT_BINARY_DIR}/srcRepo) +set(srcDir ${CMAKE_CURRENT_BINARY_DIR}/src) +set(binDir ${CMAKE_CURRENT_BINARY_DIR}/build) +file(MAKE_DIRECTORY ${srcRepo}) +file(MAKE_DIRECTORY ${srcDir}) + +file(GLOB entries ${srcRepo}/*) +file(REMOVE_RECURSE ${entries} ${binDir}) +file(TOUCH ${srcRepo}/firstFile.txt) +configure_file(${CMAKE_CURRENT_LIST_DIR}/FetchGitTags/CMakeLists.txt + ${srcDir}/CMakeLists.txt COPYONLY) + +function(execGitCommand) + execute_process( + WORKING_DIRECTORY ${srcRepo} + COMMAND ${GIT_EXECUTABLE} ${ARGN} + COMMAND_ECHO STDOUT + COMMAND_ERROR_IS_FATAL ANY + ) +endfunction() + +function(configureAndBuild tag) + execute_process(COMMAND ${CMAKE_COMMAND} + -G ${CMAKE_GENERATOR} -T "${CMAKE_GENERATOR_TOOLSET}" + -A "${CMAKE_GENERATOR_PLATFORM}" + -D repoDir:PATH=${srcRepo} + -D gitTag:STRING=${tag} + -B ${binDir} + -S ${srcDir} + COMMAND_ECHO STDOUT + COMMAND_ERROR_IS_FATAL ANY + ) + + execute_process(COMMAND ${CMAKE_COMMAND} --build ${binDir} --target fetcher + WORKING_DIRECTORY ${binDir} + COMMAND_ECHO STDOUT + COMMAND_ERROR_IS_FATAL ANY + ) +endfunction() + +# Setup a fresh source repo with a predictable default branch across all +# git versions +execGitCommand(-c init.defaultBranch=master init) +execGitCommand(config --add user.email "testauthor@cmake.org") +execGitCommand(config --add user.name testauthor) + +# Create the initial repo structure +execGitCommand(add firstFile.txt) +execGitCommand(commit -m "First file") + +message(STATUS "First configure-and-build") +configureAndBuild(master) + +# Create a tagged commit that is not on any branch. With git 2.20 or later, +# this commit won't be fetched without the --tags option. +file(TOUCH ${srcRepo}/secondFile.txt) +execGitCommand(add secondFile.txt) +execGitCommand(commit -m "Second file") +execGitCommand(tag -a -m "Adding tag" tag_of_interest) +execGitCommand(reset --hard HEAD~1) + +message(STATUS "Second configure-and-build") +configureAndBuild(tag_of_interest) diff --git a/Tests/RunCMake/ExternalProject/FetchGitTags/CMakeLists.txt b/Tests/RunCMake/ExternalProject/FetchGitTags/CMakeLists.txt new file mode 100644 index 0000000..d9a380c --- /dev/null +++ b/Tests/RunCMake/ExternalProject/FetchGitTags/CMakeLists.txt @@ -0,0 +1,15 @@ +cmake_minimum_required(VERSION 3.19) +project(FetchTags LANGUAGES NONE) + +include(ExternalProject) + +# repoDir and gitTag are expected to be set as cache variables + +ExternalProject_Add(fetcher + GIT_REPOSITORY ${repoDir} + GIT_TAG ${gitTag} + GIT_REMOTE_UPDATE_STRATEGY CHECKOUT + CONFIGURE_COMMAND "" + BUILD_COMMAND "" + INSTALL_COMMAND "" +) diff --git a/Tests/RunCMake/ExternalProject/RunCMakeTest.cmake b/Tests/RunCMake/ExternalProject/RunCMakeTest.cmake index 22b8d24..976655a 100644 --- a/Tests/RunCMake/ExternalProject/RunCMakeTest.cmake +++ b/Tests/RunCMake/ExternalProject/RunCMakeTest.cmake @@ -181,3 +181,12 @@ endfunction() if(NOT RunCMake_GENERATOR MATCHES "Visual Studio 9 ") __ep_test_CONFIGURE_HANDLED_BY_BUILD() endif() + +find_package(Git QUIET) +if(GIT_EXECUTABLE) + # Note that there appear to be differences in where git writes its output to + # on some platforms. It may go to stdout or stderr, so force it to be merged. + set(RunCMake_TEST_OUTPUT_MERGE TRUE) + run_cmake(FetchGitTags) + set(RunCMake_TEST_OUTPUT_MERGE FALSE) +endif() diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-check.py b/Tests/RunCMake/FileAPI/codemodel-v2-check.py index c66757f..df2410a 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-check.py +++ b/Tests/RunCMake/FileAPI/codemodel-v2-check.py @@ -608,7 +608,7 @@ def gen_check_targets(c, g, inSource): read_codemodel_json_data("targets/generated_exe.json"), ] - if cxx_compiler_id in ['Clang', 'AppleClang', 'GNU', 'Intel', 'MSVC', 'Embarcadero'] and g["name"] != "Xcode": + if cxx_compiler_id in ['Clang', 'AppleClang', 'GNU', 'Intel', 'IntelLLVM', 'MSVC', 'Embarcadero'] and g["name"] != "Xcode": for e in expected: if e["name"] == "cxx_exe": if matches(g["name"], "^(Visual Studio |Ninja Multi-Config)"): diff --git a/Tests/RunCMake/GenerateExportHeader/GEH.cmake b/Tests/RunCMake/GenerateExportHeader/GEH.cmake index ae9a84c..431d1ce 100644 --- a/Tests/RunCMake/GenerateExportHeader/GEH.cmake +++ b/Tests/RunCMake/GenerateExportHeader/GEH.cmake @@ -103,7 +103,7 @@ add_executable(GenerateExportHeader exportheader_test.cpp) target_link_libraries(GenerateExportHeader ${link_libraries}) if (WIN32 OR CYGWIN) - if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND + if((CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "IntelLLVM") AND CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC") set(_platform Win32-Clang) elseif(MSVC AND COMPILER_HAS_DEPRECATED) diff --git a/Utilities/Release/linux/aarch64/Dockerfile b/Utilities/Release/linux/aarch64/Dockerfile index fe9b02c..9abae2a 100644 --- a/Utilities/Release/linux/aarch64/Dockerfile +++ b/Utilities/Release/linux/aarch64/Dockerfile @@ -5,7 +5,7 @@ # Build using the CMake source directory as the build context. # The resulting image will have an '/out' directory containing the package. -# Keep this in sync with the `.gitlab-ci.yml` `release_linux` image. +# Keep this in sync with the `.gitlab/os-linux.yml` `.linux_release_aarch64` image. ARG FROM_IMAGE_NAME=kitware/cmake:build-linux-aarch64-deps-2020-12-21 ARG FROM_IMAGE_DIGEST=@sha256:0bd7dfe4e45593b04e39cd21e44011034610cfd376900558c5ef959bb1af15af ARG FROM_IMAGE=$FROM_IMAGE_NAME$FROM_IMAGE_DIGEST diff --git a/Utilities/Release/linux/x86_64/Dockerfile b/Utilities/Release/linux/x86_64/Dockerfile index b448108..8c98d3e 100644 --- a/Utilities/Release/linux/x86_64/Dockerfile +++ b/Utilities/Release/linux/x86_64/Dockerfile @@ -5,7 +5,7 @@ # Build using the CMake source directory as the build context. # The resulting image will have an '/out' directory containing the package. -# Keep this in sync with the `.gitlab-ci.yml` `release_linux` image. +# Keep this in sync with the `.gitlab/os-linux.yml` `.linux_release_x86_64` image. ARG FROM_IMAGE_NAME=kitware/cmake:build-linux-x86_64-deps-2020-04-02 ARG FROM_IMAGE_DIGEST=@sha256:77e9ab183f34680990db9da5945473e288f0d6556bce79ecc1589670d656e157 ARG FROM_IMAGE=$FROM_IMAGE_NAME$FROM_IMAGE_DIGEST diff --git a/Utilities/cmbzip2/CMakeLists.txt b/Utilities/cmbzip2/CMakeLists.txt index cb4a038..9b53b0f 100644 --- a/Utilities/cmbzip2/CMakeLists.txt +++ b/Utilities/cmbzip2/CMakeLists.txt @@ -2,7 +2,7 @@ project(bzip2) # Disable warnings to avoid changing 3rd party code. if(CMAKE_C_COMPILER_ID MATCHES - "^(GNU|Clang|AppleClang|XLClang|XL|VisualAge|SunPro|HP|Intel)$") + "^(GNU|Clang|AppleClang|XLClang|XL|VisualAge|SunPro|HP|Intel|IntelLLVM)$") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w") elseif(CMAKE_C_COMPILER_ID STREQUAL "PathScale") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -woffall") diff --git a/Utilities/cmcurl/CMakeLists.txt b/Utilities/cmcurl/CMakeLists.txt index ecdf3af..327c829 100644 --- a/Utilities/cmcurl/CMakeLists.txt +++ b/Utilities/cmcurl/CMakeLists.txt @@ -95,7 +95,7 @@ endif(APPLE) # Disable warnings to avoid changing 3rd party code. if(CMAKE_C_COMPILER_ID MATCHES - "^(GNU|Clang|AppleClang|XLClang|XL|VisualAge|SunPro|HP|Intel)$") + "^(GNU|Clang|AppleClang|XLClang|XL|VisualAge|SunPro|HP|Intel|IntelLLVM)$") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w") elseif(CMAKE_C_COMPILER_ID STREQUAL "PathScale") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -woffall") diff --git a/Utilities/cmexpat/CMakeLists.txt b/Utilities/cmexpat/CMakeLists.txt index cf31556..b8dc4e8 100644 --- a/Utilities/cmexpat/CMakeLists.txt +++ b/Utilities/cmexpat/CMakeLists.txt @@ -1,6 +1,6 @@ # Disable warnings to avoid changing 3rd party code. IF(CMAKE_C_COMPILER_ID MATCHES - "^(GNU|Clang|AppleClang|XLClang|XL|VisualAge|SunPro|HP|Intel)$") + "^(GNU|Clang|AppleClang|XLClang|XL|VisualAge|SunPro|HP|Intel|IntelLLVM)$") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w") ELSEIF(CMAKE_C_COMPILER_ID STREQUAL "PathScale") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -woffall") diff --git a/Utilities/cmjsoncpp/CMakeLists.txt b/Utilities/cmjsoncpp/CMakeLists.txt index 764be8d..74e9988 100644 --- a/Utilities/cmjsoncpp/CMakeLists.txt +++ b/Utilities/cmjsoncpp/CMakeLists.txt @@ -2,7 +2,7 @@ project(JsonCpp CXX) # Disable warnings to avoid changing 3rd party code. if(CMAKE_CXX_COMPILER_ID MATCHES - "^(GNU|Clang|AppleClang|XLClang|XL|VisualAge|SunPro|HP|Intel)$") + "^(GNU|Clang|AppleClang|XLClang|XL|VisualAge|SunPro|HP|Intel|IntelLLVM)$") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w") elseif(CMAKE_CXX_COMPILER_ID STREQUAL "PathScale") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -woffall") diff --git a/Utilities/cmlibarchive/CMakeLists.txt b/Utilities/cmlibarchive/CMakeLists.txt index 6d6c1fb..689d98a 100644 --- a/Utilities/cmlibarchive/CMakeLists.txt +++ b/Utilities/cmlibarchive/CMakeLists.txt @@ -94,7 +94,7 @@ SET(CMAKE_REQUIRED_FLAGS) # Disable warnings to avoid changing 3rd party code. IF(CMAKE_C_COMPILER_ID MATCHES - "^(GNU|Clang|AppleClang|XLClang|XL|VisualAge|SunPro|HP|Intel)$") + "^(GNU|Clang|AppleClang|XLClang|XL|VisualAge|SunPro|HP|Intel|IntelLLVM)$") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w") ELSEIF(CMAKE_C_COMPILER_ID STREQUAL "PathScale") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -woffall") diff --git a/Utilities/cmliblzma/CMakeLists.txt b/Utilities/cmliblzma/CMakeLists.txt index 6b6fae6..32a14dc 100644 --- a/Utilities/cmliblzma/CMakeLists.txt +++ b/Utilities/cmliblzma/CMakeLists.txt @@ -148,7 +148,7 @@ INCLUDE_DIRECTORIES( # Disable warnings to avoid changing 3rd party code. IF(CMAKE_C_COMPILER_ID MATCHES - "^(GNU|Clang|AppleClang|XLClang|XL|VisualAge|SunPro|HP|Intel)$") + "^(GNU|Clang|AppleClang|XLClang|XL|VisualAge|SunPro|HP|Intel|IntelLLVM)$") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w") ELSEIF(CMAKE_C_COMPILER_ID STREQUAL "PathScale") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -woffall") diff --git a/Utilities/cmlibrhash/CMakeLists.txt b/Utilities/cmlibrhash/CMakeLists.txt index 1b025fc..37e2399 100644 --- a/Utilities/cmlibrhash/CMakeLists.txt +++ b/Utilities/cmlibrhash/CMakeLists.txt @@ -2,7 +2,7 @@ project(librhash C) # Disable warnings to avoid changing 3rd party code. if(CMAKE_C_COMPILER_ID MATCHES - "^(GNU|Clang|AppleClang|XLClang|XL|VisualAge|SunPro|HP|Intel)$") + "^(GNU|Clang|AppleClang|XLClang|XL|VisualAge|SunPro|HP|Intel|IntelLLVM)$") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w") elseif(CMAKE_C_COMPILER_ID STREQUAL "PathScale") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -woffall") diff --git a/Utilities/cmlibuv/CMakeLists.txt b/Utilities/cmlibuv/CMakeLists.txt index 92d2411..f8b47af 100644 --- a/Utilities/cmlibuv/CMakeLists.txt +++ b/Utilities/cmlibuv/CMakeLists.txt @@ -2,7 +2,7 @@ project(libuv C) # Disable warnings to avoid changing 3rd party code. if(CMAKE_C_COMPILER_ID MATCHES - "^(GNU|Clang|AppleClang|XLClang|XL|VisualAge|SunPro|HP|Intel)$") + "^(GNU|Clang|AppleClang|XLClang|XL|VisualAge|SunPro|HP|Intel|IntelLLVM)$") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w") elseif(CMAKE_C_COMPILER_ID STREQUAL "PathScale") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -woffall") diff --git a/Utilities/cmnghttp2/CMakeLists.txt b/Utilities/cmnghttp2/CMakeLists.txt index 3a11ace..17cc6dd 100644 --- a/Utilities/cmnghttp2/CMakeLists.txt +++ b/Utilities/cmnghttp2/CMakeLists.txt @@ -1,6 +1,6 @@ # Disable warnings to avoid changing 3rd party code. if(CMAKE_C_COMPILER_ID MATCHES - "^(GNU|Clang|AppleClang|XLClang|XL|VisualAge|SunPro|HP|Intel)$") + "^(GNU|Clang|AppleClang|XLClang|XL|VisualAge|SunPro|HP|Intel|IntelLLVM)$") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w") elseif(CMAKE_C_COMPILER_ID STREQUAL "PathScale") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -woffall") diff --git a/Utilities/cmzlib/CMakeLists.txt b/Utilities/cmzlib/CMakeLists.txt index 0584c55..d266af9 100644 --- a/Utilities/cmzlib/CMakeLists.txt +++ b/Utilities/cmzlib/CMakeLists.txt @@ -2,7 +2,7 @@ PROJECT(CMZLIB) # Disable warnings to avoid changing 3rd party code. if(CMAKE_C_COMPILER_ID MATCHES - "^(GNU|Clang|AppleClang|XLClang|XL|VisualAge|SunPro|HP|Intel)$") + "^(GNU|Clang|AppleClang|XLClang|XL|VisualAge|SunPro|HP|Intel|IntelLLVM)$") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w") elseif(CMAKE_C_COMPILER_ID STREQUAL "PathScale") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -woffall") diff --git a/Utilities/cmzstd/CMakeLists.txt b/Utilities/cmzstd/CMakeLists.txt index 4f4f91f..323151c 100644 --- a/Utilities/cmzstd/CMakeLists.txt +++ b/Utilities/cmzstd/CMakeLists.txt @@ -2,7 +2,7 @@ project(zstd C) # Disable warnings to avoid changing 3rd party code. if(CMAKE_C_COMPILER_ID MATCHES - "^(GNU|Clang|AppleClang|XLClang|XL|VisualAge|SunPro|HP|Intel)$") + "^(GNU|Clang|AppleClang|XLClang|XL|VisualAge|SunPro|HP|Intel|IntelLLVM)$") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w") elseif(CMAKE_C_COMPILER_ID STREQUAL "PathScale") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -woffall") |