aboutsummaryrefslogtreecommitdiff
path: root/science/mbdyn/Makefile
blob: a601b39b80e0dd4d8287dfbe3193fa94018c7c10 (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
60
61
62
63
64
65
66
67
68
69
70
71
72
PORTNAME=	mbdyn
DISTVERSION=	1.7.3
PORTREVISION=	15
CATEGORIES=	science
MASTER_SITES=	https://www.mbdyn.org/userfiles/downloads/

MAINTAINER=	yuri@FreeBSD.org
COMMENT=	MultiBody Dynamics analysis system
WWW=		https://www.mbdyn.org/

LICENSE=	GPLv2
LICENSE_FILE=	${WRKSRC}/COPYING

BROKEN_powerpc=		does not compile on powerpc

BUILD_DEPENDS=	libatomic_ops>0:devel/libatomic_ops
LIB_DEPENDS=	libltdl.so:devel/libltdl \
		libarpack.so:math/arpack-ng \
		libumfpack.so:math/suitesparse-umfpack

USES=		compiler:c++11-lib fortran gmake libtool:build localbase
USE_LDCONFIG=	yes
USE_CXXSTD=	c++14 # fix build breakage with clang16 due to use of deprecated feature 'dynamic exception specifications', see https://public.gitlab.polimi.it/DAER/mbdyn/-/issues/339

CPPFLAGS+=	-fpermissive -I${LOCALBASE}/include/suitesparse

GNU_CONFIGURE=	yes
GNU_CONFIGURE_MANPREFIX=	${PREFIX}/share
CONFIGURE_ARGS=	--program-prefix='' --enable-multithread --with-mpi=no \
		--with-ginac=no

INSTALL_TARGET=	install-strip

OPTIONS_DEFINE=	METIS CHACO
OPTIONS_RADIO=	BLAS
OPTIONS_RADIO_BLAS=	REFERENCE ATLAS
OPTIONS_DEFAULT=	REFERENCE

ATLAS_DESC=	ATLAS
CHACO_DESC=	Enable chaco-support
METIS_DESC=	Enable metis-support
REFERENCE_DESC=	Blas / Lapack

ATLAS_CONFIGURE_ON=	--with-blas=atlas
ATLAS_USES=	blaslapack:atlas

CHACO_BUILD_DEPENDS=	${LOCALBASE}/lib/libchaco.a:math/chaco
CHACO_CONFIGURE_ON=	--with-chaco=yes
CHACO_CONFIGURE_OFF=	--with-chaco=no

METIS_CONFIGURE_ON=	--with-metis=yes
METIS_CONFIGURE_OFF=	--with-metis=no
METIS_CPPFLAGS=		-I${LOCALBASE}/include/metis
METIS_LIB_DEPENDS=	libmetis.so:math/metis

REFERENCE_CONFIGURE_ON=	--with-blas=blas
REFERENCE_USES=	blaslapack:netlib

.include <bsd.port.pre.mk>

.if ${GCC_DEFAULT} >= 10
# workaround for Type mismatch in argument 't' at (1); passed REAL(4) to INTEGER(4)
# in theory, this should set FCFLAGS, but the port does not conform
FFLAGS+=	-fallow-argument-mismatch
.endif

pre-configure:
	${REINPLACE_CMD} -e '/try_lapack_LIBS=/s/-llapack/${LAPACKLIB}/' \
		-e 's/ -lxerbla//; s/-lcholmod/-lcholmod ${BLASLIB} ${LAPACKLIB} -lsuitesparseconfig/'	\
		${WRKSRC}/configure

.include <bsd.port.post.mk>