Index: armci-mpi/Makefile.am
===================================================================
--- armci-mpi.orig/Makefile.am	2022-02-24 10:00:00.100351953 +0100
+++ armci-mpi/Makefile.am	2022-02-24 10:00:17.576417027 +0100
@@ -7,12 +7,12 @@
 
 EXTRA_DIST = VERSION
 
-lib_LTLIBRARIES = libarmci.la
+lib_LTLIBRARIES = libarmci@MPI_FLAVOR@.la
 
 # Needed to connect with the GA build system
 noinst_LTLIBRARIES = libarmcii.la
 
-libarmci_la_SOURCES = src/buffer.c        \
+libarmci@MPI_FLAVOR@_la_SOURCES = src/buffer.c        \
                       src/debug.c         \
                       src/groups.c        \
                       src/internals.c     \
@@ -38,9 +38,9 @@
                       src/armci-memdev.c  \
                       src/parmci.c
 
-libarmci_la_LDFLAGS = -version-info $(libarmci_abi_version)
+libarmci@MPI_FLAVOR@_la_LDFLAGS = -version-info $(libarmci_abi_version)
 
-libarmcii_la_SOURCES = $(libarmci_la_SOURCES)
+libarmcii_la_SOURCES = $(libarmci@MPI_FLAVOR@_la_SOURCES)
 libarmcii_la_LDFLAGS = $(libarmci_abi_version)
 
 include_HEADERS = src/armci.h src/armcix.h src/message.h src/mp3.h src/armciconf.h
Index: armci-mpi/configure.ac
===================================================================
--- armci-mpi.orig/configure.ac	2022-02-24 10:00:00.100351953 +0100
+++ armci-mpi/configure.ac	2022-02-24 10:00:00.096351939 +0100
@@ -20,6 +20,12 @@
 AC_PROG_CC(mpicc)
 AM_PROG_CC_C_O
 
+AC_ARG_VAR([MPI_FLAVOR], [set specific MPI flavor (e.g. openmpi or mpich) in libarmci library name])
+AM_CONDITIONAL(MPI_FLAVOR, test x$MPI_FLAVOR != x)
+# add hyphen to library name if MPI_FLAVOR is used
+AM_COND_IF([MPI_FLAVOR],
+           [AC_SUBST(MPI_FLAVOR, -$MPI_FLAVOR)])
+
 # automake 1.12 seems to require this, but automake 1.11 doesn't recognize it
 # must come before LT_INIT
 m4_ifdef([AM_PROG_AR],[AM_PROG_AR])
Index: armci-mpi/benchmarks/Makefile.mk
===================================================================
--- armci-mpi.orig/benchmarks/Makefile.mk	2022-02-24 10:00:00.100351953 +0100
+++ armci-mpi/benchmarks/Makefile.mk	2022-02-24 10:00:00.096351939 +0100
@@ -17,9 +17,9 @@
                   benchmarks/rmw_perf           \
                   # end
 
-benchmarks_ping_pong_LDADD = libarmci.la
-benchmarks_ring_flood_LDADD = libarmci.la
-benchmarks_contiguous_bench_LDADD = libarmci.la -lm
-benchmarks_strided_bench_LDADD = libarmci.la -lm
-benchmarks_bench_groups_LDADD = libarmci.la -lm
-benchmarks_rmw_perf_LDADD = libarmci.la
+benchmarks_ping_pong_LDADD = libarmci$(MPI_FLAVOR).la
+benchmarks_ring_flood_LDADD = libarmci$(MPI_FLAVOR).la
+benchmarks_contiguous_bench_LDADD = libarmci$(MPI_FLAVOR).la -lm
+benchmarks_strided_bench_LDADD = libarmci$(MPI_FLAVOR).la -lm
+benchmarks_bench_groups_LDADD = libarmci$(MPI_FLAVOR).la -lm
+benchmarks_rmw_perf_LDADD = libarmci$(MPI_FLAVOR).la
Index: armci-mpi/tests/Makefile.mk
===================================================================
--- armci-mpi.orig/tests/Makefile.mk	2022-02-24 10:00:00.100351953 +0100
+++ armci-mpi/tests/Makefile.mk	2022-02-24 10:00:00.096351939 +0100
@@ -54,29 +54,29 @@
                   tests/test_malloc           \
                   # end
 
-tests_test_onesided_LDADD = libarmci.la
-tests_test_onesided_shared_LDADD = libarmci.la
-tests_test_onesided_shared_dla_LDADD = libarmci.la
-tests_test_mutex_LDADD = libarmci.la
-tests_test_mutex_rmw_LDADD = libarmci.la
-tests_test_mutex_trylock_LDADD = libarmci.la
-tests_test_malloc_LDADD = libarmci.la
-tests_test_malloc_irreg_LDADD = libarmci.la
-tests_ARMCI_PutS_latency_LDADD = libarmci.la
-tests_ARMCI_AccS_latency_LDADD = libarmci.la
-tests_test_groups_LDADD = libarmci.la
-tests_test_group_split_LDADD = libarmci.la
-tests_test_malloc_group_LDADD = libarmci.la
-tests_test_accs_LDADD = libarmci.la
-tests_test_accs_dla_LDADD = libarmci.la
-tests_test_puts_LDADD = libarmci.la
-tests_test_puts_gets_LDADD = libarmci.la
-tests_test_puts_gets_dla_LDADD = libarmci.la
-tests_test_putv_LDADD = libarmci.la
-tests_test_assert_LDADD = libarmci.la
-tests_test_igop_LDADD = libarmci.la
-tests_test_rmw_fadd_LDADD = libarmci.la
-tests_test_parmci_LDADD = libarmci.la
+tests_test_onesided_LDADD = libarmci$(MPI_FLAVOR).la
+tests_test_onesided_shared_LDADD = libarmci$(MPI_FLAVOR).la
+tests_test_onesided_shared_dla_LDADD = libarmci$(MPI_FLAVOR).la
+tests_test_mutex_LDADD = libarmci$(MPI_FLAVOR).la
+tests_test_mutex_rmw_LDADD = libarmci$(MPI_FLAVOR).la
+tests_test_mutex_trylock_LDADD = libarmci$(MPI_FLAVOR).la
+tests_test_malloc_LDADD = libarmci$(MPI_FLAVOR).la
+tests_test_malloc_irreg_LDADD = libarmci$(MPI_FLAVOR).la
+tests_ARMCI_PutS_latency_LDADD = libarmci$(MPI_FLAVOR).la
+tests_ARMCI_AccS_latency_LDADD = libarmci$(MPI_FLAVOR).la
+tests_test_groups_LDADD = libarmci$(MPI_FLAVOR).la
+tests_test_group_split_LDADD = libarmci$(MPI_FLAVOR).la
+tests_test_malloc_group_LDADD = libarmci$(MPI_FLAVOR).la
+tests_test_accs_LDADD = libarmci$(MPI_FLAVOR).la
+tests_test_accs_dla_LDADD = libarmci$(MPI_FLAVOR).la
+tests_test_puts_LDADD = libarmci$(MPI_FLAVOR).la
+tests_test_puts_gets_LDADD = libarmci$(MPI_FLAVOR).la
+tests_test_puts_gets_dla_LDADD = libarmci$(MPI_FLAVOR).la
+tests_test_putv_LDADD = libarmci$(MPI_FLAVOR).la
+tests_test_assert_LDADD = libarmci$(MPI_FLAVOR).la
+tests_test_igop_LDADD = libarmci$(MPI_FLAVOR).la
+tests_test_rmw_fadd_LDADD = libarmci$(MPI_FLAVOR).la
+tests_test_parmci_LDADD = libarmci$(MPI_FLAVOR).la
 tests_test_parmci_SOURCES = tests/test_parmci.c tests/test_parmci_lib.c
 
 include tests/mpi/Makefile.mk
Index: armci-mpi/tests/contrib/Makefile.mk
===================================================================
--- armci-mpi.orig/tests/contrib/Makefile.mk	2022-02-24 10:00:00.100351953 +0100
+++ armci-mpi/tests/contrib/Makefile.mk	2022-02-24 10:00:00.096351939 +0100
@@ -12,8 +12,8 @@
                   tests/contrib/armci-test         \
                   # end
 
-tests_contrib_armci_perf_LDADD = libarmci.la -lm
-tests_contrib_armci_test_LDADD = libarmci.la -lm
+tests_contrib_armci_perf_LDADD = libarmci$(MPI_FLAVOR).la -lm
+tests_contrib_armci_test_LDADD = libarmci$(MPI_FLAVOR).la -lm
 
 include tests/contrib/cg/Makefile.mk
 include tests/contrib/lu/Makefile.mk
Index: armci-mpi/tests/contrib/cg/Makefile.mk
===================================================================
--- armci-mpi.orig/tests/contrib/cg/Makefile.mk	2022-02-24 10:00:00.100351953 +0100
+++ armci-mpi/tests/contrib/cg/Makefile.mk	2022-02-24 10:00:00.096351939 +0100
@@ -6,4 +6,4 @@
 
 tests_contrib_cg_cg_SOURCES = tests/contrib/cg/cg.c tests/contrib/cg/compute.c \
 	tests/contrib/cg/read_input.c tests/contrib/cg/cg_timing.c
-tests_contrib_cg_cg_LDADD = libarmci.la -lm
+tests_contrib_cg_cg_LDADD = libarmci$(MPI_FLAVOR).la -lm
Index: armci-mpi/tests/contrib/lu/Makefile.mk
===================================================================
--- armci-mpi.orig/tests/contrib/lu/Makefile.mk	2022-02-24 10:00:00.100351953 +0100
+++ armci-mpi/tests/contrib/lu/Makefile.mk	2022-02-24 10:00:00.096351939 +0100
@@ -7,10 +7,10 @@
 TESTS          += tests/contrib/lu/lu-block tests/contrib/lu/lu-b-bc
 
 tests_contrib_lu_lu_SOURCES = tests/contrib/lu/lu.c tests/contrib/lu/lu_timing.c
-tests_contrib_lu_lu_LDADD = libarmci.la -lm
+tests_contrib_lu_lu_LDADD = libarmci$(MPI_FLAVOR).la -lm
 
 tests_contrib_lu_lu_block_SOURCES = tests/contrib/lu/lu-block.c tests/contrib/lu/lu_timing.c
-tests_contrib_lu_lu_block_LDADD = libarmci.la -lm
+tests_contrib_lu_lu_block_LDADD = libarmci$(MPI_FLAVOR).la -lm
 
 tests_contrib_lu_lu_b_bc_SOURCES = tests/contrib/lu/lu-b-bc.c tests/contrib/lu/lu_timing.c
-tests_contrib_lu_lu_b_bc_LDADD = libarmci.la -lm
+tests_contrib_lu_lu_b_bc_LDADD = libarmci$(MPI_FLAVOR).la -lm
Index: armci-mpi/tests/contrib/non-blocking/Makefile.mk
===================================================================
--- armci-mpi.orig/tests/contrib/non-blocking/Makefile.mk	2022-02-24 10:00:00.100351953 +0100
+++ armci-mpi/tests/contrib/non-blocking/Makefile.mk	2022-02-24 10:00:00.096351939 +0100
@@ -7,7 +7,7 @@
 TESTS          += tests/contrib/non-blocking/simple
 
 tests_contrib_non_blocking_overlap_SOURCES = tests/contrib/non-blocking/overlap.c
-tests_contrib_non_blocking_overlap_LDADD = libarmci.la -lm
+tests_contrib_non_blocking_overlap_LDADD = libarmci$(MPI_FLAVOR).la -lm
 
 tests_contrib_non_blocking_simple_SOURCES = tests/contrib/non-blocking/simple.c
-tests_contrib_non_blocking_simple_LDADD = libarmci.la -lm
+tests_contrib_non_blocking_simple_LDADD = libarmci$(MPI_FLAVOR).la -lm
Index: armci-mpi/tests/contrib/transp1D/Makefile.mk
===================================================================
--- armci-mpi.orig/tests/contrib/transp1D/Makefile.mk	2022-02-24 10:00:00.100351953 +0100
+++ armci-mpi/tests/contrib/transp1D/Makefile.mk	2022-02-24 10:00:00.096351939 +0100
@@ -7,4 +7,4 @@
 TESTS          += tests/contrib/transp1D/transp1D-c
 
 tests_contrib_transp1D_transp1D_c_SOURCES = tests/contrib/transp1D/transp1D-c.c
-tests_contrib_transp1D_transp1D_c_LDADD = libarmci.la
+tests_contrib_transp1D_transp1D_c_LDADD = libarmci$(MPI_FLAVOR).la
Index: armci-mpi/tests/ctree/Makefile.mk
===================================================================
--- armci-mpi.orig/tests/ctree/Makefile.mk	2022-02-24 10:00:00.100351953 +0100
+++ armci-mpi/tests/ctree/Makefile.mk	2022-02-24 10:00:00.096351939 +0100
@@ -11,6 +11,6 @@
                   tests/ctree/ctree_test_rand_interval
 
 
-tests_ctree_ctree_test_LDADD = libarmci.la -lm
-tests_ctree_ctree_test_rand_LDADD = libarmci.la -lm
-tests_ctree_ctree_test_rand_interval_LDADD = libarmci.la -lm
+tests_ctree_ctree_test_LDADD = libarmci$(MPI_FLAVOR).la -lm
+tests_ctree_ctree_test_rand_LDADD = libarmci$(MPI_FLAVOR).la -lm
+tests_ctree_ctree_test_rand_interval_LDADD = libarmci$(MPI_FLAVOR).la -lm
Index: armci-mpi/tests/mpi/Makefile.mk
===================================================================
--- armci-mpi.orig/tests/mpi/Makefile.mk	2022-02-24 10:00:00.100351953 +0100
+++ armci-mpi/tests/mpi/Makefile.mk	2022-02-24 10:00:00.096351939 +0100
@@ -26,11 +26,11 @@
                   #tests/mpi/ping-pong-mpi      \
                   # end
 
-tests_mpi_ping_pong_mpi_LDADD = libarmci.la
-tests_mpi_test_mpi_accs_LDADD = libarmci.la
-tests_mpi_test_mpi_indexed_accs_LDADD = libarmci.la
-tests_mpi_test_mpi_indexed_gets_LDADD = libarmci.la
-tests_mpi_test_mpi_indexed_puts_gets_LDADD = libarmci.la
-tests_mpi_test_mpi_subarray_accs_LDADD = libarmci.la
-tests_mpi_test_win_create_LDADD = libarmci.la
-tests_mpi_test_win_model_LDADD = libarmci.la
+tests_mpi_ping_pong_mpi_LDADD = libarmci$(MPI_FLAVOR).la
+tests_mpi_test_mpi_accs_LDADD = libarmci$(MPI_FLAVOR).la
+tests_mpi_test_mpi_indexed_accs_LDADD = libarmci$(MPI_FLAVOR).la
+tests_mpi_test_mpi_indexed_gets_LDADD = libarmci$(MPI_FLAVOR).la
+tests_mpi_test_mpi_indexed_puts_gets_LDADD = libarmci$(MPI_FLAVOR).la
+tests_mpi_test_mpi_subarray_accs_LDADD = libarmci$(MPI_FLAVOR).la
+tests_mpi_test_win_create_LDADD = libarmci$(MPI_FLAVOR).la
+tests_mpi_test_win_model_LDADD = libarmci$(MPI_FLAVOR).la
