Skip to content

Commit 68e6823

Browse files
authored
Adapt for supporting only a subset of variable types
1 parent 8ef600f commit 68e6823

File tree

4 files changed

+28
-28
lines changed

4 files changed

+28
-28
lines changed

cmake/arch.cmake

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,7 @@ if (DYNAMIC_ARCH)
8383
endif ()
8484
endif ()
8585

86-
CHECK_INCLUDE_FILE ("${PROJECT_SOURCE_DIR}/config_kernel.h" TRAP)
87-
if (TRAP)
86+
if (EXISTS ${PROJECT_SOURCE_DIR}/config_kernel.h)
8887
message (FATAL_ERROR "Your build directory contains a file config_kernel.h, probably from a previous compilation with make. This will conflict with the cmake compilation and cause strange compiler errors - please remove the file before trying again")
8988
endif ()
9089

cmake/lapack.cmake

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
# Sources for compiling lapack-netlib. Can't use CMakeLists.txt because lapack-netlib already has its own cmake files.
22

33
set(ALLAUX ilaenv.f ilaenv2stage.f ieeeck.f lsamen.f iparmq.f iparam2stage.F
4-
ilaprec.f ilatrans.f ilauplo.f iladiag.f chla_transtype.f
4+
ilaprec.f ilatrans.f ilauplo.f iladiag.f chla_transtype.f dlaset.f
55
../INSTALL/ilaver.f xerbla_array.f
66
../INSTALL/slamch.f)
77

88
set(SCLAUX
9+
scombssq.f sbdsvdx.f sstevx.f sstein.f
910
sbdsdc.f
1011
sbdsqr.f sdisna.f slabad.f slacpy.f sladiv.f slae2.f slaebz.f
1112
slaed0.f slaed1.f slaed2.f slaed3.f slaed4.f slaed5.f slaed6.f
@@ -25,6 +26,7 @@ set(SCLAUX
2526

2627
set(DZLAUX
2728
dbdsdc.f
29+
dbdsvdx.f dstevx.f dstein.f
2830
dbdsqr.f ddisna.f dlabad.f dlacpy.f dladiv.f dlae2.f dlaebz.f
2931
dlaed0.f dlaed1.f dlaed2.f dlaed3.f dlaed4.f dlaed5.f dlaed6.f
3032
dlaed7.f dlaed8.f dlaed9.f dlaeda.f dlaev2.f dlagtf.f
@@ -35,14 +37,14 @@ set(DZLAUX
3537
dlartg.f dlaruv.f dlas2.f dlascl.f
3638
dlasd0.f dlasd1.f dlasd2.f dlasd3.f dlasd4.f dlasd5.f dlasd6.f
3739
dlasd7.f dlasd8.f dlasda.f dlasdq.f dlasdt.f
38-
dlaset.f dlasq1.f dlasq2.f dlasq3.f dlasq4.f dlasq5.f dlasq6.f
40+
dlasq1.f dlasq2.f dlasq3.f dlasq4.f dlasq5.f dlasq6.f
3941
dlasr.f dlasrt.f dlassq.f dlasv2.f dpttrf.f dstebz.f dstedc.f
4042
dsteqr.f dsterf.f dlaisnan.f disnan.f
4143
dlartgp.f dlartgs.f
4244
../INSTALL/dlamch.f ../INSTALL/dsecnd_${TIMER}.f)
4345

4446
set(SLASRC
45-
sbdsvdx.f sgbbrd.f sgbcon.f sgbequ.f sgbrfs.f sgbsv.f
47+
sgbbrd.f sgbcon.f sgbequ.f sgbrfs.f sgbsv.f
4648
sgbsvx.f sgbtf2.f sgbtrf.f sgbtrs.f sgebak.f sgebal.f sgebd2.f
4749
sgebrd.f sgecon.f sgeequ.f sgees.f sgeesx.f sgeev.f sgeevx.f
4850
sgehd2.f sgehrd.f sgelq2.f sgelqf.f
@@ -83,8 +85,8 @@ set(SLASRC
8385
ssbev.f ssbevd.f ssbevx.f ssbgst.f ssbgv.f ssbgvd.f ssbgvx.f
8486
ssbtrd.f sspcon.f sspev.f sspevd.f sspevx.f sspgst.f
8587
sspgv.f sspgvd.f sspgvx.f ssprfs.f sspsv.f sspsvx.f ssptrd.f
86-
ssptrf.f ssptri.f ssptrs.f sstegr.f sstein.f sstev.f sstevd.f sstevr.f
87-
sstevx.f ssycon.f ssyev.f ssyevd.f ssyevr.f ssyevx.f ssygs2.f
88+
ssptrf.f ssptri.f ssptrs.f sstegr.f sstev.f sstevd.f sstevr.f
89+
ssycon.f ssyev.f ssyevd.f ssyevr.f ssyevx.f ssygs2.f
8890
ssygst.f ssygv.f ssygvd.f ssygvx.f ssyrfs.f ssysv.f ssysvx.f
8991
ssytd2.f ssytf2.f ssytrd.f ssytrf.f ssytri.f ssytri2.f ssytri2x.f
9092
ssyswapr.f ssytrs.f ssytrs2.f
@@ -116,7 +118,7 @@ set(SLASRC
116118
ssytrd_2stage.f ssytrd_sy2sb.f ssytrd_sb2st.F ssb2st_kernels.f
117119
ssyevd_2stage.f ssyev_2stage.f ssyevx_2stage.f ssyevr_2stage.f
118120
ssbev_2stage.f ssbevx_2stage.f ssbevd_2stage.f ssygv_2stage.f
119-
scombssq.f sgesvdq.f slaorhr_col_getrfnp.f
121+
sgesvdq.f slaorhr_col_getrfnp.f
120122
slaorhr_col_getrfnp2.f sorgtsqr.f sorhr_col.f )
121123

122124
set(SXLASRC sgesvxx.f sgerfsx.f sla_gerfsx_extended.f sla_geamv.f
@@ -229,7 +231,7 @@ set(CXLASRC cgesvxx.f cgerfsx.f cla_gerfsx_extended.f cla_geamv.f
229231
cla_lin_berr.f clarscl2.f clascl2.f cla_wwaddw.f)
230232

231233
set(DLASRC
232-
dbdsvdx.f dgbbrd.f dgbcon.f dgbequ.f dgbrfs.f dgbsv.f
234+
dgbbrd.f dgbcon.f dgbequ.f dgbrfs.f dgbsv.f
233235
dgbsvx.f dgbtf2.f dgbtrf.f dgbtrs.f dgebak.f dgebal.f dgebd2.f
234236
dgebrd.f dgecon.f dgeequ.f dgees.f dgeesx.f dgeev.f dgeevx.f
235237
dgehd2.f dgehrd.f dgelq2.f dgelqf.f
@@ -270,8 +272,8 @@ set(DLASRC
270272
dsbev.f dsbevd.f dsbevx.f dsbgst.f dsbgv.f dsbgvd.f dsbgvx.f
271273
dsbtrd.f dspcon.f dspev.f dspevd.f dspevx.f dspgst.f
272274
dspgv.f dspgvd.f dspgvx.f dsprfs.f dspsv.f dspsvx.f dsptrd.f
273-
dsptrf.f dsptri.f dsptrs.f dstegr.f dstein.f dstev.f dstevd.f dstevr.f
274-
dstevx.f dsycon.f dsyev.f dsyevd.f dsyevr.f
275+
dsptrf.f dsptri.f dsptrs.f dstegr.f dstev.f dstevd.f dstevr.f
276+
dsycon.f dsyev.f dsyevd.f dsyevr.f
275277
dsyevx.f dsygs2.f dsygst.f dsygv.f dsygvd.f dsygvx.f dsyrfs.f
276278
dsysv.f dsysvx.f
277279
dsytd2.f dsytf2.f dsytrd.f dsytrf.f dsytri.f dsytrs.f dsytrs2.f
@@ -474,12 +476,16 @@ endif()
474476
if(BUILD_COMPLEX)
475477
set(LA_REL_SRC ${LA_REL_SRC} ${CLASRC} ${ZCLASRC} ${ALLAUX} ${SCLAUX})
476478
SET(LA_GEN_SRC ${LA_GEN_SRC} ${CMATGEN} ${SCATGEN})
477-
message(STATUS "Building Complex Precision")
479+
message(STATUS "Building Single Precision Complex")
478480
endif()
479481
if(BUILD_COMPLEX16)
480482
set(LA_REL_SRC ${LA_REL_SRC} ${ZLASRC} ${ZCLASRC} ${ALLAUX} ${DZLAUX})
481483
SET(LA_GEN_SRC ${LA_GEN_SRC} ${ZMATGEN} ${DZATGEN})
482-
message(STATUS "Building Double Complex Precision")
484+
# for zlange/zlanhe
485+
if (NOT BUILD_DOUBLE)
486+
set (LA_REL_SRC ${LA_REL_SRC} dcombssq.f)
487+
endif ()
488+
message(STATUS "Building Double Precision Complex")
483489
endif()
484490

485491
# add lapack-netlib folder to the sources

cmake/system.cmake

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,6 @@ if (DEFINED TARGET)
7070
set (KERNEL_DEFINITIONS "${KERNEL_DEFINITIONS} -mavx2")
7171
endif()
7272
endif()
73-
if (DEFINED HAVE_SSE3)
74-
set (KERNEL_DEFINITIONS "${KERNEL_DEFINITIONS} -msse3")
75-
endif()
7673
endif()
7774

7875
if (DEFINED TARGET)
@@ -326,13 +323,7 @@ else ()
326323
set(CCOMMON_OPT "${CCOMMON_OPT} -DMAX_STACK_ALLOC=2048")
327324
endif ()
328325
endif ()
329-
if (NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
330-
if (DEFINED BLAS3_MEM_ALLOC_THRESHOLD)
331-
if (NOT ${BLAS3_MEM_ALLOC_THRESHOLD} EQUAL 32)
332-
set(CCOMMON_OPT "${CCOMMON_OPT} -DBLAS3_MEM_ALLOC_THRESHOLD=${BLAS3_MEM_ALLOC_THRESHOLD}")
333-
endif()
334-
endif()
335-
endif()
326+
336327
if (DEFINED LIBNAMESUFFIX)
337328
set(LIBPREFIX "libopenblas_${LIBNAMESUFFIX}")
338329
else ()
@@ -410,16 +401,20 @@ if (NOT BUILD_SINGLE AND NOT BUILD_DOUBLE AND NOT BUILD_COMPLEX AND NOT BUILD_CO
410401
set (BUILD_COMPLEX16 ON)
411402
endif()
412403
if (BUILD_SINGLE)
413-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DBUILD_SINGLE")
404+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DBUILD_SINGLE=1")
405+
set(CCOMMON_OPT "${CCOMMON_OPT} -DBUILD_SINGLE=1")
414406
endif()
415407
if (BUILD_DOUBLE)
416-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DBUILD_DOUBLE")
408+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DBUILD_DOUBLE=1")
409+
set(CCOMMON_OPT "${CCOMMON_OPT} -DBUILD_SINGLE=1")
417410
endif()
418411
if (BUILD_COMPLEX)
419-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DBUILD_COMPLEX")
412+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DBUILD_COMPLEX=1")
413+
set(CCOMMON_OPT "${CCOMMON_OPT} -DBUILD_COMPLEX=1")
420414
endif()
421415
if (BUILD_COMPLEX16)
422-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DBUILD_COMPLEX16")
416+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DBUILD_COMPLEX16=1")
417+
set(CCOMMON_OPT "${CCOMMON_OPT} -DBUILD_COMPLEX16=1")
423418
endif()
424419
if(NOT MSVC)
425420
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} ${CCOMMON_OPT}")

cmake/system_check.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,6 @@ endif()
121121

122122
include(CheckIncludeFile)
123123
CHECK_INCLUDE_FILE("stdatomic.h" HAVE_C11)
124-
if (HAVE_C11)
124+
if (HAVE_C11 EQUAL 1)
125125
set (CCOMMON_OPT "${CCOMMON_OPT} -DHAVE_C11")
126126
endif()

0 commit comments

Comments
 (0)