build 1.11 KB
Newer Older
gsell's avatar
gsell committed
1
#!/usr/bin/env modbuild
gsell's avatar
gsell committed
2

gsell's avatar
gsell committed
3
pbuild::configure() {
gsell's avatar
gsell committed
4 5 6 7 8 9 10 11 12 13 14
	case ${COMPILER} in
	gcc )
		CC='gcc'
		;;
	intel )
		CC='icc'
		;;
	* )
		die 3 "Oops: unknown compiler: ${COMPILER}"
		;;
	esac
15
	cat <<EOF > "${MODULE_SRCDIR}/make.inc"
gsell's avatar
gsell committed
16 17 18 19 20
SHELL = /bin/sh
PLAT = 
DRVOPTS  = \$(OPTS)
LOADER   = \$(FORTRAN) -pthread
ARCHFLAGS= -ru
gsell's avatar
gsell committed
21
EOF
22
	cat <<EOF > "${MODULE_SRCDIR}/Makefile.rule"
gsell's avatar
gsell committed
23 24
VERSION = 0.2.9
TARGET = CORE2
gsell's avatar
gsell committed
25
CC = ${CC}
gsell's avatar
gsell committed
26
BINARY=64
27 28
USE_THREAD = 0
USE_OPENMP = 0
gsell's avatar
gsell committed
29 30 31 32 33
NO_SHARED = 1
NO_WARMUP = 1
NO_AFFINITY = 1
FCOMMON_OPT = -frecursive
COMMON_PROF = -pg
gsell's avatar
gsell committed
34 35 36
EOF
}

gsell's avatar
gsell committed
37
pbuild::build() {
38
	cd "${MODULE_SRCDIR}"
gsell's avatar
gsell committed
39
	make
gsell's avatar
gsell committed
40 41
}

gsell's avatar
gsell committed
42
pbuild::install() {
gsell's avatar
gsell committed
43
	make PREFIX="${PREFIX}" install
44 45 46 47
	# 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
gsell's avatar
gsell committed
48 49
	rm -f "${PREFIX}/lib/"*.dylib 
	#( cd "${PREFIX}/lib"; ln -fs
gsell's avatar
gsell committed
50 51
}

gsell's avatar
gsell committed
52 53 54 55 56 57 58
pbuild::add_to_group 'Compiler'
pbuild::set_runtime_dependencies "${COMPILER}"
pbuild::set_build_dependencies "${COMPILER}"
pbuild::set_docfiles 'LICENSE' 'README.md'
pbuild::set_supported_compilers 'gcc' 'intel'
pbuild::make_all
pbuild::cleanup_src