From owner-dev-commits-ports-all@freebsd.org Thu Apr 22 22:16:48 2021 Return-Path: Delivered-To: dev-commits-ports-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3B6336213F5; Thu, 22 Apr 2021 22:16:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FRBbh1BfJz4rgZ; Thu, 22 Apr 2021 22:16:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1135621E8C; Thu, 22 Apr 2021 22:16:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 13MMGmjw078398; Thu, 22 Apr 2021 22:16:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13MMGmgt078397; Thu, 22 Apr 2021 22:16:48 GMT (envelope-from git) Date: Thu, 22 Apr 2021 22:16:48 GMT Message-Id: <202104222216.13MMGmgt078397@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Yuri Victorovich Subject: git: c4254019d8e8 - main - science/mbdyn: Unbreak build by properly implementing get_nprocs() for FreeBSD. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: yuri X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c4254019d8e8aa636db96bcea5702e0a39880048 Auto-Submitted: auto-generated X-BeenThere: dev-commits-ports-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the ports repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2021 22:16:48 -0000 The branch main has been updated by yuri: URL: https://cgit.FreeBSD.org/ports/commit/?id=c4254019d8e8aa636db96bcea5702e0a39880048 commit c4254019d8e8aa636db96bcea5702e0a39880048 Author: Yuri Victorovich AuthorDate: 2021-04-22 22:12:26 +0000 Commit: Yuri Victorovich CommitDate: 2021-04-22 22:16:46 +0000 science/mbdyn: Unbreak build by properly implementing get_nprocs() for FreeBSD. It looks like it was only built for one CPU before and didn't fail. Some change in the underlying libraries triggered the build to become multi-CPU and it began failing because get_nprocs() wasn't available for FreeBSD and also was't properly linked to the surrounding code. Reported by: fallout --- science/mbdyn/Makefile | 9 +++-- .../files/patch-libraries_libobjs_get__nprocs.c | 39 ++++++++++++++++++++++ science/mbdyn/files/patch-mbdyn_base_invsolver.cc | 11 ++++++ science/mbdyn/files/patch-mbdyn_base_readlinsol.cc | 11 ++++++ science/mbdyn/files/patch-mbdyn_base_rtsolver.cc | 11 ++++++ science/mbdyn/files/patch-mbdyn_base_solver.cc | 10 ++++++ science/mbdyn/pkg-descr | 2 +- 7 files changed, 89 insertions(+), 4 deletions(-) diff --git a/science/mbdyn/Makefile b/science/mbdyn/Makefile index 006b0d124aa3..cd6b63780a8c 100644 --- a/science/mbdyn/Makefile +++ b/science/mbdyn/Makefile @@ -1,8 +1,8 @@ # 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/ @@ -20,12 +20,15 @@ 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 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 @@ -8,4 +8,4 @@ o a commercial tool o a completely supported software -WWW: http://www.mbdyn.org +WWW: https://www.mbdyn.org/