Skip to content
Permalink
master
Switch branches/tags

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?
Go to file
 
 
Cannot retrieve contributors at this time
executable file 75 lines (55 sloc) 1.83 KB
#! /bin/sh
# COOKIE=$(mcookie|cut -c-8); grep -v V_GREP_ME $0 > /dev/shm/runme-$COOKIE.sh ; sleep 1; exec bash /dev/shm/runme-$COOKIE.sh
# TESTING=1
PKG=relion
VERSION=3.1.1
SRC=https://github.com/3dem/relion/archive/$VERSION.tar.gz
BUILD=0
PREFIX=/pkg/$PKG-$VERSION-$BUILD
if [ -n "$TESTING" ]; then PREFIX=/dev/shm/$PKG-$VERSION-$BUILD ; fi
set -xe
umask 022
BUILD_TMPDIR=/dev/shm/$PKG-$VERSION-$BUILD.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
exec </dev/null
mkdir -p $PREFIX
cat >$PREFIX/profile <<-EOF
PATH=$PREFIX/bin:\$PATH
if [ -d $PREFIX/.compatlibs ]; then export LD_LIBRARY_PATH=$PREFIX/.compatlibs\${LD_LIBRARY_PATH:+:}\$LD_LIBRARY_PATH ; fi
EOF
. $PREFIX/profile
NPROC=$(( $(nproc) * 4 / 5 + 1 ))
BUILDDIR=$PREFIX/build
mkdir -p $BUILDDIR
cd $BUILDDIR
# Install an own fltk, relions cmake has problems honoring the output from "fltk-config --ldstaticflags".
# And when using the bundled version the rpath is set to the wrong location :/
FLTKVERSION=1.3.5
test -e fltk-$FLTKVERSION-source.tar.gz || wget --no-verbose https://www.fltk.org/pub/fltk/$FLTKVERSION/fltk-$FLTKVERSION-source.tar.gz
test -d fltk-$FLTKVERSION || tar -xf fltk-$FLTKVERSION-source.tar.gz
cd fltk-$FLTKVERSION
./configure \
--prefix=$PREFIX \
--enable-shared
make -j $NPROC
make install
rm -r $PREFIX/share/doc/fltk
cd ..
test -e $VERSION.tar.gz || wget --no-verbose $SRC
test -d $PKG-$VERSION || tar -xf $VERSION.tar.gz
cd $PKG-$VERSION
mkdir -p cmake_build
cd cmake_build
cmake \
-DCMAKE_INSTALL_PREFIX=$PREFIX \
-DCMAKE_COLOR_MAKEFILE=OFF \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DCMAKE_EXE_LINKER_FLAGS="$(fltk-config --ldflags)" \
-DCUDA_TOOLKIT_ROOT_DIR=/pkg/cuda-10.2.89-1 \
..
make -j $NPROC
make install
exit