Skip to content
Merged
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
1 change: 1 addition & 0 deletions build_stack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ build_lib libpng
build_lib szip
build_lib jasper
build_lib sqlite
build_lib libtiff
build_lib proj
build_lib geos

Expand Down
44 changes: 44 additions & 0 deletions config/config_linux_centos_intel.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/bin/bash

# Compiler/MPI combination
export HPC_PYTHON=${HPC_PYTHON:-"python/3.6.8"}
export HPC_COMPILER=${HPC_COMPILER:-"intel/2020.0"}
export HPC_MPI=${HPC_MPI:-"impi/2020u0"}

# Build options
export USE_SUDO=N
export PKGDIR=pkg
export LOGDIR=log
export OVERWRITE=N
export NTHREADS=4
export MAKE_CHECK=N
export MAKE_VERBOSE=Y
export MAKE_CLEAN=N
export DOWNLOAD_ONLY=N
export STACK_EXIT_ON_FAIL=Y
export WGET="wget -nv --no-check-certificate "

module purge
export BASH_ENV=$HOME/apps/lmod/lmod/init/bash # Point to the new definition of Lmod

source $BASH_ENV # Redefine the module command to point
# to the new Lmod
module use $HOME/modulefiles
module load cmake
module load intel/2020.0
module load impi/2020u0
#

export CC=icc
export FC=ifort
export CXX=icpc

export SERIAL_CC=icc
export SERIAL_FC=ifort
export SERIAL_CXX=icpc

export MPI_CC=mpiicc
export MPI_FC=mpiifort
export MPI_CXX=mpiicpc

#
61 changes: 61 additions & 0 deletions libs/build_libtiff.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#!/bin/bash

set -eux

name="libtiff"
version=${1:-${STACK_libtiff_version}}

[[ ${STACK_libtiff_shared:-} =~ [yYtT] ]] && enable_shared=YES || enable_shared=NO

# Hyphenated version used for install prefix
compiler=$(echo $HPC_COMPILER | sed 's/\//-/g')

# manage package dependencies here
if $MODULES; then
set +x
source $MODULESHOME/init/bash
module load hpc-$HPC_COMPILER
module try-load cmake
module load zlib
module list
set -x

prefix="${PREFIX:-"/opt/modules"}/$compiler/$name/$version"
if [[ -d $prefix ]]; then
if [[ $OVERWRITE =~ [yYtT] ]]; then
echo "WARNING: $prefix EXISTS: OVERWRITING!"
$SUDO rm -rf $prefix
else
echo "WARNING: $prefix EXISTS, SKIPPING"
exit 0
fi
fi

else
prefix=${LIBTIFF_ROOT:-"/usr/local"}
fi

export CC=$SERIAL_CC
export CFLAGS="${STACK_CFLAGS:-} ${STACK_libtiff_CFLAGS:-} -fPIC"

cd ${HPC_STACK_ROOT}/${PKGDIR:-"pkg"}

software=$name-$version
URL="https://gitlab.com/${name}/${name}.git"
[[ -d $software ]] || ( git clone $URL $software )
[[ ${DOWNLOAD_ONLY} =~ [yYtT] ]] && exit 0
[[ -d $software ]] && cd $software || ( echo "$software does not exist, ABORT!"; exit 1 )

sourceDir=$PWD
cd build
cmake $sourceDir \
-DCMAKE_INSTALL_PREFIX=$prefix \
-DCMAKE_BUILD_TYPE=RELEASE \
-DZLIB_ROOT=${ZLIB_ROOT}
#
make -j${NTHREADS:-4}
$SUDO make install

# generate modulefile from template
$MODULES && update_modules compiler $name $version
echo $name $version $URL >> ${HPC_STACK_ROOT}/hpc-stack-contents.log
11 changes: 11 additions & 0 deletions libs/build_proj.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ if $MODULES; then
module load hpc-$HPC_COMPILER
module try-load cmake
module load sqlite
module try-load libtiff
module list
set -x

Expand Down Expand Up @@ -57,6 +58,16 @@ CMAKE_OPTS=${STACK_proj_cmake_opts:-""}

[[ $MAKE_CHECK =~ [yYtT] ]] || CMAKE_OPTS+=" -DBUILD_TESTING=OFF"

if [[ -n ${LIBTIFF_ROOT-} ]] ; then
CMAKE_OPTS+=" -DTIFF_INCLUDE_DIR=${LIBTIFF_ROOT}/include "
[[ -f ${LIBTIFF_ROOT}/lib64/libtiff.so ]] && CMAKE_OPTS+=" -DTIFF_LIBRARY=${LIBTIFF_ROOT}/lib64/libtiff.so " || CMAKE_OPTS+=" -DTIFF_LIBRARY=${LIBTIFF_ROOT}/lib/libtiff.so "
fi

if [[ -n ${SQLITE_ROOT-} ]] ; then
CMAKE_OPTS+=" -DSQLITE3_INCLUDE_DIR=${SQLITE_ROOT}/include "
CMAKE_OPTS+=" -DSQLITE3_LIBRARY=${SQLITE_ROOT}/lib/libsqlite3.so "
fi

LIB_DIR=${SQLITE_ROOT:-} cmake -H. -Bbuild -DCMAKE_INSTALL_PREFIX=$prefix $CMAKE_OPTS
cd build
VERBOSE=$MAKE_VERBOSE make -j${NTHREADS:-4}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
help([[
]])

local pkgName = myModuleName()
local pkgVersion = myModuleVersion()
local pkgNameVer = myModuleFullName()

local hierA = hierarchyA(pkgNameVer,1)
local compNameVer = hierA[1]
local compNameVerD = compNameVer:gsub("/","-")

conflict(pkgName)

local opt = os.getenv("HPC_OPT") or os.getenv("OPT") or "/opt/modules"

local base = pathJoin(opt,compNameVerD,pkgName,pkgVersion)

prepend_path("PATH", pathJoin(base,"bin"))
prepend_path("LD_LIBRARY_PATH", pathJoin(base,"${CMAKE_INSTALL_LIBDIR}"))
prepend_path("DYLD_LIBRARY_PATH", pathJoin(base,"${CMAKE_INSTALL_LIBDIR}"))
prepend_path("CPATH", pathJoin(base,"include"))
prepend_path("MANPATH", pathJoin(base,"share","man"))

setenv("LIBTIFF_ROOT", base)
setenv("LIBTIFF_VERSION", pkgVersion)

prepend_path("PKG_CONFIG_PATH", pathJoin(base,"${CMAKE_INSTALL_LIBDIR}","pkgconfig"))

whatis("Name: ".. pkgName)
whatis("Version: " .. pkgVersion)
whatis("Category: library")
whatis("Description: LIBTIFF (libtiff library) are Functions to read, write and display bitmap images stored in the LIBTIFF format. It can read and write both files and in-memory raw vectors, including native image representation")
8 changes: 6 additions & 2 deletions stack/stack_custom.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ pio:

esmf:
build: YES
version: 8_1_1
version: 8_2_0
shared: YES
enable_pnetcdf: NO
debug: NO
Expand Down Expand Up @@ -312,7 +312,7 @@ cmakemodules:
gftl_shared:
build: YES
repo: Goddard-Fortran-Ecosystem
version: v1.3.0
version: v1.3.3

yafyaml:
build: YES
Expand All @@ -328,6 +328,10 @@ geos:
build: YES
version: 3.8.1

libtiff:
build: YES
version: 4.0.3

sqlite:
build: YES
version: 3.32.3
Expand Down
5 changes: 5 additions & 0 deletions stack_helpers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,11 @@ function no_modules {
export MPI_CXX=${MPI_CXX:-"CC"}
export MPI_FC=${MPI_FC:-"ftn"}
;;
mpt )
export MPI_CC=${MPI_CC:-"mpicc"}
export MPI_CXX=${MPI_CXX:-"CC"}
export MPI_FC=${MPI_FC:-"mpif90"}
;;
* )
echo "Unknown MPI option = $mpiName, ABORT!"
local abort=Y
Expand Down