Skip to content

Commit

Permalink
create INDEX64 target
Browse files Browse the repository at this point in the history
  • Loading branch information
epsilon-0 committed Nov 3, 2020
1 parent a6870da commit 5dd47be
Show file tree
Hide file tree
Showing 25 changed files with 135 additions and 117 deletions.
4 changes: 2 additions & 2 deletions BLAS/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ add_subdirectory(SRC)
if(BUILD_TESTING)
add_subdirectory(TESTING)
endif()
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/blas.pc.in ${CMAKE_CURRENT_BINARY_DIR}/blas.pc @ONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/blas.pc.in ${CMAKE_CURRENT_BINARY_DIR}/${BLASLIB}.pc @ONLY)
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/blas.pc
${CMAKE_CURRENT_BINARY_DIR}/${BLASLIB}.pc
DESTINATION ${PKG_CONFIG_DIR}
COMPONENT Development
)
6 changes: 3 additions & 3 deletions BLAS/SRC/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ if(BUILD_COMPLEX16)
endif()
list(REMOVE_DUPLICATES SOURCES)

add_library(blas ${SOURCES})
add_library(${BLASLIB} ${SOURCES})
set_target_properties(
blas PROPERTIES
${BLASLIB} PROPERTIES
VERSION ${LAPACK_VERSION}
SOVERSION ${LAPACK_MAJOR_VERSION}
)
lapack_install_library(blas)
lapack_install_library(${BLASLIB})
2 changes: 1 addition & 1 deletion BLAS/TESTING/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ macro(add_blas_test name src)
get_filename_component(baseNAME ${src} NAME_WE)
set(TEST_INPUT "${CMAKE_CURRENT_SOURCE_DIR}/${baseNAME}.in")
add_executable(${name} ${src})
target_link_libraries(${name} blas)
target_link_libraries(${name} ${BLASLIB})
if(EXISTS "${TEST_INPUT}")
add_test(NAME BLAS-${name} COMMAND "${CMAKE_COMMAND}"
-DTEST=$<TARGET_FILE:${name}>
Expand Down
2 changes: 1 addition & 1 deletion BLAS/blas.pc.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ Name: BLAS
Description: FORTRAN reference implementation of BLAS Basic Linear Algebra Subprograms
Version: @LAPACK_VERSION@
URL: http://www.netlib.org/blas/
Libs: -L${libdir} -lblas
Libs: -L${libdir} -l@BLASLIB@
30 changes: 15 additions & 15 deletions CBLAS/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
Expand Down Expand Up @@ -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
Expand All @@ -61,34 +61,34 @@ 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.
list(GET ALL_TARGETS 0 _cblas_config_build_guard_target)
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
# )
4 changes: 2 additions & 2 deletions CBLAS/cblas.pc.in
Original file line number Diff line number Diff line change
Expand Up @@ -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 changes: 2 additions & 2 deletions CBLAS/cmake/cblas-config-build.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -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@)
8 changes: 4 additions & 4 deletions CBLAS/cmake/cblas-config-install.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -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)
4 changes: 2 additions & 2 deletions CBLAS/examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
2 changes: 1 addition & 1 deletion CBLAS/examples/cblas_example1.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion CBLAS/examples/cblas_example2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down
10 changes: 5 additions & 5 deletions CBLAS/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
24 changes: 12 additions & 12 deletions CBLAS/testing/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion CMAKE/lapack-config-build.cmake.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Load lapack targets from the build tree if necessary.
set(_LAPACK_TARGET "@_lapack_config_build_guard_target@")
if(_LAPACK_TARGET AND NOT TARGET "${_LAPACK_TARGET}")
include("@LAPACK_BINARY_DIR@/lapack-targets.cmake")
include("@LAPACK_BINARY_DIR@/@LAPACKLIB@-targets.cmake")
endif()
unset(_LAPACK_TARGET)

Expand Down
2 changes: 1 addition & 1 deletion CMAKE/lapack-config-install.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ get_filename_component(_LAPACK_SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
# Load lapack targets from the install tree if necessary.
set(_LAPACK_TARGET "@_lapack_config_install_guard_target@")
if(_LAPACK_TARGET AND NOT TARGET "${_LAPACK_TARGET}")
include("${_LAPACK_SELF_DIR}/lapack-targets.cmake")
include("${_LAPACK_SELF_DIR}/@LAPACKLIB@-targets.cmake")
endif()
unset(_LAPACK_TARGET)

Expand Down
Loading

0 comments on commit 5dd47be

Please sign in to comment.