Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add wrapper compiler flags in CONDA_BUILD, install .mod in include #158

Merged
merged 10 commits into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions recipe/build-mpi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ fi
make -j"${CPU_COUNT:-1}"
make install

# openmpi installs .mod files in the wrong prefix (/lib instead of /include)
ls -l $PREFIX/lib/*.mod
mv -v $PREFIX/lib/*.mod $PREFIX/include/

POST_LINK=$PREFIX/bin/.openmpi-post-link.sh
if [ -n "$build_with_ucx" ]; then
echo "setting MCA pml to ^ucx..."
Expand Down
2 changes: 1 addition & 1 deletion recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% set version = "5.0.3" %}
{% set major = version.rpartition('.')[0] %}
{% set cuda_major = (cuda_compiler_version|default("11.8")).rpartition('.')[0] %}
{% set build = 4 %}
{% set build = 5 %}

# give conda package a higher build number
{% if mpi_type == 'conda' %}
Expand Down
8 changes: 8 additions & 0 deletions recipe/openmpi_activate.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
if [[ "${CONDA_BUILD:-}" = "1" ]]; then
echo "setting openmpi environment variables for conda-build"
# build-time variables
for _var in CC CXX FC CPPFLAGS CFLAGS CXXFLAGS FCFLAGS LDFLAGS; do
if [[ ! -z "${!_var:-}" ]]; then
declare -x OMPI_${_var}=${!_var}
fi
done

# runtime variables
export OMPI_MCA_plm_ssh_agent=false
export OMPI_MCA_pml=ob1
export OMPI_MCA_mpi_yield_when_idle=true
Expand Down
26 changes: 20 additions & 6 deletions recipe/run_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,44 +26,58 @@ if [[ $PKG_NAME == "openmpi" ]]; then
command -v mpiexec
$MPIEXEC --help
$MPIEXEC -n 4 ./helloworld.sh

test -f $PREFIX/include/mpi.mod
test ! -f $PREFIX/lib/mpi.mod
fi

if [[ $PKG_NAME == "openmpi-mpicc" ]]; then
command -v mpicc
mpicc -show

mpicc $CFLAGS $LDFLAGS helloworld.c -o helloworld_c
test ! -z "${OMPI_CC:-}"
test ! -z "${OMPI_CFLAGS:-}"
test ! -z "${OMPI_CPPFLAGS:-}"
test ! -z "${OMPI_LDFLAGS:-}"

mpicc helloworld.c -o helloworld_c
$MPIEXEC -n 4 ./helloworld_c
fi

if [[ $PKG_NAME == "openmpi-mpicxx" ]]; then
command -v mpicxx
mpicxx -show

mpicxx $CXXFLAGS $LDFLAGS helloworld.cxx -o helloworld_cxx
test ! -z "${OMPI_CXX:-}"
test ! -z "${OMPI_CXXFLAGS:-}"

mpicxx helloworld.cxx -o helloworld_cxx
$MPIEXEC -n 4 ./helloworld_cxx
fi

if [[ $PKG_NAME == "openmpi-mpifort" ]]; then
command -v mpifort
mpifort -show

test ! -z "${OMPI_FC:-}"
test ! -z "${OMPI_FCFLAGS:-}"

mpifort $FFLAGS $LDFLAGS helloworld.f -o helloworld1_f
mpifort helloworld.f -o helloworld1_f
$MPIEXEC -n 4 ./helloworld1_f

mpifort $FFLAGS $LDFLAGS helloworld.f90 -o helloworld1_f90
mpifort helloworld.f90 -o helloworld1_f90
$MPIEXEC -n 4 ./helloworld1_f90

command -v mpif77
mpif77 -show

mpif77 $FFLAGS $LDFLAGS helloworld.f -o helloworld2_f
mpif77 helloworld.f -o helloworld2_f
$MPIEXEC -n 4 ./helloworld2_f

command -v mpif90
mpif90 -show

mpif90 $FFLAGS $LDFLAGS helloworld.f90 -o helloworld2_f90
mpif90 helloworld.f90 -o helloworld2_f90
$MPIEXEC -n 4 ./helloworld2_f90

fi
Expand Down
Loading