Skip to content

Commit c10039e

Browse files
authored
Fix: mpi4py requirement for --target pip_install (#3265)
Installs `mpi4py` if not already found during ``` cmake --build build -j 4 --target pip_install ```
1 parent c7eff60 commit c10039e

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

CMakeLists.txt

+6-1
Original file line numberDiff line numberDiff line change
@@ -447,8 +447,13 @@ if(WarpX_LIB)
447447
)
448448

449449
# this will also upgrade/downgrade dependencies, e.g., when the version of picmistandard changes
450+
if(WarpX_MPI)
451+
set(pyWarpX_REQUIREMENT_FILE "requirements_mpi.txt")
452+
else()
453+
set(pyWarpX_REQUIREMENT_FILE "requirements.txt")
454+
endif()
450455
add_custom_target(${WarpX_CUSTOM_TARGET_PREFIX}pip_install_requirements
451-
python3 -m pip install ${PYINSTALLOPTIONS} -r ${WarpX_SOURCE_DIR}/requirements.txt
456+
python3 -m pip install ${PYINSTALLOPTIONS} -r "${WarpX_SOURCE_DIR}/${pyWarpX_REQUIREMENT_FILE}"
452457
WORKING_DIRECTORY
453458
${WarpX_BINARY_DIR}
454459
)

requirements_mpi.txt

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
-r requirements.txt
2+
mpi4py>=2.1.0

0 commit comments

Comments
 (0)