Skip to content

Commit

Permalink
Merge branch 'master' into CBM-47-singularity-not-linking-oiio-and-dcmtk
Browse files Browse the repository at this point in the history
  • Loading branch information
tartarini authored Jan 2, 2023
2 parents e397147 + 54b4556 commit b5b0d4e
Show file tree
Hide file tree
Showing 7 changed files with 154 additions and 358 deletions.
55 changes: 35 additions & 20 deletions singularity/base_centos8_for_pfire.def
Original file line number Diff line number Diff line change
@@ -1,44 +1,59 @@
# base_centos8_for_pfire.sif
# Generate using:
# sudo singularity build -F base_centos8_for_pfire.sif base_centos8_for_pfire.def

Bootstrap: docker
From: centos:8


#
# Bind system folders into container folders with writing permissions
# 1) run, exec, shell, and instance start will accept the --bind/-B command-line option to specify bind paths [:dest_in_container[:ro|rw]]
# -B can be repeated or the paths can be comma separated
# 2) $SINGULARITY_BIND or $SINGULARITY_BINDPATH
#
#




%post

%post

# Setup directory structure
export SANDBOX=/singularity_sandbox
mkdir -p $SANDBOX
cd ${SANDBOX}

#### System-wide installations

# change repository stream
dnf -y --disablerepo '*' --enablerepo=extras swap centos-linux-repos centos-stream-repos
dnf -y distro-sync

yum install -y wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm

dnf install -y https://download1.rpmfusion.org/free/el/rpmfusion-free-release-8.noarch.rpm
dnf install -y https://download1.rpmfusion.org/nonfree/el/rpmfusion-nonfree-release-8.noarch.rpm


yum update -y
dnf install -y 'dnf-command(config-manager)'
dnf config-manager --set-enabled powertools
dnf groupinstall -y "Development Tools"

yum install -y git cmake make automake python3.9 vim yum-utils gcc-toolset-9-gcc-gfortran

alternatives --set python /usr/bin/python3.9

# yum install -y gcc-toolset-9 tzdata
# yum install -y boost-program-options boost-test boost-filesystem boost-iostreams boost-serialization boost-timer boost-program-options boost-test boost-filesystem boost-iostreams boost-serialization boost-devel

yum update -y

yum install -y git cmake make automake python2 python3 vim
yum install -y gcc-toolset-9 vim #tzdata
yum install -y boost-program-options boost-test boost-filesystem boost-iostreams boost-serialization boost-timer boost-program-options boost-test boost-filesystem boost-iostreams boost-serialization boost-devel

#OpenImageIO-devel dcmtk-devel \
#hdf5-openmpi-devel petsc



dnf groupinstall -y "Development Tools"

##############################################################





####################################################################################

# Build time not runtime but not build time



%runscript
alias ll='ls -lrath'
69 changes: 35 additions & 34 deletions singularity/base_centos8_openmpi_for_pfire.def
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
# base_centos8_openmpi_for_pfire.def
# sudo singularity build -F base_centos8_openmpi_for_pfire.sif base_centos8_openmpi_for_pfire.def

Bootstrap: localimage
From: base_centos8_for_pfire.sif
Bootstrap: docker
From: centos:8

#
# Bind system folders into container folders with writing permissions
Expand All @@ -13,41 +10,48 @@ From: base_centos8_for_pfire.sif
#




%post


# Setup directory structure
export SANDBOX=/singularity_sandbox
mkdir -p $SANDBOX
cd ${SANDBOX}

#########################################################################
# System-wide installations
#########################################################################

#### System-wide installations
dnf -y --disablerepo '*' --enablerepo=extras swap centos-linux-repos centos-stream-repos
yum install -y wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
yum update -y
dnf install -y 'dnf-command(config-manager)'
dnf config-manager --set-enabled powertools

yum update -y



yum install -y boost-program-options boost-test boost-filesystem boost-iostreams boost-serialization boost-timer boost-program-options boost-test boost-filesystem boost-iostreams boost-serialization boost-devel
yum install -y git cmake make automake python2 python3 vim
yum install -y gcc-toolset-9-gcc-gfortran
# yum install -y gcc-toolset-9
yum install -y boost-program-options boost-test boost-filesystem boost-iostreams boost-serialization boost-timer boost-program-options boost-test boost-filesystem boost-iostreams boost-serialization boost-devel \

# yum install -y openmpi-devel openmpi
# OpenImageIO-devel dcmtk-devel hdf5-openmpi-devel petsc openmpi-devel openmpi\ tzdata

#OpenImageIO-devel dcmtk-devel \
#hdf5-openmpi-devel petsc
#openmpi-devel openmpi\ tzdata

dnf groupinstall -y "Development Tools"

##############################################################
# Installing OpenMPI
##############################################################

# yum install -y openmpi-devel openmpi



echo "Installing OpenMPI..."

export OMPI_VERSION=4.0.1
export OMPI_DIR=/opt/ompi
export OMPI_ROOT=${OMPI_DIR}
export OMPI_URL="https://download.open-mpi.org/release/open-mpi/v4.0/openmpi-$OMPI_VERSION.tar.bz2"

# Install support of omnipath
yum install -y rdma-core-devel libibmad-devel libpsm2 opa-basic-tools libfabric libfabric-devel libpsm2-compat libpsm2-devel


export OMPI_VERSION=4.0.1
export OMPI_DIR=/opt/ompi
export OMPI_URL="https://download.open-mpi.org/release/open-mpi/v4.0/openmpi-$OMPI_VERSION.tar.bz2"
mkdir -p /tmp/ompi
mkdir -p /opt

Expand All @@ -61,22 +65,19 @@ From: base_centos8_for_pfire.sif
export PATH=$OMPI_DIR/bin:$PATH
export LD_LIBRARY_PATH=$OMPI_DIR/lib:$LD_LIBRARY_PATH

echo "export MPI_ROOT=${OMPI_ROOT}" >> $SINGULARITY_ENVIRONMENT
echo "export MPI_DIR=${OMPI_ROOT}" >> $SINGULARITY_ENVIRONMENT
echo "export CPATH=\"\${CPATH}:${MPI_ROOT}/include\"" >> $SINGULARITY_ENVIRONMENT
echo "export PATH=\"\${PATH}:$PATH}\"" >> $SINGULARITY_ENVIRONMENT


####################################################################################

# environemnt variables. may be overwritten by SINGULARITY_ENVIRONMENT
# Build time not runtime but not build time
%environment
# Point to OMPI binaries, libraries, man pages
export OMPI_VERSION=4.0.1
export OMPI_DIR=/opt/ompi
export MPI_ROOT=${OMPI_DIR}
export PATH="$OMPI_DIR/bin:$PATH"
export LD_LIBRARY_PATH="$OMPI_DIR/lib:$LD_LIBRARY_PATH"
export MANPATH="$OMPI_DIR/share/man:$MANPATH"




%runscript

alias ll='ls -lrath'
69 changes: 29 additions & 40 deletions singularity/base_openmpi_petsc_for_pfire.def
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#base_openmpi_petsc_for_pfire.sif
Bootstrap: localimage
From: base_centos8_openmpi_for_pfire.sif
# Generate with:
# sudo singularity build -F base_openmpi_petsc_for_pfire.sif base_openmpi_petsc_for_pfire.def
Bootstrap: localimage
From: base_centos8_openmpi_for_pfire.sif

#
# Bind system folders into container folders with writing permissions
# 1) run, exec, shell, and instance start will accept the --bind/-B command-line option to specify bind paths [:dest_in_container[:ro|rw]]
# -B can be repeated or the paths can be comma separated
Expand All @@ -13,21 +12,23 @@ From: base_centos8_openmpi_for_pfire.sif

%post


yum install -y python39 python39-lxml python39-numpy-doc python39-pip python39-devel python2

yum install -y swig libxml2 libxml2-devel python3-libxml2 openssl openssl-devel doxygen
# Install system wide packages and updates
dnf -y --disablerepo '*' --enablerepo=extras swap centos-linux-repos centos-stream-repos
dnf -y distro-sync

yum install -y wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm

# danielta yum install -y OpenImageIO python3-openimageio OpenImageIO-utils OpenImageIO-iv OpenImageIO-devel
yum install -y python39 python39-lxml python39-numpy-doc python39-pip python39-devel
yum install -y dcmtk.x86_64 dcmtk-devel.x86_64 libjpeg-turbo libjpeg-turbo-devel swig libxml2 libxml2-devel python3-libxml2 openssl openssl-devel doxygen

pip3 install --upgrade pip
python3 -m pip install PyQt5==5.15.4
python3 -m pip install PyQt5-Qt5==5.15.2
python3 -m pip install PyQt5-sip==12.9.0
python3 -m pip install cached-property configobj cycler decorator docutils dpath h5py
python3 -m pip install kiwisolver
python3 -m pip install matplotlib networkx numpy Pillow pyparsing
python3 -m pip install python-dateutil PyWavelets PyYAML scikit-image scipy six tabulate tifffile
pip3 install PyQt5==5.15.4
pip3 install PyQt5-Qt5==5.15.2
pip3 install PyQt5-sip==12.9.0
pip3 install cached-property configobj cycler decorator docutils dpath h5py
pip3 install imageio kiwisolver
pip3 install matplotlib networkx numpy Pillow pyparsing
pip3 install python-dateutil PyWavelets PyYAML scikit-image scipy six tabulate tifffile

# Setup directory structure
export SANDBOX=/singularity_sandbox
Expand All @@ -51,27 +52,25 @@ From: base_centos8_openmpi_for_pfire.sif

cd hdf5-${HDF5_VERSION}

export HDF5_ROOT="/opt/HDF5/${HDF5_VERSION}"

echo "export HDF5_ROOT=\"${HDF5_ROOT}\"" >> $SINGULARITY_ENVIRONMENT
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${HDF5_ROOT}
echo "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH" >> $SINGULARITY_ENVIRONMENT

HDF5_ROOT="/opt/HDF5/${HDF5_VERSION}"

CC=/opt/ompi/bin/mpicc ./configure --enable-parallel --prefix=${HDF5_ROOT}
make -j 4
make install

###################################################################
echo "Installing PETSc"

#export OMPI_DIR=/opt/ompi
#export PATH=$OMPI_DIR/bin:$PATH
#export LD_LIBRARY_PATH=$OMPI_DIR/lib:$LD_LIBRARY_PATH
#export MANPATH=$OMPI_DIR/share/man:$MANPATH

export PETSC_ARCH=opt
export PETSC_VERSION=3.10.5
export PETSC_DIR=/opt/petsc-${PETSC_VERSION}
export PETSC_URL=http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-lite-${PETSC_VERSION}.tar.gz

echo "export PETSC_DIR=\"${PETSC_DIR}\"" >> $SINGULARITY_ENVIRONMENT
echo "export PETSC_ARCH=\"${PETSC_ARCH}\"" >> $SINGULARITY_ENVIRONMENT

mkdir -p /tmp/petsc

cd /tmp/petsc
Expand All @@ -83,9 +82,6 @@ From: base_centos8_openmpi_for_pfire.sif
#yum install -y hdf5-openmpi-devel hdf5-devel vim
#yum install -y mpich-devel hdf5-mpich-devel hdf5-mpich vim mpich

ls -lrat $PETSC_DIR
#ls -lrat $PETSC_DIR/$PETSC_ARCH/

# Compile and install
cd ${PETSC_DIR}
CC=mpicc CXX=mpicxx python2 config/configure.py --with-make-np=10 --download-f2cblaslapack --with-hdf5-dir=${HDF5_ROOT}
Expand All @@ -104,22 +100,14 @@ From: base_centos8_openmpi_for_pfire.sif

export MPI_ROOT=${OMPI_DIR}

echo "MPI_ROOT=/opt/ompi/" >> $SINGULARITY_ENVIRONMENT
echo "MPI_DIR=/opt/ompi/" >> $SINGULARITY_ENVIRONMENT
echo "export CPATH=\"\${CPATH}:${MPI_ROOT}/include\"" >> $SINGULARITY_ENVIRONMENT
echo "export CPATH=\"\${CPATH}:$PETSC_DIR/$PETSC_ARCH/include\"" >> $SINGULARITY_ENVIRONMENT

#echo "export PATH=$PETSC_DIR/bin:\"${PATH}\"" >> $SINGULARITY_ENVIRONMENT
echo "export PATH=$PETSC_DIR/$PETSC_ARCH/bin:\"${PATH}\"" >> $SINGULARITY_ENVIRONMENT
echo "export LD_LIBRARY_PATH=$PETSC_DIR/$PETSC_ARCH/lib:\"${LD_LIBRARY_PATH}\"" >> $SINGULARITY_ENVIRONMENT
#echo "export LD_LIBRARY_PATH=$PETSC_DIR/lib:\"${LD_LIBRARY_PATH}\"" >> $SINGULARITY_ENVIRONMENT

export PATH=$PETSC_DIR/bin:$PATH
export LD_LIBRARY_PATH=$PETSC_DIR/lib:$LD_LIBRARY_PATH
export MANPATH=$PETSC_DIR/share/man:$MANPATH


##############################################################
# Configure mpich environment
# Information about the version of MPICH to use
# Information about the version of MPICH to use
#export MPICH_VERSION=3.3.2
#export MPICH_URL="http://www.mpich.org/static/downloads/$MPICH_VERSION/mpich-$MPICH_VERSION.tar.gz"
#export MPICH_DIR=/opt/mpich
Expand All @@ -130,3 +118,4 @@ From: base_centos8_openmpi_for_pfire.sif


%runscript
alias ll='ls -lrath'
13 changes: 6 additions & 7 deletions singularity/base_petsc_for_pfire.def
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ From: base_centos8_for_pfire.sif
mkdir -p $SANDBOX
cd ${SANDBOX}


837144
/etc/.profile
echo "alias ll='ls -lrath'" >> /etc/.bashrc
###################################################################
Expand Down Expand Up @@ -63,9 +63,8 @@ From: base_centos8_for_pfire.sif

export MPI_ROOT=/opt/petsc-3.10.5/opt/
export HDF5_ROOT=/opt/petsc-3.10.5/opt/


echo "export HDF5_ROOT=\"${HDF5_ROOT}\"" >> $SINGULARITY_ENVIRONMENT
export PETSC_ARCH=opt
export PETSC_DIR=/opt/petsc-3.10.5/

##############################################################
# Configure mpich environment
Expand All @@ -86,7 +85,7 @@ From: base_centos8_for_pfire.sif
# disable python
# /home/sa_ac1dt/DEVELOP/INSIGNEO/PFIRE/docker-pfire/singularity/singularity_sandbox/pfire_ext_libs

# TODO separate build dir in oiio from its dependencies
# TODO separate build dire in oiio from its dependencies
export ILMBASE_ROOT=/home/sa_ac1dt/DEVELOP/INSIGNEO/PFIRE/docker-pfire/singularity/singularity_sandbox/oiio_git/build/ext/dist
export OPENEXR_ROOT=/home/sa_ac1dt/DEVELOP/INSIGNEO/PFIRE/docker-pfire/singularity/singularity_sandbox/oiio_git/build/ext/dist
export ILMBASE_LIBRARY_DIR=/home/sa_ac1dt/DEVELOP/INSIGNEO/PFIRE/docker-pfire/singularity/singularity_sandbox/oiio_git/build/ext/dist/lib
Expand Down Expand Up @@ -116,6 +115,6 @@ export LD_LIBRARY_PATH=/home/sa_ac1dt/DEVELOP/INSIGNEO/PFIRE/docker-pfire/singul

export pybind11_ROOT=/home/sa_ac1dt/DEVELOP/INSIGNEO/PFIRE/docker-pfire/singularity/singularity_sandbox/oiio_git/build/ext/dist

export pugixml_ROOT=/home/sa_ac1dt/DEVELOP/INSIGNEO/PFIRE/docker-pfire/singularity/singularity_sandbox/oiio_git/build/ext/dist
+ export pugixml_ROOT=/home/sa_ac1dt/DEVELOP/INSIGNEO/PFIRE/docker-pfire/singularity/singularity_sandbox/oiio_git/build/ext/dist

export LD_LIBRARY_PATH=/home/sa_ac1dt/DEVELOP/INSIGNEO/PFIRE/docker-pfire/singularity/singularity_sandbox/oiio_git/build/ext/dist/lib:/home/sa_ac1dt/DEVELOP/INSIGNEO/PFIRE/docker-pfire/singularity/singularity_sandbox/oiio_git/build/ext/dist/lib64:/home/sa_ac1dt/DEVELOP/INSIGNEO/PFIRE/docker-pfire/singularity/singularity_sandbox/oiio_git/build/ext/dist/lib:/home/sa_ac1dt/DEVELOP/INSIGNEO/PFIRE/docker-pfire/singularity/singularity_sandbox/pFIRE/build/openexr/build/src/:/.singularity.d/libs:/home/sa_ac1dt/DEVELOP/INSIGNEO/PFIRE/docker-pfire/singularity/singularity_sandbox/oiio_git/build/ext/dist/lib
+ export LD_LIBRARY_PATH=/home/sa_ac1dt/DEVELOP/INSIGNEO/PFIRE/docker-pfire/singularity/singularity_sandbox/oiio_git/build/ext/dist/lib:/home/sa_ac1dt/DEVELOP/INSIGNEO/PFIRE/docker-pfire/singularity/singularity_sandbox/oiio_git/build/ext/dist/lib64:/home/sa_ac1dt/DEVELOP/INSIGNEO/PFIRE/docker-pfire/singularity/singularity_sandbox/oiio_git/build/ext/dist/lib:/home/sa_ac1dt/DEVELOP/INSIGNEO/PFIRE/docker-pfire/singularity/singularity_sandbox/pFIRE/build/openexr/build/src/:/.singularity.d/libs:/home/sa_ac1dt/DEVELOP/INSIGNEO/PFIRE/docker-pfire/singularity/singularity_sandbox/oiio_git/build/ext/dist/lib
4 changes: 1 addition & 3 deletions singularity/build_pfire_singularity.bash
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,5 @@
singularity build -F base_centos8_for_pfire.sif base_centos8_for_pfire.def
singularity build -F base_centos8_openmpi_for_pfire.sif base_centos8_openmpi_for_pfire.def
singularity build -F base_openmpi_petsc_for_pfire.sif base_openmpi_petsc_for_pfire.def
#singularity build -F base_petsc_for_pfire.sif base_petsc_for_pfire.def

singularity build -F base_openmpi_petsc_dcmtk_oiio_for_pfire.sif base_openmpi_petsc_dcmtk_oiio_for_pfire.def
singularity build -F base_petsc_for_pfire.sif base_petsc_for_pfire.def
singularity build -F pfire_openmpi.sif pfire_openmpi.def
Loading

0 comments on commit b5b0d4e

Please sign in to comment.