Skip to content

Commit 1840bc5

Browse files
authored
Add OpenMP dependency to pkgconfig file if needed
1 parent 7c0977c commit 1840bc5

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Makefile.install

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,14 @@ OPENBLAS_CMAKE_DIR := $(OPENBLAS_LIBRARY_DIR)/cmake/openblas
1313
OPENBLAS_CMAKE_CONFIG := OpenBLASConfig.cmake
1414
OPENBLAS_CMAKE_CONFIG_VERSION := OpenBLASConfigVersion.cmake
1515
OPENBLAS_PKGCONFIG_DIR := $(OPENBLAS_LIBRARY_DIR)/pkgconfig
16+
PKG_EXTRALIB := $(EXTRALIB)
17+
ifeq ($(USE_OPENMP), 1)
18+
ifeq ($(C_COMPILER), PGI)
19+
PKG_EXTRALIB += -lomp
20+
else
21+
PKG_EXTRALIB += -lgomp
22+
endif
23+
endif
1624

1725
.PHONY : install
1826
.NOTPARALLEL : install
@@ -147,7 +155,7 @@ endif
147155
@echo 'includedir='$(OPENBLAS_INCLUDE_DIR) >> "$(DESTDIR)$(OPENBLAS_PKGCONFIG_DIR)/openblas.pc"
148156
@echo 'openblas_config= USE_64BITINT='$(USE_64BITINT) 'DYNAMIC_ARCH='$(DYNAMIC_ARCH) 'DYNAMIC_OLDER='$(DYNAMIC_OLDER) 'NO_CBLAS='$(NO_CBLAS) 'NO_LAPACK='$(NO_LAPACK) 'NO_LAPACKE='$(NO_LAPACKE) 'NO_AFFINITY='$(NO_AFFINITY) 'USE_OPENMP='$(USE_OPENMP) $(CORE) 'MAX_THREADS='$(NUM_THREADS)>> "$(DESTDIR)$(OPENBLAS_PKGCONFIG_DIR)/openblas.pc"
149157
@echo 'version='$(VERSION) >> "$(DESTDIR)$(OPENBLAS_PKGCONFIG_DIR)/openblas.pc"
150-
@echo 'extralib='$(EXTRALIB) >> "$(DESTDIR)$(OPENBLAS_PKGCONFIG_DIR)/openblas.pc"
158+
@echo 'extralib='$(PKG_EXTRALIB) >> "$(DESTDIR)$(OPENBLAS_PKGCONFIG_DIR)/openblas.pc"
151159
@cat openblas.pc.in >> "$(DESTDIR)$(OPENBLAS_PKGCONFIG_DIR)/openblas.pc"
152160

153161

0 commit comments

Comments
 (0)