Commit 60482cc2 authored by Kenneth Raffenetti's avatar Kenneth Raffenetti Committed by Halim Amer
Browse files

tsuite: explicitly add -lpthread when used in tests

For tests that call pthread routines, add an explicit dependency.
This was not an issue previously, because either the compile wrappers
always added -lpthread, or the linker discovered the pthread symbols
via an interlibrary dependency on libmpi. However on FreeBSD 10, the
interlibrary dependency resolution appears more strict. Applications
must specify any libraries directly used, thus this fix.
Signed-off-by: default avatarHalim Amer <>
parent 46d7e443
......@@ -695,6 +695,7 @@ if test "$spawndir" = "spawn" ; then
# Headers needed for threads tests
if test "$threadsdir" = "threads" ; then
# Check for needed threads headers and needed and optional routines
......@@ -703,7 +704,7 @@ if test "$threadsdir" = "threads" ; then
# we shouldn't actually need to do this, but we are dodging the chicken/egg
# problem b/c we don't have a working mpicc yet and we temporarily discarded
# the MPICH-set LIBS (probably the wrong thing to do)
AC_CHECK_FUNCS(pthread_create pthread_yield pthread_barrier_init pthread_barrier_wait)
......@@ -711,6 +712,7 @@ if test "$threadsdir" = "threads" ; then
# Check for h_addr or h_addr_list. This is needed for the singjoin test
# in manual/singjoin.c
......@@ -16,7 +16,7 @@ noinst_PROGRAMS = singjoin testconnect testconnectserial dimsbalanced \
# directory of the MPI library. This definition is not required.
noinst_HEADERS = connectstuff.h
testconnectserial_SOURCES = testconnectserial.c tchandlers.c tcutil.c
testconnectserial_LDADD = $(LDADD) -lm
testconnectserial_LDADD = $(LDADD) -lm -lpthread
singjoin_LDADD = $(LDADD) @socklib@ @nslib@
......@@ -13,7 +13,7 @@
include $(top_srcdir)/Makefile.mtest
## then add rules/vars for mtestthread.o
LDADD += $(top_builddir)/threads/util/mtestthread.$(OBJEXT)
LDADD += $(top_builddir)/threads/util/mtestthread.$(OBJEXT) @threadlib@
$(top_builddir)/threads/util/mtestthread.$(OBJEXT): $(top_srcdir)/threads/util/mtestthread.c
(cd $(top_builddir)/threads/util && $(MAKE) mtestthread.$(OBJEXT))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment