aboutsummaryrefslogtreecommitdiff
path: root/biology/hhsuite
diff options
context:
space:
mode:
authorYuri Victorovich <yuri@FreeBSD.org>2019-05-22 02:50:56 +0000
committerYuri Victorovich <yuri@FreeBSD.org>2019-05-22 02:50:56 +0000
commit16421979c082c0af8b8f76c936a6248872bca921 (patch)
treeb032624b104fef466af84cc7df5348bf3ef4bd37 /biology/hhsuite
parenta578d380e9443202169d6b4f9ec27978a30cea96 (diff)
downloadports-16421979c082c0af8b8f76c936a6248872bca921.tar.gz
ports-16421979c082c0af8b8f76c936a6248872bca921.zip
biology/hhsuite: Fix build on platforms where SIMD instruction set doesn't exist or isn't detected.
It forces it to default to SSE2 on amd64/i386 and relaxes the SIMD requirement on all other platforms. Reported by: fallout
Notes
Notes: svn path=/head/; revision=502244
Diffstat (limited to 'biology/hhsuite')
-rw-r--r--biology/hhsuite/Makefile6
-rw-r--r--biology/hhsuite/files/patch-src_CMakeLists.txt30
2 files changed, 36 insertions, 0 deletions
diff --git a/biology/hhsuite/Makefile b/biology/hhsuite/Makefile
index e7288f102ee9..822c19e39909 100644
--- a/biology/hhsuite/Makefile
+++ b/biology/hhsuite/Makefile
@@ -23,4 +23,10 @@ GH_PROJECT= hh-suite
LDFLAGS+= -Wl,-rpath,${LOCALBASE}/mpi/openmpi/lib -L${LOCALBASE}/mpi/openmpi/lib -lmpi # force linking to openmpi, and not to mpich
+.include <bsd.port.options.mk>
+
+.if ${ARCH} == amd64 || ${ARCH} == i386
+CMAKE_ON= HAVE_SSE2
+.endif
+
.include <bsd.port.mk>
diff --git a/biology/hhsuite/files/patch-src_CMakeLists.txt b/biology/hhsuite/files/patch-src_CMakeLists.txt
new file mode 100644
index 000000000000..56195464c836
--- /dev/null
+++ b/biology/hhsuite/files/patch-src_CMakeLists.txt
@@ -0,0 +1,30 @@
+--- src/CMakeLists.txt.orig 2019-04-01 04:04:44 UTC
++++ src/CMakeLists.txt
+@@ -2,20 +2,26 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
+ set(CHECK_MPI 1 CACHE BOOL "Check MPI availability")
+
+ if (${HAVE_AVX2})
++ MESSAGE(STATUS "SIMD: HAVE_AVX2 is set")
+ ADD_DEFINITIONS("-DAVX2")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mavx2 -Wa,-q")
+ elseif (${HAVE_SSE2})
++ MESSAGE(STATUS "SIMD: HAVE_SSE2 is set")
+ ADD_DEFINITIONS("-DSSE")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse -msse2")
+ else ()
++ MESSAGE(STATUS "SIMD: No HAVE_AVX2 or HAVE_SSE2 are set, trying to detect them")
+ include(CheckSSEFeatures)
+ ADD_DEFINITIONS(${CXX_DFLAGS})
+ if (${HAVE_AVX2_EXTENSIONS})
++ MESSAGE(STATUS "SIMD: Found AVX2")
+ ADD_DEFINITIONS("-DAVX2")
+ elseif (${HAVE_SSE2_EXTENSIONS})
++ MESSAGE(STATUS "SIMD: Found SSE2")
+ ADD_DEFINITIONS("-DSSE")
+ else ()
+- message(FATAL_ERROR "At least SSE2 instruction set support is required! CMake will exit.")
++ #message(FATAL_ERROR "At least SSE2 instruction set support is required! CMake will exit.")
++ message(STATUS "SIMD: This platform doesn't have a supported SIMD instruction set, expect it to be slow.")
+ endif (${HAVE_AVX2_EXTENSIONS})
+ endif ()
+