Skip to content

Commit b11bb6e

Browse files
authored
Merge pull request #2790 from martin-frbg/issue2789
Add OpenMP dependency to pkgconfig information if needed
2 parents 9ee21a0 + 1840bc5 commit b11bb6e

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
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

cmake/openblas.pc.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ Name: OpenBLAS
77
Description: OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD version
88
Version: @OPENBLAS_VERSION@
99
URL: https://github.com/xianyi/OpenBLAS
10-
Libs: -L${libdir} -lopenblas${libsuffix}
10+
Libs: @OpenMP_C_FLAGS@ -L${libdir} -lopenblas${libsuffix}
1111
Cflags: -I${includedir}

0 commit comments

Comments
 (0)