From 799f580d2d96ada85f1de7e3cc1de9f8d642b31b Mon Sep 17 00:00:00 2001 From: conda-forge-admin Date: Thu, 19 Oct 2023 13:35:34 +0000 Subject: [PATCH] Initial feedstock commit with conda-smithy 3.27.1. --- conda-forge.yml | 1 + recipe/3599.patch | 81 +++++++++++++++++++++++++++++++++++++++++++++++ recipe/bld.bat | 58 +++++++++++++++++++++++++++++++++ recipe/build.sh | 56 ++++++++++++++++++++++++++++++++ recipe/meta.yaml | 67 +++++++++++++++++++++++++++++++++++++++ 5 files changed, 263 insertions(+) create mode 100644 conda-forge.yml create mode 100644 recipe/3599.patch create mode 100644 recipe/bld.bat create mode 100644 recipe/build.sh create mode 100644 recipe/meta.yaml diff --git a/conda-forge.yml b/conda-forge.yml new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/conda-forge.yml @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/recipe/3599.patch b/recipe/3599.patch new file mode 100644 index 0000000..99bb65d --- /dev/null +++ b/recipe/3599.patch @@ -0,0 +1,81 @@ +From a1accf5a6ea7468f7e223c0305cdb13c70a34fc2 Mon Sep 17 00:00:00 2001 +From: Axel Huebl +Date: Wed, 18 Oct 2023 09:58:37 -0700 +Subject: [PATCH] Install Move Tools to `shared/amrex` + +Packaging AMReX for Conda, we realized that we break with +common conventions on Unix systems by installing a top-level +`Tools/` directory. + +This moves its content in both the build directory and the +install destination to `share/amrex/` and +`/AMReXCMakeModules/`, respectively. +--- + Tools/CMake/AMReXInstallHelpers.cmake | 31 ++++++++++++++++++--------- + 1 file changed, 21 insertions(+), 10 deletions(-) + +diff --git a/Tools/CMake/AMReXInstallHelpers.cmake b/Tools/CMake/AMReXInstallHelpers.cmake +index 0720efb4cf9..a01cd63301d 100644 +--- a/Tools/CMake/AMReXInstallHelpers.cmake ++++ b/Tools/CMake/AMReXInstallHelpers.cmake +@@ -26,7 +26,7 @@ function (install_amrex_targets) + else() + set(CMAKE_FILES_DIR lib/cmake/AMReX) + endif() +- set(MODULE_PATH Tools/CMake) # Relative path to top level installation/build-tree ++ set(MODULE_PATH ${CMAKE_FILES_DIR}/AMReXCMakeModules) # Relative path to top level installation/build-tree + + # Write Config file -- this is designed to work for both install and build trees + configure_package_config_file(${AMREX_CMAKE_MODULES_PATH}/AMReXConfig.cmake.in +@@ -60,7 +60,7 @@ function (install_amrex_targets) + + install( EXPORT AMReXTargets + NAMESPACE AMReX:: +- DESTINATION lib/cmake/AMReX ) ++ DESTINATION ${CMAKE_FILES_DIR} ) + + # + # alias: last element will be legacy target +@@ -88,11 +88,17 @@ function (install_amrex_targets) + # Install Tools directory + install( + DIRECTORY +- ${PROJECT_SOURCE_DIR}/Tools/CMake +- ${PROJECT_SOURCE_DIR}/Tools/C_scripts +- ${PROJECT_SOURCE_DIR}/Tools/typechecker ++ ${PROJECT_SOURCE_DIR}/Tools/C_scripts ++ ${PROJECT_SOURCE_DIR}/Tools/typechecker ++ DESTINATION ++ share/amrex ++ USE_SOURCE_PERMISSIONS ++ ) ++ install( ++ DIRECTORY ++ ${PROJECT_SOURCE_DIR}/Tools/CMake/ + DESTINATION +- Tools ++ ${MODULE_PATH} + USE_SOURCE_PERMISSIONS + ) + endif() +@@ -106,11 +112,16 @@ function (install_amrex_targets) + # Copy Tools directory to build tree + file( + COPY +- ${PROJECT_SOURCE_DIR}/Tools/CMake +- ${PROJECT_SOURCE_DIR}/Tools/C_scripts +- ${PROJECT_SOURCE_DIR}/Tools/typechecker ++ ${PROJECT_SOURCE_DIR}/Tools/C_scripts ++ ${PROJECT_SOURCE_DIR}/Tools/typechecker ++ DESTINATION ++ ${PROJECT_BINARY_DIR}/share/amrex ++ ) ++ file( ++ COPY ++ ${PROJECT_SOURCE_DIR}/Tools/CMake/ + DESTINATION +- ${PROJECT_BINARY_DIR}/Tools ++ ${PROJECT_BINARY_DIR}/${MODULE_PATH} + ) + + diff --git a/recipe/bld.bat b/recipe/bld.bat new file mode 100644 index 0000000..ecf0188 --- /dev/null +++ b/recipe/bld.bat @@ -0,0 +1,58 @@ +@echo on + +:: configure +cmake ^ + -S %SRC_DIR% -B build ^ + %CMAKE_ARGS% ^ + -G "Ninja" ^ + -DAMReX_ASCENT=OFF ^ + -DAMReX_BUILD_TUTORIALS=OFF ^ + -DAMReX_CONDUIT=OFF ^ + -DAMReX_CUDA_LTO=OFF ^ + -DAMReX_EB=OFF ^ + -DAMReX_ENABLE_TESTS=ON ^ + -DAMReX_FORTRAN=OFF ^ + -DAMReX_FORTRAN_INTERFACES=OFF ^ + -DAMReX_GPU_BACKEND=NONE ^ + -DAMReX_GPU_RDC=OFF ^ + -DAMReX_HDF5=OFF ^ + -DAMReX_HYPRE=OFF ^ + -DAMReX_IPO=OFF ^ + -DAMReX_MPI=OFF ^ + -DAMReX_MPI_THREAD_MULTIPLE=OFF ^ + -DAMReX_OMP=ON ^ + -DAMReX_PARTICLES=ON ^ + -DAMReX_PLOTFILE_TOOLS=OFF ^ + -DAMReX_PROBINIT=OFF ^ + -DAMReX_PIC=ON ^ + -DAMReX_SPACEDIM="1;2;3" ^ + -DAMReX_SENSEI=OFF ^ + -DAMReX_TEST_TYPE=Small ^ + -DAMReX_TINY_PROFILE=ON ^ + -DBUILD_SHARED_LIBS=ON ^ + -DCMAKE_BUILD_TYPE=Release ^ + -DCMAKE_C_COMPILER=clang-cl ^ + -DCMAKE_CXX_COMPILER=clang-cl ^ + -DCMAKE_INSTALL_LIBDIR=lib ^ + -DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% ^ + -DCMAKE_LINKER=lld-link ^ + -DCMAKE_NM=llvm-nm ^ + -DCMAKE_VERBOSE_MAKEFILE=ON +if errorlevel 1 exit 1 + +:: build +cmake --build build --config Release --parallel %CPU_COUNT% +if errorlevel 1 exit 1 + +:: install +cmake --build build --config Release --target install +if errorlevel 1 exit 1 + +:: clean "symlink" +del "%LIBRARY_PREFIX%\lib\amrex.dll" +del "%LIBRARY_PREFIX%\bin\amrex.dll" + +:: test +set "OMP_NUM_THREADS=2" +ctest --test-dir build --build-config Release --output-on-failure +if errorlevel 1 exit 1 diff --git a/recipe/build.sh b/recipe/build.sh new file mode 100644 index 0000000..7b1aeb3 --- /dev/null +++ b/recipe/build.sh @@ -0,0 +1,56 @@ +#!/usr/bin/env bash + +# avoid side-injection of -std=c++14 flag in some toolchains +if [[ ${CXXFLAGS} == *"-std=c++14"* ]]; then + echo "14 -> 17" + export CXXFLAGS="${CXXFLAGS} -std=c++17" +fi +# Darwin modern C++ +# https://conda-forge.org/docs/maintainer/knowledge_base.html#newer-c-features-with-old-sdk +if [[ ${target_platform} =~ osx.* ]]; then + export CXXFLAGS="${CXXFLAGS} -D_LIBCPP_DISABLE_AVAILABILITY" +fi + +# configure +cmake \ + -S ${SRC_DIR} -B build \ + ${CMAKE_ARGS} \ + -DAMReX_ASCENT=OFF \ + -DAMReX_BUILD_TUTORIALS=OFF \ + -DAMReX_CONDUIT=OFF \ + -DAMReX_CUDA_LTO=OFF \ + -DAMReX_EB=OFF \ + -DAMReX_ENABLE_TESTS=ON \ + -DAMReX_FORTRAN=OFF \ + -DAMReX_FORTRAN_INTERFACES=OFF \ + -DAMReX_GPU_BACKEND=NONE \ + -DAMReX_GPU_RDC=OFF \ + -DAMReX_HDF5=OFF \ + -DAMReX_HYPRE=OFF \ + -DAMReX_IPO=OFF \ + -DAMReX_MPI=OFF \ + -DAMReX_MPI_THREAD_MULTIPLE=OFF \ + -DAMReX_OMP=ON \ + -DAMReX_PARTICLES=ON \ + -DAMReX_PLOTFILE_TOOLS=OFF \ + -DAMReX_PROBINIT=OFF \ + -DAMReX_PIC=ON \ + -DAMReX_SPACEDIM="1;2;3" \ + -DAMReX_SENSEI=OFF \ + -DAMReX_TEST_TYPE=Small \ + -DAMReX_TINY_PROFILE=ON \ + -DBUILD_SHARED_LIBS=ON \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_VERBOSE_MAKEFILE=ON \ + -DCMAKE_INSTALL_LIBDIR=lib \ + -DCMAKE_INSTALL_PREFIX=${PREFIX} + +# build +cmake --build build --parallel ${CPU_COUNT} + +# test +OMP_NUM_THREADS=2 ctest --test-dir build --output-on-failure + +# install +cmake --build build --target install + diff --git a/recipe/meta.yaml b/recipe/meta.yaml new file mode 100644 index 0000000..2693338 --- /dev/null +++ b/recipe/meta.yaml @@ -0,0 +1,67 @@ +{% set name = "amrex" %} +{% set version = "23.10" %} + +package: + name: {{ name|lower }} + version: {{ version }} + +source: + url: https://github.com/AMReX-Codes/amrex/archive/refs/tags/{{ version }}.tar.gz + sha256: e76e4787735c06ae747eaf57a682b12fed297ef2d5c7727051e20d34e4e79ce3 + patches: + # Install CMake Scripts from Tools/CMake/ to /Modules/ + # https://github.com/AMReX-Codes/amrex/pull/3599 + - 3599.patch + +build: + number: 0 + +requirements: + build: + - {{ compiler('c') }} + - {{ compiler('cxx') }} + - ccache # [unix] + - clang # [win] + - cmake + - lld # [win] + # TODO: add libxml2 dep in lld-feedstock + - libxml2 # [win] + - make # [unix] + - ninja # [win] + - libgomp # [linux] + - llvm-openmp # [osx or win] + - pkgconfig + +test: + commands: + - test -f ${PREFIX}/lib/libamrex_1d.so # [linux] + - test -f ${PREFIX}/lib/libamrex_2d.so # [linux] + - test -f ${PREFIX}/lib/libamrex_3d.so # [linux] + - test -f ${PREFIX}/lib/libamrex_1d.dylib # [osx] + - test -f ${PREFIX}/lib/libamrex_2d.dylib # [osx] + - test -f ${PREFIX}/lib/libamrex_3d.dylib # [osx] + - if not exist %LIBRARY_PREFIX%\bin\amrex_1d.dll exit 1 # [win] + - if not exist %LIBRARY_PREFIX%\bin\amrex_2d.dll exit 1 # [win] + - if not exist %LIBRARY_PREFIX%\bin\amrex_3d.dll exit 1 # [win] + +about: + home: https://amrex-codes.github.io/amrex/ + license: BSD-3-Clause-LBNL + license_family: BSD + license_file: LICENSE + summary: A software framework for massively parallel, block-structured adaptive mesh refinement (AMR) applications + + description: | + AMReX is a software framework containing all the functionality to write + massively parallel, block-structured adaptive mesh refinement (AMR) + applications. AMReX is developed at LBNL, NREL, and ANL as part of the + Block-Structured AMR Co-Design Center in DOE's Exascale Computing Project. + + doc_url: https://amrex-codes.github.io/amrex/docs_html/ + dev_url: https://github.com/AMReX-Codes/amrex + +extra: + recipe-maintainers: + - atmyers + - ax3l + - WeiqunZhang