diff --git a/.gitignore b/.gitignore index c89ecb7..179afe5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,24 @@ -*.pyc +# User content belongs under recipe/. +# Feedstock configuration goes in `conda-forge.yml` +# Everything else is managed by the conda-smithy rerender process. +# Please do not modify + +# Ignore all files and folders in root +* +!/conda-forge.yml + +# Don't ignore any files/folders if the parent folder is 'un-ignored' +# This also avoids warnings when adding an already-checked file with an ignored parent. +!/**/ +# Don't ignore any files/folders recursively in the following folders +!/recipe/** +!/.ci_support/** -build_artifacts +# Since we ignore files/folders recursively, any folders inside +# build_artifacts gets ignored which trips some build systems. +# To avoid that we 'un-ignore' all files/folders recursively +# and only ignore the root build_artifacts folder. +!/build_artifacts/** +/build_artifacts + +*.pyc diff --git a/.scripts/build_steps.sh b/.scripts/build_steps.sh index eba1dfd..9121002 100755 --- a/.scripts/build_steps.sh +++ b/.scripts/build_steps.sh @@ -34,9 +34,9 @@ CONDARC export CONDA_LIBMAMBA_SOLVER_NO_CHANNELS_FROM_INSTALLED=1 mamba install --update-specs --yes --quiet --channel conda-forge --strict-channel-priority \ - pip mamba conda-build boa conda-forge-ci-setup=4 + pip mamba conda-build conda-forge-ci-setup=4 "conda-build>=24.1" mamba update --update-specs --yes --quiet --channel conda-forge --strict-channel-priority \ - pip mamba conda-build boa conda-forge-ci-setup=4 + pip mamba conda-build conda-forge-ci-setup=4 "conda-build>=24.1" # set up the condarc setup_conda_rc "${FEEDSTOCK_ROOT}" "${RECIPE_ROOT}" "${CONFIG_FILE}" @@ -57,12 +57,6 @@ if [[ -f "${FEEDSTOCK_ROOT}/LICENSE.txt" ]]; then cp "${FEEDSTOCK_ROOT}/LICENSE.txt" "${RECIPE_ROOT}/recipe-scripts-license.txt" fi -if [[ "${sha:-}" == "" ]]; then - pushd ${FEEDSTOCK_ROOT} - sha=$(git rev-parse HEAD) - popd -fi - if [[ "${BUILD_WITH_CONDA_DEBUG:-0}" == 1 ]]; then if [[ "x${BUILD_OUTPUT_ID:-}" != "x" ]]; then EXTRA_CB_OPTIONS="${EXTRA_CB_OPTIONS:-} --output-id ${BUILD_OUTPUT_ID}" @@ -74,7 +68,7 @@ if [[ "${BUILD_WITH_CONDA_DEBUG:-0}" == 1 ]]; then # Drop into an interactive shell /bin/bash else - conda mambabuild "${RECIPE_ROOT}" -m "${CI_SUPPORT}/${CONFIG}.yaml" \ + conda build "${RECIPE_ROOT}" -m "${CI_SUPPORT}/${CONFIG}.yaml" \ --suppress-variables ${EXTRA_CB_OPTIONS:-} \ --clobber-file "${CI_SUPPORT}/clobber_${CONFIG}.yaml" \ --extra-meta flow_run_id="${flow_run_id:-}" remote_url="${remote_url:-}" sha="${sha:-}" diff --git a/.scripts/run_docker_build.sh b/.scripts/run_docker_build.sh index b70ef01..00f377a 100755 --- a/.scripts/run_docker_build.sh +++ b/.scripts/run_docker_build.sh @@ -21,6 +21,12 @@ if [ -z ${FEEDSTOCK_NAME} ]; then export FEEDSTOCK_NAME=$(basename ${FEEDSTOCK_ROOT}) fi +if [[ "${sha:-}" == "" ]]; then + pushd "${FEEDSTOCK_ROOT}" + sha=$(git rev-parse HEAD) + popd +fi + docker info # In order for the conda-build process in the container to write to the mounted diff --git a/.scripts/run_osx_build.sh b/.scripts/run_osx_build.sh index 9259eb9..16daa69 100755 --- a/.scripts/run_osx_build.sh +++ b/.scripts/run_osx_build.sh @@ -26,9 +26,9 @@ export CONDA_SOLVER="libmamba" export CONDA_LIBMAMBA_SOLVER_NO_CHANNELS_FROM_INSTALLED=1 mamba install --update-specs --quiet --yes --channel conda-forge --strict-channel-priority \ - pip mamba conda-build boa conda-forge-ci-setup=4 + pip mamba conda-build conda-forge-ci-setup=4 "conda-build>=24.1" mamba update --update-specs --yes --quiet --channel conda-forge --strict-channel-priority \ - pip mamba conda-build boa conda-forge-ci-setup=4 + pip mamba conda-build conda-forge-ci-setup=4 "conda-build>=24.1" @@ -81,7 +81,7 @@ else EXTRA_CB_OPTIONS="${EXTRA_CB_OPTIONS:-} --no-test" fi - conda mambabuild ./recipe -m ./.ci_support/${CONFIG}.yaml \ + conda build ./recipe -m ./.ci_support/${CONFIG}.yaml \ --suppress-variables ${EXTRA_CB_OPTIONS:-} \ --clobber-file ./.ci_support/clobber_${CONFIG}.yaml \ --extra-meta flow_run_id="$flow_run_id" remote_url="$remote_url" sha="$sha" diff --git a/.scripts/run_win_build.bat b/.scripts/run_win_build.bat index 7d2fdd6..f801cf4 100755 --- a/.scripts/run_win_build.bat +++ b/.scripts/run_win_build.bat @@ -24,7 +24,7 @@ set "CONDA_LIBMAMBA_SOLVER_NO_CHANNELS_FROM_INSTALLED=1" :: Provision the necessary dependencies to build the recipe later echo Installing dependencies -mamba.exe install "python=3.10" pip mamba conda-build boa conda-forge-ci-setup=4 -c conda-forge --strict-channel-priority --yes +mamba.exe install "python=3.10" pip mamba conda-build conda-forge-ci-setup=4 "conda-build>=24.1" -c conda-forge --strict-channel-priority --yes if !errorlevel! neq 0 exit /b !errorlevel! :: Set basic configuration @@ -42,7 +42,9 @@ if EXIST LICENSE.txt ( copy LICENSE.txt "recipe\\recipe-scripts-license.txt" ) if NOT [%HOST_PLATFORM%] == [%BUILD_PLATFORM%] ( - set "EXTRA_CB_OPTIONS=%EXTRA_CB_OPTIONS% --no-test" + if [%CROSSCOMPILING_EMULATOR%] == [] ( + set "EXTRA_CB_OPTIONS=%EXTRA_CB_OPTIONS% --no-test" + ) ) if NOT [%flow_run_id%] == [] ( @@ -53,7 +55,7 @@ call :end_group :: Build the recipe echo Building recipe -conda.exe mambabuild "recipe" -m .ci_support\%CONFIG%.yaml --suppress-variables %EXTRA_CB_OPTIONS% +conda.exe build "recipe" -m .ci_support\%CONFIG%.yaml --suppress-variables %EXTRA_CB_OPTIONS% if !errorlevel! neq 0 exit /b !errorlevel! :: Prepare some environment variables for the upload step diff --git a/build-locally.py b/build-locally.py index 3f4b7a7..e0d408d 100755 --- a/build-locally.py +++ b/build-locally.py @@ -64,8 +64,9 @@ def verify_config(ns): elif ns.config.startswith("osx"): if "OSX_SDK_DIR" not in os.environ: raise RuntimeError( - "Need OSX_SDK_DIR env variable set. Run 'export OSX_SDK_DIR=SDKs' " - "to download the SDK automatically to 'SDKs/MacOSX.sdk'. " + "Need OSX_SDK_DIR env variable set. Run 'export OSX_SDK_DIR=$PWD/SDKs' " + "to download the SDK automatically to '$PWD/SDKs/MacOSX.sdk'. " + "Note: OSX_SDK_DIR must be set to an absolute path. " "Setting this variable implies agreement to the licensing terms of the SDK by Apple." ) diff --git a/recipe/build-llvm-openmp.sh b/recipe/build-llvm-openmp.sh index bc76432..44dccd0 100644 --- a/recipe/build-llvm-openmp.sh +++ b/recipe/build-llvm-openmp.sh @@ -42,6 +42,8 @@ fi if [[ "${PKG_VERSION}" == *rc* ]]; then export PKG_VERSION=${PKG_VERSION::${#PKG_VERSION}-4} fi +# used in patch to construct path to libclang_rt.builtins +export PKG_VERSION_MAJOR=$(echo ${PKG_VERSION} | cut -d "." -f1) cmake -G Ninja \ ${CMAKE_ARGS} \ diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 073d948..831173e 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -1,4 +1,4 @@ -{% set version = "17.0.6" %} +{% set version = "18.1.1" %} # check https://clang.llvm.org/docs/OpenMPSupport.html # occasionally to see last fully supported openmp ver. {% set openmp_ver = "4.5" %} @@ -9,11 +9,16 @@ package: source: url: https://github.com/llvm/llvm-project/releases/download/llvmorg-{{ version.replace(".rc", "-rc") }}/llvm-project-{{ version.replace(".rc", "rc") }}.src.tar.xz - sha256: 58a8818c60e6627064f312dbf46c02d9949956558340938b71cf731ad8bc0813 + sha256: 8f34c6206be84b186b4b31f47e1b52758fa38348565953fad453d177ef34c0ad # name folder for easier deletion; we do the equivalent of downloading # the subproject sources, so the work folder then has openmp in it; # for details see build scripts folder: llvm-project + patches: + # backport https://github.com/llvm/llvm-project/pull/80174 + - patches/0001-openmp-On-Windows-fix-standalone-cmake-build.patch + # intermediate fix for https://github.com/llvm/llvm-project/issues/54596 + - patches/0002-link-libomp-to-compiler-rt-on-osx-arm.patch build: number: 0 @@ -43,6 +48,8 @@ outputs: - llvmdev {{ version }}|{{ version }}.* - zlib # [linux] - zstd # [linux] + # see https://github.com/llvm/llvm-project/issues/54596 + - compiler-rt # [osx and arm64] run_constrained: - openmp {{ version }}|{{ version }}.* test: diff --git a/recipe/patches/0001-openmp-On-Windows-fix-standalone-cmake-build.patch b/recipe/patches/0001-openmp-On-Windows-fix-standalone-cmake-build.patch new file mode 100644 index 0000000..32a13d2 --- /dev/null +++ b/recipe/patches/0001-openmp-On-Windows-fix-standalone-cmake-build.patch @@ -0,0 +1,29 @@ +From c553881877d57c30693ede93684851210ea78d30 Mon Sep 17 00:00:00 2001 +From: Alexandre Ganea +Date: Wed, 31 Jan 2024 13:22:19 -0500 +Subject: [PATCH 1/2] [openmp] On Windows, fix standalone cmake build + +This fixes: https://github.com/llvm/llvm-project/issues/80117 +--- + openmp/cmake/HandleOpenMPOptions.cmake | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/openmp/cmake/HandleOpenMPOptions.cmake b/openmp/cmake/HandleOpenMPOptions.cmake +index 201aeabbd3df..71346201129b 100644 +--- a/openmp/cmake/HandleOpenMPOptions.cmake ++++ b/openmp/cmake/HandleOpenMPOptions.cmake +@@ -9,6 +9,14 @@ if (NOT COMMAND append_if) + endfunction() + endif() + ++if (NOT COMMAND append) ++ function(append value) ++ foreach(variable ${ARGN}) ++ set(${variable} "${${variable}} ${value}" PARENT_SCOPE) ++ endforeach(variable) ++ endfunction() ++endif() ++ + # MSVC and clang-cl in compatibility mode map -Wall to -Weverything. + # TODO: LLVM adds /W4 instead, check if that works for the OpenMP runtimes. + if (NOT MSVC) diff --git a/recipe/patches/0002-link-libomp-to-compiler-rt-on-osx-arm.patch b/recipe/patches/0002-link-libomp-to-compiler-rt-on-osx-arm.patch new file mode 100644 index 0000000..7272850 --- /dev/null +++ b/recipe/patches/0002-link-libomp-to-compiler-rt-on-osx-arm.patch @@ -0,0 +1,26 @@ +From 9fd9c8c26219bf8995321b7786e853d6c51e1dc8 Mon Sep 17 00:00:00 2001 +From: "H. Vetinari" +Date: Thu, 1 Feb 2024 12:29:07 +0100 +Subject: [PATCH 2/2] link libomp to compiler-rt on osx-arm + +--- + openmp/runtime/src/CMakeLists.txt | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/openmp/runtime/src/CMakeLists.txt b/openmp/runtime/src/CMakeLists.txt +index 619d4f7ba458..11d9c969e381 100644 +--- a/openmp/runtime/src/CMakeLists.txt ++++ b/openmp/runtime/src/CMakeLists.txt +@@ -161,6 +161,12 @@ if(OPENMP_STANDALONE_BUILD OR (NOT OPENMP_ENABLE_LIBOMP_PROFILING)) + add_library(omp ${LIBOMP_LIBRARY_KIND} ${LIBOMP_SOURCE_FILES}) + # Linking command will include libraries in LIBOMP_CONFIGURED_LIBFLAGS + target_link_libraries(omp ${LIBOMP_CONFIGURED_LIBFLAGS} ${LIBOMP_DL_LIBS}) ++ if(APPLE AND CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64") ++ cmake_path(SET CLANG_RT_BUILTINS_LIBRARY ++ NORMALIZE ++ "$ENV{PREFIX}/lib/clang/$ENV{PKG_VERSION_MAJOR}/lib/libclang_rt.builtins_arm64_osx.a") ++ target_link_libraries(omp ${CLANG_RT_BUILTINS_LIBRARY}) ++ endif() + else() + add_llvm_library(omp ${LIBOMP_LIBRARY_KIND} ${LIBOMP_SOURCE_FILES} PARTIAL_SOURCES_INTENDED + LINK_LIBS ${LIBOMP_CONFIGURED_LIBFLAGS} ${LIBOMP_DL_LIBS}