Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use f2c translations of LAPACK when no Fortran compiler is available #3539

Merged
merged 95 commits into from
Apr 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
1c81f50
Add C equivalents as fallbacks
martin-frbg Feb 22, 2022
9f0f000
Add C versions as fallback
martin-frbg Feb 22, 2022
d1ef539
Add C versions as fallback
martin-frbg Feb 22, 2022
5c73f47
Add C versions as fallback
martin-frbg Feb 22, 2022
cb6bc65
Add C versions as fallback
martin-frbg Feb 22, 2022
8a667a0
Add C versions as fallback
martin-frbg Feb 22, 2022
ac44a94
Add C versions as fallback
martin-frbg Feb 22, 2022
baab2aa
Add C versions as fallback
martin-frbg Feb 22, 2022
3dbefd1
Add C versions as fallback
martin-frbg Feb 22, 2022
c23ae2f
Add C versions as fallback
martin-frbg Feb 22, 2022
18f3aa1
Add C versions as fallback
martin-frbg Feb 22, 2022
538740d
Add C versions as fallback
martin-frbg Feb 22, 2022
08fba49
Add C versions as fallback
martin-frbg Feb 22, 2022
5d23def
Add C versions as fallback
martin-frbg Feb 22, 2022
91118d8
Add C versions as fallback
martin-frbg Feb 22, 2022
d604a48
Add C versions as fallback
martin-frbg Feb 22, 2022
0e1f896
Add C versions as fallback
martin-frbg Feb 22, 2022
cf72d61
Add C versions as fallback
martin-frbg Feb 22, 2022
b542c1d
Add C versions as fallback
martin-frbg Feb 22, 2022
1ed9c00
Add C versions as fallback
martin-frbg Feb 22, 2022
62e3b48
Add C versions as fallback
martin-frbg Feb 22, 2022
083bc17
Add C versions as fallback
martin-frbg Feb 22, 2022
88ce3f8
Add C versions as fallback
martin-frbg Feb 22, 2022
f8e238a
Add C versions as fallback
martin-frbg Feb 23, 2022
071f773
Add C versions as fallback
martin-frbg Feb 23, 2022
8efa762
Add C versions as fallback
martin-frbg Feb 23, 2022
0699e0f
Add C versions as fallback
martin-frbg Feb 23, 2022
3256525
Use C translations of LAPACK when no Fortran compiler is available
martin-frbg Feb 23, 2022
8a15de0
Add C versions as fallback
martin-frbg Feb 23, 2022
2a9e337
Include ctype.h for toupper
martin-frbg Feb 23, 2022
86056c0
restore filtering out of ?laswp duplication
martin-frbg Feb 23, 2022
d68bddf
Add C_LAPACK option
martin-frbg Mar 3, 2022
9f22a20
Add fallback to C version of LAPACK
martin-frbg Mar 3, 2022
3c84faf
Define TIMER variable for MSVC C_LAPACK builds
martin-frbg Mar 4, 2022
5f810fd
Set TIMER variable for C LAPACK
martin-frbg Mar 4, 2022
165a462
Fix declaration for INTERFACE64
martin-frbg Mar 8, 2022
320439d
Update dgesvd.c
martin-frbg Mar 8, 2022
45b4963
Support INTERFACE64
martin-frbg Mar 9, 2022
3b8e409
Support INTERFACE64
martin-frbg Mar 10, 2022
28cc16f
Support INTERFACE64
martin-frbg Mar 10, 2022
ecbe0a0
Support INTERFACE64
martin-frbg Mar 10, 2022
5b460ab
Support INTERFACE64
martin-frbg Mar 10, 2022
5fd8fa0
Pass INTERFACE64 to C LAPACK builds if set
martin-frbg Mar 10, 2022
b932ccd
Ensure INTERFACE64 gets passed to C LAPACK builds
martin-frbg Mar 11, 2022
2b85911
Support INTERFACE64
martin-frbg Mar 12, 2022
d8bbf63
Support INTERFACE64
martin-frbg Mar 12, 2022
eadebbe
Support INTERFACE64
martin-frbg Mar 12, 2022
b32ec3b
Support INTERFACE64
martin-frbg Mar 12, 2022
d896b38
Support INTERFACE64
martin-frbg Mar 12, 2022
2e06e5f
Support INTERFACE64
martin-frbg Mar 12, 2022
e47d949
Support INTERFACE64
martin-frbg Mar 12, 2022
8f8af61
Support INTERFACE64
martin-frbg Mar 12, 2022
0875a53
Support INTERFACE64
martin-frbg Mar 12, 2022
b48a0b7
Support INTERFACE64
martin-frbg Mar 13, 2022
bb58a9e
Support INTERFACE64
martin-frbg Mar 13, 2022
b5b879a
Support INTERFACE64
martin-frbg Mar 13, 2022
c296c1d
Support INTERFACE64
martin-frbg Mar 13, 2022
f71767e
Support INTERFACE64
martin-frbg Mar 13, 2022
c89c9b9
Support INTERFACE64
martin-frbg Mar 13, 2022
34f140b
Support INTERFACE64
martin-frbg Mar 13, 2022
a6866ee
Support INTERFACE64
martin-frbg Mar 13, 2022
609291d
Support INTERFACE64
martin-frbg Mar 13, 2022
c3dfdaf
Support INTERFACE64
martin-frbg Mar 13, 2022
3836c7f
Support INTERFACE64
martin-frbg Mar 13, 2022
fed03c2
Support INTERFACE64
martin-frbg Mar 13, 2022
cc0f721
Support INTERFACE64
martin-frbg Mar 13, 2022
ddfae6d
Support INTERFACE64
martin-frbg Mar 13, 2022
fdb5f5b
Support INTERFACE64
martin-frbg Mar 13, 2022
1ac991e
Support INTERFACE64
martin-frbg Mar 14, 2022
2f94272
Support INTERFACE64
martin-frbg Mar 14, 2022
eda2ddb
Support INTERFACE64
martin-frbg Mar 14, 2022
0a1d0cd
Support INTERFACE64
martin-frbg Mar 14, 2022
69f5eec
Support INTERFACE64
martin-frbg Mar 14, 2022
4fe7093
Support INTERFACE64
martin-frbg Mar 14, 2022
1ab8680
Support INTERFACE64
martin-frbg Mar 14, 2022
d2d9a3c
Support INTERFACE64
martin-frbg Mar 15, 2022
255d56b
Support INTERFACE64
martin-frbg Mar 15, 2022
e3250e2
Merge branch 'develop' into clapack
martin-frbg Mar 30, 2022
f8f9cb8
Support INTERFACE64
martin-frbg Mar 30, 2022
99ec157
Support INTERFACE64
martin-frbg Mar 30, 2022
59a0d01
Remove special handling of MSVC
martin-frbg Mar 30, 2022
4036069
Fix compile flags for C_LAPACK case
martin-frbg Apr 3, 2022
b364249
Fix INTERFACE64 definitions for 64bit Windows
martin-frbg Apr 3, 2022
a5b9dfc
Rewrite _Complex for MSVC
martin-frbg Apr 3, 2022
ec67809
Update cgbcon.c
martin-frbg Apr 3, 2022
740eea9
Update cgbcon.c
martin-frbg Apr 4, 2022
ba8995e
Disable fallback to C_LAPACK for MSVC (needs fixes for complex)
martin-frbg Apr 7, 2022
de8ca69
Disable C_LAPACK fallback for MSVC
martin-frbg Apr 7, 2022
2f79f24
Update system.cmake
martin-frbg Apr 7, 2022
f1b4f39
Cleanup conditionals around netlib section
martin-frbg Apr 7, 2022
7d491ba
fix typo
martin-frbg Apr 7, 2022
d11985a
Update azure-pipelines.yml
martin-frbg Apr 7, 2022
32e83d5
Update azure-pipelines.yml
martin-frbg Apr 7, 2022
7e010db
revert unrelated changes
martin-frbg Apr 9, 2022
3e98f66
Fix indentation
martin-frbg Apr 9, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ option(BUILD_WITHOUT_LAPACK "Do not build LAPACK and LAPACKE (Only BLAS or CBLAS

option(BUILD_TESTING "Build LAPACK testsuite when building LAPACK" ON)

option(C_LAPACK "Build LAPACK from C sources instead of the original Fortran" OFF)

option(BUILD_WITHOUT_CBLAS "Do not build the C interface (CBLAS) to the BLAS functions" OFF)

option(DYNAMIC_ARCH "Include support for multiple CPU targets, with automatic selection at runtime (x86/x86_64, aarch64 or ppc only)" OFF)
Expand Down Expand Up @@ -175,7 +177,7 @@ endforeach ()

# Can't just use lapack-netlib's CMake files, since they are set up to search for BLAS, build and install a binary. We just want to build a couple of lib files out of lapack and lapacke.
# Not using add_subdirectory here because lapack-netlib already has its own CMakeLists.txt. Instead include a cmake script with the sources we want.
if (NOT NOFORTRAN AND NOT NO_LAPACK)
if (NOT NO_LAPACK)
include("${PROJECT_SOURCE_DIR}/cmake/lapack.cmake")
if (NOT NO_LAPACKE)
include("${PROJECT_SOURCE_DIR}/cmake/lapacke.cmake")
Expand Down
14 changes: 6 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,14 @@ ifeq ($(NO_FORTRAN), 1)
define NOFORTRAN
1
endef
define NO_LAPACK
ifneq ($(NO_LAPACK), 1)
define C_LAPACK
1
endef
endif
export NOFORTRAN
export NO_LAPACK
export C_LAPACK
endif

LAPACK_NOOPT := $(filter-out -O0 -O1 -O2 -O3 -Ofast -O -Og -Os,$(LAPACK_FFLAGS))
Expand Down Expand Up @@ -241,19 +244,14 @@ hpl_p :
fi; \
done

ifeq ($(NO_LAPACK), 1)
netlib :

else
netlib : lapack_prebuild
ifeq ($(NOFORTRAN), $(filter 0,$(NOFORTRAN)))
ifneq ($(NO_LAPACK), 1)
@$(MAKE) -C $(NETLIB_LAPACK_DIR) lapacklib
@$(MAKE) -C $(NETLIB_LAPACK_DIR) tmglib
endif
ifneq ($(NO_LAPACKE), 1)
@$(MAKE) -C $(NETLIB_LAPACK_DIR) lapackelib
endif
endif

ifeq ($(NO_LAPACK), 1)
re_lapack :
Expand All @@ -267,7 +265,7 @@ prof_lapack : lapack_prebuild
@$(MAKE) -C $(NETLIB_LAPACK_DIR) lapack_prof

lapack_prebuild :
ifeq ($(NOFORTRAN), $(filter 0,$(NOFORTRAN)))
ifeq ($(NO_LAPACK), $(filter 0,$(NO_LAPACK)))
-@echo "FC = $(FC)" > $(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
Expand Down
7 changes: 6 additions & 1 deletion Makefile.system
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ OBJCONV = $(CROSS_SUFFIX)objconv

# When fortran support was either not detected or actively deselected, only build BLAS.
ifeq ($(NOFORTRAN), 1)
NO_LAPACK = 1
C_LAPACK = 1
override FEXTRALIB =
endif

Expand Down Expand Up @@ -1303,6 +1303,10 @@ ifeq ($(DYNAMIC_OLDER), 1)
CCOMMON_OPT += -DDYNAMIC_OLDER
endif

ifeq ($(C_LAPACK), 1)
CCOMMON_OPT += -DC_LAPACK
endif

ifeq ($(NO_LAPACK), 1)
CCOMMON_OPT += -DNO_LAPACK
#Disable LAPACK C interface
Expand Down Expand Up @@ -1661,6 +1665,7 @@ export USE_OPENMP
export CROSS
export CROSS_SUFFIX
export NOFORTRAN
export C_LAPACK
export NO_FBLAS
export EXTRALIB
export CEXTRALIB
Expand Down
14 changes: 11 additions & 3 deletions cmake/f_check.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,19 @@ check_language(Fortran)
if(CMAKE_Fortran_COMPILER)
enable_language(Fortran)
else()
set (NOFORTRAN 1)
if (NOT NO_LAPACK)
message(STATUS "No Fortran compiler found, can build only BLAS but not LAPACK")
if (NOT MSVC)
message(STATUS "No Fortran compiler found, can build only BLAS and f2c-converted LAPACK")
set(C_LAPACK 1)
if (INTERFACE64)
set (CCOMMON_OPT "${CCOMMON_OPT} -DLAPACK_ILP64")
endif ()
set(TIMER "NONE")
else ()
message(STATUS "No Fortran compiler found, can build only BLAS")
endif()
endif()
set (NOFORTRAN 1)
set (NO_LAPACK 1)
endif()

if (NOT ONLY_CBLAS)
Expand Down
Loading