Skip to content

Commit b572419

Browse files
authored
Export LDFLAGS within OpenBLAS builder (#410)
* Export `LDFLAGS` within `OpenBLAS` builder Otherwise, we get no RPATHs * Patch out `-Ofast` on power
1 parent dc2135e commit b572419

File tree

5 files changed

+50
-4
lines changed

5 files changed

+50
-4
lines changed

O/OpenBLAS/OpenBLAS@0.3.5/build_tarballs.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ platforms = openblas_platforms()
1212
products = openblas_products()
1313
dependencies = []
1414

15-
# Build the tarballs, and possibly a `build.jl` as well.
15+
# Build the tarballs
1616
build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies; preferred_gcc_version=v"6")
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
diff --git a/Makefile.power b/Makefile.power
2+
index a49372ad..6132495e 100644
3+
--- a/Makefile.power
4+
+++ b/Makefile.power
5+
@@ -13,10 +13,10 @@ endif
6+
7+
ifeq ($(CORE), POWER8)
8+
ifeq ($(USE_OPENMP), 1)
9+
-COMMON_OPT += -Ofast -mcpu=power8 -mtune=power8 -mvsx -malign-power -DUSE_OPENMP -fno-fast-math -fopenmp
10+
+COMMON_OPT += -mcpu=power8 -mtune=power8 -mvsx -malign-power -DUSE_OPENMP -fno-fast-math -fopenmp
11+
FCOMMON_OPT += -O2 -frecursive -mcpu=power8 -mtune=power8 -malign-power -DUSE_OPENMP -fno-fast-math -fopenmp
12+
else
13+
-COMMON_OPT += -Ofast -mcpu=power8 -mtune=power8 -mvsx -malign-power -fno-fast-math
14+
+COMMON_OPT += -mcpu=power8 -mtune=power8 -mvsx -malign-power -fno-fast-math
15+
FCOMMON_OPT += -O2 -frecursive -mcpu=power8 -mtune=power8 -malign-power -fno-fast-math
16+
endif
17+
endif

O/OpenBLAS/OpenBLAS@0.3.7/build_tarballs.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ platforms = openblas_platforms()
1212
products = openblas_products()
1313
dependencies = []
1414

15-
# Build the tarballs, and possibly a `build.jl` as well.
15+
# Build the tarballs
1616
build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies; preferred_gcc_version=v"6")
1717

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
diff --git a/Makefile.power b/Makefile.power
2+
index 24d8aa8a..e53a243a 100644
3+
--- a/Makefile.power
4+
+++ b/Makefile.power
5+
@@ -11,20 +11,20 @@ endif
6+
7+
ifeq ($(CORE), POWER9)
8+
ifeq ($(USE_OPENMP), 1)
9+
-COMMON_OPT += -Ofast -mcpu=power9 -mtune=power9 -mvsx -malign-power -DUSE_OPENMP -fno-fast-math -fopenmp
10+
+COMMON_OPT += -mcpu=power9 -mtune=power9 -mvsx -malign-power -DUSE_OPENMP -fno-fast-math -fopenmp
11+
FCOMMON_OPT += -O2 -frecursive -mcpu=power9 -mtune=power9 -malign-power -DUSE_OPENMP -fno-fast-math -fopenmp
12+
else
13+
-COMMON_OPT += -Ofast -mcpu=power9 -mtune=power9 -mvsx -malign-power -fno-fast-math
14+
+COMMON_OPT += -mcpu=power9 -mtune=power9 -mvsx -malign-power -fno-fast-math
15+
FCOMMON_OPT += -O2 -frecursive -mcpu=power9 -mtune=power9 -malign-power -fno-fast-math
16+
endif
17+
endif
18+
19+
ifeq ($(CORE), POWER8)
20+
ifeq ($(USE_OPENMP), 1)
21+
-COMMON_OPT += -Ofast -mcpu=power8 -mtune=power8 -mvsx -malign-power -DUSE_OPENMP -fno-fast-math -fopenmp
22+
+COMMON_OPT += -mcpu=power8 -mtune=power8 -mvsx -malign-power -DUSE_OPENMP -fno-fast-math -fopenmp
23+
FCOMMON_OPT += -O2 -frecursive -mcpu=power8 -mtune=power8 -malign-power -DUSE_OPENMP -fno-fast-math -fopenmp
24+
else
25+
-COMMON_OPT += -Ofast -mcpu=power8 -mtune=power8 -mvsx -malign-power -fno-fast-math
26+
+COMMON_OPT += -mcpu=power8 -mtune=power8 -mvsx -malign-power -fno-fast-math
27+
FCOMMON_OPT += -O2 -frecursive -mcpu=power8 -mtune=power8 -malign-power -fno-fast-math
28+
endif
29+
endif

O/OpenBLAS/common.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ function openblas_script(;kwargs...)
7474
# libgfortran and other friends alongside, we need an RPATH of '$ORIGIN',
7575
# so set it here.
7676
if [[ ${target} == *linux* ]] || [[ ${target} == *freebsd* ]]; then
77-
LDFLAGS="${LDFLAGS} '-Wl,-rpath,\$\$ORIGIN' -Wl,-z,origin"
77+
export LDFLAGS="${LDFLAGS} '-Wl,-rpath,\$\$ORIGIN' -Wl,-z,origin"
7878
elif [[ ${target} == *apple* ]]; then
79-
LDFLAGS="${LDFLAGS} -Wl,-rpath,@loader_path/"
79+
export LDFLAGS="${LDFLAGS} -Wl,-rpath,@loader_path/"
8080
fi
8181
8282

0 commit comments

Comments
 (0)