build 1.02 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() {
4 5 6 7 8 9
	CC=$MPICC
	CXX=$MPICXX
	F77=$MPIF77
	F90=$MPIF90
	FC=$MPIFC
	FORTRAN=$MPIFORTRAN
gsell's avatar
gsell committed
10 11
}

gsell's avatar
gsell committed
12
pbuild::build() {
gsell's avatar
gsell committed
13 14
	local -ri MAJOR_VERSION=${V%%.*}
	if (( MAJOR_VERSION == 3 )) ; then
15
		cd "${MODULE_SRCDIR}"
gsell's avatar
gsell committed
16 17 18 19 20 21 22 23 24
		make -e -j3 || exit 1

		mkdir -p $PREFIX/include/metis
		mkdir -p $PREFIX/lib

		cp *.h $PREFIX/include
		cp METISLib/*.h $PREFIX/include/metis
		cp lib*.a $PREFIX/lib
	elif (( MAJOR_VERSION == 4 )); then
25
		cd "${MODULE_SRCDIR}"
gsell's avatar
gsell committed
26 27 28 29 30 31 32 33 34 35 36 37 38 39
		make config prefix=$PREFIX || exit 1
		make -j3 || exit 1
		make install

		LIBMETIS_A=$(find . -name libmetis.a)
		METIS_H=$(find . -name metis.h)

		install -m 0644 $METIS_H    $PREFIX/include
		install -m 0644 $LIBMETIS_A $PREFIX/lib
	else
		die 42 "Unsupported version: $V"
	fi
}

gsell's avatar
gsell committed
40
pbuild::install() {
gsell's avatar
gsell committed
41 42 43 44
	:
}


gsell's avatar
gsell committed
45 46 47 48 49 50
pbuild::add_to_group 'MPI'
pbuild::set_runtime_dependencies "${COMPILER}" "${MPI}"
pbuild::set_build_dependencies "${COMPILER}" "${MPI}"
pbuild::set_docfiles 'CHANGES' 'INSTALL' 'LICENSE.txt' 'README' 'VERSION' 
pbuild::make_all
pbuild::cleanup_src
gsell's avatar
gsell committed
51