create INDEX64 target
This commit is contained in:
committed by
Markus Mützel
parent
34ecd967a5
commit
3efbf968f1
@@ -1,7 +1,7 @@
|
||||
message(STATUS "CBLAS enable")
|
||||
enable_language(C)
|
||||
|
||||
set(LAPACK_INSTALL_EXPORT_NAME cblas-targets)
|
||||
set(LAPACK_INSTALL_EXPORT_NAME ${CBLASLIB}-targets)
|
||||
|
||||
# Create a header file cblas.h for the routines called in my C programs
|
||||
include(FortranCInterface)
|
||||
@@ -42,15 +42,15 @@ if(BUILD_TESTING)
|
||||
endif()
|
||||
|
||||
if(NOT BLAS_FOUND)
|
||||
set(ALL_TARGETS ${ALL_TARGETS} blas)
|
||||
set(ALL_TARGETS ${ALL_TARGETS} ${BLASLIB})
|
||||
endif()
|
||||
|
||||
# Export cblas targets from the
|
||||
# install tree, if any.
|
||||
set(_cblas_config_install_guard_target "")
|
||||
if(ALL_TARGETS)
|
||||
install(EXPORT cblas-targets
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/cblas-${LAPACK_VERSION}
|
||||
install(EXPORT ${CBLASLIB}-targets
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${CBLASLIB}-${LAPACK_VERSION}
|
||||
COMPONENT Development
|
||||
)
|
||||
# Choose one of the cblas targets to use as a guard for
|
||||
@@ -61,7 +61,7 @@ endif()
|
||||
# Export cblas targets from the build tree, if any.
|
||||
set(_cblas_config_build_guard_target "")
|
||||
if(ALL_TARGETS)
|
||||
export(TARGETS ${ALL_TARGETS} FILE cblas-targets.cmake)
|
||||
export(TARGETS ${ALL_TARGETS} FILE ${CBLASLIB}-targets.cmake)
|
||||
|
||||
# Choose one of the cblas targets to use as a guard
|
||||
# for cblas-config.cmake to load targets from the build tree.
|
||||
@@ -69,26 +69,26 @@ if(ALL_TARGETS)
|
||||
endif()
|
||||
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/cblas-config-version.cmake.in
|
||||
${LAPACK_BINARY_DIR}/cblas-config-version.cmake @ONLY)
|
||||
${LAPACK_BINARY_DIR}/${CBLASLIB}-config-version.cmake @ONLY)
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/cblas-config-build.cmake.in
|
||||
${LAPACK_BINARY_DIR}/cblas-config.cmake @ONLY)
|
||||
${LAPACK_BINARY_DIR}/${CBLASLIB}-config.cmake @ONLY)
|
||||
|
||||
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cblas.pc.in ${CMAKE_CURRENT_BINARY_DIR}/cblas.pc @ONLY)
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cblas.pc.in ${CMAKE_CURRENT_BINARY_DIR}/${CBLASLIB}.pc @ONLY)
|
||||
install(FILES
|
||||
${CMAKE_CURRENT_BINARY_DIR}/cblas.pc
|
||||
${CMAKE_CURRENT_BINARY_DIR}/${CBLASLIB}.pc
|
||||
DESTINATION ${PKG_CONFIG_DIR}
|
||||
)
|
||||
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/cblas-config-install.cmake.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/cblas-config.cmake @ONLY)
|
||||
${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${CBLASLIB}-config.cmake @ONLY)
|
||||
install(FILES
|
||||
${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/cblas-config.cmake
|
||||
${LAPACK_BINARY_DIR}/cblas-config-version.cmake
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/cblas-${LAPACK_VERSION}
|
||||
${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${CBLASLIB}-config.cmake
|
||||
${LAPACK_BINARY_DIR}/${CBLASLIB}-config-version.cmake
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${CBLASLIB}-${LAPACK_VERSION}
|
||||
)
|
||||
|
||||
#install(EXPORT cblas-targets
|
||||
# DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/cblas-${LAPACK_VERSION}
|
||||
#install(EXPORT ${CBLASLIB}-targets
|
||||
# DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${CBLASLIB}-${LAPACK_VERSION}
|
||||
# COMPONENT Development
|
||||
# )
|
||||
|
||||
@@ -5,6 +5,6 @@ Name: CBLAS
|
||||
Description: C Standard Interface to BLAS Basic Linear Algebra Subprograms
|
||||
Version: @LAPACK_VERSION@
|
||||
URL: http://www.netlib.org/blas/#_cblas
|
||||
Libs: -L${libdir} -lcblas
|
||||
Libs: -L${libdir} -l@CBLASLIB@
|
||||
Cflags: -I${includedir}
|
||||
Requires.private: blas
|
||||
Requires.private: @BLASLIB@
|
||||
|
||||
@@ -4,11 +4,11 @@ find_package(LAPACK NO_MODULE)
|
||||
|
||||
# Load lapack targets from the build tree, including lapacke targets.
|
||||
if(NOT TARGET lapacke)
|
||||
include("@LAPACK_BINARY_DIR@/lapack-targets.cmake")
|
||||
include("@LAPACK_BINARY_DIR@/@LAPACKLIB@-targets.cmake")
|
||||
endif()
|
||||
|
||||
# Report cblas header search locations from build tree.
|
||||
set(CBLAS_INCLUDE_DIRS "@LAPACK_BINARY_DIR@/include")
|
||||
|
||||
# Report cblas libraries.
|
||||
set(CBLAS_LIBRARIES cblas)
|
||||
set(CBLAS_LIBRARIES @CBLASLIB@)
|
||||
|
||||
@@ -5,19 +5,19 @@ get_filename_component(_CBLAS_PREFIX "${_CBLAS_PREFIX}" PATH)
|
||||
get_filename_component(_CBLAS_PREFIX "${_CBLAS_PREFIX}" PATH)
|
||||
|
||||
# Load the LAPACK package with which we were built.
|
||||
set(LAPACK_DIR "${_CBLAS_PREFIX}/@CMAKE_INSTALL_LIBDIR@/cmake/lapack-@LAPACK_VERSION@")
|
||||
set(LAPACK_DIR "${_CBLAS_PREFIX}/@CMAKE_INSTALL_LIBDIR@/cmake/@LAPACKLIB@-@LAPACK_VERSION@")
|
||||
find_package(LAPACK NO_MODULE)
|
||||
|
||||
# Load lapacke targets from the install tree.
|
||||
if(NOT TARGET cblas)
|
||||
include(${_CBLAS_SELF_DIR}/cblas-targets.cmake)
|
||||
if(NOT TARGET @CBLASLIB@)
|
||||
include(${_CBLAS_SELF_DIR}/@CBLASLIB@-targets.cmake)
|
||||
endif()
|
||||
|
||||
# Report lapacke header search locations.
|
||||
set(CBLAS_INCLUDE_DIRS ${_CBLAS_PREFIX}/include)
|
||||
|
||||
# Report lapacke libraries.
|
||||
set(CBLAS_LIBRARIES cblas)
|
||||
set(CBLAS_LIBRARIES @CBLASLIB@)
|
||||
|
||||
unset(_CBLAS_PREFIX)
|
||||
unset(_CBLAS_SELF_DIR)
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
add_executable(xexample1_CBLAS cblas_example1.c)
|
||||
add_executable(xexample2_CBLAS cblas_example2.c)
|
||||
|
||||
target_link_libraries(xexample1_CBLAS cblas)
|
||||
target_link_libraries(xexample2_CBLAS cblas ${BLAS_LIBRARIES})
|
||||
target_link_libraries(xexample1_CBLAS ${CBLASLIB})
|
||||
target_link_libraries(xexample2_CBLAS ${CBLASLIB} ${BLAS_LIBRARIES})
|
||||
|
||||
add_test(example1_CBLAS ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/xexample1_CBLAS)
|
||||
add_test(example2_CBLAS ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/xexample2_CBLAS)
|
||||
|
||||
@@ -11,7 +11,7 @@ int main ( )
|
||||
|
||||
double *a, *x, *y;
|
||||
double alpha, beta;
|
||||
int m, n, lda, incx, incy, i;
|
||||
CBLAS_INDEX m, n, lda, incx, incy, i;
|
||||
|
||||
Layout = CblasColMajor;
|
||||
transa = CblasNoTrans;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
int main (int argc, char **argv )
|
||||
{
|
||||
int rout=-1,info=0,m,n,k,lda,ldb,ldc;
|
||||
CBLAS_INDEX rout=-1,info=0,m,n,k,lda,ldb,ldc;
|
||||
double A[2] = {0.0,0.0},
|
||||
B[2] = {0.0,0.0},
|
||||
C[2] = {0.0,0.0},
|
||||
|
||||
@@ -113,16 +113,16 @@ if(BUILD_COMPLEX16)
|
||||
endif()
|
||||
list(REMOVE_DUPLICATES SOURCES)
|
||||
|
||||
add_library(cblas ${SOURCES})
|
||||
add_library(${CBLASLIB} ${SOURCES})
|
||||
set_target_properties(
|
||||
cblas PROPERTIES
|
||||
${CBLASLIB} PROPERTIES
|
||||
LINKER_LANGUAGE C
|
||||
VERSION ${LAPACK_VERSION}
|
||||
SOVERSION ${LAPACK_MAJOR_VERSION}
|
||||
)
|
||||
target_include_directories(cblas PUBLIC
|
||||
target_include_directories(${CBLASLIB} PUBLIC
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../include>
|
||||
$<INSTALL_INTERFACE:include>
|
||||
)
|
||||
target_link_libraries(cblas PRIVATE ${BLAS_LIBRARIES})
|
||||
lapack_install_library(cblas)
|
||||
target_link_libraries(${CBLASLIB} PRIVATE ${BLAS_LIBRARIES})
|
||||
lapack_install_library(${CBLASLIB})
|
||||
|
||||
@@ -52,9 +52,9 @@ if(BUILD_SINGLE)
|
||||
add_executable(xscblat2 c_sblat2.f ${STESTL2O} ${LAPACK_BINARY_DIR}/include/cblas_test.h)
|
||||
add_executable(xscblat3 c_sblat3.f ${STESTL3O} ${LAPACK_BINARY_DIR}/include/cblas_test.h)
|
||||
|
||||
target_link_libraries(xscblat1 cblas)
|
||||
target_link_libraries(xscblat2 cblas)
|
||||
target_link_libraries(xscblat3 cblas)
|
||||
target_link_libraries(xscblat1 ${CBLASLIB})
|
||||
target_link_libraries(xscblat2 ${CBLASLIB})
|
||||
target_link_libraries(xscblat3 ${CBLASLIB})
|
||||
|
||||
add_cblas_test(stest1.out "" xscblat1)
|
||||
add_cblas_test(stest2.out sin2 xscblat2)
|
||||
@@ -66,9 +66,9 @@ if(BUILD_DOUBLE)
|
||||
add_executable(xdcblat2 c_dblat2.f ${DTESTL2O} ${LAPACK_BINARY_DIR}/include/cblas_test.h)
|
||||
add_executable(xdcblat3 c_dblat3.f ${DTESTL3O} ${LAPACK_BINARY_DIR}/include/cblas_test.h)
|
||||
|
||||
target_link_libraries(xdcblat1 cblas)
|
||||
target_link_libraries(xdcblat2 cblas)
|
||||
target_link_libraries(xdcblat3 cblas)
|
||||
target_link_libraries(xdcblat1 ${CBLASLIB})
|
||||
target_link_libraries(xdcblat2 ${CBLASLIB})
|
||||
target_link_libraries(xdcblat3 ${CBLASLIB})
|
||||
|
||||
add_cblas_test(dtest1.out "" xdcblat1)
|
||||
add_cblas_test(dtest2.out din2 xdcblat2)
|
||||
@@ -80,9 +80,9 @@ if(BUILD_COMPLEX)
|
||||
add_executable(xccblat2 c_cblat2.f ${CTESTL2O} ${LAPACK_BINARY_DIR}/include/cblas_test.h)
|
||||
add_executable(xccblat3 c_cblat3.f ${CTESTL3O} ${LAPACK_BINARY_DIR}/include/cblas_test.h)
|
||||
|
||||
target_link_libraries(xccblat1 cblas ${BLAS_LIBRARIES})
|
||||
target_link_libraries(xccblat2 cblas)
|
||||
target_link_libraries(xccblat3 cblas)
|
||||
target_link_libraries(xccblat1 ${CBLASLIB} ${BLAS_LIBRARIES})
|
||||
target_link_libraries(xccblat2 ${CBLASLIB})
|
||||
target_link_libraries(xccblat3 ${CBLASLIB})
|
||||
|
||||
add_cblas_test(ctest1.out "" xccblat1)
|
||||
add_cblas_test(ctest2.out cin2 xccblat2)
|
||||
@@ -94,9 +94,9 @@ if(BUILD_COMPLEX16)
|
||||
add_executable(xzcblat2 c_zblat2.f ${ZTESTL2O} ${LAPACK_BINARY_DIR}/include/cblas_test.h)
|
||||
add_executable(xzcblat3 c_zblat3.f ${ZTESTL3O} ${LAPACK_BINARY_DIR}/include/cblas_test.h)
|
||||
|
||||
target_link_libraries(xzcblat1 cblas)
|
||||
target_link_libraries(xzcblat2 cblas)
|
||||
target_link_libraries(xzcblat3 cblas)
|
||||
target_link_libraries(xzcblat1 ${CBLASLIB})
|
||||
target_link_libraries(xzcblat2 ${CBLASLIB})
|
||||
target_link_libraries(xzcblat3 ${CBLASLIB})
|
||||
|
||||
add_cblas_test(ztest1.out "" xzcblat1)
|
||||
add_cblas_test(ztest2.out zin2 xzcblat2)
|
||||
|
||||
Reference in New Issue
Block a user