summaryrefslogtreecommitdiff
path: root/science/elmerfem/Makefile
blob: ab043123fe771bbfbfc50b520e9a55adaa6a383e (plain)
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
# Created by: Pedro Giffuni
# $FreeBSD$

PORTNAME=	elmerfem
PORTVERSION=	8.4
PORTREVISION=	1
DISTVERSIONPREFIX=	release-
CATEGORIES=	science

MAINTAINER=	ports@FreeBSD.org
COMMENT=	Multiphysical simulation software

LICENSE=	GPLv2

LIB_DEPENDS=	libparpack.so:math/arpack-ng \
		libmetis.so:math/metis \
		libmpich.so:net/mpich

USES=		blaslapack:netlib cmake fortran tcl
USE_GITHUB=	yes
GH_ACCOUNT=	ElmerCSC
USE_LDCONFIG=	${PREFIX}/lib/elmersolver

ALL_TARGET=	# empty

CMAKE_ARGS=	-DELMER_FEM_REVISION:STRING=f6bfdc9

CMAKE_ARGS+=	-DHAVE_INTTYPES_H=ON
.if !defined(MAINTAINER_MODE)
CMAKE_ARGS+=	-Wno-dev
.endif

.include <bsd.port.pre.mk>

.if ${ARCH} == "amd64"
CFLAGS_${ARCH}=	-fPIC
CXXFLAGS_${ARCH}= -fPIC
FCFLAGS+=	-fPIC
FFLAGS+=	-fPIC
.endif

LDFLAGS+=	-L${LOCALBASE}/lib
FCPPFLAGS+=	-ansi

post-patch:
	@${RM} -r ${WRKSRC}/elmergrid/src/metis-5.1.0
	@${REINPLACE_CMD} -e 's,"metis.*/metis\.h",<metis.h>,' \
		${WRKSRC}/elmergrid/src/femelmer.c

post-install:
	${LN} -sf ElmerSolver_mpi ${STAGEDIR}${PREFIX}/bin/ElmerSolver
	@${STRIP_CMD} ${STAGEDIR}/${PREFIX}/bin/ElmerGrid

do-test:
	@cd ${TEST_WRKSRC} && ctest -C ${CMAKE_BUILD_TYPE} ${_MAKE_JOBS}

.include <bsd.port.post.mk>