Skip to content
Snippets Groups Projects
Commit 51216ba1 authored by Oriol Tintó's avatar Oriol Tintó
Browse files

First commit

parents
No related branches found
No related tags found
No related merge requests found
all:
cd recipes && $(MAKE)
clean:
cd recipes && $(MAKE) clean
rm -rf installation build-module
# Versions that will be installed
HDF5_VERSION=1.13.1
SZ_VERSION=2.1.12.4
ZFP_VERSION=0.5.5
BLOSC_VERSION=1.21.0
STD_COMPAT_VERSION=0.0.14
LIBPRESSIO_VERSION=0.83.0
#!/usr/bin/env bash
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
source config.sh
INSTALLATION_DIR=${SCRIPT_DIR}/installation
# HDF5
HDF5_DIR=${INSTALLATION_DIR}/hdf5/${HDF5_VERSION}
export HDF5_DIR
# Prepare environment variables
SZ_DIR=${INSTALLATION_DIR}/sz/${SZ_VERSION}
export SZ_DIR
std_compat_DIR=${INSTALLATION_DIR}/std_compat/${STD_COMPAT_VERSION}
export std_compat_DIR
ZFP_DIR=${INSTALLATION_DIR}/zfp/${ZFP_VERSION}
export ZFP_DIR
BLOSC_DIR=${INSTALLATION_DIR}/c-blosc/${BLOSC_VERSION}
export BLOSC_DIR
LIBPRESSIO_DIR=${INSTALLATION_DIR}/libpressio/${LIBPRESSIO_VERSION}
# PLUGINS PATH!
export HDF5_PLUGIN_PATH=${SZ_DIR}/lib:${BLOSC_DIR}/lib:${ZFP_DIR}/lib:${HDF5_PLUGIN_PATH:=""}
# LIBPRESSIO PYTHON
export PYTHONPATH=${LIBPRESSIO_DIR}/python:${PYTHONPATH:=""}
# ADD LIBRARIES TO LIBRARY_PATH
export LIBRARY_PATH=${LIBPRESSIO_DIR}/lib:${LIBRARY_PATH:=""}
export LD_LIBRARY_PATH=${LIBPRESSIO_DIR}/lib:${ZFP_DIR}/lib:${SZ_DIR}/lib:${BLOSC_DIR}/lib:${LD_LIBRARY_PATH:=""}
all: enstools.done
hdf5.done:
./compile_hdf5.sh
touch $@
sz.done: hdf5.done
./compile_sz.sh
touch $@
cblosc.done:
./compile_cblosc.sh
touch $@
zfp.done:
./compile_zfp.sh
touch $@
stdcompat.done:
./compile_stdcompat.sh
touch $@
libpressio.done: sz.done cblosc.done zfp.done stdcompat.done
./compile_libpressio.sh
touch $@
enstools.done: libpressio.done
./install_enstools.sh
touch $@
clean:
rm -f *done
#!/bin/bash -l
set -e
source etc/shared_functions.sh
source config.sh
source ../environment.sh
# compile eccodes
SW=c-blosc
REPOSITORY=https://github.com/Blosc/c-blosc.git
VERSION=${BLOSC_VERSION}
INSTALLDIR=$(get_install_base)/${SW}/${VERSION}
mkdir -p ${INSTALLDIR}
# create temporal folder and switch into it
switch2build
TAG_NAME=v${VERSION}
git clone ${REPOSITORY} -b ${TAG_NAME} source
cd source
# compile and install
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=${INSTALLDIR} ..
cmake --build .
ctest
cmake --build . --target install
# cleanup
switch2base_cleanup
#!/bin/bash -l
# compiler HDF5 library
set -xuve
source etc/shared_functions.sh
source config.sh
# clean_modules
# parallel or serial
SW=hdf5
# Version
VERSION=${HDF5_VERSION}
# Get tag name
TAG_NAME=hdf5-$( echo $VERSION | tr . _ )
INSTALLDIR=$(get_install_base)/${SW}/${VERSION}
mkdir -p ${INSTALLDIR}
REPOSITORY=https://github.com/HDFGroup/hdf5.git
# create temporal folder and switch into it
switch2build
# extract tar file
git clone ${REPOSITORY} -b ${TAG_NAME} source
# enter the folder
cd source
# Create build directory and enter it
mkdir build
cd build
# Launch CMAKE
cmake .. -DCMAKE_INSTALL_PREFIX=$INSTALLDIR -DHDF5_BUILD_FORTRAN=ON -DHDF5_BUILD_CPP_LIB=ON
# compile and install
make -j $(nproc)
make install
# cleanup
switch2base_cleanup
#!/bin/bash -l
set -xuve
source etc/shared_functions.sh
source config.sh
source ../environment.sh
# compile eccodes
SW=libpressio
REPOSITORY=https://github.com/robertu94/libpressio.git
VERSION=${LIBPRESSIO_VERSION}
INSTALLDIR=$(get_install_base)/${SW}/${VERSION}
mkdir -p ${INSTALLDIR}
export CMAKE_PREFIX_PATH=${BLOSC_DIR}:${CMAKE_PREFIX_PATH:=""}:
# create temporal folder and switch into it
switch2build
# create and activate virtual environment (otherwise problems installing python module)
if [ ! -d venv ]; then
python3 -m venv venv
source venv/bin/activate
python3 -m pip install numpy
fi
source venv/bin/activate
if [ ! -d source ]; then
# Clone repository and enter directory
git clone ${REPOSITORY} -b ${VERSION} source
fi
cd source
########################################33
#
# INSTALLATION
#
#FIXME: if we don't disable this doxygen flag compilation fails.
sed "s/set(CMAKE_SWIG_FLAGS \"-doxygen\")/#set(CMAKE_SWIG_FLAGS \"-doxygen\")/g" tools/swig/CMakeLists.txt -i
# Create build directory and go there
if [ ! -d build ]; then
mkdir build
fi
cd build
# Run cmake
cmake .. -DCMAKE_INSTALL_PREFIX=${INSTALLDIR} -DBUILD_PYTHON_WRAPPER=ON -DLIBPRESSIO_HAS_SZ=ON -DLIBPRESSIO_HAS_ZFP=ON -DLIBPRESSIO_HAS_BLOSC=ON -DCMAKE_CXX_FLAGS=-I${SZ_DIR}/include
# Compile and install
make -j
make install
PYTHON_INSTALL=../../venv/lib/python*/site-packages/
# Copy python files to python directory inside installdir
mkdir -p ${INSTALLDIR}/python
for file in libpressio.py pressio.py _pressio.so ; do
cp ${PYTHON_INSTALL}/${file} ${INSTALLDIR}/python/
done
########################################33
#!/bin/bash -l
set -xuve
source etc/shared_functions.sh
source config.sh
source ../environment.sh
# compile eccodes
SW=std_compat
VERSION=${STD_COMPAT_VERSION}
REPOSITORY=https://github.com/robertu94/std_compat
INSTALLDIR=$(get_install_base)/${SW}/${VERSION}
mkdir -p ${INSTALLDIR}
# create temporal folder and switch into it
switch2build
# Clone repository and enter directory
git clone ${REPOSITORY} -b ${VERSION} source
cd source
###########################################################
#
# INSTALLATION
#
BUILD_DIR=build
mkdir $BUILD_DIR
cd $BUILD_DIR
cmake .. -DCMAKE_INSTALL_PREFIX=${INSTALLDIR}
make
make test
make install
###########################################################
# cleanup
switch2base_cleanup
#!/bin/bash -l
set -xuve
source etc/shared_functions.sh
source config.sh
source ../environment.sh
# compile eccodes
SW=sz
VERSION=${SZ_VERSION}
REPOSITORY=https://github.com/szcompressor/SZ/
# Get path to the installation directory and create it
INSTALLDIR=$(get_install_base)/${SW}/${VERSION}
mkdir -p ${INSTALLDIR}
# create temporal folder and switch into it
switch2build
# Clone repository and enter directory
TAG_NAME=v${VERSION}
git clone ${REPOSITORY} -b ${TAG_NAME} source
cd source
# Disable loading configuration file before compiling
sed "s/int load_conffile_flag = 1;/int load_conffile_flag = 0;/g" hdf5-filter/H5Z-SZ/src/H5Z_SZ.c -i
# Create build folder
mkdir build
cd build
# Launch cmake
CMAKE_FLAGS="-DCMAKE_INSTALL_PREFIX:PATH=${INSTALLDIR} -DBUILD_HDF5_FILTER:BOOL=ON"
cmake .. ${CMAKE_FLAGS}
# Compile and install
make
make install
# cleanup
switch2base_cleanup
#!/bin/bash -l
set -xuve
source etc/shared_functions.sh
source config.sh
source ../environment.sh
# compile eccodes
SW=zfp
VERSION=${ZFP_VERSION}
REPOSITORY=https://github.com/LLNL/zfp.git
# Get the path for the installation directory and create it
INSTALLDIR=$(get_install_base)/${SW}/${VERSION}
mkdir -p ${INSTALLDIR}
# create temporal folder and switch into it
switch2build
# Clone repository and enter directory
git clone ${REPOSITORY} -b ${VERSION} source
cd source
# Create build directory and enter it
mkdir build
cd build
# Run CMake
cmake -DCMAKE_INSTALL_PREFIX=${INSTALLDIR} -DZFP_BIT_STREAM_WORD_SIZE=8 ..
# Compile
make
make install
# cleanup
switch2base_cleanup
../config.sh
\ No newline at end of file
# file with shared functions for creation of modules.
#
# All functions write their results to stdout and to a Variable called RESULT.
RESULT=""
# clean up loaded module
function clean_modules() {
unset LD_PRELOAD
module purge
module load spack
module use /project/meteo-scratch/Oriol.Tinto/module_building/modulefiles
}
# base directory for installation, depends on site
function get_install_base() {
RESULT=$(pwd)/../installation
echo $RESULT
}
# create a temporal folder for the compilation process
function create_tmp() {
local tmp_path
RESULT=$(pwd)/../build-module/${SW}/
mkdir -p $RESULT
echo $RESULT
}
# switch to temporal folder
function switch2build() {
BASE_DIR=$PWD
BUILD_DIR=$(create_tmp)
cd $BUILD_DIR
}
# switch back to base dir and cleanup
function switch2base_cleanup() {
cd $BASE_DIR
rm -rf $BUILD_DIR
}
source ../environment.sh
python3 -m pip install enstools-compression --no-binary h5py
export DEBIAN_FRONTEND=noninteractive
apt update
# Util if there's need to modify something on the way
apt install -yq vim
# Common dependencies
apt install -yq make cmake git python3 python3-pip python3-venv
# libpressio&filter dependencies
apt install -yq swig gcc gfortran pkg-config libzstd-dev
# Additional dependencies for enstools
apt install -yq libproj-dev proj-data proj-bin libgeos-dev libeccodes-dev
#!/bin/bash -l
set -xuve
source environment.sh
if [ ! -d enstools-compression ]; then
# Clone enstools-compression
git clone https://gitlab.physik.uni-muenchen.de/w2w/enstools-compression.git
fi
# Enter folder
cd enstools-compression
python3 -m pip install pytest pytest-mock
# Run tests
pytest tests
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment