Files
MX_Pmodule/Compiler/OpenBLAS/build

59 lines
1.1 KiB
Plaintext
Executable File

#!/usr/bin/env modbuild
#SOURCE_URL="http://github.com/xianyi/$P/archive/v$V.tar.gz"
pbuild::configure() {
case ${COMPILER} in
gcc )
CC='gcc'
;;
intel )
CC='icc'
;;
* )
die 3 "Oops: unknown compiler: ${COMPILER}"
;;
esac
cat <<EOF > "${MODULE_SRCDIR}/make.inc"
SHELL = /bin/sh
PLAT =
DRVOPTS = \$(OPTS)
LOADER = \$(FORTRAN) -pthread
ARCHFLAGS= -ru
EOF
cat <<EOF > "${MODULE_SRCDIR}/Makefile.rule"
VERSION = 0.2.9
TARGET = CORE2
CC = ${CC}
BINARY=64
USE_THREAD = 0
USE_OPENMP = 0
NO_SHARED = 1
NO_WARMUP = 1
NO_AFFINITY = 1
FCOMMON_OPT = -frecursive
COMMON_PROF = -pg
EOF
}
pbuild::build() {
make
}
pbuild::install() {
make PREFIX="${PREFIX}" install
# We have to build shared libs and remove them here.
# Building with NOSHARED gives an error during install -
# due to a bug in the Makefile(s).
rm -f "${PREFIX}/lib/"*.so
rm -f "${PREFIX}/lib/"*.dylib
#( cd "${PREFIX}/lib"; ln -fs
}
pbuild::add_to_group 'Compiler'
pbuild::compile_in_sourcetree
pbuild::set_docfiles 'LICENSE' 'README.md'
pbuild::set_supported_compilers 'gcc' 'intel'
pbuild::make_all
pbuild::cleanup_src