Skip to content

Commit a1bf464

Browse files
committed
brew: hack for building under brew
-march=... currently works at configure time, but is replaced with -march=nehalem at build time under brew's superenv. This causes Open MPI build to fail under brew. This commit does pass the -march=... option that worked at configure time via the HOMEBREW_ARCHFLAGS environment variable. This is a bit hacky, but less suboptimal than simply not building the op/avx component (e.g. configure --enable-mca-no-build=op-avx) The suspicious superenv behavior has been reported at Homebrew/brew#10078. Refs. #8306 Signed-off-by: Gilles Gouaillardet <[email protected]>
1 parent 8ff2277 commit a1bf464

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed

ompi/mca/op/avx/Makefile.am

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
# First, list all .h and .c sources. It is necessary to list all .h
2121
# files so that they will be picked up in the distribution tarball.
2222

23+
SUBDIRS = sub
24+
2325
sources = op_avx_component.c op_avx.h
2426
sources_extended = op_avx_functions.c
2527

ompi/mca/op/avx/configure.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
# ------------------------------------------------
2020
# We can always build, unless we were explicitly disabled.
2121
AC_DEFUN([MCA_ompi_op_avx_CONFIG],[
22-
AC_CONFIG_FILES([ompi/mca/op/avx/Makefile])
22+
AC_CONFIG_FILES([ompi/mca/op/avx/Makefile ompi/mca/op/avx/sub/Makefile])
2323

2424
MCA_BUILD_OP_AVX_FLAGS=""
2525
MCA_BUILD_OP_AVX2_FLAGS=""

ompi/mca/op/avx/sub/Makefile.am

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
noinst_LTLIBRARIES =
2+
3+
if MCA_BUILD_ompi_op_has_avx2_support
4+
noinst_LTLIBRARIES += libfoo.la
5+
nodist_libfoo_la_SOURCES = foo.c
6+
foo.c:
7+
cd .. && env HOMEBREW_ARCHFLAGS=@MCA_BUILD_OP_AVX2_FLAGS@ make liblocal_ops_avx2_la-liblocal_ops_avx2.lo
8+
touch foo.c
9+
endif
10+
11+
if MCA_BUILD_ompi_op_has_avx512_support
12+
noinst_LTLIBRARIES += libbar.la
13+
nodist_libbar_la_SOURCES = bar.c
14+
bar.c:
15+
cd .. && env HOMEBREW_ARCHFLAGS=@MCA_BUILD_OP_AVX512_FLAGS@ make liblocal_ops_avx512_la-liblocal_ops_avx512.lo
16+
touch bar.c
17+
endif
18+
19+
clean-local:
20+
rm -f foo.c bar.c

0 commit comments

Comments
 (0)