pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

armadillo: more dependencies and BLAS fixup



Module Name:	pkgsrc-wip
Committed By:	Dr. Thomas Orgis <thomas.orgis%uni-hamburg.de@localhost>
Pushed By:	thor
Date:		Wed Feb 26 21:00:45 2020 +0100
Changeset:	171ca63ad6894c73b7af4c1d675682a54c32a417

Modified Files:
	armadillo/Makefile
	armadillo/distinfo
Added Files:
	armadillo/patches/patch-CMakeLists.txt

Log Message:
armadillo: more dependencies and BLAS fixup

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=171ca63ad6894c73b7af4c1d675682a54c32a417

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 armadillo/Makefile                     | 13 ++++++---
 armadillo/distinfo                     |  1 +
 armadillo/patches/patch-CMakeLists.txt | 53 ++++++++++++++++++++++++++++++++++
 3 files changed, 63 insertions(+), 4 deletions(-)

diffs:
diff --git a/armadillo/Makefile b/armadillo/Makefile
index 7277035f44..1baf0fa9c8 100644
--- a/armadillo/Makefile
+++ b/armadillo/Makefile
@@ -21,16 +21,21 @@ PKG_MINOR=	40
 DIST_MINOR=	${PKG_MINOR}0
 
 CMAKE_ARGS+=	-DINSTALL_LIB_DIR=${PREFIX}/lib
+CONFIGURE_ENV+=	LAPACK_LIBS=${LAPACK_LIBS:Q} BLAS_LIBS=${BLAS_LIBS:Q}
 
 SUBST_CLASSES=		minor
 SUBST_STAGE.minor=	post-patch
 SUBST_FILES.minor=	CMakeLists.txt
 SUBST_SED.minor=	-e "s|ARMA_MINOR ${DIST_MINOR}|ARMA_MINOR ${PKG_MINOR}|g"
 
-# Upstream requires both lapack and openblas, so we cannot use
-# mk/blas.buildlink.mk without extensive hacking
-.include "../../wip/openblas/buildlink3.mk"
-.include "../../wip/lapack/buildlink3.mk"
+# wip/superlu has that because I do not know better how to force
+# a specifc blas lib (easily). We need to ensure to avoid mixing BLAS libs.
+# If this setting is dropped, it should be dropped for both.
+BLAS_ACCEPTED=          openblas netlib
+
+.include "../../wip/mk/blas.buildlink3.mk"
+.include "../../wip/superlu/buildlink3.mk"
+.include "../../math/arpack/buildlink3.mk"
 .include "../../devel/boost-libs/buildlink3.mk"
 .include "../../devel/boost-headers/buildlink3.mk"
 .include "../../devel/hdf5/buildlink3.mk"
diff --git a/armadillo/distinfo b/armadillo/distinfo
index 03dfe014ce..d81dc848ef 100644
--- a/armadillo/distinfo
+++ b/armadillo/distinfo
@@ -4,3 +4,4 @@ SHA1 (armadillo-9.400.3.tar.xz) = 142acafa7801613b01965a113267211d09e421dc
 RMD160 (armadillo-9.400.3.tar.xz) = e1d73d9c5cb9eed997ca294fee85d5c649a8ef90
 SHA512 (armadillo-9.400.3.tar.xz) = ae35f6d2e45202af4f5ef4516467c38a064ca2c1796d5c03ab389c31b800e8eea110b9035912a742c3f297234890b57f91918a40df071db5ebb20ec74b18ada5
 Size (armadillo-9.400.3.tar.xz) = 4798164 bytes
+SHA1 (patch-CMakeLists.txt) = bb6d8eaa1e4301e5280b2784e7e071922c0a0a0f
diff --git a/armadillo/patches/patch-CMakeLists.txt b/armadillo/patches/patch-CMakeLists.txt
new file mode 100644
index 0000000000..0f419d8eb4
--- /dev/null
+++ b/armadillo/patches/patch-CMakeLists.txt
@@ -0,0 +1,53 @@
+$Netbsd$
+
+Make the build use LAPACK_LIBS and BLAS_LIBS from the environment.
+Could this be acceptible to upstream?
+
+--- CMakeLists.txt.orig	2020-02-24 22:11:41.093696230 +0100
++++ CMakeLists.txt	2020-02-24 22:14:52.780347663 +0100
+@@ -151,6 +151,16 @@
+ ##
+ 
+ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake_aux/Modules/")
++if(APPLE)
++  if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
++    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
++    message(STATUS "Clang compiler on MacOS X detected. Added '-stdlib=libc++' to compiler flags")
++  endif()
++  
++  set(CMAKE_MACOSX_RPATH 1)
++endif()
++
++if("$ENV{BLAS_LIBS}" STREQUAL "")
+ 
+ if(APPLE)
+   
+@@ -162,13 +172,6 @@
+   set(ARMA_LIBS ${ARMA_LIBS} "-framework Accelerate")  # or "-framework accelerate" ?
+   message(STATUS "MacOS X detected. Added '-framework Accelerate' to compiler flags")
+   
+-  if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
+-    message(STATUS "Clang compiler on MacOS X detected. Added '-stdlib=libc++' to compiler flags")
+-  endif()
+-  
+-  set(CMAKE_MACOSX_RPATH 1)
+-  
+ else()
+   
+   set(ARMA_OS unix)
+@@ -284,6 +287,14 @@
+   
+ endif()
+ 
++else()
++
++set(ARMA_USE_BLAS   true)
++set(ARMA_USE_LAPACK true)
++set(ARMA_LIBS ${ARMA_LIBS} $ENV{LAPACK_LIBS} $ENV{BLAS_LIBS})
++message(STATUS "Using BLAS/LAPACK from BLAS_LIBS and LAPACK_LIBS environment variables.")
++
++endif()
+ 
+ find_package(PkgConfig)
+ 


Home | Main Index | Thread Index | Old Index