aboutsummaryrefslogtreecommitdiff
path: root/science/ocean/Makefile
blob: 1d3d1b9dc40004de4e462c148ec85804bd9dc8c0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
PORTNAME=	ocean
DISTVERSIONPREFIX=	v
DISTVERSION=	3.1.0
PORTREVISION=	2
CATEGORIES=	science
PKGNAMESUFFIX=	-spectroscopy-code

MAINTAINER=	yuri@FreeBSD.org
COMMENT=	BSE code for core spectroscopy
WWW=		https://github.com/times-software/OCEAN

LICENSE=	BSD3CLAUSE
LICENSE_FILE=	${WRKSRC}/License

LIB_DEPENDS=	libfftw3.so:math/fftw3 \
		libopenblas.so:math/openblas
RUN_DEPENDS=	abinit>0:science/abinit \
		quantum-espresso>0:science/quantum-espresso

USES=		fortran gmake localbase perl5 shebangfix
USE_PERL5=	build run

SHEBANG_GLOB=	*.pl

USE_GITHUB=	yes
GH_ACCOUNT=	times-software
GH_PROJECT=	${PORTNAME:tu}

MAKE_ARGS=	MPIFC=${MPIFC} \
		MPI_HOME=${MPI_HOME} \
		MPI_LIBS="${MPI_LIBS}"

MAKE_JOBS_UNSAFE=	yes # parallel build fails, see https://github.com/times-software/OCEAN/issues/327

BINARY_ALIAS=	make=${GMAKE}

OPTIONS_SINGLE=		MPI
OPTIONS_SINGLE_MPI=	MPICH OPENMPI
OPTIONS_DEFAULT=	OPENMPI

MPICH_USES=		mpi:mpich

OPENMPI_USES=		mpi:openmpi

post-extract:
	# copy in the Makefile.arch file
	@${LN} -s ${FILESDIR}/Makefile.arch ${WRKSRC}/
	# set execution flag on all *.pl files
	@${FIND} ${WRKSRC} -name "*.pl" | ${XARGS} ${CHMOD} +x

post-patch:
	# patch the bash path (but run_examples.pl is currently dysfunctional, according to README)
	@${REINPLACE_CMD} -i '' -e 's|#!/bin/bash|#!${LOCALBASE}/bin/bash|' ${WRKSRC}/EXAMPLE/run_examples.pl

post-install:
	# strip binaries
	@${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/*.x

.include <bsd.port.mk>