Skip to content

Commit d094ab9

Browse files
authored
Merge pull request Reference-LAPACK#7 from Reference-LAPACK/master
rebase
2 parents ce0db88 + 741f431 commit d094ab9

File tree

185 files changed

+13053
-3444
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

185 files changed

+13053
-3444
lines changed

.travis.yml

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,24 +14,37 @@ addons:
1414
matrix:
1515
include:
1616
- os: linux
17+
name: "CMake Release Test on Linux"
1718
env: CMAKE_BUILD_TYPE=Release
1819
- os: linux
20+
name: "Makefile Test on Linux"
21+
script:
22+
- rm -f make.inc
23+
- cp make.inc.example make.inc
24+
- make -s -j2 all
25+
- make -j2 lapack_install
26+
- os: linux
27+
name: "CMake Coverage Test on Linux"
1928
env: CMAKE_BUILD_TYPE=Coverage
2029
- os: osx
30+
name: "CMake Release Test on Mac OS X"
31+
osx_image: xcode10.3
2132
env: CMAKE_BUILD_TYPE=Release
22-
before_install:
23-
- brew update > /dev/null
24-
- brew upgrade gcc > /dev/null
2533
- os: osx
26-
env: CMAKE_BUILD_TYPE=Coverage
27-
before_install:
28-
- brew update > /dev/null
29-
- brew upgrade gcc > /dev/null
34+
osx_image: xcode10.3
35+
name: "Makefile Test on Mac OS X"
36+
script:
37+
- rm -f make.inc
38+
- cp make.inc.example make.inc
39+
- make -s -j2 all
40+
- make -j2 lapack_install
3041

31-
script:
42+
before_script:
3243
- export PR=https://github.com/api/repos/$TRAVIS_REPO_SLUG/pulls/$TRAVIS_PULL_REQUEST
3344
- export BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo `curl -s $PR | jq -r .head.ref`; fi)
3445
- echo "TRAVIS_BRANCH=$TRAVIS_BRANCH, PR=$PR, BRANCH=$BRANCH"
46+
47+
script:
3548
- export SRC_DIR=$(pwd)
3649
- export BLD_DIR=${SRC_DIR}/lapack-travis-bld
3750
- export INST_DIR=${SRC_DIR}/../lapack-travis-install
@@ -46,6 +59,7 @@ script:
4659
-DLAPACKE:BOOL=ON
4760
-DBUILD_TESTING=ON
4861
-DLAPACKE_WITH_TMG:BOOL=ON
62+
-DCMAKE_Fortran_FLAGS:STRING="-fimplicit-none -frecursive"
4963
${SRC_DIR}
5064
- ctest -D ExperimentalStart
5165
- ctest -D ExperimentalConfigure

BLAS/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ add_subdirectory(SRC)
22
if(BUILD_TESTING)
33
add_subdirectory(TESTING)
44
endif()
5-
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/blas.pc.in ${CMAKE_CURRENT_BINARY_DIR}/blas.pc @ONLY)
5+
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/blas.pc.in ${CMAKE_CURRENT_BINARY_DIR}/${BLASLIB}.pc @ONLY)
66
install(FILES
7-
${CMAKE_CURRENT_BINARY_DIR}/blas.pc
7+
${CMAKE_CURRENT_BINARY_DIR}/${BLASLIB}.pc
88
DESTINATION ${PKG_CONFIG_DIR}
99
COMPONENT Development
1010
)

BLAS/SRC/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,10 @@ if(BUILD_COMPLEX16)
9797
endif()
9898
list(REMOVE_DUPLICATES SOURCES)
9999

100-
add_library(blas ${SOURCES})
100+
add_library(${BLASLIB} ${SOURCES})
101101
set_target_properties(
102-
blas PROPERTIES
102+
${BLASLIB} PROPERTIES
103103
VERSION ${LAPACK_VERSION}
104104
SOVERSION ${LAPACK_MAJOR_VERSION}
105105
)
106-
lapack_install_library(blas)
106+
lapack_install_library(${BLASLIB})

BLAS/TESTING/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ macro(add_blas_test name src)
22
get_filename_component(baseNAME ${src} NAME_WE)
33
set(TEST_INPUT "${CMAKE_CURRENT_SOURCE_DIR}/${baseNAME}.in")
44
add_executable(${name} ${src})
5-
target_link_libraries(${name} blas)
5+
target_link_libraries(${name} ${BLASLIB})
66
if(EXISTS "${TEST_INPUT}")
77
add_test(NAME BLAS-${name} COMMAND "${CMAKE_COMMAND}"
88
-DTEST=$<TARGET_FILE:${name}>

BLAS/blas.pc.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ Name: BLAS
55
Description: FORTRAN reference implementation of BLAS Basic Linear Algebra Subprograms
66
Version: @LAPACK_VERSION@
77
URL: http://www.netlib.org/blas/
8-
Libs: -L${libdir} -lblas
8+
Libs: -L${libdir} -l@BLASLIB@

CBLAS/CMakeLists.txt

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
message(STATUS "CBLAS enable")
22
enable_language(C)
33

4-
set(LAPACK_INSTALL_EXPORT_NAME cblas-targets)
4+
set(LAPACK_INSTALL_EXPORT_NAME ${CBLASLIB}-targets)
55

66
# Create a header file cblas.h for the routines called in my C programs
77
include(FortranCInterface)
@@ -42,15 +42,15 @@ if(BUILD_TESTING)
4242
endif()
4343

4444
if(NOT BLAS_FOUND)
45-
set(ALL_TARGETS ${ALL_TARGETS} blas)
45+
set(ALL_TARGETS ${ALL_TARGETS} ${BLASLIB})
4646
endif()
4747

4848
# Export cblas targets from the
4949
# install tree, if any.
5050
set(_cblas_config_install_guard_target "")
5151
if(ALL_TARGETS)
52-
install(EXPORT cblas-targets
53-
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/cblas-${LAPACK_VERSION}
52+
install(EXPORT ${CBLASLIB}-targets
53+
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${CBLASLIB}-${LAPACK_VERSION}
5454
COMPONENT Development
5555
)
5656
# Choose one of the cblas targets to use as a guard for
@@ -61,34 +61,34 @@ endif()
6161
# Export cblas targets from the build tree, if any.
6262
set(_cblas_config_build_guard_target "")
6363
if(ALL_TARGETS)
64-
export(TARGETS ${ALL_TARGETS} FILE cblas-targets.cmake)
64+
export(TARGETS ${ALL_TARGETS} FILE ${CBLASLIB}-targets.cmake)
6565

6666
# Choose one of the cblas targets to use as a guard
6767
# for cblas-config.cmake to load targets from the build tree.
6868
list(GET ALL_TARGETS 0 _cblas_config_build_guard_target)
6969
endif()
7070

7171
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/cblas-config-version.cmake.in
72-
${LAPACK_BINARY_DIR}/cblas-config-version.cmake @ONLY)
72+
${LAPACK_BINARY_DIR}/${CBLASLIB}-config-version.cmake @ONLY)
7373
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/cblas-config-build.cmake.in
74-
${LAPACK_BINARY_DIR}/cblas-config.cmake @ONLY)
74+
${LAPACK_BINARY_DIR}/${CBLASLIB}-config.cmake @ONLY)
7575

7676

77-
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cblas.pc.in ${CMAKE_CURRENT_BINARY_DIR}/cblas.pc @ONLY)
77+
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cblas.pc.in ${CMAKE_CURRENT_BINARY_DIR}/${CBLASLIB}.pc @ONLY)
7878
install(FILES
79-
${CMAKE_CURRENT_BINARY_DIR}/cblas.pc
79+
${CMAKE_CURRENT_BINARY_DIR}/${CBLASLIB}.pc
8080
DESTINATION ${PKG_CONFIG_DIR}
8181
)
8282

8383
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/cblas-config-install.cmake.in
84-
${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/cblas-config.cmake @ONLY)
84+
${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${CBLASLIB}-config.cmake @ONLY)
8585
install(FILES
86-
${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/cblas-config.cmake
87-
${LAPACK_BINARY_DIR}/cblas-config-version.cmake
88-
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/cblas-${LAPACK_VERSION}
86+
${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${CBLASLIB}-config.cmake
87+
${LAPACK_BINARY_DIR}/${CBLASLIB}-config-version.cmake
88+
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${CBLASLIB}-${LAPACK_VERSION}
8989
)
9090

91-
#install(EXPORT cblas-targets
92-
# DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/cblas-${LAPACK_VERSION}
91+
#install(EXPORT ${CBLASLIB}-targets
92+
# DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${CBLASLIB}-${LAPACK_VERSION}
9393
# COMPONENT Development
9494
# )

CBLAS/cblas.pc.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ Name: CBLAS
55
Description: C Standard Interface to BLAS Basic Linear Algebra Subprograms
66
Version: @LAPACK_VERSION@
77
URL: http://www.netlib.org/blas/#_cblas
8-
Libs: -L${libdir} -lcblas
8+
Libs: -L${libdir} -l@CBLASLIB@
99
Cflags: -I${includedir}
10-
Requires.private: blas
10+
Requires.private: @BLASLIB@

CBLAS/cmake/cblas-config-build.cmake.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ find_package(LAPACK NO_MODULE)
44

55
# Load lapack targets from the build tree, including lapacke targets.
66
if(NOT TARGET lapacke)
7-
include("@LAPACK_BINARY_DIR@/lapack-targets.cmake")
7+
include("@LAPACK_BINARY_DIR@/@LAPACKLIB@-targets.cmake")
88
endif()
99

1010
# Report cblas header search locations from build tree.
1111
set(CBLAS_INCLUDE_DIRS "@LAPACK_BINARY_DIR@/include")
1212

1313
# Report cblas libraries.
14-
set(CBLAS_LIBRARIES cblas)
14+
set(CBLAS_LIBRARIES @CBLASLIB@)

CBLAS/cmake/cblas-config-install.cmake.in

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,19 @@ get_filename_component(_CBLAS_PREFIX "${_CBLAS_PREFIX}" PATH)
55
get_filename_component(_CBLAS_PREFIX "${_CBLAS_PREFIX}" PATH)
66

77
# Load the LAPACK package with which we were built.
8-
set(LAPACK_DIR "${_CBLAS_PREFIX}/@CMAKE_INSTALL_LIBDIR@/cmake/lapack-@LAPACK_VERSION@")
8+
set(LAPACK_DIR "${_CBLAS_PREFIX}/@CMAKE_INSTALL_LIBDIR@/cmake/@LAPACKLIB@-@LAPACK_VERSION@")
99
find_package(LAPACK NO_MODULE)
1010

1111
# Load lapacke targets from the install tree.
12-
if(NOT TARGET cblas)
13-
include(${_CBLAS_SELF_DIR}/cblas-targets.cmake)
12+
if(NOT TARGET @CBLASLIB@)
13+
include(${_CBLAS_SELF_DIR}/@CBLASLIB@-targets.cmake)
1414
endif()
1515

1616
# Report lapacke header search locations.
1717
set(CBLAS_INCLUDE_DIRS ${_CBLAS_PREFIX}/include)
1818

1919
# Report lapacke libraries.
20-
set(CBLAS_LIBRARIES cblas)
20+
set(CBLAS_LIBRARIES @CBLASLIB@)
2121

2222
unset(_CBLAS_PREFIX)
2323
unset(_CBLAS_SELF_DIR)

CBLAS/examples/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
add_executable(xexample1_CBLAS cblas_example1.c)
22
add_executable(xexample2_CBLAS cblas_example2.c)
33

4-
target_link_libraries(xexample1_CBLAS cblas)
5-
target_link_libraries(xexample2_CBLAS cblas ${BLAS_LIBRARIES})
4+
target_link_libraries(xexample1_CBLAS ${CBLASLIB})
5+
target_link_libraries(xexample2_CBLAS ${CBLASLIB} ${BLAS_LIBRARIES})
66

77
add_test(example1_CBLAS ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/xexample1_CBLAS)
88
add_test(example2_CBLAS ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/xexample2_CBLAS)

CBLAS/examples/cblas_example1.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ int main ( )
1111

1212
double *a, *x, *y;
1313
double alpha, beta;
14-
int m, n, lda, incx, incy, i;
14+
CBLAS_INDEX m, n, lda, incx, incy, i;
1515

1616
Layout = CblasColMajor;
1717
transa = CblasNoTrans;

CBLAS/examples/cblas_example2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
int main (int argc, char **argv )
1111
{
12-
int rout=-1,info=0,m,n,k,lda,ldb,ldc;
12+
CBLAS_INDEX rout=-1,info=0,m,n,k,lda,ldb,ldc;
1313
double A[2] = {0.0,0.0},
1414
B[2] = {0.0,0.0},
1515
C[2] = {0.0,0.0},

CBLAS/src/CMakeLists.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,16 +113,16 @@ if(BUILD_COMPLEX16)
113113
endif()
114114
list(REMOVE_DUPLICATES SOURCES)
115115

116-
add_library(cblas ${SOURCES})
116+
add_library(${CBLASLIB} ${SOURCES})
117117
set_target_properties(
118-
cblas PROPERTIES
118+
${CBLASLIB} PROPERTIES
119119
LINKER_LANGUAGE C
120120
VERSION ${LAPACK_VERSION}
121121
SOVERSION ${LAPACK_MAJOR_VERSION}
122122
)
123-
target_include_directories(cblas PUBLIC
123+
target_include_directories(${CBLASLIB} PUBLIC
124124
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../include>
125125
$<INSTALL_INTERFACE:include>
126126
)
127-
target_link_libraries(cblas PRIVATE ${BLAS_LIBRARIES})
128-
lapack_install_library(cblas)
127+
target_link_libraries(${CBLASLIB} PRIVATE ${BLAS_LIBRARIES})
128+
lapack_install_library(${CBLASLIB})

CBLAS/testing/CMakeLists.txt

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ if(BUILD_SINGLE)
5252
add_executable(xscblat2 c_sblat2.f ${STESTL2O} ${LAPACK_BINARY_DIR}/include/cblas_test.h)
5353
add_executable(xscblat3 c_sblat3.f ${STESTL3O} ${LAPACK_BINARY_DIR}/include/cblas_test.h)
5454

55-
target_link_libraries(xscblat1 cblas)
56-
target_link_libraries(xscblat2 cblas)
57-
target_link_libraries(xscblat3 cblas)
55+
target_link_libraries(xscblat1 ${CBLASLIB})
56+
target_link_libraries(xscblat2 ${CBLASLIB})
57+
target_link_libraries(xscblat3 ${CBLASLIB})
5858

5959
add_cblas_test(stest1.out "" xscblat1)
6060
add_cblas_test(stest2.out sin2 xscblat2)
@@ -66,9 +66,9 @@ if(BUILD_DOUBLE)
6666
add_executable(xdcblat2 c_dblat2.f ${DTESTL2O} ${LAPACK_BINARY_DIR}/include/cblas_test.h)
6767
add_executable(xdcblat3 c_dblat3.f ${DTESTL3O} ${LAPACK_BINARY_DIR}/include/cblas_test.h)
6868

69-
target_link_libraries(xdcblat1 cblas)
70-
target_link_libraries(xdcblat2 cblas)
71-
target_link_libraries(xdcblat3 cblas)
69+
target_link_libraries(xdcblat1 ${CBLASLIB})
70+
target_link_libraries(xdcblat2 ${CBLASLIB})
71+
target_link_libraries(xdcblat3 ${CBLASLIB})
7272

7373
add_cblas_test(dtest1.out "" xdcblat1)
7474
add_cblas_test(dtest2.out din2 xdcblat2)
@@ -80,9 +80,9 @@ if(BUILD_COMPLEX)
8080
add_executable(xccblat2 c_cblat2.f ${CTESTL2O} ${LAPACK_BINARY_DIR}/include/cblas_test.h)
8181
add_executable(xccblat3 c_cblat3.f ${CTESTL3O} ${LAPACK_BINARY_DIR}/include/cblas_test.h)
8282

83-
target_link_libraries(xccblat1 cblas ${BLAS_LIBRARIES})
84-
target_link_libraries(xccblat2 cblas)
85-
target_link_libraries(xccblat3 cblas)
83+
target_link_libraries(xccblat1 ${CBLASLIB} ${BLAS_LIBRARIES})
84+
target_link_libraries(xccblat2 ${CBLASLIB})
85+
target_link_libraries(xccblat3 ${CBLASLIB})
8686

8787
add_cblas_test(ctest1.out "" xccblat1)
8888
add_cblas_test(ctest2.out cin2 xccblat2)
@@ -94,9 +94,9 @@ if(BUILD_COMPLEX16)
9494
add_executable(xzcblat2 c_zblat2.f ${ZTESTL2O} ${LAPACK_BINARY_DIR}/include/cblas_test.h)
9595
add_executable(xzcblat3 c_zblat3.f ${ZTESTL3O} ${LAPACK_BINARY_DIR}/include/cblas_test.h)
9696

97-
target_link_libraries(xzcblat1 cblas)
98-
target_link_libraries(xzcblat2 cblas)
99-
target_link_libraries(xzcblat3 cblas)
97+
target_link_libraries(xzcblat1 ${CBLASLIB})
98+
target_link_libraries(xzcblat2 ${CBLASLIB})
99+
target_link_libraries(xzcblat3 ${CBLASLIB})
100100

101101
add_cblas_test(ztest1.out "" xzcblat1)
102102
add_cblas_test(ztest2.out zin2 xzcblat2)

CMAKE/lapack-config-build.cmake.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Load lapack targets from the build tree if necessary.
22
set(_LAPACK_TARGET "@_lapack_config_build_guard_target@")
33
if(_LAPACK_TARGET AND NOT TARGET "${_LAPACK_TARGET}")
4-
include("@LAPACK_BINARY_DIR@/lapack-targets.cmake")
4+
include("@LAPACK_BINARY_DIR@/@LAPACKLIB@-targets.cmake")
55
endif()
66
unset(_LAPACK_TARGET)
77

CMAKE/lapack-config-install.cmake.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ get_filename_component(_LAPACK_SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
44
# Load lapack targets from the install tree if necessary.
55
set(_LAPACK_TARGET "@_lapack_config_install_guard_target@")
66
if(_LAPACK_TARGET AND NOT TARGET "${_LAPACK_TARGET}")
7-
include("${_LAPACK_SELF_DIR}/lapack-targets.cmake")
7+
include("${_LAPACK_SELF_DIR}/@LAPACKLIB@-targets.cmake")
88
endif()
99
unset(_LAPACK_TARGET)
1010

0 commit comments

Comments
 (0)