[clapack] port patch from #5169 (#6291)

This commit is contained in:
Stefano Sinigardi 2019-05-03 20:43:10 +02:00 committed by Victor Romero
parent 050e71d01d
commit df482edfd9
4 changed files with 42 additions and 47 deletions

View File

@ -1,4 +1,4 @@
Source: clapack
Version: 3.2.1-3
Version: 3.2.1-4
Description: CLAPACK (f2c'ed version of LAPACK)
Build-Depends: openblas
Build-Depends: openblas (!osx)

View File

@ -1,19 +1,18 @@
diff --git a/F2CLIBS/libf2c/CMakeLists.txt b/F2CLIBS/libf2c/CMakeLists.txt
index 2bdbd05..e77b3a3 100644
--- a/F2CLIBS/libf2c/CMakeLists.txt
+++ b/F2CLIBS/libf2c/CMakeLists.txt
@@ -60,3 +60,13 @@ include_directories(${CLAPACK_SOURCE_DIR}/F2CLIBS/libf2c)
include_directories(${CLAPACK_BINARY_DIR}/F2CLIBS/libf2c)
add_library(f2c STATIC ${OFILES} ${CMAKE_CURRENT_BINARY_DIR}/arith.h)
set_property(TARGET f2c PROPERTY PREFIX lib)
+
+install(TARGETS f2c
+ RUNTIME DESTINATION bin
+ LIBRARY DESTINATION lib
+ ARCHIVE DESTINATION lib)
+
+install(TARGETS arithchk
+ RUNTIME DESTINATION tools
+ LIBRARY DESTINATION lib
+ ARCHIVE DESTINATION lib)
\ No newline at end of file
diff --git a/F2CLIBS/libf2c/CMakeLists.txt b/F2CLIBS/libf2c/CMakeLists.txt
index ca1473f..fa54e94 100644
--- a/F2CLIBS/libf2c/CMakeLists.txt
+++ b/F2CLIBS/libf2c/CMakeLists.txt
@@ -63,3 +63,13 @@ if(UNIX)
target_link_libraries(f2c m)
endif()
set_property(TARGET f2c PROPERTY PREFIX lib)
+install(TARGETS f2c
+ RUNTIME DESTINATION bin
+ LIBRARY DESTINATION lib
+ ARCHIVE DESTINATION lib)
+
+install(TARGETS arithchk
+ RUNTIME DESTINATION tools
+ LIBRARY DESTINATION lib
+ ARCHIVE DESTINATION lib)
+

View File

@ -0,0 +1,12 @@
diff --git a/F2CLIBS/libf2c/CMakeLists.txt b/F2CLIBS/libf2c/CMakeLists.txt
index 2bdbd05..ca1473f 100644
--- a/F2CLIBS/libf2c/CMakeLists.txt
+++ b/F2CLIBS/libf2c/CMakeLists.txt
@@ -59,4 +59,7 @@ endif()
include_directories(${CLAPACK_SOURCE_DIR}/F2CLIBS/libf2c)
include_directories(${CLAPACK_BINARY_DIR}/F2CLIBS/libf2c)
add_library(f2c STATIC ${OFILES} ${CMAKE_CURRENT_BINARY_DIR}/arith.h)
+if(UNIX)
+ target_link_libraries(f2c m)
+endif()
set_property(TARGET f2c PROPERTY PREFIX lib)

View File

@ -1,15 +1,3 @@
# Common Ambient Variables:
# CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT}
# CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET}
# CURRENT_PORT DIR = ${VCPKG_ROOT_DIR}\ports\${PORT}
# PORT = current port name (zlib, etc)
# TARGET_TRIPLET = current triplet (x86-windows, x64-windows-static, etc)
# VCPKG_CRT_LINKAGE = C runtime linkage type (static, dynamic)
# VCPKG_LIBRARY_LINKAGE = target library linkage type (static, dynamic)
# VCPKG_ROOT_DIR = <C:\path\to\current\vcpkg>
# VCPKG_TARGET_ARCHITECTURE = target architecture (x64, x86, arm)
#
include(vcpkg_common_functions)
if(NOT VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
@ -22,16 +10,13 @@ vcpkg_download_distfile(ARCHIVE
FILENAME "clapack-3.2.1.tgz"
SHA512 cf19c710291ddff3f6ead7d86bdfdeaebca21291d9df094bf0a8ef599546b007757fb2dbb19b56511bb53ef7456eac0c73973b9627bf4d02982c856124428b49
)
vcpkg_extract_source_archive(${ARCHIVE})
# apply patch can not add file
file(COPY ${CMAKE_CURRENT_LIST_DIR}/lapack.def DESTINATION ${SOURCE_PATH}/SRC)
vcpkg_apply_patches(
SOURCE_PATH ${SOURCE_PATH}
PATCHES
use-other-blas-and-install-include.patch
fix-lack-library.patch
vcpkg_extract_source_archive_ex(
OUT_SOURCE_PATH SOURCE_PATH
ARCHIVE ${ARCHIVE}
PATCHES
use-other-blas-and-install-include.patch
link-to-math-lib.patch
)
if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux")
@ -41,13 +26,12 @@ if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux")
)
endif()
if(NOT VCPKG_CMAKE_SYSTEM_NAME)
file(COPY ${CMAKE_CURRENT_LIST_DIR}/lapack.def DESTINATION ${SOURCE_PATH}/SRC)
endif()
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
# Disable this option if project cannot be built with Ninja
# OPTIONS -DUSE_THIS_IN_ALL_BUILDS=1 -DUSE_THIS_TOO=2
# OPTIONS_RELEASE -DOPTIMIZE=1
# OPTIONS_DEBUG -DDEBUGGABLE=1
)
vcpkg_install_cmake()