Image size: 8.9 GB

For more on pulling from the registry, see the ilifu documentation.

First, once: add the registry and make it your default

singularity remote add --no-login idia-registry https://sregistry.idia.ac.za
singularity remote use idia-registry

If you added it before, as the ilifu docs describe, remote add says it already exists: just run remote use.

Log in, for a private collection

singularity remote login idia-registry

Paste a token from your token page when asked. Public collections need no login.

Pull the container

singularity pull library://calibration/difmap:v2.5q-2024-09-10

Shell into the container

singularity shell library://calibration/difmap:v2.5q-2024-09-10

Run the container

singularity run library://calibration/difmap:v2.5q-2024-09-10

First, once: add the registry and make it your default

apptainer remote add --no-login idia-registry https://sregistry.idia.ac.za
apptainer remote use idia-registry

If you added it before, as the ilifu docs describe, remote add says it already exists: just run remote use.

Log in, for a private collection

apptainer remote login idia-registry

Paste a token from your token page when asked. Public collections need no login.

Pull the container

apptainer pull library://calibration/difmap:v2.5q-2024-09-10

Shell into the container

apptainer shell library://calibration/difmap:v2.5q-2024-09-10

Run the container

apptainer run library://calibration/difmap:v2.5q-2024-09-10
Bootstrap: debootstrap
MirrorURL: http://archive.ubuntu.com/ubuntu/
OSVersion: jammy

%labels
        APPLICATION_NAME Ubuntu LTS + Difmaps
        OS_VERSION 20.04
        APPLICATION_URL https://github.com/sabourke/difmap

        SYSTEM_NAME iLifu
        SYSTEM_SINGULARITY_VERSION 3.9.1
        SYSTEM_URL http://www.ilifu.ac.za

        AUTHOR_NAME IDIA
        AUTHOR_EMAIL support@ilifu.ac.za

%environment
	export PATH=$PATH:~/.local/bin
        # PGplot
        export PGPLOT_DIR='/usr/local/pgplot'   
        # Default xwindow device
        export PGPLOT_DEV='/xwin'
        # Default white background
        export PGPLOT_BACKGROUND='white'
        # Default black foreground
        export PGPLOT_FOREGROUND='black'
        # Marking text written in the ps file so it can be be edited
        export PGPLOT_PS_VERBOSE_TEXT='yes'
        # Export difmap
        export PATH="$PATH:/opt/difmap/uvf_difmap_2.5q/"

%post

        # Create Installation Directories and export paths. This is needed as part of post.
        # %environment scriptlet does not define these paths during %post, only after.
        mkdir -p /opt
        export DEBIAN_FRONTEND=noninteractive
        #export PATH=/opt/difmap/uvf_difmap_2.5q/
        export PATH="$PATH:/opt/difmap/uvf_difmap_2.5q/"

        # Installation of initial packages
        apt-get update -y
        apt-get install -y software-properties-common
        add-apt-repository -y universe
        add-apt-repository -y restricted
        apt-get update -y
        apt-get install -y wget vim apt-utils git build-essential bzip2 libpng-dev gcc gfortran make xvfb ghostscript curl pkg-config libxi-dev libfuse-dev python-is-python3 libx11-dev
        apt-get install -y fuse
        apt-get install -y lib32ncurses5-dev
        apt-get install -y texlive-full

        #Install pgplot
        #apt install pgplot5

        # Update pip and install python packages
        apt-get install -y python3-pip
        python -m pip install --upgrade cloudpickle holoviews datashader bokeh pandas dask-ms[xarray] scipy protobuf==3.20 scikit-image matplotlib katdal astroquery
        python -m pip install --no-binary :all: python-casacore
        python -m pip install pyvirtualdisplay

        # Install Jupyter for IPykernel
        python -m pip install jupyter ipykernel

        # Install PGplot using a compiler
        wget ftp://ftp.astro.caltech.edu/pub/pgplot/pgplot5.2.tar.gz
        mv pgplot5.2.tar.gz /usr/local/src/
        cd /usr/local/src/
        tar xzvf pgplot5.2.tar.gz
        mkdir /usr/local/pgplot
        cd /usr/local/pgplot
        cp /usr/local/src/pgplot/drivers.list .
        
        #Eddit the drivers list here
        sed -i 's/! PSDRIV 1/  PSDRIV 1/g' drivers.list 
        sed -i 's/! PSDRIV 2/  PSDRIV 2/g' drivers.list 
        sed -i 's/! PSDRIV 4/  PSDRIV 3/g' drivers.list 
        sed -i 's/! PSDRIV 4/  PSDRIV 4/g' drivers.list 
        sed -i 's/! XWDRIV 1/  XWDRIV 1/g' drivers.list 
        sed -i 's/! XWDRIV 2/  XWDRIV 2/g' drivers.list 

        /usr/local/src/pgplot/makemake /usr/local/src/pgplot linux g77_gcc
        #Eddit the make file
        sed -i 's/FCOMPL=g77/FCOMPL=gfortran/g' makefile 
        sed -i 's/FFLAGC=-u -Wall -fPIC -O/FFLAGC=-ffixed-form -ffixed-line-length-none -u -Wall -fPIC -O/g' makefile 

        make
        make clean
        make cpg

        cd /usr/local/lib
        ln -s /usr/local/pgplot/libpgplot.so .

        #Install Difmaps
        mkdir -p /opt/difmap
        cd /opt/difmap
        
        wget ftp://ftp.astro.caltech.edu/pub/difmap/difmap2.5q.tar.gz
        tar xzf difmap2.5q.tar.gz
        cd uvf_difmap_2.5q/
        
        #Edit the configure script
        sed -i 's|PGPLOT_LIB="-lpgplot -lX11"|PGPLOT_LIB="-lpgplot -L/usr/local/pgplot -Xlinker -R/usr/local/pgplot -lpgplot -lX11"|g' configure
        ./configure linux-i486-gcc
        ./makeall
        cd doc
        ./makemanual

%runscript
	python "$@"
Download calibration-difmap_v2.5q-2024-09-10.def
#!/bin/sh

	python "$@"
# /.singularity.d/env/90-environment.sh
#!/bin/sh
# Custom environment shell code should follow


	export PATH=$PATH:~/.local/bin
        # PGplot
        export PGPLOT_DIR='/usr/local/pgplot'   
        # Default xwindow device
        export PGPLOT_DEV='/xwin'
        # Default white background
        export PGPLOT_BACKGROUND='white'
        # Default black foreground
        export PGPLOT_FOREGROUND='black'
        # Marking text written in the ps file so it can be be edited
        export PGPLOT_PS_VERBOSE_TEXT='yes'
        # Export difmap
        export PATH="$PATH:/opt/difmap/uvf_difmap_2.5q/"