Skip to content

Commit

Permalink
Export LDFLAGS within OpenBLAS builder (#410)
Browse files Browse the repository at this point in the history
* Export `LDFLAGS` within `OpenBLAS` builder

Otherwise, we get no RPATHs

* Patch out `-Ofast` on power
  • Loading branch information
staticfloat authored Jan 28, 2020
1 parent dc2135e commit b572419
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 4 deletions.
2 changes: 1 addition & 1 deletion O/OpenBLAS/OpenBLAS@0.3.5/build_tarballs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ platforms = openblas_platforms()
products = openblas_products()
dependencies = []

# Build the tarballs, and possibly a `build.jl` as well.
# Build the tarballs
build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies; preferred_gcc_version=v"6")
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
diff --git a/Makefile.power b/Makefile.power
index a49372ad..6132495e 100644
--- a/Makefile.power
+++ b/Makefile.power
@@ -13,10 +13,10 @@ endif

ifeq ($(CORE), POWER8)
ifeq ($(USE_OPENMP), 1)
-COMMON_OPT += -Ofast -mcpu=power8 -mtune=power8 -mvsx -malign-power -DUSE_OPENMP -fno-fast-math -fopenmp
+COMMON_OPT += -mcpu=power8 -mtune=power8 -mvsx -malign-power -DUSE_OPENMP -fno-fast-math -fopenmp
FCOMMON_OPT += -O2 -frecursive -mcpu=power8 -mtune=power8 -malign-power -DUSE_OPENMP -fno-fast-math -fopenmp
else
-COMMON_OPT += -Ofast -mcpu=power8 -mtune=power8 -mvsx -malign-power -fno-fast-math
+COMMON_OPT += -mcpu=power8 -mtune=power8 -mvsx -malign-power -fno-fast-math
FCOMMON_OPT += -O2 -frecursive -mcpu=power8 -mtune=power8 -malign-power -fno-fast-math
endif
endif
2 changes: 1 addition & 1 deletion O/OpenBLAS/OpenBLAS@0.3.7/build_tarballs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ platforms = openblas_platforms()
products = openblas_products()
dependencies = []

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

Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
diff --git a/Makefile.power b/Makefile.power
index 24d8aa8a..e53a243a 100644
--- a/Makefile.power
+++ b/Makefile.power
@@ -11,20 +11,20 @@ endif

ifeq ($(CORE), POWER9)
ifeq ($(USE_OPENMP), 1)
-COMMON_OPT += -Ofast -mcpu=power9 -mtune=power9 -mvsx -malign-power -DUSE_OPENMP -fno-fast-math -fopenmp
+COMMON_OPT += -mcpu=power9 -mtune=power9 -mvsx -malign-power -DUSE_OPENMP -fno-fast-math -fopenmp
FCOMMON_OPT += -O2 -frecursive -mcpu=power9 -mtune=power9 -malign-power -DUSE_OPENMP -fno-fast-math -fopenmp
else
-COMMON_OPT += -Ofast -mcpu=power9 -mtune=power9 -mvsx -malign-power -fno-fast-math
+COMMON_OPT += -mcpu=power9 -mtune=power9 -mvsx -malign-power -fno-fast-math
FCOMMON_OPT += -O2 -frecursive -mcpu=power9 -mtune=power9 -malign-power -fno-fast-math
endif
endif

ifeq ($(CORE), POWER8)
ifeq ($(USE_OPENMP), 1)
-COMMON_OPT += -Ofast -mcpu=power8 -mtune=power8 -mvsx -malign-power -DUSE_OPENMP -fno-fast-math -fopenmp
+COMMON_OPT += -mcpu=power8 -mtune=power8 -mvsx -malign-power -DUSE_OPENMP -fno-fast-math -fopenmp
FCOMMON_OPT += -O2 -frecursive -mcpu=power8 -mtune=power8 -malign-power -DUSE_OPENMP -fno-fast-math -fopenmp
else
-COMMON_OPT += -Ofast -mcpu=power8 -mtune=power8 -mvsx -malign-power -fno-fast-math
+COMMON_OPT += -mcpu=power8 -mtune=power8 -mvsx -malign-power -fno-fast-math
FCOMMON_OPT += -O2 -frecursive -mcpu=power8 -mtune=power8 -malign-power -fno-fast-math
endif
endif
4 changes: 2 additions & 2 deletions O/OpenBLAS/common.jl
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ function openblas_script(;kwargs...)
# libgfortran and other friends alongside, we need an RPATH of '$ORIGIN',
# so set it here.
if [[ ${target} == *linux* ]] || [[ ${target} == *freebsd* ]]; then
LDFLAGS="${LDFLAGS} '-Wl,-rpath,\$\$ORIGIN' -Wl,-z,origin"
export LDFLAGS="${LDFLAGS} '-Wl,-rpath,\$\$ORIGIN' -Wl,-z,origin"
elif [[ ${target} == *apple* ]]; then
LDFLAGS="${LDFLAGS} -Wl,-rpath,@loader_path/"
export LDFLAGS="${LDFLAGS} -Wl,-rpath,@loader_path/"
fi
Expand Down

0 comments on commit b572419

Please sign in to comment.