Skip to content

Commit ec638a8

Browse files
authored
Merge pull request #2852 from martin-frbg/issue2588-cmake
Support building only a subset of variable types
2 parents b593e6b + caa0d75 commit ec638a8

Some content is hidden

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

41 files changed

+2779
-954
lines changed

Makefile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,18 @@ else
304304
endif
305305
ifeq ($(BUILD_LAPACK_DEPRECATED), 1)
306306
-@echo "BUILD_DEPRECATED = 1" >> $(NETLIB_LAPACK_DIR)/make.inc
307+
endif
308+
ifeq ($(BUILD_SINGLE), 1)
309+
-@echo "BUILD_SINGLE = 1" >> $(NETLIB_LAPACK_DIR)/make.inc
310+
endif
311+
ifeq ($(BUILD_DOUBLE), 1)
312+
-@echo "BUILD_DOUBLE = 1" >> $(NETLIB_LAPACK_DIR)/make.inc
313+
endif
314+
ifeq ($(BUILD_COMPLEX), 1)
315+
-@echo "BUILD_COMPLEX = 1" >> $(NETLIB_LAPACK_DIR)/make.inc
316+
endif
317+
ifeq ($(BUILD_COMPLEX16), 1)
318+
-@echo "BUILD_COMPLEX16 = 1" >> $(NETLIB_LAPACK_DIR)/make.inc
307319
endif
308320
-@echo "LAPACKE_WITH_TMG = 1" >> $(NETLIB_LAPACK_DIR)/make.inc
309321
-@cat make.inc >> $(NETLIB_LAPACK_DIR)/make.inc

Makefile.system

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ifndef TOPDIR
99
TOPDIR = .
1010
endif
1111

12-
# If ARCH is not set, we use the host system's architecture for getarch compile options.
12+
# If ARCH is not set, we use the host system's architecture for getarch compile options.
1313
ifndef ARCH
1414
HOSTARCH := $(shell uname -m)
1515
else
@@ -73,6 +73,18 @@ endif
7373
#
7474
# Beginning of system configuration
7575
#
76+
ifneq ($(BUILD_SINGLE),1)
77+
ifneq ($(BUILD_DOUBLE),1)
78+
ifneq ($(BUILD_COMPLEX),1)
79+
ifneq ($(BUILD_COMPLEX16),1)
80+
override BUILD_SINGLE=1
81+
override BUILD_DOUBLE=1
82+
override BUILD_COMPLEX=1
83+
override BUILD_COMPLEX16=1
84+
endif
85+
endif
86+
endif
87+
endif
7688

7789
ifndef HOSTCC
7890
HOSTCC = $(CC)
@@ -1224,16 +1236,16 @@ ifeq ($(BUILD_HALF), 1)
12241236
CCOMMON_OPT += -DBUILD_HALF
12251237
endif
12261238
ifeq ($(BUILD_SINGLE), 1)
1227-
CCOMMON_OPT += -DBUILD_SINGLE
1239+
CCOMMON_OPT += -DBUILD_SINGLE=1
12281240
endif
12291241
ifeq ($(BUILD_DOUBLE), 1)
1230-
CCOMMON_OPT += -DBUILD_DOUBLE
1242+
CCOMMON_OPT += -DBUILD_DOUBLE=1
12311243
endif
12321244
ifeq ($(BUILD_COMPLEX), 1)
1233-
CCOMMON_OPT += -DBUILD_COMPLEX
1245+
CCOMMON_OPT += -DBUILD_COMPLEX=1
12341246
endif
12351247
ifeq ($(BUILD_COMPLEX16), 1)
1236-
CCOMMON_OPT += -DBUILD_COMPLEX16
1248+
CCOMMON_OPT += -DBUILD_COMPLEX16=1
12371249
endif
12381250

12391251
CCOMMON_OPT += -DVERSION=\"$(VERSION)\"

Makefile.tail

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ COMMONOBJS_P = $(COMMONOBJS:.$(SUFFIX)=.$(PSUFFIX))
1111

1212
HPLOBJS_P = $(HPLOBJS:.$(SUFFIX)=.$(PSUFFIX))
1313

14-
BLASOBJS = $(SHEXTOBJS) $(SHBLASOBJS) $(SBLASOBJS) $(DBLASOBJS) $(CBLASOBJS) $(ZBLASOBJS)
15-
BLASOBJS_P = $(SHEXTOBJS_P) $(SHBLASOBJS_P) $(SBLASOBJS_P) $(DBLASOBJS_P) $(CBLASOBJS_P) $(ZBLASOBJS_P)
14+
BLASOBJS = $(SHEXTOBJS) $(SHBLASOBJS) $(SBLASOBJS) $(DBLASOBJS) $(CBLASOBJS) $(ZBLASOBJS) $(CBAUXOBJS)
15+
BLASOBJS_P = $(SHEXTOBJS_P) $(SHBLASOBJS_P) $(SBLASOBJS_P) $(DBLASOBJS_P) $(CBLASOBJS_P) $(ZBLASOBJS_P) $(CBAUXOBJS_P)
1616

1717
ifdef EXPRECISION
1818
BLASOBJS += $(QBLASOBJS) $(XBLASOBJS)

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

0 commit comments

Comments
 (0)