Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
19 changes: 19 additions & 0 deletions o/openmpi/build_info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"maintainer": "SakshiJain0302",
"package_name": "openmpi",
"github_url": "https://download.open-mpi.org/release/open-mpi/v5.0/openmpi-5.0.6.tar.gz",
"version": "5.0.6",
"wheel_build" : false,
"package_dir": "o/openmpi",
"default_branch": "main",
"build_script": "openmpi_ubi_9.3.sh",
"docker_build": false,
"validate_build_script": true,
"use_non_root_user": false,
"*" : {
"build_script": [
"openmpi_ubi_9.3.sh",
"openmpi_ubi_10.1.sh"
]
}
}
94 changes: 94 additions & 0 deletions o/openmpi/openmpi_ubi_10.1.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
#!/bin/bash -e
# -----------------------------------------------------------------------------
#
# Package : openmpi
# Version : 5.0.6
# Source repo : https://download.open-mpi.org/release/open-mpi/v5.0/openmpi-5.0.6.tar.gz
# Tested on : UBI:10.1
# Language : Python, C, C++
# Ci-Check : True
# Script License : Apache License, Version 2 or later
# Maintainer : Sakshi Jain <sakshi.jain16@ibm.com>
#
# Disclaimer : This script has been tested in root mode on given
# ========== platform using the mentioned version of the package.
# It may not work as expected with newer versions of the
# package and/or distribution. In such case, please
# contact "Maintainer" of this script.
#
# ---------------------------------------------------------------------------------------------
# Variables
PACKAGE_NAME=openmpi
PACKAGE_VERSION=${1:-5.0.6}
PACKAGE_VERSION_DIR=5.0
PACKAGE_URL=https://download.open-mpi.org/release/open-mpi/v$PACKAGE_VERSION_DIR/$PACKAGE_NAME-$PACKAGE_VERSION.tar.gz
PACKAGE_DIR=$PACKAGE_NAME-$PACKAGE_VERSION
CURRENT_DIR=$(pwd)

# Install dependencies
yum install -y git gcc gcc-c++ make wget openssl-devel bzip2-devel libffi-devel zlib-devel autoconf automake libtool krb5-devel cmake python3.12 python3.12-devel python3.12-pip

echo "Downloading the tarball..."
wget $PACKAGE_URL

echo "Extracting the tarball..."
tar -xvf $PACKAGE_NAME-$PACKAGE_VERSION.tar.gz
cd $PACKAGE_NAME-$PACKAGE_VERSION

mkdir prefix
export PREFIX=$(pwd)/prefix

# Set environment variables
export CC=gcc
export CXX=g++
export LIBRARY_PATH="/usr/lib64"

# Configure to set the installation prefix and disable dependency tracking
./configure --prefix=$PREFIX --disable-dependency-tracking
# Make to build Open MPI with parallel processing
make -j 4
# Install Open MPI to the specified prefix directory
make install

# Create the necessary directory structure and copy OpenMPI files
mkdir -p local/openmpi
cp -r $PREFIX/* local/openmpi/

# Set path for mpi/ompi
export PATH=$PREFIX/bin:$PATH
export LD_LIBRARY_PATH=$PREFIX/lib:$LD_LIBRARY_PATH

# Install Python bindings
pip install setuptools build

#create pyproject.toml
wget https://raw.githubusercontent.com/ppc64le/build-scripts/refs/heads/master/o/openmpi/pyproject.toml
sed -i s/{PACKAGE_VERSION}/$PACKAGE_VERSION/g pyproject.toml

#get testfile
wget https://raw.githubusercontent.com/ppc64le/build-scripts/refs/heads/master/o/openmpi/helloworld.c

echo "Running the test program with mpirun..."
$PREFIX/bin/mpicc helloworld.c -o helloworld_c

if ! $PREFIX/bin/mpirun --allow-run-as-root --oversubscribe -n 2 ./helloworld_c; then
echo "------------------$PACKAGE_NAME:Test_Fails-------------------------------------"
echo "$PACKAGE_URL $PACKAGE_NAME"
echo "$PACKAGE_NAME | $PACKAGE_URL | $PACKAGE_VERSION | GitHub | Fail | Test_Fails"
exit 1
fi

#install
if ! (pip install .) ; then
echo "------------------$PACKAGE_NAME:Install_fails-------------------------------------"
echo "$PACKAGE_URL $PACKAGE_NAME"
echo "$PACKAGE_NAME | $PACKAGE_URL | $PACKAGE_VERSION | GitHub | Fail | Install_Fails"
exit 1
fi
#build wheel
if ! (python3 -m build --wheel --outdir="$CURRENT_DIR") ; then
echo "------------------$PACKAGE_NAME:Install_fails-------------------------------------"
echo "$PACKAGE_URL $PACKAGE_NAME"
echo "$PACKAGE_NAME | $PACKAGE_URL | $PACKAGE_VERSION | GitHub | Fail | Build_Fails"
exit 1
fi
Loading