Skip to content

Instantly share code, notes, and snippets.

@jose-d
Last active August 7, 2025 16:12
Show Gist options
  • Select an option

  • Save jose-d/079c16c9bf767b243d1375c4267f4988 to your computer and use it in GitHub Desktop.

Select an option

Save jose-d/079c16c9bf767b243d1375c4267f4988 to your computer and use it in GitHub Desktop.
Install openmpi in current conda environment
#!/bin/bash
# this script installs openmpi from source into current conda/microconda/condaforge environment
export CC=${CONDA_PREFIX}/bin/clang
export CXX=${CONDA_PREFIX}/bin/clang++
rm -rf libevent-2.1.12-stable
wget https://github.com/libevent/libevent/releases/download/release-2.1.12-stable/libevent-2.1.12-stable.tar.gz
tar -xvf ./libevent-2.1.12-stable.tar.gz
cd libevent-2.1.12-stable/
./configure --prefix=${CONDA_PREFIX}
make -j 12
make install
cd ..
rm -rf hwloc-2.12.1
wget -nc https://download.open-mpi.org/release/hwloc/v2.12/hwloc-2.12.1.tar.bz2
tar -xvf ./hwloc-2.12.1.tar.bz2
cd hwloc-2.12.1/
./configure --prefix=${CONDA_PREFIX}
make -j 12
make install
cd ..
rm -rf ucx-1.19.0
wget -nc https://github.com/openucx/ucx/releases/download/v1.19.0/ucx-1.19.0.tar.gz
tar -xvf ./ucx-1.19.0.tar.gz
cd ucx-1.19.0/
./contrib/configure-release --prefix=${CONDA_PREFIX} --enable-devel-headers --enable-optimizations
make -j 12
make install
cd ..
rm -rf pmix-5.0.8
wget -nc https://github.com/openpmix/openpmix/releases/download/v5.0.8/pmix-5.0.8.tar.bz2
tar -xf pmix-5.0.8.tar.bz2
cd pmix-5.0.8/
./configure --prefix=${CONDA_PREFIX}
make -j 12
make install
cd ..
rm -rf openmpi-5.0.8
wget -nc https://download.open-mpi.org/release/open-mpi/v5.0/openmpi-5.0.8.tar.bz2
tar -xf ./openmpi-5.0.8.tar.bz2
cd openmpi-5.0.8/
./configure --prefix=${CONDA_PREFIX} --with-pmix --with-ucx
make -j 16
make install
cd ..
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment