Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 26 May 2019 04:08:09 +0000 (UTC)
From:      Yuri Victorovich <yuri@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r502676 - in head/science: . opensph opensph/files
Message-ID:  <201905260408.x4Q489Sj016376@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: yuri
Date: Sun May 26 04:08:09 2019
New Revision: 502676
URL: https://svnweb.freebsd.org/changeset/ports/502676

Log:
  New port: science/opensph: Library and graphical tools for running SPH and N-body simulations

Added:
  head/science/opensph/
  head/science/opensph/Makefile   (contents, props changed)
  head/science/opensph/distinfo   (contents, props changed)
  head/science/opensph/files/
  head/science/opensph/files/patch-gui_objects_Palette.cpp   (contents, props changed)
  head/science/opensph/files/patch-lib_math_MathUtils.h   (contents, props changed)
  head/science/opensph/files/patch-lib_objects_geometry_Generic.h   (contents, props changed)
  head/science/opensph/files/patch-lib_system_Platform.cpp   (contents, props changed)
  head/science/opensph/pkg-descr   (contents, props changed)
Modified:
  head/science/Makefile

Modified: head/science/Makefile
==============================================================================
--- head/science/Makefile	Sun May 26 04:04:15 2019	(r502675)
+++ head/science/Makefile	Sun May 26 04:08:09 2019	(r502676)
@@ -174,6 +174,7 @@
     SUBDIR += openkim
     SUBDIR += openmx
     SUBDIR += opensim-core
+    SUBDIR += opensph
     SUBDIR += opsin
     SUBDIR += p5-Algorithm-SVMLight
     SUBDIR += p5-Chemistry-3DBuilder

Added: head/science/opensph/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/science/opensph/Makefile	Sun May 26 04:08:09 2019	(r502676)
@@ -0,0 +1,33 @@
+# $FreeBSD$
+
+PORTNAME=	OpenSPH
+DISTVERSIONPREFIX=	v
+DISTVERSION=	g20190519
+CATEGORIES=	science
+
+MAINTAINER=	yuri@FreeBSD.org
+COMMENT=	Library and graphical tools for running SPH and N-body simulations
+
+LICENSE=	MIT
+LICENSE_FILE=	${WRKSRC}/LICENSE
+
+LIB_DEPENDS=	libwx_baseu-3.1.so:x11-toolkits/wxgtk31
+
+USES=		compiler:c++14-lang eigen:3 qmake qt:5
+USE_GITLAB=	yes
+GL_SITE=	https://gitlab.com
+GL_ACCOUNT=	sevecekp
+GL_PROJECT=	sph
+GL_COMMIT=	06686fa7f7307bdf8c9261e55b9875aafa278a13
+
+QMAKE_SOURCE_PATH=	${WRKSRC}/sph.pro
+
+BINARY_ALIAS=	wx-config=${LOCALBASE}/bin/wxgtk3u-3.1-config
+
+PLIST_FILES=	bin/opensph-cli bin/opensph
+
+do-install: # https://gitlab.com/sevecekp/sph/issues/2
+	${INSTALL_PROGRAM} ${BUILD_WRKSRC}/cli/launcher/launcher ${STAGEDIR}${PREFIX}/bin/opensph-cli
+	${INSTALL_PROGRAM} ${BUILD_WRKSRC}/gui/launcherGui/launcherGui ${STAGEDIR}${PREFIX}/bin/opensph
+
+.include <bsd.port.mk>

Added: head/science/opensph/distinfo
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/science/opensph/distinfo	Sun May 26 04:08:09 2019	(r502676)
@@ -0,0 +1,3 @@
+TIMESTAMP = 1558839946
+SHA256 (sevecekp-sph-06686fa7f7307bdf8c9261e55b9875aafa278a13_GL0.tar.gz) = c8566141a37461a7445149c7460c6ef8daf630a75a755c7567761d2bb4ea6acc
+SIZE (sevecekp-sph-06686fa7f7307bdf8c9261e55b9875aafa278a13_GL0.tar.gz) = 21945021

Added: head/science/opensph/files/patch-gui_objects_Palette.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/science/opensph/files/patch-gui_objects_Palette.cpp	Sun May 26 04:08:09 2019	(r502676)
@@ -0,0 +1,42 @@
+--- gui/objects/Palette.cpp.orig	2019-05-26 03:22:37 UTC
++++ gui/objects/Palette.cpp
+@@ -2,6 +2,7 @@
+ #include "io/Path.h"
+ #include "objects/utility/StringUtils.h"
+ #include <fstream>
++#include <cmath>
+ 
+ NAMESPACE_SPH_BEGIN
+ 
+@@ -41,12 +42,12 @@ float Palette::paletteToLinear(const float value) cons
+     case PaletteScale::LINEAR:
+         return value;
+     case PaletteScale::LOGARITHMIC:
+-        return exp10(value);
++        return std::pow(10.,value);
+     case PaletteScale::HYBRID:
+         if (value > 1.f) {
+-            return exp10(value - 1.f);
++            return std::pow(10.,value - 1.f);
+         } else if (value < -1.f) {
+-            return -exp10(-value - 1.f);
++            return -std::pow(10.,-value - 1.f);
+         } else {
+             return value;
+         }
+@@ -142,12 +143,12 @@ float Palette::relativeToPalette(const float value) co
+     case PaletteScale::LINEAR:
+         return interpol;
+     case PaletteScale::LOGARITHMIC:
+-        return exp10(interpol);
++        return std::pow(10.,interpol);
+     case PaletteScale::HYBRID:
+         if (interpol > 1.f) {
+-            return exp10(interpol - 1.f);
++            return std::pow(10.,interpol - 1.f);
+         } else if (interpol < -1.f) {
+-            return -exp10(-interpol - 1.f);
++            return -std::pow(10.,-interpol - 1.f);
+         } else {
+             return interpol;
+         }

Added: head/science/opensph/files/patch-lib_math_MathUtils.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/science/opensph/files/patch-lib_math_MathUtils.h	Sun May 26 04:08:09 2019	(r502676)
@@ -0,0 +1,10 @@
+--- lib/math/MathUtils.h.orig	2019-05-26 03:08:36 UTC
++++ lib/math/MathUtils.h
+@@ -11,6 +11,7 @@
+ #include <limits>
+ #include <math.h>
+ #include <utility>
++#include <cmath>
+ 
+ NAMESPACE_SPH_BEGIN
+ 

Added: head/science/opensph/files/patch-lib_objects_geometry_Generic.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/science/opensph/files/patch-lib_objects_geometry_Generic.h	Sun May 26 04:08:09 2019	(r502676)
@@ -0,0 +1,10 @@
+--- lib/objects/geometry/Generic.h.orig	2019-05-26 03:09:40 UTC
++++ lib/objects/geometry/Generic.h
+@@ -7,6 +7,7 @@
+ 
+ #include "objects/containers/StaticArray.h"
+ #include <math.h>
++#include <cmath>
+ 
+ NAMESPACE_SPH_BEGIN
+ 

Added: head/science/opensph/files/patch-lib_system_Platform.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/science/opensph/files/patch-lib_system_Platform.cpp	Sun May 26 04:08:09 2019	(r502676)
@@ -0,0 +1,57 @@
+--- lib/system/Platform.cpp.orig	2019-05-26 03:11:41 UTC
++++ lib/system/Platform.cpp
+@@ -8,14 +8,14 @@
+ #include <string.h>
+ #include <sys/stat.h>
+ #include <sys/times.h>
+-#include <sys/vtimes.h>
++//#include <sys/vtimes.h>
+ #include <unistd.h>
+ 
+ NAMESPACE_SPH_BEGIN
+ 
+ Expected<Path> getExecutablePath() {
+     char result[PATH_MAX];
+-    ssize_t count = readlink("/proc/self/exe", result, PATH_MAX);
++    ssize_t count = readlink("/proc/curproc/file", result, PATH_MAX);
+     if (count != -1) {
+         Path path(result);
+         return path.parentPath();
+@@ -103,14 +103,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) {
+@@ -118,6 +122,8 @@ class CpuUsage { (private)
+                 numProcessors++;
+         }
+         fclose(file);
++#endif
++      numProcessors = 8; // TODO
+     }
+ 
+     Optional<Float> getUsage() {
+@@ -151,7 +157,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;
+     }

Added: head/science/opensph/pkg-descr
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/science/opensph/pkg-descr	Sun May 26 04:08:09 2019	(r502676)
@@ -0,0 +1,7 @@
+OpenSPH is an integrator of hydrodynamic equations using SPH discretization in
+space, currently specialized on simulations of asteroid impacts. The code is
+being developed on Astronomical Institute of Charles University in Prague. It
+aims to provide a fast, versatile and easily extensible SPH solver utilizing
+modern CPU features (SSE/AVX instruction sets).
+
+WWW: https://gitlab.com/sevecekp/sph



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201905260408.x4Q489Sj016376>