diff --git a/science/opensph/Makefile b/science/opensph/Makefile index e5093e13497c..692628380398 100644 --- a/science/opensph/Makefile +++ b/science/opensph/Makefile @@ -1,73 +1,72 @@ PORTNAME= OpenSPH -DISTVERSION= 0.3.5 -PORTREVISION= 1 +DISTVERSION= 0.3.6 CATEGORIES= science MAINTAINER= yuri@FreeBSD.org COMMENT= Library and graphical tools for running SPH and N-body simulations LICENSE= MIT LICENSE_FILE= ${WRKSRC}/LICENSE TEST_DEPENDS= catch>0:devel/catch USES= compiler:c++14-lang qmake qt:5 USE_GITLAB= yes USE_WX= 3.1 GL_SITE= https://gitlab.com GL_ACCOUNT= sevecekp GL_PROJECT= sph -GL_COMMIT= da3692e99fac19bc512c8462b0492eabd2de33af +GL_COMMIT= 39d79bf5d4c9de7976ef18fd02a76c96942902b9 QMAKE_SOURCE_PATH= ${WRKSRC}/sph.pro QMAKE_ARGS= CONFIG+=release CXXFLAGS+= -DSPH_CONFIG_SET TEST_WRKSRC= ${WRKDIR}/test BINARY_ALIAS= wx-config=${LOCALBASE}/bin/wxgtk3u-3.1-config PLIST_FILES= bin/opensph bin/opensph-cli bin/opensph-info OPTIONS_DEFINE= CHAISCRIPT EIGEN HDF5 OPENMP TBB VDB OPTIONS_DEFAULT= CHAISCRIPT EIGEN HDF5 OPENMP TBB VDB CHAISCRIPT_DESC= Be able to read and modify particle data from a script CHAISCRIPT_QMAKE_ON= CONFIG+=use_chaiscript CHAISCRIPT_BUILD_DEPENDS= ${LOCALBASE}/include/chaiscript/chaiscript.hpp:lang/chaiscript EIGEN_DESC= Eigen for additional methods to set up initial conditions EIGEN_QMAKE_ON= CONFIG+=use_eigen EIGEN_USES= eigen:3 HDF5_DESC= Be able to read files generated by miluphcuda code HDF5_QMAKE_ON= CONFIG+=use_hdf5 HDF5_LIB_DEPENDS= libhdf5.so:science/hdf5 OPENMP_QMAKE_ON= CONFIG+=use_openmp TBB_DESC= Parallelize with Intel Threading Building Blocks TBB_QMAKE_ON= CONFIG+=use_tbb TBB_LIB_DEPENDS= libtbb.so:devel/tbb VDB_DESC= Use OpenVDB for converting particles to volumetric data VDB_QMAKE_ON= CONFIG+=use_vdb VDB_LIB_DEPENDS= libImath.so:math/Imath \ libopenvdb.so:misc/openvdb \ libtbb.so:devel/tbb do-test: @${REINPLACE_CMD} -e 's|Path(.*|Path("${TEST_WRKSRC}");|' ${WRKSRC}/test/utils/Config.h @${MKDIR} ${TEST_WRKSRC} @cd ${_QMAKE_WRKSRC} && \ ${SETENV} ${QMAKE_ENV} ${_QMAKE} ${QMAKE_ARGS} \ ${WRKSRC}/test.pro \ ${QMAKE_CONFIGURE_ARGS:?--:} ${QMAKE_CONFIGURE_ARGS} @cd ${BUILD_WRKSRC} && \ ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${_MAKE_JOBS} ${MAKE_ARGS} @cd ${TEST_WRKSRC} && \ ${WRKSRC}/test/test .include diff --git a/science/opensph/distinfo b/science/opensph/distinfo index 6636166cb01c..d8cec48dd5b5 100644 --- a/science/opensph/distinfo +++ b/science/opensph/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1624643149 -SHA256 (sevecekp-sph-da3692e99fac19bc512c8462b0492eabd2de33af_GL0.tar.gz) = 9e8da74a66ae16063294dd0ef23e5fbded8cd67e18ca4f0a753d2d5de1fc7060 -SIZE (sevecekp-sph-da3692e99fac19bc512c8462b0492eabd2de33af_GL0.tar.gz) = 26541002 +TIMESTAMP = 1626231147 +SHA256 (sevecekp-sph-39d79bf5d4c9de7976ef18fd02a76c96942902b9_GL0.tar.gz) = 954b7acf9914c89f05bf574fcac52111f75b6253bd183c113ae6def914121435 +SIZE (sevecekp-sph-39d79bf5d4c9de7976ef18fd02a76c96942902b9_GL0.tar.gz) = 26576081 diff --git a/science/opensph/files/patch-lib_system_Platform.cpp b/science/opensph/files/patch-core_system_Platform.cpp similarity index 94% rename from science/opensph/files/patch-lib_system_Platform.cpp rename to science/opensph/files/patch-core_system_Platform.cpp index cee58217b01e..652b8dd7c998 100644 --- a/science/opensph/files/patch-lib_system_Platform.cpp +++ b/science/opensph/files/patch-core_system_Platform.cpp @@ -1,52 +1,52 @@ ---- lib/system/Platform.cpp.orig 2021-04-08 21:23:28 UTC -+++ lib/system/Platform.cpp +--- core/system/Platform.cpp.orig 2021-04-08 21:23:28 UTC ++++ core/system/Platform.cpp @@ -14,7 +14,11 @@ NAMESPACE_SPH_BEGIN Expected getExecutablePath() { char result[PATH_MAX]; +#if defined(__FreeBSD__) + ssize_t count = readlink("/proc/curproc/file", result, PATH_MAX); +#else ssize_t count = readlink("/proc/self/exe", result, PATH_MAX); +#endif if (count != -1) { Path path(std::string(result, count)); return path.parentPath(); @@ -102,14 +106,18 @@ class CpuUsage { (private) public: CpuUsage() { +#if !defined(__FreeBSD__) FILE* file; +#endif struct tms timeSample; +#if !defined(__FreeBSD__) char line[128]; +#endif lastCpu = times(&timeSample); lastSysCpu = timeSample.tms_stime; lastUserCpu = timeSample.tms_utime; - +#if !defined(__FreeBSD__) file = fopen("/proc/cpuinfo", "r"); numProcessors = 0; while (fgets(line, 128, file) != NULL) { @@ -117,6 +125,8 @@ class CpuUsage { (private) numProcessors++; } fclose(file); +#endif + numProcessors = 8; // TODO } Optional getUsage() { @@ -150,7 +160,7 @@ bool isDebuggerPresent() { char buf[1024]; bool debuggerPresent = false; - int status_fd = open("/proc/self/status", O_RDONLY); + int status_fd = open("/proc/curproc/status", O_RDONLY); if (status_fd == -1) { return false; }