Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F145544001
D47140.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
4 KB
Referenced Files
None
Subscribers
None
D47140.id.diff
View Options
diff --git a/science/opensph/Makefile b/science/opensph/Makefile
--- a/science/opensph/Makefile
+++ b/science/opensph/Makefile
@@ -1,6 +1,6 @@
PORTNAME= OpenSPH
DISTVERSION= 0.4.1
-PORTREVISION= 3
+PORTREVISION= 4
CATEGORIES= science
MAINTAINER= yuri@FreeBSD.org
@@ -10,9 +10,11 @@
LICENSE= MIT
LICENSE_FILE= ${WRKSRC}/LICENSE
-ONLY_FOR_ARCHS= amd64 i386
+ONLY_FOR_ARCHS= aarch64 amd64 i386
ONLY_FOR_ARCHS_REASON= unconditional use of -msse4.1 and inclusion of immintrin.h
+BUILD_DEPENDS_aarch64= ${LOCALBASE}/include/sse2neon.h:devel/sse2neon
+BUILD_DEPENDS+= ${BUILD_DEPENDS_${ARCH}}
TEST_DEPENDS= catch>0:devel/catch
USES= compiler:c++17-lang qmake qt:5
@@ -28,6 +30,8 @@
QMAKE_ARGS= CONFIG+=release
CXXFLAGS+= -DSPH_CONFIG_SET
+CXXFLAGS_amd64= -msse4.1
+CXXFLAGS_i386= -msse4.1
TEST_WRKSRC= ${WRKDIR}/test
@@ -63,7 +67,7 @@
libtbb.so:devel/onetbb
post-patch: # workaround for https://gitlab.com/sevecekp/sph/-/issues/48
- @${FIND} ${WRKSRC} -name "*.pro" | ${XARGS} ${REINPLACE_CMD} -e 's|c++14|c++17|'
+ @${FIND} ${WRKSRC} -name "*.pro" | ${XARGS} ${REINPLACE_CMD} -e 's|c++14|c++17|' -e 's|-msse4.1||'
do-test:
@${REINPLACE_CMD} -e 's|Path(.*|Path("${TEST_WRKSRC}");|' ${WRKSRC}/test/utils/Config.h
diff --git a/science/opensph/files/patch-core_objects_containers_BasicAllocators.h b/science/opensph/files/patch-core_objects_containers_BasicAllocators.h
new file mode 100644
--- /dev/null
+++ b/science/opensph/files/patch-core_objects_containers_BasicAllocators.h
@@ -0,0 +1,13 @@
+--- core/objects/containers/BasicAllocators.h.orig 2024-10-15 17:04:09 UTC
++++ core/objects/containers/BasicAllocators.h
+@@ -6,7 +6,9 @@
+ /// \date 2016-2021
+
+ #include "common/Assert.h"
+-#ifndef SPH_WIN
++#if defined(__arm__) || defined(__aarch64__)
++#include <sse2neon.h>
++#elif !defined(SPH_WIN)
+ #include <mm_malloc.h>
+ #else
+ #include <malloc.h>
diff --git a/science/opensph/files/patch-core_objects_geometry_Vector.h b/science/opensph/files/patch-core_objects_geometry_Vector.h
new file mode 100644
--- /dev/null
+++ b/science/opensph/files/patch-core_objects_geometry_Vector.h
@@ -0,0 +1,17 @@
+--- core/objects/geometry/Vector.h.orig 2024-10-15 17:00:09 UTC
++++ core/objects/geometry/Vector.h
+@@ -9,9 +9,13 @@
+ #include "objects/containers/Tuple.h"
+ #include "objects/geometry/Generic.h"
+ #include "objects/wrappers/Interval.h"
+-#include <immintrin.h>
+ #include <iomanip>
++#if defined(__arm__) || defined(__aarch64__)
++#include <sse2neon.h>
++#else
++#include <immintrin.h>
+ #include <smmintrin.h>
++#endif
+
+ NAMESPACE_SPH_BEGIN
+
diff --git a/science/opensph/files/patch-core_objects_wrappers_AlignedStorage.h b/science/opensph/files/patch-core_objects_wrappers_AlignedStorage.h
new file mode 100644
--- /dev/null
+++ b/science/opensph/files/patch-core_objects_wrappers_AlignedStorage.h
@@ -0,0 +1,13 @@
+--- core/objects/wrappers/AlignedStorage.h.orig 2024-10-15 17:05:35 UTC
++++ core/objects/wrappers/AlignedStorage.h
+@@ -7,7 +7,9 @@
+
+ #include "common/Assert.h"
+ #include "common/Traits.h"
+-#ifndef SPH_WIN
++#if defined(__arm__) || defined(__aarch64__)
++#include <sse2neon.h>
++#elif !defined(SPH_WIN)
+ #include <mm_malloc.h>
+ #else
+ #include <malloc.h>
diff --git a/science/opensph/files/patch-core_system_Platform.cpp b/science/opensph/files/patch-core_system_Platform.cpp
--- a/science/opensph/files/patch-core_system_Platform.cpp
+++ b/science/opensph/files/patch-core_system_Platform.cpp
@@ -1,6 +1,6 @@
---- core/system/Platform.cpp.orig 2021-04-08 21:23:28 UTC
+--- core/system/Platform.cpp.orig 2022-11-16 12:31:25 UTC
+++ core/system/Platform.cpp
-@@ -102,14 +106,18 @@ class CpuUsage { (private)
+@@ -117,14 +117,18 @@ class CpuUsage { (public)
public:
CpuUsage() {
@@ -20,7 +20,7 @@
file = fopen("/proc/cpuinfo", "r");
numProcessors = 0;
while (fgets(line, 128, file) != NULL) {
-@@ -117,6 +125,8 @@ class CpuUsage { (private)
+@@ -132,6 +136,8 @@ class CpuUsage { (public)
numProcessors++;
}
fclose(file);
@@ -29,7 +29,7 @@
}
Optional<Float> getUsage() {
-@@ -150,7 +160,7 @@ bool isDebuggerPresent() {
+@@ -176,7 +182,7 @@ bool isDebuggerPresent() {
char buf[1024];
bool debuggerPresent = false;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Feb 22, 6:20 AM (3 h, 39 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28933322
Default Alt Text
D47140.id.diff (4 KB)
Attached To
Mode
D47140: science/opensph: port to aarch64
Attached
Detach File
Event Timeline
Log In to Comment