diff --git a/science/mbdyn/Makefile b/science/mbdyn/Makefile index 006b0d124aa3..cd6b63780a8c 100644 --- a/science/mbdyn/Makefile +++ b/science/mbdyn/Makefile @@ -1,73 +1,76 @@ # Created by: Kay Lehmann PORTNAME= mbdyn -PORTVERSION= 1.7.3 -PORTREVISION= 1 +DISTVERSION= 1.7.3 +PORTREVISION= 3 CATEGORIES= science MASTER_SITES= https://www.mbdyn.org/userfiles/downloads/ MAINTAINER= yuri@FreeBSD.org COMMENT= MultiBody Dynamics analysis system LICENSE= GPLv2 LICENSE_FILE= ${WRKSRC}/COPYING BROKEN_powerpc= Does not compile on powerpc BROKEN_powerpc64= fails to compile: libraries/libmbutil/parser.h:275:3: error: expected identifier BUILD_DEPENDS= libatomic_ops>0:devel/libatomic_ops LIB_DEPENDS= libltdl.so:devel/libltdl \ libarpack.so:math/arpack-ng \ libumfpack.so:math/suitesparse -GNU_CONFIGURE= yes USES= compiler:c++11-lib fortran gmake libtool:build localbase USE_LDCONFIG= yes + CPPFLAGS+= -fpermissive -I${LOCALBASE}/include/suitesparse + +GNU_CONFIGURE= yes 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 GOTOBLAS ATLAS OPTIONS_DEFAULT= REFERENCE ATLAS_DESC= ATLAS CHACO_DESC= Enable chaco-support GOTOBLAS_DESC= GotoBLAS2 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 GOTOBLAS_CONFIGURE_ON= --with-blas=goto --with-goto=goto2 GOTOBLAS_USES= blaslapack:gotoblas 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 .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 diff --git a/science/mbdyn/files/patch-libraries_libobjs_get__nprocs.c b/science/mbdyn/files/patch-libraries_libobjs_get__nprocs.c new file mode 100644 index 000000000000..9aaa6e62bd02 --- /dev/null +++ b/science/mbdyn/files/patch-libraries_libobjs_get__nprocs.c @@ -0,0 +1,39 @@ +--- libraries/libobjs/get_nprocs.c.orig 2021-04-22 19:18:04 UTC ++++ libraries/libobjs/get_nprocs.c +@@ -39,10 +39,28 @@ + + #ifndef HAVE_GET_NPROCS + ++#if defined(__FreeBSD__) ++#include ++#include ++#include ++#include ++#endif ++ + /* GNU libc */ + int + get_nprocs(void) + { ++#if defined(__FreeBSD__) ++ static int name[2] = {CTL_HW, HW_NCPU}; ++ int32_t ncpu; ++ size_t size = sizeof(ncpu); ++ if (sysctl(name, sizeof(name)/sizeof(*name), &ncpu, &size, NULL, 0)) { ++ perror("unable to determine number of CPUs"); ++ abort(); ++ } ++ return (int)ncpu; ++ ++#else + #warning "pippero!!!" + #if defined(_SC_NPROCESSORS_ONLN) + /* POSIX.1. */ +@@ -65,6 +83,7 @@ get_nprocs(void) + #endif + /* we assume that there is at least one :) */ + return 1; ++#endif + } + + #endif /* HAVE_GET_NPROCS */ diff --git a/science/mbdyn/files/patch-mbdyn_base_invsolver.cc b/science/mbdyn/files/patch-mbdyn_base_invsolver.cc new file mode 100644 index 000000000000..63e116306104 --- /dev/null +++ b/science/mbdyn/files/patch-mbdyn_base_invsolver.cc @@ -0,0 +1,11 @@ +--- mbdyn/base/invsolver.cc.orig 2017-09-09 09:20:12 UTC ++++ mbdyn/base/invsolver.cc +@@ -76,6 +76,8 @@ + + #include "solver_impl.h" + ++extern "C" {int get_nprocs(void);} ++ + InverseSolver::InverseSolver(MBDynParser& HPar, + const std::string& sInFName, + const std::string& sOutFName, diff --git a/science/mbdyn/files/patch-mbdyn_base_readlinsol.cc b/science/mbdyn/files/patch-mbdyn_base_readlinsol.cc new file mode 100644 index 000000000000..2154c6d46aaf --- /dev/null +++ b/science/mbdyn/files/patch-mbdyn_base_readlinsol.cc @@ -0,0 +1,11 @@ +--- mbdyn/base/readlinsol.cc.orig 2021-04-22 19:28:15 UTC ++++ mbdyn/base/readlinsol.cc +@@ -35,6 +35,8 @@ + #include "dataman.h" + #include "readlinsol.h" + ++extern "C" {int get_nprocs(void);} ++ + void + ReadLinSol(LinSol& cs, HighParser &HP, bool bAllowEmpty) + { diff --git a/science/mbdyn/files/patch-mbdyn_base_rtsolver.cc b/science/mbdyn/files/patch-mbdyn_base_rtsolver.cc new file mode 100644 index 000000000000..bc93ef8cfb6d --- /dev/null +++ b/science/mbdyn/files/patch-mbdyn_base_rtsolver.cc @@ -0,0 +1,11 @@ +--- mbdyn/base/rtsolver.cc.orig 2021-04-22 19:28:55 UTC ++++ mbdyn/base/rtsolver.cc +@@ -38,6 +38,8 @@ + #include "rtaisolver.h" + #include "rtposixsolver.h" + #include "ac/sys_sysinfo.h" ++ ++extern "C" {int get_nprocs(void);} + + /* RTSolverBase - begin */ + diff --git a/science/mbdyn/files/patch-mbdyn_base_solver.cc b/science/mbdyn/files/patch-mbdyn_base_solver.cc new file mode 100644 index 000000000000..92675d27ae77 --- /dev/null +++ b/science/mbdyn/files/patch-mbdyn_base_solver.cc @@ -0,0 +1,10 @@ +--- mbdyn/base/solver.cc.orig 2021-04-22 19:30:51 UTC ++++ mbdyn/base/solver.cc +@@ -85,6 +85,7 @@ + #include "ac/arpack.h" + #include "eigjdqz.h" + ++extern "C" {int get_nprocs(void);} + + #ifdef HAVE_SIGNAL + /* diff --git a/science/mbdyn/pkg-descr b/science/mbdyn/pkg-descr index 14cc6838c91c..68a8e27e7369 100644 --- a/science/mbdyn/pkg-descr +++ b/science/mbdyn/pkg-descr @@ -1,11 +1,11 @@ * What MBDyn is o a command-line, direct initial-value problem solver with a large, flexible multifield element library o a research tool o a community developed, research driven open-source software * What MBDyn is not o a complete out-of-the-box ``bells and whistles'' GUI for solid modeling o a commercial tool o a completely supported software -WWW: http://www.mbdyn.org +WWW: https://www.mbdyn.org/