Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 May 2019 02:50:56 +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: r502244 - in head/biology/hhsuite: . files
Message-ID:  <201905220250.x4M2ouuw011056@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: yuri
Date: Wed May 22 02:50:56 2019
New Revision: 502244
URL: https://svnweb.freebsd.org/changeset/ports/502244

Log:
  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

Added:
  head/biology/hhsuite/files/patch-src_CMakeLists.txt   (contents, props changed)
Modified:
  head/biology/hhsuite/Makefile

Modified: head/biology/hhsuite/Makefile
==============================================================================
--- head/biology/hhsuite/Makefile	Wed May 22 02:34:39 2019	(r502243)
+++ head/biology/hhsuite/Makefile	Wed May 22 02:50:56 2019	(r502244)
@@ -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>

Added: head/biology/hhsuite/files/patch-src_CMakeLists.txt
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/biology/hhsuite/files/patch-src_CMakeLists.txt	Wed May 22 02:50:56 2019	(r502244)
@@ -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 ()
+ 



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