Open
Description
I am having trouble linking applications against an Open MPI configured with --disable-shared --enable-static
. Here is what I get:
$ make -C mpi/pt2pt/ osu_bibw
[...]
/bin/bash ../../libtool --tag=CXX --mode=link mpicxx -g -O2 -o osu_bibw osu_bibw.o ../../util/osu_util.o ../../util/osu_util_mpi.o
libtool: link: mpicxx -g -O2 -o osu_bibw osu_bibw.o ../../util/osu_util.o ../../util/osu_util_mpi.o
/usr/bin/ld: libopen-pal.a(libopen-palmca_common_ucx_noinst_la-common_ucx.o): undefined reference to symbol 'ucm_test_external_events'
/usr/bin/ld: libucm.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make: *** [Makefile:553: osu_bibw] Error 1
The link line used by Open MPI is
$ mpicxx -showme -g -O2 -o osu_bibw osu_bibw.o ../../util/osu_util.o ../../util/osu_util_mpi.o
g++ -g -O2 -o osu_bibw osu_bibw.o ../../util/osu_util.o ../../util/osu_util_mpi.o -I/path/to/opt/openmpi-master/include -pthread -L/path/to/openmpi-master/lib -L/path/to/opt/ucx-1.11.2/lib -Wl,-rpath -Wl,/path/to/opt/openmpi-master/lib -Wl,-rpath -Wl,/path/to/ucx-1.11.2/lib -Wl,--enable-new-dtags -lmpi -lopen-pal -L/path/to/ucx-1.11.2/lib -lrt -lucs -luct -lucp -lpthread -lpmix -lz -lm -lutil -ldl -lhwloc -levent_core -levent_pthreads
If I take the link command and manually add -lucm
at the end linking succeeds:
$ mpicxx -g -O2 -o osu_bibw osu_bibw.o ../../util/osu_util.o ../../util/osu_util_mpi.o -lucm
configure was invoked as below:
../configure --prefix=/path/to/opt/openmpi-master/ --with-ucx=/path/to/opt/ucx-1.11.2 --disable-oshmem --disable-shared --enable-static --disable-debug CC=gcc CXX=g++ CFLAGS="-g -fPIC"
This is with UCX 1.11.2 and GCC 11.2.0 building current Open MPI main
(v2.x-dev-9895-gc21033e367
).