Skip to content

Commit 256ac02

Browse files
committed
update patch for install step
1 parent ab46c97 commit 256ac02

File tree

2 files changed

+60
-7
lines changed

2 files changed

+60
-7
lines changed

patches/0001-build-a-single-shared-object.patch

Lines changed: 59 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
From f3f6eeba8e569e66a0f92b9e58f8465924f636f4 Mon Sep 17 00:00:00 2001
1+
From 7203d885e0b88128d2b2252956d21c0000888de4 Mon Sep 17 00:00:00 2001
22
From: mattip <[email protected]>
3-
Date: Fri, 19 Jan 2024 15:13:13 +0200
4-
Subject: [PATCH] build a single shared object
3+
Date: Fri, 19 Jan 2024 17:15:06 +0200
4+
Subject: [PATCH] create a single shared object
55

66
---
7-
Makefile | 5 -----
8-
Makefile.system | 3 +++
9-
exports/Makefile | 4 ++--
10-
3 files changed, 5 insertions(+), 7 deletions(-)
7+
Makefile | 5 -----
8+
Makefile.install | 11 -----------
9+
Makefile.system | 3 +++
10+
exports/Makefile | 4 ++--
11+
4 files changed, 5 insertions(+), 18 deletions(-)
1112

1213
diff --git a/Makefile b/Makefile
1314
index 8621a8b3f..0febfd0a6 100644
@@ -31,6 +32,57 @@ index 8621a8b3f..0febfd0a6 100644
3132
endif
3233
ifeq ($(OSNAME), WINNT)
3334
@$(MAKE) -C exports dll
35+
diff --git a/Makefile.install b/Makefile.install
36+
index 01899b970..7dee121c1 100644
37+
--- a/Makefile.install
38+
+++ b/Makefile.install
39+
@@ -90,30 +90,22 @@ endif
40+
ifneq ($(NO_STATIC),1)
41+
@echo Copying the static library to $(DESTDIR)$(OPENBLAS_LIBRARY_DIR)
42+
@install -m644 $(LIBNAME) "$(DESTDIR)$(OPENBLAS_LIBRARY_DIR)"
43+
- @cd "$(DESTDIR)$(OPENBLAS_LIBRARY_DIR)" ; \
44+
- ln -fs $(LIBNAME) $(LIBPREFIX).$(LIBSUFFIX)
45+
endif
46+
#for install shared library
47+
ifneq ($(NO_SHARED),1)
48+
@echo Copying the shared library to $(DESTDIR)$(OPENBLAS_LIBRARY_DIR)
49+
ifeq ($(OSNAME), $(filter $(OSNAME),Linux SunOS Android Haiku FreeBSD DragonFly))
50+
@install -m755 $(LIBSONAME) "$(DESTDIR)$(OPENBLAS_LIBRARY_DIR)"
51+
- @cd "$(DESTDIR)$(OPENBLAS_LIBRARY_DIR)" ; \
52+
- ln -fs $(LIBSONAME) $(LIBPREFIX).so ; \
53+
- ln -fs $(LIBSONAME) $(LIBPREFIX).so.$(MAJOR_VERSION)
54+
endif
55+
56+
ifeq ($(OSNAME), $(filter $(OSNAME),OpenBSD NetBSD))
57+
@cp $(LIBSONAME) "$(DESTDIR)$(OPENBLAS_LIBRARY_DIR)"
58+
@cd "$(DESTDIR)$(OPENBLAS_LIBRARY_DIR)" ; \
59+
- ln -fs $(LIBSONAME) $(LIBPREFIX).so
60+
endif
61+
ifeq ($(OSNAME), Darwin)
62+
@-cp $(LIBDYNNAME) "$(DESTDIR)$(OPENBLAS_LIBRARY_DIR)"
63+
@-install_name_tool -id "$(OPENBLAS_LIBRARY_DIR)/$(LIBPREFIX).$(MAJOR_VERSION).dylib" "$(DESTDIR)$(OPENBLAS_LIBRARY_DIR)/$(LIBDYNNAME)"
64+
@cd "$(DESTDIR)$(OPENBLAS_LIBRARY_DIR)" ; \
65+
- ln -fs $(LIBDYNNAME) $(LIBPREFIX).dylib ; \
66+
- ln -fs $(LIBDYNNAME) $(LIBPREFIX).$(MAJOR_VERSION).dylib
67+
endif
68+
ifeq ($(OSNAME), WINNT)
69+
@-cp $(LIBDLLNAME) "$(DESTDIR)$(OPENBLAS_BINARY_DIR)"
70+
@@ -141,15 +133,12 @@ ifneq ($(NO_STATIC),1)
71+
@echo Copying the static library to $(DESTDIR)$(OPENBLAS_LIBRARY_DIR)
72+
@installbsd -c -m 644 $(LIBNAME) "$(DESTDIR)$(OPENBLAS_LIBRARY_DIR)"
73+
@cd "$(DESTDIR)$(OPENBLAS_LIBRARY_DIR)" ; \
74+
- ln -fs $(LIBNAME) $(LIBPREFIX).$(LIBSUFFIX)
75+
endif
76+
#for install shared library
77+
ifneq ($(NO_SHARED),1)
78+
@echo Copying the shared library to $(DESTDIR)$(OPENBLAS_LIBRARY_DIR)
79+
@installbsd -c -m 755 $(LIBSONAME) "$(DESTDIR)$(OPENBLAS_LIBRARY_DIR)"
80+
@cd "$(DESTDIR)$(OPENBLAS_LIBRARY_DIR)" ; \
81+
- ln -fs $(LIBSONAME) $(LIBPREFIX).so ; \
82+
- ln -fs $(LIBSONAME) $(LIBPREFIX).so.$(MAJOR_VERSION)
83+
endif
84+
85+
endif
3486
diff --git a/Makefile.system b/Makefile.system
3587
index 30b0ddec2..b2c92b99a 100644
3688
--- a/Makefile.system

tools/build_steps.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ function patch_source {
9595
# Runs inside OpenBLAS directory
9696
# Make the patches by git format-patch <old commit>
9797
for f in $(ls ../patches); do
98+
echo applying patch $f
9899
git apply ../patches/$f
99100
done
100101
}

0 commit comments

Comments
 (0)