mirror of
https://github.com/cemu-project/vcpkg.git
synced 2025-02-23 02:57:09 +01:00
add clapack port for lapack
add dependency [clapack] Use COPYING from sources instead of checked in license.
This commit is contained in:
parent
6d052e3dc0
commit
804a882695
4
ports/clapack/CONTROL
Normal file
4
ports/clapack/CONTROL
Normal file
@ -0,0 +1,4 @@
|
||||
Source: clapack
|
||||
Version: 3.2.1
|
||||
Description: CLAPACK (f2c'ed version of LAPACK)
|
||||
Build-Depends: openblas
|
1453
ports/clapack/lapack.def
Normal file
1453
ports/clapack/lapack.def
Normal file
File diff suppressed because it is too large
Load Diff
52
ports/clapack/portfile.cmake
Normal file
52
ports/clapack/portfile.cmake
Normal file
@ -0,0 +1,52 @@
|
||||
# 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")
|
||||
message(FATAL_ERROR "openblas can only be built for x64 currently")
|
||||
endif()
|
||||
|
||||
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/clapack-3.2.1-CMAKE)
|
||||
vcpkg_download_distfile(ARCHIVE
|
||||
URLS "http://www.netlib.org/clapack/clapack-3.2.1-CMAKE.tgz"
|
||||
FILENAME "clapack-3.2.1"
|
||||
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 "${CMAKE_CURRENT_LIST_DIR}/use-other-blas-and-install-include.patch"
|
||||
)
|
||||
|
||||
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()
|
||||
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
||||
|
||||
# Handle copyright
|
||||
file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/clapack)
|
||||
file(RENAME ${CURRENT_PACKAGES_DIR}/share/clapack/COPYING ${CURRENT_PACKAGES_DIR}/share/clapack/copyright)
|
||||
|
||||
vcpkg_copy_pdbs()
|
103
ports/clapack/use-other-blas-and-install-include.patch
Normal file
103
ports/clapack/use-other-blas-and-install-include.patch
Normal file
@ -0,0 +1,103 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 320ccc6..8c53def 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -3,6 +3,9 @@ project(CLAPACK C)
|
||||
enable_testing()
|
||||
include(CTest)
|
||||
|
||||
+# BLAS_LIBRARIES
|
||||
+find_package(BLAS REQUIRED)
|
||||
+
|
||||
if(WIN32 AND NOT CYGWIN)
|
||||
set(SECOND_SRC ${CLAPACK_SOURCE_DIR}/INSTALL/winsecond.c)
|
||||
set(DSECOND_SRC ${CLAPACK_SOURCE_DIR}/INSTALL/windsecnd.c)
|
||||
@@ -19,7 +22,8 @@ if(NOT USE_BLAS_WRAP)
|
||||
endif()
|
||||
include_directories(${CLAPACK_SOURCE_DIR}/INCLUDE)
|
||||
add_subdirectory(F2CLIBS)
|
||||
-add_subdirectory(BLAS)
|
||||
+
|
||||
+# add_subdirectory(BLAS)
|
||||
add_subdirectory(SRC)
|
||||
add_subdirectory(TESTING)
|
||||
set(CLAPACK_VERSION 3.2.1)
|
||||
@@ -27,8 +31,13 @@ set(CPACK_PACKAGE_VERSION_MAJOR 3)
|
||||
set(CPACK_PACKAGE_VERSION_MINOR 2)
|
||||
set(CPACK_PACKAGE_VERSION_PATCH 1)
|
||||
include(CPack)
|
||||
-export(TARGETS f2c blas lapack FILE clapack-targets.cmake)
|
||||
-configure_file(${CLAPACK_SOURCE_DIR}/clapack-config-version.cmake.in
|
||||
- ${CLAPACK_BINARY_DIR}/clapack-config-version.cmake @ONLY)
|
||||
-configure_file(${CLAPACK_SOURCE_DIR}/clapack-config.cmake.in
|
||||
- ${CLAPACK_BINARY_DIR}/clapack-config.cmake @ONLY)
|
||||
+# export(TARGETS f2c blas lapack FILE clapack-targets.cmake)
|
||||
+# configure_file(${CLAPACK_SOURCE_DIR}/clapack-config-version.cmake.in
|
||||
+# ${CLAPACK_BINARY_DIR}/clapack-config-version.cmake @ONLY)
|
||||
+# configure_file(${CLAPACK_SOURCE_DIR}/clapack-config.cmake.in
|
||||
+# ${CLAPACK_BINARY_DIR}/clapack-config.cmake @ONLY)
|
||||
+
|
||||
+install(FILES
|
||||
+ ${CMAKE_CURRENT_LIST_DIR}/include/clapack.h
|
||||
+ ${CMAKE_CURRENT_LIST_DIR}/include/f2c.h
|
||||
+ DESTINATION include)
|
||||
\ No newline at end of file
|
||||
diff --git a/F2CLIBS/libf2c/CMakeLists.txt b/F2CLIBS/libf2c/CMakeLists.txt
|
||||
index 43d7b3f..2bdbd05 100644
|
||||
--- a/F2CLIBS/libf2c/CMakeLists.txt
|
||||
+++ b/F2CLIBS/libf2c/CMakeLists.txt
|
||||
@@ -58,5 +58,5 @@ if(WIN32)
|
||||
endif()
|
||||
include_directories(${CLAPACK_SOURCE_DIR}/F2CLIBS/libf2c)
|
||||
include_directories(${CLAPACK_BINARY_DIR}/F2CLIBS/libf2c)
|
||||
-add_library(f2c ${OFILES} ${CMAKE_CURRENT_BINARY_DIR}/arith.h)
|
||||
+add_library(f2c STATIC ${OFILES} ${CMAKE_CURRENT_BINARY_DIR}/arith.h)
|
||||
set_property(TARGET f2c PROPERTY PREFIX lib)
|
||||
diff --git a/INCLUDE/clapack.h b/INCLUDE/clapack.h
|
||||
index d22da98..5ef0a5b 100644
|
||||
--- a/INCLUDE/clapack.h
|
||||
+++ b/INCLUDE/clapack.h
|
||||
@@ -3,6 +3,8 @@
|
||||
#ifndef __CLAPACK_H
|
||||
#define __CLAPACK_H
|
||||
|
||||
+#include "f2c.h"
|
||||
+
|
||||
/* Subroutine */ int caxpy_(integer *n, complex *ca, complex *cx, integer *
|
||||
incx, complex *cy, integer *incy);
|
||||
|
||||
diff --git a/SRC/CMakeLists.txt b/SRC/CMakeLists.txt
|
||||
index ac4cce3..0548c8d 100644
|
||||
--- a/SRC/CMakeLists.txt
|
||||
+++ b/SRC/CMakeLists.txt
|
||||
@@ -375,6 +375,17 @@ endif()
|
||||
if(BUILD_COMPLEX16)
|
||||
set(ALLOBJ ${ZLASRC} ${ALLAUX} ${DZLAUX})
|
||||
endif()
|
||||
-add_library(lapack ${ALLOBJ} ${ALLXOBJ})
|
||||
-target_link_libraries(lapack blas)
|
||||
+if(BUILD_SHARED_LIBS AND MSVC)
|
||||
+ add_library(lapack SHARED ${ALLOBJ} ${ALLXOBJ} ${CMAKE_CURRENT_LIST_DIR}/lapack.def)
|
||||
+else()
|
||||
+ add_library(lapack ${ALLOBJ} ${ALLXOBJ})
|
||||
+endif(BUILD_SHARED_LIBS AND MSVC)
|
||||
+
|
||||
+
|
||||
+target_link_libraries(lapack ${BLAS_LIBRARIES} f2c)
|
||||
+
|
||||
+install(TARGETS lapack
|
||||
+ RUNTIME DESTINATION bin
|
||||
+ LIBRARY DESTINATION lib
|
||||
+ ARCHIVE DESTINATION lib)
|
||||
|
||||
diff --git a/TESTING/MATGEN/CMakeLists.txt b/TESTING/MATGEN/CMakeLists.txt
|
||||
index b2cb47a..54fa7a8 100644
|
||||
--- a/TESTING/MATGEN/CMakeLists.txt
|
||||
+++ b/TESTING/MATGEN/CMakeLists.txt
|
||||
@@ -65,5 +65,5 @@ endif()
|
||||
if(BUILD_COMPLEX16)
|
||||
set(ALLOBJ $(ZMATGEN) $(DZATGEN))
|
||||
endif()
|
||||
-add_library(tmglib ${ALLOBJ} )
|
||||
+add_library(tmglib STATIC ${ALLOBJ} )
|
||||
|
Loading…
x
Reference in New Issue
Block a user