Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: Allow simple fixed library names (as used in pkgsrc) #4252

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -130,18 +130,28 @@ shared : libs netlib $(RELA)
ifneq ($(NO_SHARED), 1)
ifeq ($(OSNAME), $(filter $(OSNAME),Linux SunOS Android Haiku FreeBSD DragonFly))
@$(MAKE) -C exports so
ifneq ($(LIBSONAME), $(LIBPREFIX).so)
@ln -fs $(LIBSONAME) $(LIBPREFIX).so
endif
ifneq ($(LIBSONAME), $(LIBPREFIX).so.$(MAJOR_VERSION))
@ln -fs $(LIBSONAME) $(LIBPREFIX).so.$(MAJOR_VERSION)
endif
endif
ifeq ($(OSNAME), $(filter $(OSNAME),OpenBSD NetBSD))
@$(MAKE) -C exports so
ifneq ($(LIBSONAME), $(LIBPREFIX).so)
@ln -fs $(LIBSONAME) $(LIBPREFIX).so
endif
endif
ifeq ($(OSNAME), Darwin)
@$(MAKE) -C exports dyn
ifneq ($(LIBDYNNAME), $(LIBPREFIX).dylib)
@ln -fs $(LIBDYNNAME) $(LIBPREFIX).dylib
endif
ifneq ($(LIBDYNNAME), $(LIBPREFIX).$(MAJOR_VERSION).dylib)
@ln -fs $(LIBDYNNAME) $(LIBPREFIX).$(MAJOR_VERSION).dylib
endif
endif
ifeq ($(OSNAME), WINNT)
@$(MAKE) -C exports dll
endif
Expand Down Expand Up @@ -209,13 +219,17 @@ endif
ifdef USE_THREAD
@echo USE_THREAD=$(USE_THREAD) >> Makefile.conf_last
endif
ifneq ($(LIBNAME), $(LIBPREFIX).$(LIBSUFFIX))
@-ln -fs $(LIBNAME) $(LIBPREFIX).$(LIBSUFFIX)
endif
@touch lib.grd

prof : prof_blas prof_lapack

prof_blas :
ifneq ($(LIBNAME_P), $(LIBPREFIX)_p.$(LIBSUFFIX))
ln -fs $(LIBNAME_P) $(LIBPREFIX)_p.$(LIBSUFFIX)
endif
for d in $(SUBDIRS) ; \
do if test -d $$d; then \
$(MAKE) -C $$d prof || exit 1 ; \
Expand All @@ -226,15 +240,19 @@ ifeq ($(DYNAMIC_ARCH), 1)
endif

blas :
ifneq ($(LIBNAME), $(LIBPREFIX).$(LIBSUFFIX))
ln -fs $(LIBNAME) $(LIBPREFIX).$(LIBSUFFIX)
endif
for d in $(BLASDIRS) ; \
do if test -d $$d; then \
$(MAKE) -C $$d libs || exit 1 ; \
fi; \
done

hpl :
ifneq ($(LIBNAME), $(LIBPREFIX).$(LIBSUFFIX))
ln -fs $(LIBNAME) $(LIBPREFIX).$(LIBSUFFIX)
endif
for d in $(BLASDIRS) ../laswp exports ; \
do if test -d $$d; then \
$(MAKE) -C $$d $(@F) || exit 1 ; \
Expand All @@ -248,7 +266,9 @@ ifeq ($(DYNAMIC_ARCH), 1)
endif

hpl_p :
ifneq ($(LIBNAME_P), $(LIBPREFIX)_p.$(LIBSUFFIX))
ln -fs $(LIBNAME_P) $(LIBPREFIX)_p.$(LIBSUFFIX)
endif
for d in $(SUBDIRS) ../laswp exports ; \
do if test -d $$d; then \
$(MAKE) -C $$d $(@F) || exit 1 ; \
Expand Down
26 changes: 19 additions & 7 deletions Makefile.install
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ PKG_EXTRALIB := $(EXTRALIB)
ifeq ($(INTERFACE64),1)
SUFFIX64=64
endif
PKGFILE="$(DESTDIR)$(OPENBLAS_PKGCONFIG_DIR)/$(LIBSONAMEBASE)$(SUFFIX64).pc"
PKGFILE="$(DESTDIR)$(OPENBLAS_PKGCONFIG_DIR)/$(LIBNAMEBASE).pc"

ifeq ($(USE_OPENMP), 1)
ifeq ($(C_COMPILER), PGI)
Expand Down Expand Up @@ -90,29 +90,37 @@ endif
ifneq ($(NO_STATIC),1)
@echo Copying the static library to $(DESTDIR)$(OPENBLAS_LIBRARY_DIR)
@install -m644 $(LIBNAME) "$(DESTDIR)$(OPENBLAS_LIBRARY_DIR)"
ifneq ($(LIBNAME), $(LIBPREFIX).$(LIBSUFFIX))
@cd "$(DESTDIR)$(OPENBLAS_LIBRARY_DIR)" ; \
ln -fs $(LIBNAME) $(LIBPREFIX).$(LIBSUFFIX)
endif
endif
#for install shared library
ifneq ($(NO_SHARED),1)
@echo Copying the shared library to $(DESTDIR)$(OPENBLAS_LIBRARY_DIR)
ifeq ($(OSNAME), $(filter $(OSNAME),Linux SunOS Android Haiku FreeBSD DragonFly))
@install -m755 $(LIBSONAME) "$(DESTDIR)$(OPENBLAS_LIBRARY_DIR)"
@cd "$(DESTDIR)$(OPENBLAS_LIBRARY_DIR)" ; \
ln -fs $(LIBSONAME) $(LIBPREFIX).so ; \
ln -fs $(LIBSONAME) $(LIBPREFIX).so.$(MAJOR_VERSION)
if ! test $(LIBSONAME) = $(LIBPREFIX).so; then \
ln -fs $(LIBSONAME) $(LIBPREFIX).so ; fi ; \
if ! test $(LIBSONAME) = $(LIBPREFIX).so.$(MAJOR_VERSION); then \
ln -fs $(LIBSONAME) $(LIBPREFIX).so.$(MAJOR_VERSION); fi
endif

ifeq ($(OSNAME), $(filter $(OSNAME),OpenBSD NetBSD))
@cp $(LIBSONAME) "$(DESTDIR)$(OPENBLAS_LIBRARY_DIR)"
ifneq ($(LIBSONAME), $(LIBPREFIX).so)
@cd "$(DESTDIR)$(OPENBLAS_LIBRARY_DIR)" ; \
ln -fs $(LIBSONAME) $(LIBPREFIX).so
endif
endif
ifeq ($(OSNAME), Darwin)
@-cp $(LIBDYNNAME) "$(DESTDIR)$(OPENBLAS_LIBRARY_DIR)"
@-install_name_tool -id "$(OPENBLAS_LIBRARY_DIR)/$(LIBPREFIX).$(MAJOR_VERSION).dylib" "$(DESTDIR)$(OPENBLAS_LIBRARY_DIR)/$(LIBDYNNAME)"
@cd "$(DESTDIR)$(OPENBLAS_LIBRARY_DIR)" ; \
if ! test $(LIBDYNNAME) = $(LIBPREFIX).dylib; then \
ln -fs $(LIBDYNNAME) $(LIBPREFIX).dylib ; \
fi ; \
ln -fs $(LIBDYNNAME) $(LIBPREFIX).$(MAJOR_VERSION).dylib
endif
ifeq ($(OSNAME), WINNT)
Expand Down Expand Up @@ -140,16 +148,20 @@ endif
ifneq ($(NO_STATIC),1)
@echo Copying the static library to $(DESTDIR)$(OPENBLAS_LIBRARY_DIR)
@installbsd -c -m 644 $(LIBNAME) "$(DESTDIR)$(OPENBLAS_LIBRARY_DIR)"
ifneq ($(LIBNAME), $(LIBPREFIX).$(LIBSUFFIX))
@cd "$(DESTDIR)$(OPENBLAS_LIBRARY_DIR)" ; \
ln -fs $(LIBNAME) $(LIBPREFIX).$(LIBSUFFIX)
endif
endif
#for install shared library
ifneq ($(NO_SHARED),1)
@echo Copying the shared library to $(DESTDIR)$(OPENBLAS_LIBRARY_DIR)
@installbsd -c -m 755 $(LIBSONAME) "$(DESTDIR)$(OPENBLAS_LIBRARY_DIR)"
@cd "$(DESTDIR)$(OPENBLAS_LIBRARY_DIR)" ; \
ln -fs $(LIBSONAME) $(LIBPREFIX).so ; \
ln -fs $(LIBSONAME) $(LIBPREFIX).so.$(MAJOR_VERSION)
if ! test $(LIBSONAME) = $(LIBPREFIX).so; then \
ln -fs $(LIBSONAME) $(LIBPREFIX).so ; fi ; \
if ! test $(LIBSONAME) = $(LIBPREFIX).so.$(MAJOR_VERSION); then \
ln -fs $(LIBSONAME) $(LIBPREFIX).so.$(MAJOR_VERSION); fi
endif

endif
Expand All @@ -158,7 +170,7 @@ endif
ifeq ($(INTERFACE64),1)
SUFFIX64=64
endif
PKGFILE="$(DESTDIR)$(OPENBLAS_PKGCONFIG_DIR)/$(LIBSONAMEBASE)$(SUFFIX64).pc"
PKGFILE="$(DESTDIR)$(OPENBLAS_PKGCONFIG_DIR)/$(LIBNAMEBASE).pc"

@echo Generating $(LIBSONAMEBASE)$(SUFFIX64).pc in "$(DESTDIR)$(OPENBLAS_PKGCONFIG_DIR)"
@echo 'libdir='$(OPENBLAS_LIBRARY_DIR) > "$(PKGFILE)"
Expand All @@ -167,7 +179,7 @@ endif
@echo 'openblas_config= USE_64BITINT='$(INTERFACE64) '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)>> "$(PKGFILE)"
@echo 'version='$(VERSION) >> "$(PKGFILE)"
@echo 'extralib='$(PKG_EXTRALIB) >> "$(PKGFILE)"
@cat openblas.pc.in >> "$(PKGFILE)"
@cat openblas.pc.in | sed -e 's,-lopenblas\b,-l$(LIBNAMEBASE),' >> "$(PKGFILE)"


#Generating OpenBLASConfig.cmake
Expand Down
Loading