Skip to content

Commit

Permalink
Use fewer processes while building OpenBLAS
Browse files Browse the repository at this point in the history
Closes #15716
  • Loading branch information
eschnett committed Apr 1, 2016
1 parent 76dc1d8 commit 97d5404
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 81 deletions.
6 changes: 2 additions & 4 deletions deps/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1149,7 +1149,7 @@ OPENBLAS_BUILD_OPTS += NO_AFFINITY=1

# Build for all architectures - required for distribution
ifeq ($(OPENBLAS_DYNAMIC_ARCH), 1)
OPENBLAS_BUILD_OPTS += DYNAMIC_ARCH=1
OPENBLAS_BUILD_OPTS += DYNAMIC_ARCH=1 MAKE_NO_J=1
endif

# 64-bit BLAS interface
Expand Down Expand Up @@ -1185,9 +1185,7 @@ OPENBLAS_BUILD_OPTS += NO_AVX2=1
endif

$(BUILDDIR)/$(OPENBLAS_SRC_DIR)/config.status: $(BUILDDIR)/$(OPENBLAS_SRC_DIR)/Makefile
ifeq ($(OS),WINNT)
cd $(dir $@) && patch -p1 < $(SRCDIR)/openblas-win64.patch
endif
cd $(dir $@) && patch -p1 < $(SRCDIR)/openblas-make.patch
perl -i -ple 's/^\s*(EXTRALIB\s*\+=\s*-lSystemStubs)\s*$$/# $$1/g' $<.system
touch $@
$(OPENBLAS_OBJ_SOURCE): $(BUILDDIR)/$(OPENBLAS_SRC_DIR)/config.status
Expand Down
35 changes: 35 additions & 0 deletions deps/openblas-make.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
diff --git a/Makefile.system b/Makefile.system
index b89f60e..2dbdad0 100644
--- a/Makefile.system
+++ b/Makefile.system
@@ -139,6 +139,10 @@ NO_PARALLEL_MAKE=0
endif
GETARCH_FLAGS += -DNO_PARALLEL_MAKE=$(NO_PARALLEL_MAKE)

+ifdef MAKE_NO_J
+GETARCH_FLAGS += -DMAKE_NO_J=$(MAKE_NO_J)
+endif
+
ifdef MAKE_NB_JOBS
GETARCH_FLAGS += -DMAKE_NB_JOBS=$(MAKE_NB_JOBS)
endif
diff --git a/getarch.c b/getarch.c
index f9c49e6..dffad70 100644
--- a/getarch.c
+++ b/getarch.c
@@ -1012,6 +1012,7 @@ int main(int argc, char *argv[]){
#endif
#endif

+#ifndef MAKE_NO_J
#ifdef MAKE_NB_JOBS
printf("MAKE += -j %d\n", MAKE_NB_JOBS);
#elif NO_PARALLEL_MAKE==1
@@ -1021,6 +1022,7 @@ int main(int argc, char *argv[]){
printf("MAKE += -j %d\n", get_num_cores());
#endif
#endif
+#endif

break;

75 changes: 0 additions & 75 deletions deps/openblas-win64.patch

This file was deleted.

4 changes: 2 additions & 2 deletions deps/openblas.version
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
OPENBLAS_BRANCH=v0.2.15
OPENBLAS_SHA1=53e849f4fcae4363a64576de00e982722c7304f9
OPENBLAS_BRANCH=v0.2.17
OPENBLAS_SHA1=a71e8c82f6a9f73093b631e5deab1e8da716b61f

0 comments on commit 97d5404

Please sign in to comment.