Skip to content

Commit b7cee00

Browse files
authored
Merge pull request #1327 from martin-frbg/cmake-relapack
Make ReLAPACK available in cmake builds
2 parents c460027 + 962b20a commit b7cee00

File tree

3 files changed

+93
-1
lines changed

3 files changed

+93
-1
lines changed

CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ option(BUILD_WITHOUT_LAPACK "Without LAPACK and LAPACKE (Only BLAS or CBLAS)" ON
2424
endif()
2525
option(BUILD_WITHOUT_CBLAS "Without CBLAS" OFF)
2626
option(DYNAMIC_ARCH "Build with DYNAMIC_ARCH" OFF)
27+
option(BUILD_RELAPACK "Build with ReLAPACK (recursive LAPACK" OFF)
2728
#######
2829
if(BUILD_WITHOUT_LAPACK)
2930
set(NO_LAPACK 1)
@@ -55,6 +56,9 @@ endif ()
5556
set(SUBDIRS ${BLASDIRS})
5657
if (NOT NO_LAPACK)
5758
list(APPEND SUBDIRS lapack)
59+
if(BUILD_RELAPACK)
60+
list(APPEND SUBDIRS relapack/src)
61+
endif()
5862
endif ()
5963

6064
# set which float types we want to build for
@@ -141,7 +145,7 @@ endif()
141145

142146

143147
# add objects to the openblas lib
144-
add_library(${OpenBLAS_LIBNAME} ${LA_SOURCES} ${LAPACKE_SOURCES} ${TARGET_OBJS} ${OpenBLAS_DEF_FILE})
148+
add_library(${OpenBLAS_LIBNAME} ${LA_SOURCES} ${LAPACKE_SOURCES} ${RELA_SOURCES} ${TARGET_OBJS} ${OpenBLAS_DEF_FILE})
145149

146150
# Handle MSVC exports
147151
if(MSVC AND BUILD_SHARED_LIBS)

cmake/system.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,9 @@ if (NOT NO_LAPACK)
387387
if (NOT NO_LAPACKE)
388388
set(LIB_COMPONENTS "${LIB_COMPONENTS} LAPACKE")
389389
endif ()
390+
if (BUILD_RELAPACK)
391+
set(LIB_COMPONENTS "${LIB_COMPONENTS} ReLAPACK")
392+
endif ()
390393
endif ()
391394

392395
if (ONLY_CBLAS)

relapack/src/CMakeLists.txt

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
include_directories(${PROJECT_SOURCE_DIR})
2+
include_directories(${PROJECT_BINARY_DIR})
3+
4+
set(RELAFILES
5+
clauum.c
6+
ctrsyl_rec2.c
7+
dsytrf.c
8+
spbtrf.c
9+
strsyl_rec2.c
10+
zhetrf_rook_rec2.c
11+
ztrsyl.c
12+
cgbtrf.c
13+
cpbtrf.c
14+
ctrtri.c
15+
dsytrf_rec2.c
16+
spotrf.c
17+
strtri.c
18+
zlauum.c
19+
ztrsyl_rec2.c
20+
cgemmt.c
21+
cpotrf.c
22+
dgbtrf.c
23+
dsytrf_rook.c
24+
lapack_wrappers.c
25+
ssygst.c
26+
zgbtrf.c
27+
zpbtrf.c
28+
ztrtri.c
29+
cgetrf.c
30+
csytrf.c
31+
dgemmt.c
32+
dsytrf_rook_rec2.c
33+
ssytrf.c
34+
zgemmt.c
35+
zpotrf.c
36+
chegst.c
37+
csytrf_rec2.c
38+
dgetrf.c
39+
dtgsyl.c
40+
ssytrf_rec2.c
41+
zgetrf.c
42+
zsytrf.c
43+
chetrf.c
44+
csytrf_rook.c
45+
dlauum.c
46+
dtrsyl.c
47+
sgbtrf.c
48+
ssytrf_rook.c
49+
zhegst.c
50+
zsytrf_rec2.c
51+
chetrf_rec2.c
52+
csytrf_rook_rec2.c
53+
dpbtrf.c
54+
dtrsyl_rec2.c
55+
sgemmt.c
56+
ssytrf_rook_rec2.c
57+
zhetrf.c
58+
zsytrf_rook.c
59+
chetrf_rook.c
60+
ctgsyl.c
61+
dpotrf.c
62+
dtrtri.c
63+
sgetrf.c
64+
stgsyl.c
65+
zhetrf_rec2.c
66+
zsytrf_rook_rec2.c
67+
chetrf_rook_rec2.c
68+
ctrsyl.c
69+
dsygst.c
70+
f2c.c
71+
slauum.c
72+
strsyl.c
73+
zhetrf_rook.c
74+
ztgsyl.c
75+
)
76+
77+
78+
79+
# add relapack folder to the sources
80+
set(RELA_SOURCES "")
81+
foreach (RELA_FILE ${RELAFILES})
82+
list(APPEND RELA_SOURCES "${PROJECT_SOURCE_DIR}/relapack/src/${RELA_FILE}")
83+
endforeach ()
84+
add_library(relapack_src OBJECT ${RELA_SOURCES})
85+
set_source_files_properties(${RELA_SOURCES} PROPERTIES COMPILE_FLAGS "${LAPACK_CFLAGS}")

0 commit comments

Comments
 (0)