diff --git a/science/opensph/Makefile b/science/opensph/Makefile index 837ee88b8ba7..744a9cab323c 100644 --- a/science/opensph/Makefile +++ b/science/opensph/Makefile @@ -1,74 +1,73 @@ PORTNAME= OpenSPH -DISTVERSION= 0.3.7 +DISTVERSION= 0.3.8 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= bd306b644ab617f3b44613fa98b78b40f8ef6805 +GL_COMMIT= fb6ec33d8fc20324161207aa2951e2e90698c272 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 - disabled pending OneTBB support, see https://gitlab.com/sevecekp/sph/-/issues/36 +OPTIONS_DEFAULT= CHAISCRIPT EIGEN HDF5 OPENMP TBB # VDB - broken 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/onetbb -TBB_BROKEN= OneTBB support is missing, but the dependency misc/openvdb already switched to OneTBB 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/onetbb -VDB_BROKEN= OneTBB support is missing, but the dependency misc/openvdb already switched to OneTBB +VDB_BROKEN= Fails to build, see https://gitlab.com/sevecekp/sph/-/issues/39 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 d8cd578c86a5..479f9ebefeef 100644 --- a/science/opensph/distinfo +++ b/science/opensph/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1629095035 -SHA256 (sevecekp-sph-bd306b644ab617f3b44613fa98b78b40f8ef6805_GL0.tar.gz) = 9cca11f4814211ae3992095b2a9a5c1ee9f88b21674db004960e8b9782f6c0ab -SIZE (sevecekp-sph-bd306b644ab617f3b44613fa98b78b40f8ef6805_GL0.tar.gz) = 26626447 +TIMESTAMP = 1633211138 +SHA256 (sevecekp-sph-fb6ec33d8fc20324161207aa2951e2e90698c272_GL0.tar.gz) = 84ad21c187af8ed7d897aeb0c099af72d8a04e41ce4ad5fe6f7421abd01e2dc2 +SIZE (sevecekp-sph-fb6ec33d8fc20324161207aa2951e2e90698c272_GL0.tar.gz) = 26628931 diff --git a/science/opensph/files/patch-core_io_FileSystem.cpp b/science/opensph/files/patch-core_io_FileSystem.cpp new file mode 100644 index 000000000000..d551b405b720 --- /dev/null +++ b/science/opensph/files/patch-core_io_FileSystem.cpp @@ -0,0 +1,14 @@ +--- core/io/FileSystem.cpp.orig 2021-10-02 16:31:29 UTC ++++ core/io/FileSystem.cpp +@@ -429,7 +429,11 @@ bool FileSystem::setWorkingDirectory(const Path& path) + Expected FileSystem::getDirectoryOfExecutable() { + #ifndef SPH_WIN + char result[4096] = { '\0' }; ++#if defined(__FreeBSD__) ++ ssize_t count = readlink("/proc/curproc/file", result, sizeof(result)); ++#else + ssize_t count = readlink("/proc/self/exe", result, sizeof(result)); ++#endif + if (count != -1) { + Path path(String::fromUtf8(result)); + return path.parentPath(); diff --git a/science/opensph/files/patch-core_system_Platform.cpp b/science/opensph/files/patch-core_system_Platform.cpp index 652b8dd7c998..54324cc45a0c 100644 --- a/science/opensph/files/patch-core_system_Platform.cpp +++ b/science/opensph/files/patch-core_system_Platform.cpp @@ -1,52 +1,40 @@ --- 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; }