Skip to content

Commit

Permalink
Python Layer
Browse files Browse the repository at this point in the history
- remove hard-coded dependencies
- add pywarpx (PICMI) interface package
  • Loading branch information
ax3l committed Mar 2, 2021
1 parent 378ec6b commit 938ff18
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 13 deletions.
24 changes: 16 additions & 8 deletions recipe/bld.bat
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@

echo "CXXFLAGS: %CXXFLAGS%"

for %%d in (2 3 RZ) do (
cmake ^
-S . -B build ^
Expand All @@ -9,10 +7,9 @@ for %%d in (2 3 RZ) do (
-DCMAKE_C_COMPILER=clang-cl ^
-DCMAKE_CXX_COMPILER=clang-cl ^
-DCMAKE_VERBOSE_MAKEFILE=ON ^
-DWarpX_amrex_branch=%PKG_VERSION% ^
-DWarpX_openpmd_internal=OFF ^
-DWarpX_picsar_branch=47c269eb242815f9382da61a110c0c8f12be2d08 ^
-DWarpX_ASCENT=OFF ^
-DWarpX_LIB=ON ^
-DWarpX_MPI=OFF ^
-DWarpX_OPENPMD=ON ^
-DWarpX_PSATD=OFF ^
Expand All @@ -24,11 +21,12 @@ for %%d in (2 3 RZ) do (
cmake --build build --config RelWithDebInfo --parallel 2
if errorlevel 1 exit 1
)
:: future (if skipping AMReX headers) - inside above loop
:: cmake --build build --config RelWithDebInfo --target install
:: if errorlevel 1 exit 1

:: future: test

:: future: install
:: now: copy all warpx*.exe files
:: simple install
:: copy all warpx*.exe and warpx*.dll files
if not exist %LIBRARY_PREFIX%\bin md %LIBRARY_PREFIX%\bin
if errorlevel 1 exit 1

Expand All @@ -38,3 +36,13 @@ for /r "build\bin" %%f in (*.exe) do (
copy build\bin\%%~nf.exe %LIBRARY_PREFIX%\bin\
if errorlevel 1 exit 1
)
for /r "build\lib" %%f in (*.dll) do (
echo %%~nf
dir
copy build\lib\%%~nf.dll %LIBRARY_PREFIX%\lib\
if errorlevel 1 exit 1
)

:: add Python API (PICMI interface)
PYWARPX_LIB_DIR=%LIBRARY_PREFIX%\lib python3 -m pip wheel .
python3 -m pip install pywarpx-*whl
16 changes: 11 additions & 5 deletions recipe/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,9 @@ do
-DCMAKE_CXX_STANDARD=${CXX_STANDARD} \
-DCMAKE_INSTALL_LIBDIR=lib \
-DCMAKE_INSTALL_PREFIX=${PREFIX} \
-DWarpX_amrex_branch=${PKG_VERSION} \
-DWarpX_openpmd_internal=OFF \
-DWarpX_picsar_branch=47c269eb242815f9382da61a110c0c8f12be2d08 \
-DWarpX_ASCENT=OFF \
-DWarpX_LIB=ON \
-DWarpX_OPENPMD=ON \
-DWarpX_PSATD=OFF \
-DWarpX_QED=ON \
Expand All @@ -37,10 +36,17 @@ do

# future:
#CTEST_OUTPUT_ON_FAILURE=1 make ${VERBOSE_CM} test

# future (if skipping AMReX headers)
#cmake --build build --target install
done

# future:
#make install
mkdir -p ${PREFIX}/bin
# simple install
# copy all binaries and libwarpx* files
mkdir -p ${PREFIX}/bin ${PREFIX}/lib
cp build/bin/warpx.* ${PREFIX}/bin/
cp build/lib/libwarpx.* ${PREFIX}/lib/

# add Python API (PICMI interface)
PYWARPX_LIB_DIR=$PREFIX/lib python3 -m pip wheel .
python3 -m pip install pywarpx-*whl
9 changes: 9 additions & 0 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,22 @@ requirements:
- llvm-openmp # [osx or win]
host:
- boost-cpp
- mpi4py
- openmpi # [unix]
- openpmd-api * mpi_openmpi_* # [unix]
- openpmd-api # [win]
- pip
- setuptools
- wheel
# future
# - fftw * mpi_openmpi_* # [unix]
# - fftw # [win]
# a variant could provide CUDA support
run:
- numpy
- periodictable
- python
- scipy

test:
commands:
Expand Down

0 comments on commit 938ff18

Please sign in to comment.