Skip to content

Commit 145eae8

Browse files
staticfloatViralBShah
authored andcommitted
Add patch to set -O2 for suitesparse build (#20165)
[ci skip]
1 parent bb76add commit 145eae8

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

deps/patches/SuiteSparse-O2.patch

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
--- SuiteSparse_config/SuiteSparse_config.mk 2014-12-22 14:21:00.000000000 -0800
2+
+++ SuiteSparse_config/SuiteSparse_config.mk 2017-01-20 15:17:43.000000000 -0800
3+
@@ -69,7 +69,7 @@
4+
# C and C++ compiler flags. The first three are standard for *.c and *.cpp
5+
# Add -DNTIMER if you do use any timing routines (otherwise -lrt is required).
6+
# CF = $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -O3 -fexceptions -fPIC -DNTIMER
7+
- CF = $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -O3 -fexceptions -fPIC
8+
+ CF = $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -O2 -fexceptions -fPIC
9+
# for the MKL BLAS:
10+
# CF = $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -O3 -fexceptions -fPIC -I$(MKLROOT)/include -D_GNU_SOURCE
11+
# with no optimization:

deps/suitesparse.mk

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,17 @@ $(BUILDDIR)/SuiteSparse-$(SUITESPARSE_VER)/SuiteSparse-winclang.patch-applied: $
3737
cd $(dir $@) && patch -p0 < $(SRCDIR)/patches/SuiteSparse-winclang.patch
3838
echo 1 > $@
3939

40+
$(BUILDDIR)/SuiteSparse-$(SUITESPARSE_VER)/SuiteSparse-O2.patch-applied: $(BUILDDIR)/SuiteSparse-$(SUITESPARSE_VER)/SuiteSparse-winclang.patch-applied
41+
cd $(dir $@) && patch -p0 < $(SRCDIR)/patches/SuiteSparse-O2.patch
42+
echo 1 > $@
43+
44+
4045
ifeq ($(USE_SYSTEM_BLAS), 0)
4146
$(BUILDDIR)/SuiteSparse-$(SUITESPARSE_VER)/build-compiled: | $(build_prefix)/manifest/openblas
4247
else ifeq ($(USE_SYSTEM_LAPACK), 0)
4348
$(BUILDDIR)/SuiteSparse-$(SUITESPARSE_VER)/build-compiled: | $(build_prefix)/manifest/lapack
4449
endif
45-
$(BUILDDIR)/SuiteSparse-$(SUITESPARSE_VER)/build-compiled: $(BUILDDIR)/SuiteSparse-$(SUITESPARSE_VER)/source-extracted $(BUILDDIR)/SuiteSparse-$(SUITESPARSE_VER)/SuiteSparse-winclang.patch-applied
50+
$(BUILDDIR)/SuiteSparse-$(SUITESPARSE_VER)/build-compiled: $(BUILDDIR)/SuiteSparse-$(SUITESPARSE_VER)/source-extracted $(BUILDDIR)/SuiteSparse-$(SUITESPARSE_VER)/SuiteSparse-O2.patch-applied
4651
$(MAKE) -C $(dir $<) library $(SUITESPARSE_MFLAGS)
4752
echo 1 > $@
4853

0 commit comments

Comments
 (0)