Created
November 25, 2015 21:23
-
-
Save corburn/7efe09f9ca30e64a8b02 to your computer and use it in GitHub Desktop.
SC15 Student Cluster Competition
This file contains hidden or 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
${SRC}/gmp: | |
wget https://ftp.gnu.org/gnu/gmp/gmp-6.0.0a.tar.xz && \ | |
tar xvf gmp-6.0.0a.tar.xz && rm gmp-6.0.0a.tar.xz && \ | |
mv gmp-6.0.0 $@ | |
${LOCAL}/gmp: ${SRC}/gmp | |
cd $< && ./configure --prefix=$@ \ | |
AR=ar LD=ld CC=gcc CXX=g++ CFLAGS="" LDFLAGS="" && \ | |
make && make install | |
${SRC}/mpfr: | |
wget http://www.mpfr.org/mpfr-current/mpfr-3.1.3.tar.xz && \ | |
tar xvf mpfr-3.1.3.tar.xz && rm mpfr-3.1.3.tar.xz && \ | |
mv mpfr-3.1.3 $@ | |
# TODO: review INSTALL. building with gmp internals | |
#--enable-decimal-float | |
${LOCAL}/mpfr: ${SRC}/mpfr ${LOCAL}/gmp | |
cd $< && ./configure --prefix=$@ \ | |
--with-gmp=${LOCAL}/gmp \ | |
AR=ar LD=ld CC=gcc CXX=g++ CFLAGS="" LDFLAGS="" && \ | |
make && make install | |
${SRC}/mpc: | |
wget ftp://ftp.gnu.org/gnu/mpc/mpc-1.0.3.tar.gz && \ | |
tar xvf mpc-1.0.3.tar.gz && rm mpc-1.0.3.tar.gz && \ | |
mv mpc-1.0.3 $@ | |
${LOCAL}/mpc: ${SRC}/mpc ${LOCAL}/gmp ${LOCAL}/mpfr | |
cd $< && \ | |
./configure --prefix=$@ \ | |
--with-gmp=${LOCAL}/gmp \ | |
--with-mpfr=${LOCAL}/mpfr && \ | |
AR=ar LD=ld CC=gcc CXX=g++ CFLAGS="" LDFLAGS="" && \ | |
make && make install | |
# https://gcc.gnu.org/install/prerequisites.html | |
# If an ISL source distribution is found in a subdirectory of your GCC sources | |
# named isl, it will be built together with GCC | |
${SRC}/isl: | |
wget ftp://gcc.gnu.org/pub/gcc/infrastructure/isl-0.14.tar.bz2 && \ | |
tar xvf isl-0.14.tar.bz2 && rm isl-0.14.tar.bz2 && mv isl-0.14 $@ | |
#--with-gmp=build \ | |
# configure: error: Setting /home/jlt256/local/gmp implies use of system gmp | |
${LOCAL}/isl: ${SRC}/isl ${LOCAL}/gmp | |
cd $< && ./configure --prefix=$@ \ | |
--with-gmp-prefix=${LOCAL}/gmp \ | |
AR=ar LD=ld CC=gcc CXX=g++ CFLAGS="" LDFLAGS="" && \ | |
make && make install | |
# error: cloog/version.h: No such file or directory | |
${SRC}/cloog: | |
wget http://www.bastoul.net/cloog/pages/download/count.php3?url=./cloog-0.18.4.tar.gz -O cloog-0.18.4.tar.gz && \ | |
tar xvf cloog-0.18.4.tar.gz && rm cloog-0.18.4.tar.gz && \ | |
mv cloog-0.18.4 $@ | |
# gcc4.9 checks for isl0.14 | |
# --with-isl=bundled | |
${LOCAL}/cloog: ${SRC}/cloog ${LOCAL}/gmp | |
cd $< && \ | |
./configure --prefix=$@ \ | |
--with-isl-prefix=${LOCAL}/isl \ | |
--with-gmp-prefix=${LOCAL}/gmp \ | |
--with-osl=bundled \ | |
AR=ar LD=ld CC=gcc CXX=g++ CFLAGS="" LDFLAGS="" && \ | |
make && make install | |
#git clone --depth=1 https://github.com/gcc-mirror/gcc.git | |
${SRC}/gcc: | |
wget http://mirrors-usa.go-parts.com/gcc/releases/gcc-4.9.3/gcc-4.9.3.tar.bz2 && \ | |
tar xvf gcc-4.9.3.tar.bz2 && rm gcc-4.9.3.tar.bz2 && \ | |
mv gcc-4.9.3 gcc | |
# g++: unrecognized option '-static-libstdc++' | |
${LOCAL}/gcc: ${SRC}/gcc ${LOCAL}/mpc ${LOCAL}/gmp ${LOCAL}/mpfr ${LOCAL}/cloog | |
export AR=ar; export LD=ld; export CC=gcc; export CXX=g++; export CFLAGS=""; export CXXFLAGS=""; export LDFLAGS=""; \ | |
mkdir gcc-build && cd gcc-build && \ | |
trap "rm -rf gcc-build" EXIT && \ | |
${SRC}/gcc/configure --prefix=$@ \ | |
--with-mpc=${LOCAL}/mpc \ | |
--with-gmp=${LOCAL}/gmp \ | |
--with-mpfr=${LOCAL}/mpfr \ | |
--disable-multilib \ | |
--disable-libstdcxx \ | |
--enable-lto && \ | |
AR=ar LD=ld CC=gcc CXX=g++ CFLAGS="" LDFLAGS="" && \ | |
make AR=ar LD=ld CC=gcc CXX=g++ CFLAGS="" LDFLAGS="" && make install | |
This file contains hidden or 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
${SRC}/hpcg: | |
git clone --depth=1 https://github.com/hpcg-benchmark/hpcg.git | |
#trap "rm -rf $${BUILD_DIR}" EXIT && | |
${LOCAL}/hpcg: ${SRC}/hpcg | |
MPdir="/packages/parallel_studio_xe/2016/compilers_and_libraries_2016.0.109/linux/mpi/intel64"; \ | |
BUILD_DIR=$(shell mktemp --directory --tmpdir=${SRC}) && \ | |
cd $${BUILD_DIR} && \ | |
sed "s|-openmp|-qopenmp|g; s|ARCHIVER\s*= ar|ARCHIVER = xiar|g" $</setup/Make.MPIICPC_OMP > $</setup/Make.SC15 && \ | |
${SRC}/hpcg/configure SC15 && make |
This file contains hidden or 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
# find ./ -type f -exec ldd {} \; 2>/dev/null | less | |
# LOCAL is the path prefix where the programs will be installed | |
# The environment variable will supersede the default value | |
#LOCAL ?= ${HOME}/local | |
SRC = ${CURDIR} | |
BIN = ${LOCAL}/bin | |
ifndef LOCAL | |
$(error LOCAL is not set) | |
endif | |
.PHONY: prebuild | |
prebuild: ccache | |
$(MAKE) ${LOCAL}/autotools/bin/pkg-config | |
#$(MAKE) ${LOCAL}/gperftools/lib/libtcmalloc_minimal.so | |
#$(MAKE) ${LOCAL}/jemalloc/lib/libjemalloc.so | |
#$(MAKE) ${LOCAL}/zlib | |
$(MAKE) all | |
all: parallel_compression ${LOCAL}/tmux ${LOCAL}/trinityrnaseq ${LOCAL}/milc.qio ${BIN}/wrf | |
include trinityrnaseq.mk | |
include milc.mk | |
include wrf.mk | |
include repast.mk | |
include hpcg.mk | |
include gcc.mk | |
.PHONY: ccache | |
ccache: | |
-@mkdir -p ${BIN}; \ | |
ln -s `which ccache-swig` ${BIN}/gcc 2>/dev/null; \ | |
ln -s `which ccache-swig` ${BIN}/g++ 2>/dev/null; \ | |
ln -s `which ccache-swig` ${BIN}/cc 2>/dev/null; \ | |
ln -s `which ccache-swig` ${BIN}/c++ 2>/dev/null; \ | |
ln -s `which ccache-swig` ${BIN}/icc 2>/dev/null; \ | |
ln -s `which ccache-swig` ${BIN}/icpc 2>/dev/null; \ | |
ln -s `which ccache-swig` ${BIN}/mpiicc 2>/dev/null; \ | |
ln -s `which ccache-swig` ${BIN}/mpiicpc 2>/dev/null; \ | |
ln -s `which ccache-swig` ${BIN}/mpicc 2>/dev/null; \ | |
ln -s `which ccache-swig` ${BIN}/mpicxx 2>/dev/null; \ | |
ln -s ${BIN}/mpicxx ${BIN}/mpic++ 2>/dev/null | |
.PHONY: parallel_compression | |
parallel_compression: ${BIN}/lbzip2 ${BIN}/pigz | |
-@ln -s ${BIN}/lbzip2 ${BIN}/bzip2 2>/dev/null; \ | |
ln -s ${BIN}/lbzip2 ${BIN}/bunzip2 2>/dev/null; \ | |
ln -s ${BIN}/lbzip2 ${BIN}/bzcat 2>/dev/null; \ | |
ln -s ${BIN}/pigz ${BIN}/gzip 2>/dev/null; \ | |
ln -s ${BIN}/pigz ${BIN}/gunzip 2>/dev/null; \ | |
ln -s ${BIN}/pigz ${BIN}/zcat 2>/dev/null | |
${SRC}/help2man-1.29: | |
wget ftp://ftp.gnu.org/gnu/help2man/help2man-1.29.tar.gz | |
tar xvf help2man-1.29.tar.gz && rm help2man-1.29.tar.gz | |
#wget https://ftp.gnu.org/gnu/help2man/help2man-1.47.2.tar.xz | |
#tar xvf help2man-1.47.2.tar.xz && rm help2man-1.47.2.tar.xz | |
${LOCAL}/autotools/bin/help2man: ${SRC}/help2man-1.29 | |
cd ${SRC}/help2man-1.29 && \ | |
./configure --prefix=${LOCAL}/autotools && make && make install | |
${SRC}/libtool: | |
git clone --branch v2.4.6 --depth 1 http://git.savannah.gnu.org/r/libtool.git | |
# bootstrap: error: Prerequisite 'help2man' not found. Please install it, or | |
# bootstrap: 'export HELP2MAN=/path/to/help2man'. | |
# bootstrap: error: HACKING explains how to obtain these prerequisite programs: | |
# bootstrap: Program Min_version Homepage | |
# bootstrap: ----------------------------------------------------------- | |
# bootstrap: help2man 1.29 http://www.gnu.org/s/help2man | |
# bootstrap: make 3.81 http://www.gnu.org/s/make | |
# bootstrap: makeinfo 4.8 http://www.gnu.org/s/texinfo | |
# bootstrap: xz 4.999.8beta http://tukaani.org/xz | |
# bootstrap: autoconf 2.62 http://www.gnu.org/s/autoconf | |
# bootstrap: automake 1.11.1 http://www.gnu.org/s/automake | |
# bootstrap: ----------------------------------------------------------- | |
# --disable-ltdl-install assuming it is not required | |
# See https://www.gnu.org/software/libtool/manual/html_node/Using-libltdl.html | |
# error: Prerequisite 'help2man' not found. Please install it, or 'export HELP2MAN=/path/to/help2man' | |
${LOCAL}/autotools/bin/libtool: ${SRC}/libtool ${LOCAL}/autotools/bin/help2man | |
export HELP2MAN="${LOCAL}/autotools/bin/help2man"; \ | |
cd ${SRC}/libtool && \ | |
./bootstrap --force && \ | |
./configure --prefix=${LOCAL}/autotools --disable-ltdl-install && make VERSION=v2.4.6 && make install | |
${SRC}/autoconf: | |
#git clone --depth 1 http://git.savannah.gnu.org/r/autoconf.git | |
wget https://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.xz && \ | |
tar xvf autoconf-2.69.tar.xz && rm autoconf-2.69.tar.xz | |
mv autoconf-2.69 autoconf | |
${LOCAL}/autotools/bin/autoconf: ${SRC}/autoconf | |
cd ${SRC}/autoconf && ./configure --prefix=${LOCAL}/autotools && make && make install | |
${SRC}/automake: | |
git clone --depth 1 http://git.savannah.gnu.org/r/automake.git | |
# configure.ac:18: error: Autoconf version 2.69 or higher is required | |
${LOCAL}/autotools/bin/automake: ${SRC}/automake ${LOCAL}/autotools/bin/autoconf | |
export PATH="${LOCAL}/autotools/bin:${PATH}"; \ | |
cd ${SRC}/automake && \ | |
./bootstrap.sh && \ | |
./configure --prefix=${LOCAL}/autotools && make && make install | |
${SRC}/pkgconf: | |
git clone --depth 1 https://github.com/pkgconf/pkgconf.git | |
# TODO: review | |
# Makefile.am:12: error: Libtool library used but 'LIBTOOL' is undefined | |
${LOCAL}/autotools/bin/pkg-config: ${SRC}/pkgconf ${LOCAL}/autotools/bin/libtool ${LOCAL}/autotools/bin/automake | |
export PATH="${LOCAL}/autotools/bin:${PATH}"; \ | |
cd ${SRC}/pkgconf && \ | |
./autogen.sh -n && \ | |
./configure --prefix=${LOCAL}/autotools && $(MAKE) && $(MAKE) install && \ | |
ln -sf ${LOCAL}/autotools/bin/pkgconf ${LOCAL}/autotools/bin/pkg-config | |
${SRC}/gperftools: | |
git clone --depth 1 https://github.com/gperftools/gperftools.git | |
# --with-tcmalloc-alignment=8|16 | |
# | |
# --with-tcmalloc-pagesize=8|32|64 can improve performance 3-5% | |
# If ___tls_get_addr: symbol not found encountered, remove #define HAVE_TLS | |
# See "*** TCMALLOC LARGE PAGES: TRADING TIME FOR SPACE" in gpertools INSTALL | |
#${LIB}/libtcmalloc.so: ${SRC}/gperftools ${BIN}/pkg-config | |
# | |
# Upgrade libtool because of the following error: | |
# ./libtool: line 1304: func_opt_split: command not found | |
# libtool: error: you must specify a MODE. | |
# | |
# autoreconf -i --force because of the following error: | |
# libtoolize: error: 'm4/ltversion.m4' is newer: use '--force' to overwrite | |
# libtool: Version mismatch error. This is libtool 2.4.6, but the | |
# libtool: definition of this LT_INIT comes from libtool 2.2.6b. | |
# libtool: You should recreate aclocal.m4 with macros from libtool 2.4.6 | |
# libtool: and run autoconf again. | |
# | |
# --enable-minimal build only tcmalloc-minimal | |
# Replaced autoreconf -i --force with ./autogen.sh because something was generating the wrong lib path: | |
# icpc: error #10236: File not found: '/home/jlt256/src/gperftools/.libs/libtcmalloc_minimal.so' | |
# libtool: error: cannot find the library '/home/jlt256/local/gperftools/lib/libtcmalloc_minimal.la' or unhandled argument '/home/jlt256/local/gperftools/lib/libtcmalloc_minimal.la' | |
# The errors are cryptic, but it seems autotools must be updated before gpertools can be | |
# compiled, however, updating the gperftools autotools files with | |
# autoconf will also break the build. | |
# Conclusion: uncertain, but it works | |
${LOCAL}/gperftools/lib/libtcmalloc_minimal.so: ${SRC}/gperftools ${LOCAL}/autotools/bin/libtool | |
#export PATH="${LOCAL}/autotools/bin:${PATH}"; \ | |
#cd ${SRC}/gperftools && \ | |
#./autogen.sh && \ | |
#./configure --prefix=${LOCAL}/gperftools --with-tcmalloc-pagesize=32 --enable-minimal && ${MAKE} && ${MAKE} install | |
# TODO(jtravis): remove jemalloc. I suspect tcmalloc is better. | |
${SRC}/jemalloc: | |
git clone --depth 1 https://github.com/jemalloc/jemalloc.git | |
# make install targets are used directly to avoid compiling | |
# documentation which depends on Docbook XSL stylesheets | |
${LOCAL}/jemalloc/lib/libjemalloc.so: ${SRC}/jemalloc | |
cd ${SRC}/jemalloc && \ | |
sh autogen.sh && ./configure --prefix=${LOCAL}/jemalloc && \ | |
make install_bin install_include install_lib | |
@echo | |
@echo '================================================================================' | |
@echo 'update_paths' | |
@echo | |
@echo 'This should update the environment to link all subsequent programs with tcmalloc' | |
@echo '================================================================================' | |
@echo | |
exit 1 | |
${SRC}/pigz: | |
git clone --depth 1 https://github.com/madler/pigz.git | |
${BIN}/pigz: ${SRC}/pigz | |
cd ${SRC}/pigz && \ | |
sed -i 's|^CC=cc||g; s|^CFLAGS=|CFLAGS?=|g; s|LDFLAGS=|LDFLAGS+=|g' Makefile && \ | |
$(MAKE) CFLAGS="$(filter-out -O3,$(CFLAGS))" && \ | |
cp pigz ${BIN} && cp unpigz ${BIN} | |
${SRC}/gnulib: | |
git clone --depth 1 http://git.savannah.gnu.org/r/gnulib.git | |
${SRC}/lbzip2: | |
git clone --depth 1 https://github.com/kjn/lbzip2.git | |
# ./build-aux/autogen.sh: line 48: gnulib-tool: command not found | |
# configure.ac:27: require Automake 1.14, but have 1.11.1 | |
${BIN}/lbzip2: ${SRC}/lbzip2 ${SRC}/gnulib ${LOCAL}/autotools/bin/automake | |
cd ${SRC}/lbzip2 && \ | |
PATH=${PATH}:${SRC}/gnulib && \ | |
./build-aux/autogen.sh && \ | |
./configure --prefix=${LOCAL} && make && make install | |
${SRC}/libevent: | |
git clone --depth 1 https://github.com/libevent/libevent.git | |
${LOCAL}/libevent: ${SRC}/libevent | |
cd ${SRC}/libevent && \ | |
sh autogen.sh && \ | |
./configure --prefix=${LOCAL}/libevent && \ | |
make && make install | |
${SRC}/tmux: | |
git clone --depth 1 https://github.com/tmux/tmux.git | |
# Fixing this error required updating pkgconfig: | |
# configure.ac:108: error: possibly undefined macro: AC_SEARCH_LIBS | |
# See https://superuser.com/questions/421396/cant-compile-tmux-with-iterm-support#comment1253220_742095 | |
${LOCAL}/tmux: ${SRC}/tmux ${LOCAL}/libevent | |
cd ${SRC}/tmux && \ | |
sh autogen.sh && \ | |
./configure --prefix=${LOCAL}/tmux PKG_CONFIG_PATH=${LOCAL}/libevent/lib/pkgconfig && \ | |
make && make install | |
${SRC}/zlib: | |
#git clone --depth 1 https://github.com/cloudflare/zlib.git | |
#sed -i 's:\$\(CC\) \$\(SFLAGS\) -DPIC:\$\(CC\) \$\(SFLAGS\) -xHOST -DPIC:g' Makefile && | |
${LOCAL}/zlib: ${SRC}/zlib | |
#cd ${SRC}/zlib && ./configure --prefix=${LOCAL}/zlib && \ | |
#sed -i 's:\([SC]\)FLAGS=-O3:\1FLAGS=-O3 -xHOST:p' Makefile && \ | |
$(MAKE) && $(MAKE) check && $(MAKE) install |
This file contains hidden or 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
KS_IMP_RHMC_TARGETS=all: su3_leapfrog su3_omelyan_rhmc su3_rhmd su3_rhmc su3_rhmd_eos su3_rhmc_eos su3_rhmc_susc su3_rhmc_susc_eos su3_rhmc_Nf su3_rhmd_hisq su3_rhmd_hisq_su3 su3_rhmc_hisq_plaq su3_rhmc_hisq_su3 su3_rhmc_hisq_eos su3_rhmd_hisq_eos su3_rhmc_hisq_susc su3_rhmc_hisq_susc_eos | |
#${SRC}/qip: | |
# git clone --depth=1 https://github.com/usqcd-software/qio.git | |
# | |
#${LOCAL}/qip: ${SRC}/qip ${LOCAL}/scidac/qmp | |
# BUILD_DIR=${SRC}/qmp/build; \ | |
# mkdir $${BUILD_DIR} && \ | |
# trap "rm -rf $${BUILD_DIR}" EXIT && \ | |
# cd $${BUILD_DIR} && \ | |
# ../configure \ | |
# --prefix=$@ \ | |
# --with-qmp=${LOCAL}/scidac/qmp \ | |
# --disable-qmp-route | |
# git clone https://github.com/FFTW/fftw3.git | |
${SRC}/fftw3: | |
wget ftp://ftp.fftw.org/pub/fftw/fftw-3.3.4.tar.gz && \ | |
tar xvf fftw-3.3.4.tar.gz && rm fftw-3.3.4.tar.gz && mv --force fftw-3.3.4 $@ | |
${LOCAL}/fftw3: ${SRC}/fftw3 | |
cd $< && ./configure --prefix=$@ \ | |
--enable-threads \ | |
--enable-openmp \ | |
--enable-mpi \ | |
--enable-fma \ | |
--enable-avx \ | |
&& make && make install | |
${SRC}/qmp: | |
git clone --depth=1 https://github.com/usqcd-software/qmp.git | |
# TODO: review configuration | |
#./bootstrap.sh && | |
#--with-combined-threads \ | |
#--enable-openmp \ | |
#--enable-mpi \ | |
#--enable-avx2 \ | |
#--disable-fortran | |
${LOCAL}/scidac/qmp: ${SRC}/qmp ${LOCAL}/fftw3 | |
cd $< && \ | |
autoreconf --force --install && \ | |
./configure --prefix=$@ \ | |
make CFLAGS="-std=gnu99 ${CFLAGS}" && make install | |
${SRC}/qio: | |
git clone --recursive --depth=1 https://github.com/usqcd-software/qio.git | |
${LOCAL}/scidac/qio: ${SRC}/qio ${LOCAL}/scidac/qmp | |
cd $< && ./autogen.sh && \ | |
./configure --prefix=$@ \ | |
--with-qmp=${LOCAL}/scidac/qmp \ | |
--enable-largefile && make CFLAGS="-std=gnu99 ${CFLAGS}" && make install | |
${SRC}/qla: | |
git clone --depth=1 https://github.com/usqcd-software/qla.git | |
#/home/jlt256/src/qla/config/missing: Unknown `--is-lightweight' option | |
#Try `/home/jlt256/src/qla/config/missing --help' for more information | |
#configure: WARNING: 'missing' script is too old or missing | |
${LOCAL}/scidac/qla: ${SRC}/qla | |
cd $< && \ | |
autoreconf --force --install && \ | |
./configure --prefix=$@ \ | |
--enable-openmp \ | |
--enable-sse3 && make CFLAGS="-std=gnu99 -qopenmp ${CFLAGS}" && make install | |
${SRC}/qdp: | |
git clone --depth=1 https://github.com/usqcd-software/qdp.git | |
${LOCAL}/scidac/qdp: ${SRC}/qdp ${LOCAL}/scidac/qmp ${LOCAL}/scidac/qio ${LOCAL}/scidac/qla | |
cd $< && autoreconf --force --install && \ | |
./configure --prefix=$@ \ | |
--enable-pthreads \ | |
--with-qmp=${LOCAL}/scidac/qmp \ | |
--with-qio=${LOCAL}/scidac/qio \ | |
--with-qla=${LOCAL}/scidac/qla && make CFLAGS="-std=gnu99 ${CFLAGS}" && make install | |
${SRC}/qopqdp: | |
git clone --depth=1 https://github.com/usqcd-software/qopqdp.git | |
# TODO: configure with blas and lapack (see configure) | |
# qll library not found | |
#--with-qll=${LOCAL}/scidac/qll | |
${LOCAL}/scidac/qopqdp: ${SRC}/qopqdp ${LOCAL}/scidac/qdp ${LOCAL}/scidac/qla ${LOCAL}/scidac/qio ${LOCAL}/scidac/qio ${LOCAL}/scidac/qmp | |
cd $< && autoreconf --force --install && \ | |
./configure --prefix=${LOCAL}/scidac/qopqdp \ | |
--with-qdp=${LOCAL}/scidac/qdp \ | |
--with-qla=${LOCAL}/scidac/qla \ | |
--with-qio=${LOCAL}/scidac/qio \ | |
--with-qmp=${LOCAL}/scidac/qmp && make CFLAGS="-std=gnu99 ${CFLAGS}" && make install | |
${SRC}/MILC_SC15: | |
tar xvf /scratch/apps/src/MILC_SC15.tgz | |
${LOCAL}/milc: ${SRC}/MILC_SC15 ${LOCAL}/scidac/qopqdp | |
cd $< && \ | |
find . -type f -exec sed -i 's:CC *= *gcc:CC = icc:g; s:#MPP = true:MPP = true:g; s:^\(OMP\|WANTQOPo\|WANTQIO\|WANTFFTW\) = #true:\1 = true:g; s:-openmp:-qopenmp:g; s:^CFLAGS *= :CFLAGS = -parallel -xHOST :g; s:INLINEOPT = -DC_GLOBAL_INLINE:INLINEOPT = -DSSE_GLOBAL_INLINE:g' {} + && \ | |
cd $</ks_imp_rhmc && \ | |
grep -q -F "${KS_IMP_RHMC_TARGETS}" Make_template || echo "${KS_IMP_RHMC_TARGETS}" >> Make_template && \ | |
${MAKE} all && cp -r $< $@ | |
#sed -i 's:CC *= *gcc:CC = icc:g; s:#MPP = true:MPP = true:g; s:^\(OMP\|WANTQOPo\|WANTQIO\|WANTFFTW\) = #true:\1 = true:g; s:-openmp:-qopenmp:g; s:^CFLAGS *= :CFLAGS = -parallel -xHOST :g; s:INLINEOPT = -DC_GLOBAL_INLINE:INLINEOPT = -DSSE_GLOBAL_INLINE:g' $</ks_imp_rhmc/Makefile && | |
${LOCAL}/milc.vanilla: ${SRC}/MILC_SC15 | |
cd $< && \ | |
cd $</ks_imp_rhmc && \ | |
grep -q -F "${KS_IMP_RHMC_TARGETS}" Make_template || echo "${KS_IMP_RHMC_TARGETS}" >> Make_template && \ | |
${MAKE} all && \ | |
cp -r $< $@ | |
${LOCAL}/milc.fftw3: ${SRC}/MILC_SC15 ${LOCAL}/fftw3 | |
cd $< && \ | |
find . -type f -exec sed -i 's:CC *= *gcc:CC = icc:g; s:AR = ar::g; s:FFTW=$${HOME}/fftw/build-gcc:FFTW=$${LOCAL}/fftw3:g' {} + && \ | |
sed -i 's:^\(WANTFFTW\) = #true:\1 = true:g' $</ks_imp_rhmc/Makefile && \ | |
cd $</ks_imp_rhmc && \ | |
grep -q -F "${KS_IMP_RHMC_TARGETS}" Make_template || echo "${KS_IMP_RHMC_TARGETS}" >> Make_template && \ | |
${MAKE} all && \ | |
cp -r $< $@ | |
${LOCAL}/milc.mpi: ${SRC}/MILC_SC15 ${LOCAL}/fftw3 | |
cd $< && \ | |
find . -type f -exec sed -i 's:CC *= *gcc:CC = icc:g; s:AR = ar::g; s:FFTW=$${HOME}/fftw/build-gcc:FFTW=$${LOCAL}/fftw3:g' {} + && \ | |
sed -i 's:#MPP = true:MPP = true:g; s:-openmp:-qopenmp:g; s:^\(OMP\|WANTFFTW\) = #true:\1 = true:g' $</ks_imp_rhmc/Makefile && \ | |
cd $</ks_imp_rhmc && \ | |
grep -q -F "${KS_IMP_RHMC_TARGETS}" Make_template || echo "${KS_IMP_RHMC_TARGETS}" >> Make_template && \ | |
${MAKE} all && \ | |
cp -r $< $@ | |
${LOCAL}/milc.qio: ${SRC}/MILC_SC15 ${LOCAL}/fftw3 ${LOCAL}/scidac/qio | |
cd $< && \ | |
find . -type f -exec sed -i 's:CC *= *gcc:CC = icc:g; s:AR = ar::g; s:FFTW=$${HOME}/fftw/build-gcc:FFTW=$${LOCAL}/fftw3:g' {} + && \ | |
sed -i 's:SCIDAC = $${HOME}/scidac/install:SCIDAC = $${LOCAL}/scidac:g; s:#MPP = true:MPP = true:g; s:-openmp:-qopenmp:g; s:^\(OMP\|WANTFFTW\|WANTQIO\) = #true:\1 = true:g' $</ks_imp_rhmc/Makefile && \ | |
cd $</ks_imp_rhmc && \ | |
grep -q -F "${KS_IMP_RHMC_TARGETS}" Make_template || echo "${KS_IMP_RHMC_TARGETS}" >> Make_template && \ | |
${MAKE} all && \ | |
cp -r $< $@ |
This file contains hidden or 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
################################################################################ | |
# LOCAL is the path prefix where user compiled programs are installed | |
################################################################################ | |
if [[ -z "$LOCAL" ]]; then | |
2>&1 echo "ERROR: LOCAL environment variable undefined" | |
2>&1 echo "LOCAL=<install_path> source $BASH_SOURCE" | |
return 1 | |
fi | |
################################################################################ | |
# Create mpd.hosts if it does not exist | |
# https://software.intel.com/sites/products/documentation/hpc/mpi/linux/getting_started.pdf | |
################################################################################ | |
if [[ -f ${HOME}/mpd.hosts ]]; then | |
NODES=$(cat ${HOME}/mpd.hosts | tr '\n' ' ') | |
else | |
# The default value of NODES is a list such as node1 node2 node3... | |
NODES=$(echo icnode{1..6}) ichn1 | |
echo ${NODES// /$'\n'} > ${HOME}/mpd.hosts | |
echo "Created default ~/mpd.hosts file" | |
fi | |
################################################################################ | |
# Add ~/.ssh/config rule to disable host key checking on the nodes | |
################################################################################ | |
grep -q -F "HOST $NODES" ${HOME}/.ssh/config || | |
{ cat << EOF >> ${HOME}/.ssh/config && echo "Added rule to ~/.ssh/config to disable host key checking on the nodes" | |
HOST $NODES | |
StrictHostKeyChecking no | |
EOF | |
} | |
PATHRC=${LOCAL}/path.rc | |
grep "export LOCAL=" $PATHRC || echo "export LOCAL=$LOCAL" >> $PATHRC | |
# Initialize *PATH variables | |
source $PATHRC | |
################################################################################ | |
# Compiler Vars | |
################################################################################ | |
export CFLAGS="-xCORE_AVX2 -ip -std=gnu99" | |
#export CXXFLAGS="-xCORE_AVX2 -ip -std=c++11" | |
export BOOST_ROOT=${LOCAL}/boost | |
export NETCDF=${LOCAL} | |
export DISTCC_POTENTIAL_HOSTS="localhost $NODES" | |
export DISTCC_ARGS="--allow 192.168.0.0/24" | |
# WCOLL is a file with a list of hosts for pdsh to target | |
# https://code.google.com/p/pdsh/wiki/UsingPDSH | |
export WCOLL=${HOME}/mpd.hosts | |
export PDSH_RCMD_TYPE=ssh | |
################################################################################ | |
# tcmalloc is supposed to be a faster implementation of the default memory | |
# allocation library (malloc, calloc, etc) | |
################################################################################ | |
malloc_cflags="-fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free" | |
malloc_ldflags="-ltcmalloc_minimal" | |
malloc_preload="${LOCAL}/gperftools/lib/libtcmalloc_minimal.so" | |
enable_malloc() { | |
if pkg-config --exists libtcmalloc_minimal; then | |
if [[ ! "$CFLAGS" =~ "$malloc_cflags" ]]; then | |
export CFLAGS="$malloc_cflags $CFLAGS" | |
fi | |
if [[ ! "$LDFLAGS" =~ "$malloc_ldflags" ]]; then | |
export LDFLAGS="$malloc_ldflags ${LDFLAGS}" | |
fi | |
if [[ ! "$LD_PRELOAD" =~ "$malloc_preload" ]]; then | |
export LD_PRELOAD="$malloc_preload $LD_PRELOAD" | |
fi | |
else | |
2>&1 echo "WARNING: pkg-config could not find tc/jemalloc. Programs will link against the default malloc" | |
if [[ -z "$PKG_CONFIG_PATH" ]]; then | |
2>&1 echo "WARNING: The PKG_CONFIG_PATH variable is empty" | |
fi | |
fi | |
} | |
disable_malloc() { | |
export CFLAGS="${CFLAGS/$malloc_cflags }" | |
export LDFLAGS="${LDFLAGS/$malloc_ldflags }" | |
export LD_PRELOAD="${LD_PRELOAD/$malloc_preload }" | |
} | |
which_profile() { | |
echo $(readlink -e $BASH_SOURCE) | |
} | |
enable_malloc |
This file contains hidden or 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
.PHONY: SCC15Programs | |
SCC15Programs: ${BIN}/python | |
#SCC15Programs: ${BIN}/tmux ${BIN}/repast ${BIN}/python | |
${SRC}/Python-2.7.10: | |
cd ${SRC} && \ | |
tar -xvf Python-2.7.10.tgz | |
${BIN}/python: ${SRC}/Python-2.7.10 | |
cd ${SRC}/Python-2.7.10 && \ | |
./configure --prefix=${LOCAL} && \ | |
make && make install | |
${SRC}/curl: | |
cd ${SRC} && \ | |
git clone https://github.com/bagder/curl.git | |
${BIN}/curl: ${SRC}/curl | |
cd ${SRC}/curl && \ | |
./buildconf && \ | |
./configure --prefix=${LOCAL} && \ | |
make && make install | |
#${SRC}/hdf5: | |
# cd ${SRC} && \ | |
# tar -xvf hdf5-1.8.15-patch1.tar && \ | |
# mv hdf5-1.8.15-patch1 hdf5 | |
#${LIB}/libhdf5.so: ${SRC}/hdf5 | |
# cd ${SRC}/hdf5 && \ | |
# CC=mpicc CXX=mpicxx FC=mpif90 CFLAGS="" CXXFLAGS="" LDFLAGS="-L/packages/parallel_studio_xe/2016/compilers_and_libraries_2016.0.109/linux/mpi/intel64/lib" ./configure --enable-parallel --prefix=${LOCAL} && \ | |
# make -j 4 && make install | |
#${SRC}/netcdf: | |
# cd ${SRC} && \ | |
# tar -xvf netcdf-4.2.1.1.tar.gz && \ | |
# mv netcdf-4.2.1.1 netcdf | |
#${LIB}/libnetcdf.so: ${SRC}/netcdf | |
# cd ${SRC}/netcdf && \ | |
# ./configure --prefix=${LOCAL} --disable-netcdf-4 && make && make install | |
#${SRC}/netcdf-cxx: | |
# cd ${SRC} && \ | |
# tar -xvf netcdf-cxx-4.2.tar.gz && \ | |
# mv netcdf-cxx-4.2 netcdf-cxx | |
#${LIB}/libnetcdf_c++.so: ${SRC}/netcdf-cxx ${LIB}/libnetcdf.so | |
# cd ${SRC}/netcdf-cxx && \ | |
# ./configure --prefix=${LOCAL} && make && make install | |
${SRC}/repast: | |
cp -rv /scratch/apps/src/SCC15HPCRepast ./repast | |
#make CXX="mpicxx" CXXLD="mpicxx -L/usr/lib64 -L/usr/lib/x86_64-redhat-linux5E/lib64 -L/packages/parallel_studio_xe/2016/compilers_and_libraries_2016.0.109/linux/mpi/intel64/lib" BOOST_INCLUDE_DIR=${LOCAL}/boost/include BOOST_LIB_DIR="${LOCAL}/boost/lib" BOOST_INFIX=-mt-s NETCDF_INCLUDE_DIR=${LOCAL}/netcdf/include NETCDF_LIB_DIR=${LOCAL}/netcdf/lib HDF5_INCLUDE_DIR=${LOCAL}/hdf5/include HDF5_LIB_DIR=${LOCAL}/hdf5/lib CURL_LIB_DIR=${LIB} CURL_INCLUDE_DIR=${INCLUDE} Z_LIB_DIR=${LOCAL}/zlib/lib && \ | |
#${BIN}/repast: ${SRC}/repast ${BIN}/curl ${LOCAL}/boost ${LIB}/libnetcdf_c++.so ${LIB}/libnetcdf.so ${LIB}/libhdf5.so | |
#${LOCAL}/repast: ${SRC}/repast ${LOCAL}/boost ${LOCAL}/netcdf/netcdf-cxx ${LOCAL}/netcdf/netcdf-c ${LOCAL}/hdf5 ${LOCAL}/zlib | |
${LOCAL}/repast: ${SRC}/repast ${LOCAL}/netcdf/netcdf-cxx ${LOCAL}/netcdf/netcdf-c ${LOCAL}/hdf5 ${LOCAL}/zlib | |
cd $</INSTALLATION && \ | |
make \ | |
CXX="mpicxx" \ | |
CXXLD="mpicxx" \ | |
BOOST_INCLUDE_DIR=${LOCAL}/boost/include \ | |
BOOST_LIB_DIR=${LOCAL}/boost/lib \ | |
BOOST_INFIX=-mt-s \ | |
NETCDF_INCLUDE_DIR=${LOCAL}/netcdf/include \ | |
NETCDF_LIB_DIR=${LOCAL}/netcdf/lib \ | |
CURL_INCLUDE_DIR=/usr/include/curl \ | |
CURL_LIB_DIR=/usr/lib64 \ | |
HDF5_INCLUDE_DIR=${LOCAL}/hdf5/include \ | |
HDF5_LIB_DIR=${LOCAL}/hdf5/lib \ | |
Z_LIB_DIR=${LOCAL}/zlib/lib && \ | |
rsync -av --exclude='INSTALLATION' $< $@ | |
This file contains hidden or 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
${SRC}/htslib: | |
git clone --depth 1 https://github.com/samtools/htslib.git | |
${SRC}/samtools: | |
git clone --depth 1 https://github.com/samtools/samtools.git | |
# With the gcc compiler: | |
# undefined reference to `gzopen64' | |
# Use sed to delete CC and LDFLAGS variables so the environment CC (icc) and LDFLAGS (ltcmalloc) | |
# will be used | |
#make prefix=${LOCAL}/samtools install HTSDIR=${SRC}/htslib install-htslib | |
#mkdir -pv $@/lib && cp libbam.a $@/samtools/lib | |
#${LOCAL}/samtools: ${SRC}/samtools ${SRC}/htslib ${LOCAL}/zlib ${LOCAL}/perl | |
${LOCAL}/samtools: ${SRC}/samtools ${SRC}/htslib ${LOCAL}/zlib | |
cd $< && \ | |
sed -i 's:^\(CC\|AR\|CFLAGS\|LDFLAGS\)\s*=.*$$::g' ${SRC}/htslib/Makefile && \ | |
sed -i 's:^\(CC\|LDFLAGS\)\s*=.*$$::g; s/-D_CURSES_LIB=1/-D_CURSES_LIB=0/g; s|$$(CC) -pthread|$$(CC) -qopenmp -pthread|g; s|$$(CC) $$(LDFLAGS)|$$(CC) -qopenmp $$(LDFLAGS)|g' Makefile && \ | |
$(MAKE) all CFLAGS="-parallel -qopenmp ${CFLAGS}" LDFLAGS="${LDFLAGS}" && $(MAKE) prefix=$@ install | |
# FIXME: tbb does not have a make install and the generated tbbvars.sh initialization script assumes everything is in the source folder | |
#${SRC}/tbb: | |
${LOCAL}/tbb: | |
wget https://www.threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb44_20150728oss_src.tgz && \ | |
tar xvf tbb44_20150728oss_src.tgz && \ | |
rm tbb44_20150728oss_src.tgz && \ | |
mv tbb44_20150728oss $@ | |
# cp ${SRC}/tbb/build/linux_intel64_icc_cc4.4.7_libc2.12_kernel2.6.32_release/{libtbbmalloc_proxy,libtbbmalloc,libtbb}.so.2 ${LIB} && \ | |
# cp -rv ${SRC}/tbb/include/tbb/* ${INCLUDE} && \ | |
# ln -sf ${LIB}/libtbbmalloc_proxy.so.2 ${LIB}/libtbbmalloc_proxy.so | |
${LOCAL}/tbb/build/linux_intel64_${CC}_cc4.4.7_libc2.12_kernel2.6.32_release/tbbvars.sh: ${LOCAL}/tbb | |
cd ${LOCAL}/tbb && $(MAKE) compiler=${CC} | |
${SRC}/bowtie: | |
git clone --depth 1 --depth 1 https://github.com/BenLangmead/bowtie.git | |
# sed replaces the prefix with $LOCAL and removes the compiler variables | |
# | |
#sed -i "s:^prefix *=.*:prefix = ${LOCAL}:; \ | |
#s:^CPP = .*::; \ | |
#s:^CXX = .*::; \ | |
#s:^CC = .*::" Makefile | |
# TODO: review | |
#sed -i "s:^prefix *=.*:prefix = $@:; s:^\(CPP\|CXX\|CC\)\s*=.*::g" Makefile && \ | |
#sed -i "s:__cpuid((void \*):__cpuid((int \*):g" processor_support.h && | |
#${LOCAL}/bowtie: ${SRC}/bowtie ${LOCAL}/tbb/build/linux_intel64_${CC}_cc4.4.7_libc2.12_kernel2.6.32_release/tbbvars.sh | |
# export LIBRARY_PATH="${LOCAL}/tbb/build/linux_intel64_icc_cc4.4.7_libc2.12_kernel2.6.32_release/:${LIBRARY_PATH}"; \ | |
# cd $< && \ | |
# sed -i "s:^prefix *=.*:prefix = $@:" Makefile && \ | |
# source ${LOCAL}/tbb/build/linux_intel64_${CC}_cc4.4.7_libc2.12_kernel2.6.32_release/tbbvars.sh && \ | |
# $(MAKE) clean && $(MAKE) CFLAGS="" WITH_TBB=1 && $(MAKE) install | |
${LOCAL}/bowtie: ${SRC}/bowtie | |
cd $< && \ | |
sed -i "s:^prefix *=.*:prefix = $@:" Makefile && \ | |
$(MAKE) clean && $(MAKE) CFLAGS="" CXXFLAGS="" LDFLAGS="" && $(MAKE) install | |
${SRC}/bowtie2: | |
git clone --branch v2.2.6 --depth 1 https://github.com/BenLangmead/bowtie2.git | |
# sed -i "s:__cpuid((void \*):__cpuid((int \*):g" processor_support.h fixes: | |
# error: argument of type "void *" is incompatible with parameter of type "int *" | |
${LOCAL}/bowtie2: ${SRC}/bowtie2 ${LOCAL}/tbb/build/linux_intel64_${CC}_cc4.4.7_libc2.12_kernel2.6.32_release/tbbvars.sh | |
export LIBRARY_PATH="${LOCAL}/tbb/build/linux_intel64_icc_cc4.4.7_libc2.12_kernel2.6.32_release/:${LIBRARY_PATH}"; \ | |
cd $< && \ | |
sed -i "s:^prefix *=.*:prefix = $@:" Makefile && \ | |
sed -i "s:__cpuid((void \*):__cpuid((int \*):g" processor_support.h && \ | |
source ${LOCAL}/tbb/build/linux_intel64_${CC}_cc4.4.7_libc2.12_kernel2.6.32_release/tbbvars.sh && \ | |
$(MAKE) clean && CFLAGS="" CXXFLAGS="" $(MAKE) WITH_TBB=1 && $(MAKE) install | |
${SRC}/protobuf: | |
git clone --branch v3.0.0-beta-1 --depth 1 https://github.com/google/protobuf.git | |
# TODO: verify protobuf.so exists | |
# make check | |
${LOCAL}/protobuf: ${SRC}/protobuf | |
cd $< && ./autogen.sh && ./configure --prefix=$@ && $(MAKE) && $(MAKE) install | |
# Configure enable plugins? weak-threads? | |
${SRC}/libicu: | |
svn export https://ssl.icu-project.org/repos/icu/icu/trunk/source/ libicu | |
# The build fails if it does not find a license.html in the parent directory | |
# TODO: review remove CFLAGS and CXXFLAGS | |
# TODO: update prefix and target | |
${LOCAL}/libicu/lib/libicudata.so: ${SRC}/libicu | |
cd $< && \ | |
touch ../license.html && \ | |
trap "rm ../license.html" EXIT && \ | |
./runConfigureICU Linux/ICC --prefix=${LOCAL}/libicu && \ | |
$(MAKE) VERBOSE=1 && $(MAKE) install | |
#git clone --depth 1 --recursive https://github.com/boostorg/boost.git | |
#wget http://downloads.sourceforge.net/project/boost/boost/1.59.0/boost_1_59_0.tar.gz && | |
${SRC}/boost: | |
wget http://sourceforge.net/projects/boost/files/boost/1.58.0/boost_1_58_0.tar.bz2 && \ | |
tar xvf boost_1_58_0.tar.gz && rm boost_1_58_0.tar.gz && mv boost_1_58_0 $@ | |
# TODO: requires libicu? | |
#./b2 --build-dir=$${BOOST_BUILD_PATH} --prefix=$@ cflags="-parallel -qopenmp ${CFLAGS}" cxxflags="-parallel -qopenmp ${CFLAGS}" linkflags="${LDFLAGS}" address-model=64 toolset=intel install | |
${LOCAL}/boost: ${SRC}/boost ${LOCAL}/libicu/lib/libicudata.so | |
cd $< && \ | |
./bootstrap.sh --prefix=$@ --with-toolset=intel-linux && \ | |
export BOOST_BUILD_PATH=$(shell mktemp --directory --tmpdir=${SRC} --suffix=boost) && \ | |
trap "rm -rf $${BOOST_BUILD_PATH}" EXIT && \ | |
printf "using mpi : : <find-shared-library>mpi ;" > $${BOOST_BUILD_PATH}/user-config.jam && \ | |
./b2 -q -d+2 --build-dir=$${BOOST_BUILD_PATH} --prefix=$@ cxxflags="-parallel -qopenmp -xCORE-AVX2 ${CXXFLAGS}" address-model=64 toolset=intel install | |
${SRC}/bamtools: | |
git clone --depth 1 https://github.com/pezmaster31/bamtools.git | |
# https://software.intel.com/en-us/forums/intel-c-compiler/topic/477556 | |
${LOCAL}/bamtools: ${SRC}/bamtools | |
BUILD_DIR=$(shell mktemp --directory --tmpdir=${SRC} --suffix=.bamtools) && \ | |
export CFLAGS="$(filter-out -std=gnu11,$(CFLAGS))"; \ | |
export CXXFLAGS="$(filter-out -ipo,$(filter-out -std=c++11,$(CXXFLAGS)))"; \ | |
trap "rm -rf $${BUILD_DIR}" EXIT && \ | |
cd $${BUILD_DIR} && \ | |
cmake -DCMAKE_INSTALL_PREFIX=$@ $< && \ | |
make && make install | |
touch ${LOCAL}/bamtools | |
${SRC}/eXpress: | |
git clone --depth 1 https://github.com/adarob/eXpress.git | |
# | |
# No Boost libraries were found. You may need to set BOOST_LIBRARYDIR to the | |
# directory containing Boost libraries or BOOST_ROOT to the location of | |
# Boost. | |
# | |
# -lrt is required because the installed clib (ldd --version) 2.12 is less than 2.17 | |
# where it was included inherently. | |
# See http://stackoverflow.com/a/32649327 | |
# | |
# Add -qopenmp to resolve the following error: | |
# undefined reference tp __kmpc_begin | |
#${LOCAL}/express: ${SRC}/eXpress ${LOCAL}/bamtools ${LOCAL}/zlib ${LOCAL}/boost ${LOCAL}/protobuf | |
${LOCAL}/express: ${SRC}/eXpress ${LOCAL}/bamtools ${LOCAL}/zlib ${LOCAL}/protobuf | |
BUILD_DIR=$(shell mktemp --directory --tmpdir=$< --suffix=.express) && \ | |
cd $${BUILD_DIR} && \ | |
trap "rm -rf $${BUILD_DIR}" EXIT && \ | |
sed -i 's:"$${CMAKE_CURRENT_SOURCE_DIR}/../bamtools/lib/libbamtools.a":"$$ENV{LOCAL}/bamtools/lib/bamtools/libbamtools.a" "rt":g' $</src/CMakeLists.txt && \ | |
sed -i 's:set(CMAKE_CXX_FLAGS ":set(CMAKE_CXX_FLAGS "-qopenmp :g' $</src/CMakeLists.txt && \ | |
cmake -DCMAKE_C_FLAGS="-qopenmp" -DCMAKE_CXX_FLAGS="-qopenmp" -DCMAKE_INSTALL_PREFIX=$@ -DZLIB_ROOT=${LOCAL}/zlib -DPROTOBUF_LIBRARY=${LOCAL}/protobuf/lib/libprotobuf.a -DPROTOBUF_INCLUDE_DIR=${LOCAL}/protobuf/include -DGPERFTOOLS_TCMALLOC_LIB=${LOCAL}/gperftools/lib .. && \ | |
make CFLAGS="-qopenmp ${CFLAGS}" CXXFLAGS="-qopenmp ${CXXFLAGS}" CPATH="${LOCAL}/bamtools/include/bamtools:${CPATH}" && make install | |
${SRC}/R: | |
wget https://cran.r-project.org/src/base/R-3/R-3.2.2.tar.gz && \ | |
tar xvf R-3.2.2.tar.gz && rm R-3.2.2.tar.gz && \ | |
mv R-3.2.2 R | |
#CFLAGS="${CFLAGS} -O3 -ipo -qopenmp -xHost" \ | |
#CXXFLAGS="${CXXFLAGS} -O3 -ipo -openmp -xHost" \ | |
#--with-blas="-lmkl_gf_lp64 -lmkl_intel_thread -lmkl_core -liomp5 -lpthread" \ | |
#--with-lapack \ | |
# https://software.intel.com/en-us/articles/build-r-301-with-intel-c-compiler-and-intel-mkl-on-linux | |
${LOCAL}/R: ${SRC}/R | |
cd $< && ./tools/rsync-recommended && ./tools/rsync-recommended && \ | |
./configure --prefix=$@ \ | |
AR=ar LD=ld CC=gcc CXX=g++ CFLAGS="" CXXFLAGS="" LDFLAGS="" \ | |
&& make && make install | |
${SRC}/RSEM: | |
git clone --depth=1 https://github.com/deweylab/RSEM.git | |
#sed -i '/:.*/ s/sam\/.*\b//g; s:sam/::g; s:libbam.a:-lbam:g' Makefile && | |
${LOCAL}/RSEM: ${SRC}/RSEM ${LOCAL}/samtools | |
cd $< && \ | |
find . -type f -exec sed -i 's/^\(CC\|CFLAGS\|AR\|LDFLAGS\)\s*=.*$$//g; s/-D_CURSES_LIB=1/-D_CURSES_LIB=0/g' {} + && \ | |
sed -i 's:^CC = g++::g; s:^CFLAGS=.*:CFLAGS += -fast -c -I.:g; s:^COFLAGS.*:COFLAGS = -fast -c -I.:g; s:\$$(CC):\$${CC} $${CFLAGS}:g' Makefile && \ | |
$(MAKE) && \ | |
mkdir -p $@/bin && cp rsem-* $@/bin && \ | |
cp rsem_perl_utils.pm $@/bin && cp WHAT_IS_NEW $@/bin | |
${SRC}/kallisto: | |
git clone --depth=1 https://github.com/pachterlab/kallisto.git | |
# FIXME: undeclared tcmalloc requirement | |
${LOCAL}/kallisto: ${SRC}/kallisto ${LOCAL}/zlib ${LOCAL}/hdf5 | |
BUILD_DIR=$(shell mktemp --directory --tmpdir=$< --suffix=.kallisto) && \ | |
cd $${BUILD_DIR} && \ | |
cmake -DCMAKE_INSTALL_PREFIX=$@ -DHDF5_tcmalloc_minimal_LIBRARY_RELEASE=${LOCAL}/gperftools/lib/libtcmalloc_minimal.so -DZLIB_ROOT=${LOCAL}/zlib .. && \ | |
make CXXFLAGS="$(filter-out -std=c++11,$(CXXFLAGS))" && make install | |
${LOCAL}/trimmomatic: | |
wget http://www.usadellab.org/cms/uploads/supplementary/Trimmomatic/Trimmomatic-Src-0.33.zip && \ | |
unzip Trimmomatic-Src-0.33.zip && rm Trimmomatic-Src-0.33.zip && \ | |
mv trimmomatic-0.33 $@ && \ | |
cd $@ && ant | |
${SRC}/perl5: | |
git clone --depth=1 https://github.com/Perl/perl5.git | |
# http://www.gossamer-threads.com/lists/modperl/modperl/97948 | |
#./Configure -Duse64bitall -Dusethreads -Dcc=icc -Dprefix=${LOCAL} -Dusedevel -Accflags='-fPIC -xHOST -fast' -de && | |
${LOCAL}/perl: ${SRC}/perl5 | |
cd $< && \ | |
./Configure -Duse64bitall -Dusethreads -Dcc=icc -Dprefix=$@ -Dusedevel -Accflags='-fPIC -xHOST -O3' -de && \ | |
$(MAKE) && $(MAKE) test; $(MAKE) install | |
${SRC}/trinityrnaseq: | |
git clone --depth 1 https://github.com/trinityrnaseq/trinityrnaseq.git | |
# express is an alternative dependency to RSEM | |
# http://trinityrnaseq.sourceforge.net/analysis/abundance_estimation.html | |
# | |
# bowtie2 supersedes bowtie, but some scripts still depend on bowtie | |
#cp -rv ${SRC}/trinityrnaseq ${BIN} | |
# TODO: restore express dependency | |
$ #$(MAKE) plugins | |
#${LOCAL}/trinityrnaseq: ${SRC}/trinityrnaseq ${LOCAL}/bowtie ${LOCAL}/bowtie2 ${LOCAL}/samtools ${LOCAL}/trimmomatic ${LOCAL}/RSEM ${LOCAL}/perl | |
#${LOCAL}/trinityrnaseq: ${SRC}/trinityrnaseq ${LOCAL}/bowtie ${LOCAL}/bowtie2 ${LOCAL}/samtools ${LOCAL}/trimmomatic ${LOCAL}/RSEM | |
${LOCAL}/trinityrnaseq: ${SRC}/trinityrnaseq ${LOCAL}/bowtie ${LOCAL}/bowtie2 ${LOCAL}/samtools | |
cd $< && \ | |
sed -i 's|CC=gcc CXX=g++||g; s|\(^trinity_essentials: .*\)samtools|\1|g' $</trinity-plugins/Makefile && \ | |
replace 'cd htslib && $$(MAKE)' 'cd htslib && sed -i "s/^\(CC\|CFLAGS\|AR\|LDFLAGS\)\s*=.*//g" Makefile && $(MAKE)' -- $</trinity-plugins/Makefile && \ | |
find $< -type f -exec sed -i 's/^\(CC\|CXX\)\s*=.*//g; s/-openmp/-qopenmp/g' {} + && \ | |
sed -i 's|-DMAKE_DATE=\x27"$$(DATE)"\x27 |-DMAKE_DATE=\x27"Fri Oct 23 18:07:50 CDT 2015"\x27 |g' Chrysalis/Makefile && \ | |
$(MAKE) TRINITY_COMPILER=intel && cp -rv $< $@ && \ | |
find $@/sample_data -type f -exec sed -i 's:./Trinity :./Trinity --grid_conf $@/hpc_conf/SLURM.test.conf :g' {} + && \ | |
sed -i 's/queue_name/all/g' $@/hpc_conf/SLURM.test.conf |
This file contains hidden or 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
${SRC}/hdf5: | |
wget http://www.hdfgroup.org/ftp/HDF5/current/src/hdf5-1.8.15-patch1.tar.bz2 && \ | |
tar xvf hdf5-1.8.15-patch1.tar.bz2 && \ | |
rm hdf5-1.8.15-patch1.tar.bz2 && \ | |
mv hdf5-1.8.15-patch1 hdf5 | |
# TODO: are cxx and fortran required | |
${LOCAL}/hdf5: ${SRC}/hdf5 ${LOCAL}/zlib | |
cd $< && \ | |
CC=mpicc ./configure --prefix=$@ \ | |
--enable-parallel \ | |
--enable-cxx \ | |
--enable-fortran \ | |
--with-zlib=${LOCAL}/zlib && \ | |
make && make test; make install | |
${SRC}/netcdf-c: | |
git clone --depth=1 https://github.com/Unidata/netcdf-c.git | |
# cmake did not respond to setting -DZLIB_ROOT | |
# hdf5 must be in PATH for cmake to find it | |
${LOCAL}/netcdf/lib64/libnetcdf.so: ${SRC}/netcdf-c ${LOCAL}/hdf5 ${LOCAL}/zlib | |
@PATH="${LOCAL}/hdf5:${PATH}"; \ | |
BUILD_DIR=$(shell mktemp --directory --tmpdir=$< --suffix=.netcdf-c) && \ | |
cd $${BUILD_DIR} && \ | |
trap "rm -rf $${BUILD_DIR}" EXIT && \ | |
cmake -DCMAKE_INSTALL_PREFIX=${LOCAL}/netcdf \ | |
-DCMAKE_C_COMPILER=mpiicc \ | |
-DZLIB_INCLUDE_DIR=${LOCAL}/zlib/include \ | |
-DZLIB_LIBRARY=${LOCAL}/zlib/lib/libz.so $< && \ | |
make && make install | |
${SRC}/netcdf-fortran: | |
git clone --depth=1 https://github.com/Unidata/netcdf-fortran.git | |
#trap "rm -rf $${BUILD_DIR}" EXIT && | |
${LOCAL}/netcdf/netcdf-fortran: ${SRC}/netcdf-fortran ${LOCAL}/netcdf/lib64/libnetcdf.so | |
BUILD_DIR=${SRC}/netcdf-fortran/build; \ | |
mkdir $${BUILD_DIR} && \ | |
cd $${BUILD_DIR} && \ | |
cmake -DCMAKE_INSTALL_PREFIX=${LOCAL}/netcdf --config Release .. && \ | |
make FC=mpif90 F77=mpif90 CXX=mpicxx CC=mpicc && make install | |
#${SRC}/netcdf-cxx: | |
# git clone --depth=1 https://github.com/Unidata/netcdf-cxx4.git netcdf-cxx | |
# | |
#${LOCAL}/netcdf/lib64/netcdf-cxx4.so: ${SRC}/netcdf-cxx ${LOCAL}/netcdf/lib64/libnetcdf.so | |
# BUILD_DIR=$</build; \ | |
# mkdir $${BUILD_DIR} && \ | |
# trap "rm -rf $${BUILD_DIR}" EXIT && \ | |
# cd $${BUILD_DIR} && \ | |
# cmake -DCMAKE_INSTALL_PREFIX=${LOCAL}/netcdf --config Release .. && \ | |
# make && make install | |
${SRC}/jasper: | |
wget https://www.ece.uvic.ca/~frodo/jasper/software/jasper-1.900.1.zip && \ | |
unzip jasper-1.900.1.zip && \ | |
rm jasper-1.900.1.zip && \ | |
mv jasper-1.900.1 jasper | |
${LOCAL}/jasper: ${SRC}/jasper | |
cd $< && \ | |
./configure --prefix=$@ && \ | |
make && make install | |
${SRC}/WPS: | |
wget http://www2.mmm.ucar.edu/wrf/src/WPSV3.7.1.TAR.gz && \ | |
tar xvf WPSV3.7.1.TAR.gz && \ | |
rm WPSV3.7.1.TAR.gz | |
${SRC}/WRFV3: | |
wget http://www2.mmm.ucar.edu/wrf/src/WRFV3.7.1.TAR.gz && \ | |
tar xvf WRFV3.7.1.TAR.gz && \ | |
rm WRFV3.7.1.TAR.gz | |
# https://www.unidata.ucar.edu/support/help/MailArchives/netcdf/msg11504.html | |
# The netcdf-fortran interface provides netcdf.inc | |
${LOCAL}/wrf: ${SRC}/WRFV3 ${LOCAL}/netcdf/lib64/libnetcdf.so ${LOCAL}/netcdf/netcdf-fortran | |
cd $< && \ | |
expect -c 'spawn ./configure; \ | |
expect "Enter selection \\\[1-63\\\] :"; \ | |
send "21\r"; \ | |
expect "Compile for nesting? \\\(1=basic, 2=preset moves, 3=vortex following\\\) \\\[default 1\\\]: "; \ | |
send "1\r"; \ | |
expect eof' && \ | |
sed -i 's|-xAVX|-xCORE-AVX2|; s|-openmp|-qopenmp|g' configure.wrf && \ | |
./compile em_real | |
# Error : Not building geogrid. Check whether WRF is compiled in /home/jlt256/local/src/WPS/../WRFV3 | |
${LOCAL}/wps: ${SRC}/WPS ${LOCAL}/wrf ${LOCAL}/netcdf/lib64/libnetcdf.so ${LOCAL}/jasper | |
cd $< && \ | |
expect -c 'spawn ./configure; \ | |
expect "Enter selection \\\[1-40\\\] :"; \ | |
send "22\r"; \ | |
expect eof' && \ | |
./compile | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment