build 1.25 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 )
		LOADER='mpif90'
		;;
	intel )
		LOADER='mpicc'
		;;
	* )
		die 3 "Oops: unknown compiler: ${COMPILER}"
		;;
	esac
15
	cat <<EOF > "${MODULE_SRCDIR}/make.inc"
gsell's avatar
gsell committed
16 17 18 19 20
PLAT		= 
DSuperLUroot 	= \${PREFIX}
DSUPERLULIB   	= \$(DSuperLUroot)/lib/libsuperlu_dist.a
BLASDEF	     	= -DUSE_VENDOR_BLAS
BLASLIB      	= \${OPENBLAS_PREFIX}/lib/libopenblas.a
21 22
METISLIB	= \${PARMETIS_PREFIX}/lib/libmetis.a
PARMETISLIB	= \${PARMETIS_PREFIX}/lib/libparmetis.a
gsell's avatar
gsell committed
23 24 25 26 27 28 29 30 31 32
FLIBS	 	= 
LIBS            = \$(DSUPERLULIB) \$(BLASLIB) \$(PARMETISLIB) \$(METISLIB)
ARCH         	= ar
ARCHFLAGS    	= cr
RANLIB       	= ranlib
CC           	= mpicc
CFLAGS          = -pipe -O3
NOOPTS		= 
FORTRAN         = mpif90
F90FLAGS	= 
gsell's avatar
gsell committed
33
LOADER	        = mpicc
gsell's avatar
gsell committed
34 35 36 37 38
LOADOPTS	= 
CDEFS        = -DAdd__ 
EOF
}

gsell's avatar
gsell committed
39
pbuild::build() {
40
	cd "${MODULE_SRCDIR}"
gsell's avatar
gsell committed
41 42 43 44
	mkdir -p "${PREFIX}/lib"
	make
}

gsell's avatar
gsell committed
45
pbuild::install() {
gsell's avatar
gsell committed
46 47
	make install
	mkdir -p "${PREFIX}/include"
48
	install -m 0444 "${MODULE_SRCDIR}"/SRC/*.h "${PREFIX}/include"
gsell's avatar
gsell committed
49 50 51
}


gsell's avatar
gsell committed
52 53 54 55 56 57
pbuild::add_to_group 'MPI'
pbuild::set_runtime_dependencies "${COMPILER}" "${MPI} 'OpenBLAS' 'parmetis'"
pbuild::set_build_dependencies "${COMPILER}" "${MPI}" 'OpenBLAS' 'parmetis'
pbuild::set_docfiles 'README'
pbuild::make_all
pbuild::cleanup_src