Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
pkg-scripts/charliecloud-0.34-0.build.sh
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
executable file
108 lines (81 sloc)
3.7 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
set -xe | |
umask 022 | |
PKG=charliecloud | |
VERSION=0.34 | |
BUILD=0 | |
PATH=/bin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/package/bin | |
PREFIX=/pkg/$PKG-$VERSION-$BUILD | |
if [ -n "$TESTING" ]; then PREFIX=/scratch/local2/$PKG-$VERSION-$BUILD ; fi | |
mkdir -p $PREFIX | |
cat >$PREFIX/profile <<-EOF | |
#source nvidia-container-toolkit | |
PATH=$PREFIX/bin:\$PATH | |
if [ -d $PREFIX/.compatlibs ]; then export LD_LIBRARY_PATH=$PREFIX/.compatlibs\${LD_LIBRARY_PATH:+:\$LD_LIBRARY_PATH} ; fi | |
EOF | |
source $PREFIX/profile | |
# needed for ~/.cache/go-build ... | |
BUILD_TMPDIR=/scratch/local2/$PKG-$VERSION-$BUILD.$USER.build.tmp | |
test -d $BUILD_TMPDIR && ( chmod -R u+rwx $BUILD_TMPDIR || true ; rm -rf $BUILD_TMPDIR ) | |
mkdir -p $BUILD_TMPDIR/home | |
export TMPDIR=$BUILD_TMPDIR | |
export HOME=$BUILD_TMPDIR/home | |
mkdir -p $PREFIX/build | |
cd $PREFIX/build | |
# start with libnvidia-container and nvidia-container-toolkit | |
( | |
VERSION=1.13.1 | |
# orig: https://github.com/NVIDIA/libnvidia-container/archive/refs/tags/v1.13.1.tar.gz | |
BEEHIVE=https://beehive.molgen.mpg.de/ed31ad76317bf46ee29205d10adf457d/libnvidia-container-1.13.1.tar.gz | |
test -e libnvidia-container-$VERSION.tar.gz || wget -nv $BEEHIVE | |
test -d libnvidia-container-$VERSION || tar -xf libnvidia-container-$VERSION.tar.gz | |
cd libnvidia-container-$VERSION | |
# remove "libnvidia-ngx.so" from the list of libs to be checked, focus on the basics now. | |
sed -i -e '/^\s\s*"libnvidia-ngx.so"/ s,"lib,//"lib,' src/nvc_info.c | |
# during the build some stuff gets downloaded, and the lsb_release command is required from within | |
# a make file, so give the people what they want ... | |
mkdir -p $PREFIX/bin | |
ln -sfv /usr/bin/chicken $PREFIX/bin/lsb_release | |
make install prefix=$PREFIX REVISION=mariux WITH_TIRPC=yes WITH_SECCOMP=no | |
cd $PREFIX/lib | |
ln -svf libnvidia-container.so.1.13.1 libnvidia-container.so.1 | |
ln -svf libnvidia-container-go.so.1.13.1 libnvidia-container-go.so.1 | |
rm -v $PREFIX/bin/lsb_release # and free the chicken again :) | |
) | |
( | |
VERSION=1.13.1 | |
# orig: https://github.com/NVIDIA/nvidia-container-toolkit/archive/refs/tags/v1.13.1.tar.gz | |
BEEHIVE=https://beehive.molgen.mpg.de/4336b6fe833e1b52e24a3e157fb843b4/nvidia-container-toolkit-1.13.1.tar.gz | |
test -e nvidia-container-toolkit-$VERSION.tar.gz || wget -nv $BEEHIVE | |
test -d nvidia-container-toolkit-$VERSION || tar -xf nvidia-container-toolkit-$VERSION.tar.gz | |
cd nvidia-container-toolkit-$VERSION | |
mkdir -p bin | |
GO_LDFLAGS="-Wl,-z,lazy,${LDFLAGS}" \ | |
GO111MODULE=auto \ | |
GOPATH="$PWD/gopath" \ | |
go build -v \ | |
-modcacherw \ | |
-buildmode=pie \ | |
-gcflags "all=-trimpath=${PWD}" \ | |
-asmflags "all=-trimpath=${PWD}" \ | |
-ldflags "-s -w -extldflags=${GO_LDFLAGS/%,/}" \ | |
-o bin \ | |
"./..." | |
install -D -m755 "./bin/nvidia-container-runtime-hook" "$PREFIX/bin/nvidia-container-runtime-hook" | |
install -D -m755 "./bin/nvidia-ctk" "$PREFIX/bin/nvidia-ctk" | |
install -D -m644 "./config/config.toml.rpm-yum" "$PREFIX/etc/nvidia-container-runtime/config.toml" | |
install -D -m644 "./oci-nvidia-hook.json" "$PREFIX/share/containers/oci/hooks.d/00-oci-nvidia-hook.json" | |
install -D -m644 "./LICENSE" "$PREFIX/share/licenses/$PKG-$VERSION/LICENSE" | |
ln -vsf nvidia-container-runtime-hook $PREFIX/bin/nvidia-container-toolkit | |
) | |
# orig: https://github.com/hpc/charliecloud/releases/download/v0.34/charliecloud-0.34.tar.gz | |
BEEHIVE=https://beehive.molgen.mpg.de/b672de23633c8253dad06a5ec81a69ea/charliecloud-0.34.tar.gz | |
test -e charliecloud-$VERSION.tar.gz || wget --no-verbose $BEEHIVE | |
test -d charliecloud-$VERSION || tar -xf charliecloud-$VERSION.tar.gz | |
cd charliecloud-$VERSION | |
# c'mon ... | |
sed -i -e 's/have_nvidia_libs=no/have_nvidia_libs=yes/' configure | |
./configure --prefix=$PREFIX | |
nice -12 make -j $(( $(nproc) * 4 / 5 + 1 )) | |
make install | |
exit |