Skip to content

Commit fe85887

Browse files
committed
Add NO_STATIC variable which disables static lib installation
Static library is still built for shared lib generation. Signed-off-by: Timothy Gu <[email protected]>
1 parent a8d4d1c commit fe85887

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,11 @@ ifeq ($(CORE), UNKOWN)
128128
endif
129129
ifeq ($(NOFORTRAN), 1)
130130
$(error OpenBLAS: Detecting fortran compiler failed. Please install fortran compiler, e.g. gfortran, ifort, openf90.)
131+
endif
132+
ifeq ($(NO_STATIC), 1)
133+
ifeq ($(NO_SHARED), 1)
134+
$(error OpenBLAS: neither static nor shared are enabled.)
135+
endif
131136
endif
132137
@-ln -fs $(LIBNAME) $(LIBPREFIX).$(LIBSUFFIX)
133138
@for d in $(SUBDIRS) ; \

Makefile.install

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,12 @@ ifndef NO_LAPACKE
5050
endif
5151

5252
#for install static library
53+
ifndef NO_STATIC
5354
@echo Copying the static library to $(DESTDIR)$(OPENBLAS_LIBRARY_DIR)
5455
@install -pm644 $(LIBNAME) $(DESTDIR)$(OPENBLAS_LIBRARY_DIR)
5556
@cd $(DESTDIR)$(OPENBLAS_LIBRARY_DIR) ; \
5657
ln -fs $(LIBNAME) $(LIBPREFIX).$(LIBSUFFIX)
58+
endif
5759
#for install shared library
5860
ifndef NO_SHARED
5961
@echo Copying the shared library to $(DESTDIR)$(OPENBLAS_LIBRARY_DIR)

Makefile.rule

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ VERSION = 0.2.9.rc2
4848
# automatically detected by the the script.
4949
# NUM_THREADS = 24
5050

51+
# if you don't need to install the static library, please comment it in.
52+
# NO_STATIC = 1
53+
5154
# if you don't need generate the shared library, please comment it in.
5255
# NO_SHARED = 1
5356

0 commit comments

Comments
 (0)