# Building within container
podman pull almalinux:8
# Within the cloned CASA folder
podman run --rm -it -v <path/to/casa>:/home/casa almalinux:8
# Dependencies
dnf install -y 'dnf-command(config-manager)'
# For RHEL 9
# dnf config-manager --set-enabled crb
dnf config-manager --set-enabled powertools
dnf install -y epel-release
# RHEL 9's EPEL does not have wcslib
# dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
yum update -y
# Casacore deps
yum -y install cmake cmake-gui gcc-gfortran gcc-c++ flex bison \
blas blas-devel lapack lapack-devel cfitsio cfitsio-devel \
ncurses ncurses-devel readline readline-devel \
fftw fftw-devel hdf5 hdf5-devel libgomp wcslib wcslib-devel
# Python deps
yum -y install python3-devel boost boost-devel \
python3-numpy boost-python3 python3-pip swig \
libjpeg-turbo-devel libxslt-devel
pip3 install matplotlib packaging certifi scipy
# Other deps
yum -y install xerces-c-devel libgomp openmpi-devel environment-modules libxml2-devel \
java-11-openjdk rsync libtool libsqlite3x-devel
# Build tools for CASA
yum -y install ccache xerces-c gsl-devel
# RPFITS
yum install -y https://casa.nrao.edu/download/repo/el7/x86_64/rpfits-2.23-02.el7.x86_64.rpm
# shtool
yum install -y https://download-ib01.fedoraproject.org/pub/epel/7/x86_64/Packages/s/shtool-2.0.8-11.el7.noarch.rpm
# Use environment modules to load OpenMPI
echo "source /usr/share/Modules/init/bash" >> ~/.bashrc
echo "module load mpi/openmpi-x86_64" >> ~/.bashrc
source ~/.bashrc
# module load mpi/openmpi-x86_64
# Commit the container finally
# podman commit <shaid> casaenv:0.1
---------------------------------------------------------------------------------
# Build CASA
git clone https://open-bitbucket.nrao.edu/scm/casa/casa6.git
cd casa6
git submodule update --init --recursive
# Build casatools
cd casatools
autoconf
./configure
# If there is an issue detecting python
# ./configure PYTHON=/usr/bin/python3
./setup.py build
# ./setup.py build --march=native
# Update Measures
PYTHONPATH=./build/lib.linux-x86_64-3.6/ python3 -m casatools --update-user-data
# Commit the measures
# podman commit <shaid> casaenv:0.2
# Build casatasks
cd ../casatasks
PYTHONPATH=../casatools/build/lib.linux-x86_64-3.6/ ./setup.py
## Test the casa installation
cd ..
PYTHONPATH=$PWD/casatools/build/lib.linux-x86_64-3.6/:$PWD/casatasks/build/lib.linux-x86_64-3.6/ python3
# Using the container to run CASA
# podman run --rm -it -v <path/to/casa>:/home/casa casaenv:0.2
CASA does not compile with GCC 11, GCC > 9 GRPC has to be patched to renamegettid
which conflicts with GLIBC- There are runtime problems with Swig 4, Swig 3 is needed
- Building within container runs into issue with GLIBCXX at runtinme, Casacore has to be compiled without a
D_GLIBCXX_ASSERTIONS
flag. A temporary possible solution isU_GLIBCXX_ASSERTIONS
/usr/include/c++/8/bits/shared_ptr_base.h:1005: std::__shared_ptr_access<_Tp, _Lp, <anonymous>, <anonymous> >::element_type& std::__shared_ptr_access<_Tp, _Lp, <anonymous>, <anonymous> >::operator*() const [with _Tp = casa6core::arrays_internal::Storage<casa6core::String, std::allocator<casa6core::String> >; __gnu_cxx::_Lock_policy _Lp = (__gnu_cxx::_Lock_policy)2; bool <anonymous> = false; bool <anonymous> = false; std::__shared_ptr_access<_Tp, _Lp, <anonymous>, <anonymous> >::element_type = casa6core::arrays_internal::Storage<casa6core::String, std::allocator<casa6core::String> >]: Assertion '_M_get() != nullptr' failed.
Aborted (core dumped)
References: