Skip to content

Commit

Permalink
External AMReX and pyAMReX Packages
Browse files Browse the repository at this point in the history
Now in Conda themselves. Migrating this will enable compatibility
with other packages that depend on AMReX in Conda, e.g., WarpX
and HiPACE++.
  • Loading branch information
ax3l committed Oct 28, 2023
1 parent eccf581 commit a75ce8f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 16 deletions.
10 changes: 3 additions & 7 deletions recipe/bld.bat
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ cmake ^
-DCMAKE_LINKER=lld-link ^
-DCMAKE_NM=llvm-nm ^
-DCMAKE_VERBOSE_MAKEFILE=ON ^
-DImpactX_amrex_internal=OFF ^
-DImpactX_openpmd_internal=OFF ^
-DImpactX_pyamrex_internal=OFF ^
-DImpactX_pybind11_internal=OFF ^
-DImpactX_LIB=ON ^
-DImpactX_MPI=OFF ^
Expand All @@ -31,21 +33,15 @@ if errorlevel 1 exit 1
:: build
cmake --build build --config Release --parallel 2
if errorlevel 1 exit 1
cmake --build build --config Release --parallel 2 --target pyamrex_pip_wheel
if errorlevel 1 exit 1
cmake --build build --config Release --parallel 2 --target pip_wheel
if errorlevel 1 exit 1

:: install
cmake --build build --config Release --target install
if errorlevel 1 exit 1
%PYTHON% -m pip install --force-reinstall --no-index --no-deps -vv --find-links=build\_deps\fetchedpyamrex-build\amrex-whl amrex
if errorlevel 1 exit 1
%PYTHON% -m pip install --force-reinstall --no-index --no-deps -vv --find-links=build\impactx-whl impactx
if errorlevel 1 exit 1

:: test
:: skip the pyAMReX tests to save CI time
set "EXCLUSION_REGEX=AMReX"
ctest --test-dir build --build-config Release --output-on-failure -E %EXCLUSION_REGEX%
ctest --test-dir build --build-config Release --output-on-failure
if errorlevel 1 exit 1
9 changes: 4 additions & 5 deletions recipe/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ cmake \
-DCMAKE_INSTALL_LIBDIR=lib \
-DCMAKE_INSTALL_PREFIX=${PREFIX} \
-DImpactX_IPO=${ImpactX_IPO} \
-DImpactX_amrex_internal=OFF \
-DImpactX_openpmd_internal=OFF \
-DImpactX_pyamrex_internal=OFF \
-DImpactX_pybind11_internal=OFF \
-DImpactX_LIB=ON \
-DImpactX_MPI=OFF \
Expand All @@ -37,22 +39,20 @@ cmake \

# build
cmake --build build --parallel ${CPU_COUNT}
cmake --build build --parallel ${CPU_COUNT} --target pyamrex_pip_wheel
cmake --build build --parallel ${CPU_COUNT} --target pip_wheel

# test
# || "${CROSSCOMPILING_EMULATOR}" != ""
if [[ "${CONDA_BUILD_CROSS_COMPILATION:-}" != "1" ]]; then
# skip the pyAMReX tests to save CI time
EXCLUSION_REGEX="AMReX"
EXCLUSION_REGEX=""

# macOS x86_64 pypy: import issue with matplotlib
# AttributeError: module 'threading' has no attribute 'get_native_id'
# https://foss.heptapod.net/pypy/pypy/-/issues/3764
if [[ "${target_platform}" == "osx-64" ]]; then
IS_PYPY=$(${PYTHON} -c "import platform; print(int(platform.python_implementation() == 'PyPy'))")
if [[ ${IS_PYPY} == "1" ]]; then
EXCLUSION_REGEX="(AMReX|plot|pytest)"
EXCLUSION_REGEX="(plot|pytest)"
fi
fi

Expand All @@ -62,5 +62,4 @@ fi

# install
cmake --build build --target install
${PYTHON} -m pip install --force-reinstall --no-index --no-deps -vv --find-links=build/_deps/fetchedpyamrex-build/amrex-whl amrex
${PYTHON} -m pip install --force-reinstall --no-index --no-deps -vv --find-links=build/impactx-whl impactx
9 changes: 5 additions & 4 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% set name = "impactx" %}
{% set version = "23.10" %}
{% set build = 1 %}
{% set build = 2 %}
{% set sha256 = "e721442da05dd9fcc3cc54ac8c7afa880b56555effe4ad56063d3435a3184e24" %}

package:
Expand All @@ -13,6 +13,7 @@ source:

build:
number: {{ build }}
skip: true # [python_impl == 'pypy']
run_exports:
# releases are not (yet) compatible
- impactx {{ version }}
Expand All @@ -24,21 +25,20 @@ requirements:
- pybind11 # [build_platform != target_platform]
- {{ compiler('c') }}
- {{ compiler('cxx') }}
- ccache # [unix]
- clang # [win]
- cmake >=3.20.0
- lld # [win]
# TODO: add libxml2 dep in lld-feedstock
- libxml2 # [win]
- make # [unix]
- ninja # [win]
- libgomp # [linux]
- llvm-openmp # [osx or win]
host:
- amrex >={{ version }}
- pip
- python
- pybind11 >=2.10.1
- pybind11-abi
- pyamrex >={{ version }}
- setuptools
- wheel
- pkgconfig
Expand All @@ -54,6 +54,7 @@ requirements:
- numpy >=1.15.0
- pandas
- python
- pyamrex >={{ version }}
- scipy

test:
Expand Down

0 comments on commit a75ce8f

Please sign in to comment.