Use C translations of LAPACK when no Fortran compiler is available

This commit is contained in:
Martin Kroeker 2022-02-23 11:06:58 +01:00 committed by GitHub
parent 0699e0f724
commit 3256525cfc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 5 deletions

View File

@ -25,11 +25,14 @@ ifeq ($(NO_FORTRAN), 1)
define NOFORTRAN define NOFORTRAN
1 1
endef endef
define NO_LAPACK ifneq ($(NO_LAPACK), 1)
define C_LAPACK
1 1
endef endef
endif
export NOFORTRAN export NOFORTRAN
export NO_LAPACK export NO_LAPACK
export C_LAPACK
endif endif
LAPACK_NOOPT := $(filter-out -O0 -O1 -O2 -O3 -Ofast -O -Og -Os,$(LAPACK_FFLAGS)) LAPACK_NOOPT := $(filter-out -O0 -O1 -O2 -O3 -Ofast -O -Og -Os,$(LAPACK_FFLAGS))
@ -246,10 +249,10 @@ netlib :
else else
netlib : lapack_prebuild netlib : lapack_prebuild
ifeq ($(NOFORTRAN), $(filter 0,$(NOFORTRAN))) #ifeq ($(NOFORTRAN), $(filter 0,$(NOFORTRAN)))
@$(MAKE) -C $(NETLIB_LAPACK_DIR) lapacklib @$(MAKE) -C $(NETLIB_LAPACK_DIR) lapacklib
@$(MAKE) -C $(NETLIB_LAPACK_DIR) tmglib @$(MAKE) -C $(NETLIB_LAPACK_DIR) tmglib
endif #endif
ifneq ($(NO_LAPACKE), 1) ifneq ($(NO_LAPACKE), 1)
@$(MAKE) -C $(NETLIB_LAPACK_DIR) lapackelib @$(MAKE) -C $(NETLIB_LAPACK_DIR) lapackelib
endif endif
@ -267,7 +270,7 @@ prof_lapack : lapack_prebuild
@$(MAKE) -C $(NETLIB_LAPACK_DIR) lapack_prof @$(MAKE) -C $(NETLIB_LAPACK_DIR) lapack_prof
lapack_prebuild : lapack_prebuild :
ifeq ($(NOFORTRAN), $(filter 0,$(NOFORTRAN))) ifeq ($(NO_LAPACK), $(filter 0,$(NO_LAPACK)))
-@echo "FC = $(FC)" > $(NETLIB_LAPACK_DIR)/make.inc -@echo "FC = $(FC)" > $(NETLIB_LAPACK_DIR)/make.inc
-@echo "override FFLAGS = $(LAPACK_FFLAGS)" >> $(NETLIB_LAPACK_DIR)/make.inc -@echo "override FFLAGS = $(LAPACK_FFLAGS)" >> $(NETLIB_LAPACK_DIR)/make.inc
-@echo "FFLAGS_DRV = $(LAPACK_FFLAGS)" >> $(NETLIB_LAPACK_DIR)/make.inc -@echo "FFLAGS_DRV = $(LAPACK_FFLAGS)" >> $(NETLIB_LAPACK_DIR)/make.inc

View File

@ -352,7 +352,7 @@ OBJCONV = $(CROSS_SUFFIX)objconv
# When fortran support was either not detected or actively deselected, only build BLAS. # When fortran support was either not detected or actively deselected, only build BLAS.
ifeq ($(NOFORTRAN), 1) ifeq ($(NOFORTRAN), 1)
NO_LAPACK = 1 C_LAPACK = 1
override FEXTRALIB = override FEXTRALIB =
endif endif
@ -1303,6 +1303,10 @@ ifeq ($(DYNAMIC_OLDER), 1)
CCOMMON_OPT += -DDYNAMIC_OLDER CCOMMON_OPT += -DDYNAMIC_OLDER
endif endif
ifeq ($(C_LAPACK), 1)
CCOMMON_OPT += -DC_LAPACK
endif
ifeq ($(NO_LAPACK), 1) ifeq ($(NO_LAPACK), 1)
CCOMMON_OPT += -DNO_LAPACK CCOMMON_OPT += -DNO_LAPACK
#Disable LAPACK C interface #Disable LAPACK C interface
@ -1661,6 +1665,7 @@ export USE_OPENMP
export CROSS export CROSS
export CROSS_SUFFIX export CROSS_SUFFIX
export NOFORTRAN export NOFORTRAN
export C_LAPACK
export NO_FBLAS export NO_FBLAS
export EXTRALIB export EXTRALIB
export CEXTRALIB export CEXTRALIB