Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ax3l committed Mar 5, 2021
1 parent 12cac76 commit aa143eb
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 24 deletions.
60 changes: 41 additions & 19 deletions recipe/bld.bat
Original file line number Diff line number Diff line change
@@ -1,26 +1,11 @@
@echo on

:: overwrite Clang with GNU CLI activation
:: https://github.com/conda-forge/clang-win-activation-feedstock/blob/724a3900c88ef1748a9c1d90d0c2927db99c3ef5/recipe/activate-clang_win-64.bat#L3-L8
set LDFLAGS=
set CFLAGS=
set CXXFLAGS=

:: CMake binutil hints need forward slashes in paths
set "BUILD_PREFIX_FWD=%BUILD_PREFIX:\=/%"

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

:: CMAKE_AR and CMAKE_RANLIB are needed for IPO with clang-cl

for %%d in (2 3 RZ) do (

set USE_PSATD=ON
if "%d%" == "RZ" set "USE_PSATD=OFF"

for %%d in (2 3) do (
cmake ^
-S . -B build ^
-G "Ninja" ^
Expand All @@ -34,7 +19,7 @@ for %%d in (2 3 RZ) do (
-DWarpX_MPI=OFF ^
-DWarpX_OPENPMD=ON ^
-DWarpX_openpmd_internal=OFF ^
-DWarpX_PSATD=%USE_PSATD% ^
-DWarpX_PSATD=ON ^
-DWarpX_QED=ON ^
-DWarpX_DIMS=%%d ^
%SRC_DIR%
Expand Down Expand Up @@ -62,7 +47,44 @@ for %%d in (2 3 RZ) do (
:: cmake --build build --config RelWithDebInfo --target install
:: if errorlevel 1 exit 1

:: RZ (until BLAS++ and LAPACK++ are shipped with conda-forge)
cmake ^
-S . -B build ^
-G "Ninja" ^
-DCMAKE_BUILD_TYPE=RelWithDebInfo ^
-DCMAKE_C_COMPILER=clang-cl ^
-DCMAKE_CXX_COMPILER=clang-cl ^
-DCMAKE_LINKER=lld-link ^
-DCMAKE_VERBOSE_MAKEFILE=ON ^
-DWarpX_ASCENT=OFF ^
-DWarpX_LIB=ON ^
-DWarpX_MPI=OFF ^
-DWarpX_OPENPMD=ON ^
-DWarpX_openpmd_internal=OFF ^
-DWarpX_PSATD=OFF ^
-DWarpX_QED=ON ^
-DWarpX_DIMS=%%d ^
%SRC_DIR%
if errorlevel 1 exit 1

cmake --build build --config RelWithDebInfo --parallel 2
if errorlevel 1 exit 1

for /r "build\bin" %%f in (*.exe) do (
echo %%~nf
dir
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
)

rmdir /s /q build

:: add Python API (PICMI interface)
set "PYWARPX_LIB_DIR=%LIBRARY_PREFIX%\lib"
%PYTHON% -m pip wheel .
%PYTHON% -m pip install --find-links=. pywarpx
%PYTHON% -m pip install . -vv --no-build-isolation
4 changes: 2 additions & 2 deletions recipe/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,5 @@ 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
export PYWARPX_LIB_DIR=$PREFIX/lib
$PYTHON -m pip install . -vv --no-build-isolation
7 changes: 4 additions & 3 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ requirements:
build:
- {{ compiler('c') }}
- {{ compiler('cxx') }}
- {{ compiler('clang') }} # [win]
- ccache
- clang # [win]
- lld # [win]
- make # [unix]
- ninja # [win]
- cmake >=3.15.0
Expand Down Expand Up @@ -63,10 +64,10 @@ test:
commands:
- test -f ${PREFIX}/bin/warpx.2d.MPI.OMP.DP.OPMD.PSATD.QED # [unix]
- test -f ${PREFIX}/bin/warpx.3d.MPI.OMP.DP.OPMD.PSATD.QED # [unix]
- test -f ${PREFIX}/bin/warpx.RZ.MPI.OMP.DP.OPMD.PSATD.QED # [unix]
- test -f ${PREFIX}/bin/warpx.RZ.MPI.OMP.DP.OPMD.QED # [unix]
- if exist %LIBRARY_PREFIX%\bin\warpx.2d.NOMPI.OMP.DP.OPMD.PSATD.QED.exe (exit 0) else (exit 1) # [win]
- if exist %LIBRARY_PREFIX%\bin\warpx.3d.NOMPI.OMP.DP.OPMD.PSATD.QED.exe (exit 0) else (exit 1) # [win]
- if exist %LIBRARY_PREFIX%\bin\warpx.RZ.NOMPI.OMP.DP.OPMD.PSATD.QED.exe (exit 0) else (exit 1) # [win]
- if exist %LIBRARY_PREFIX%\bin\warpx.RZ.NOMPI.OMP.DP.OPMD.QED.exe (exit 0) else (exit 1) # [win]

about:
home: https://ecp-warpx.github.io
Expand Down

0 comments on commit aa143eb

Please sign in to comment.