Commit 2121b2e5 authored by Lorenz Huedepohl's avatar Lorenz Huedepohl

Fix actual reason for linker problems

The actual reason for the linker problems was that the Fortran libraries
where listed before the object files, by modifying the _LINK automake
variables. The proper way to do is of course to add the necessary
libraries after the object files by appending them to the _LDADD
variables.

As the MPI module was not responsible for the linker problems it is now
used by default, unless explicitly switched off with

  --disable-mpi-module

Also, the C test programs that had these linker errors where previously
not compiled in the OpenMP case, for no obvious reason. Now they are
also included there.
parent 3d5aa19e
......@@ -219,14 +219,12 @@ noinst_PROGRAMS = \
elpa2_test_real_api@SUFFIX@ \
elpa2_test_complex_api@SUFFIX@ \
elpa1_real_toeplitz@SUFFIX@ \
elpa1_test_real_with_c@SUFFIX@
if !WITH_OPENMP
noinst_PROGRAMS += \
elpa1_test_real_with_c@SUFFIX@ \
elpa1_test_real_c_version@SUFFIX@ \
elpa1_test_complex_c_version@SUFFIX@ \
elpa2_test_real_c_version@SUFFIX@ \
elpa2_test_complex_c_version@SUFFIX@
endif
build_lib = libelpa@SUFFIX@.la libelpatest@SUFFIX@.la
......@@ -250,31 +248,25 @@ libelpatest@SUFFIX@_la_SOURCES += \
test/shared/redirect.F90
endif
if !WITH_OPENMP
elpa1_test_real_c_version@SUFFIX@_SOURCES = test/C/elpa1_test_real_c_version.c
elpa1_test_real_c_version@SUFFIX@_LDADD = $(build_lib)
elpa1_test_real_c_version@SUFFIX@_LDADD = $(build_lib) $(FCLIBS)
elpa1_test_real_c_version@SUFFIX@_FCFLAGS = $(AM_FCFLAGS) @FC_MODOUT@private_modules @FC_MODINC@private_modules
elpa1_test_real_c_version@SUFFIX@_LINK = $(LINK) $(FCLIBS)
EXTRA_elpa1_test_real_c_version@SUFFIX@_DEPENDENCIES = test/Fortran/elpa_print_headers.X90
elpa1_test_complex_c_version@SUFFIX@_SOURCES = test/C/elpa1_test_complex_c_version.c
elpa1_test_complex_c_version@SUFFIX@_LDADD = $(build_lib)
elpa1_test_complex_c_version@SUFFIX@_LDADD = $(build_lib) $(FCLIBS)
elpa1_test_complex_c_version@SUFFIX@_FCFLAGS = $(AM_FCFLAGS) @FC_MODOUT@private_modules @FC_MODINC@private_modules
elpa1_test_complex_c_version@SUFFIX@_LINK = $(LINK) $(FCLIBS)
EXTRA_elpa1_test_complex_c_version@SUFFIX@_DEPENDENCIES = test/Fortran/elpa_print_headers.X90
elpa2_test_real_c_version@SUFFIX@_SOURCES = test/C/elpa2_test_real_c_version.c
elpa2_test_real_c_version@SUFFIX@_LDADD = $(build_lib)
elpa2_test_real_c_version@SUFFIX@_LDADD = $(build_lib) $(FCLIBS)
elpa2_test_real_c_version@SUFFIX@_FCFLAGS = $(AM_FCFLAGS) @FC_MODOUT@private_modules @FC_MODINC@private_modules
elpa2_test_real_c_version@SUFFIX@_LINK = $(LINK) $(FCLIBS)
EXTRA_elpa2_test_real_c_version@SUFFIX@_DEPENDENCIES = test/Fortran/elpa_print_headers.X90
elpa2_test_complex_c_version@SUFFIX@_SOURCES = test/C/elpa2_test_complex_c_version.c
elpa2_test_complex_c_version@SUFFIX@_LDADD = $(build_lib)
elpa2_test_complex_c_version@SUFFIX@_LDADD = $(build_lib) $(FCLIBS)
elpa2_test_complex_c_version@SUFFIX@_FCFLAGS = $(AM_FCFLAGS) @FC_MODOUT@private_modules @FC_MODINC@private_modules
elpa2_test_complex_c_version@SUFFIX@_LINK = $(LINK) $(FCLIBS)
EXTRA_elpa2_test_complex_c_version@SUFFIX@_DEPENDENCIES = test/Fortran/elpa_print_headers.X90
endif
elpa1_test_real@SUFFIX@_SOURCES = test/Fortran/test_real.F90
elpa1_test_real@SUFFIX@_LDADD = $(build_lib)
......@@ -349,16 +341,11 @@ check_SCRIPTS = \
elpa2_test_real_api@SUFFIX@.sh \
elpa2_test_complex_api@SUFFIX@.sh \
elpa1_real_toeplitz@SUFFIX@.sh \
elpa2_print_kernels@SUFFIX@
if !WITH_OPENMP
check_SCRIPTS += \
elpa2_print_kernels@SUFFIX@ \
elpa1_test_real_c_version@SUFFIX@.sh \
elpa1_test_complex_c_version@SUFFIX@.sh \
elpa2_test_real_c_version@SUFFIX@.sh \
elpa2_test_complex_c_version@SUFFIX@.sh
endif
# test scripts
......
......@@ -609,13 +609,12 @@ fi
dnl Test possibility of 'use mpi', if requested
if test x"${with_mpi}" = x"yes" ; then
AC_ARG_ENABLE([use-mpi],
AS_HELP_STRING([--enable-use-mpi],
[Use Fortran MPI module (otherwise 'include "mpif.h' is used)]),
AC_ARG_ENABLE([mpi-module],
AS_HELP_STRING([--disable-mpi-module],
[Do not use the Fortran MPI module, get interfaces by 'include "mpif.h')]),
[],
[enable_use_mpi=no])
AC_MSG_RESULT([${enable_use_mpi}])
if test x"${enable_use_mpi}" = x"yes" ; then
[enable_mpi_module=yes])
if test x"${enable_mpi_module}" = x"yes" ; then
AC_MSG_CHECKING(whether Fortran mpi module can be used)
AC_COMPILE_IFELSE([AC_LANG_SOURCE([
program test_mpi_module
......@@ -631,7 +630,7 @@ if test x"${with_mpi}" = x"yes" ; then
if test x"${can_use_fortran_mpi_module}" = x"yes" ; then
AC_DEFINE([HAVE_MPI_MODULE],[1],[can use the Fortran mpi module])
else
AC_MSG_ERROR([Could not compile a Fortran program with an 'use mpi' statement])
AC_MSG_ERROR([Could not compile a Fortran program with an 'use mpi' statement. You can try again with --disable-mpi-module])
fi
fi
fi
......
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