Commit ca2b7d41 authored by Lorenz Huedepohl's avatar Lorenz Huedepohl

Restore OpenMP with mixed Intel Fortran/GNU C

libtool was too smart and mixed Intel and GNU OpenMP libraries
parent 9affd0ab
......@@ -2,16 +2,21 @@
ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS} -I m4
AM_FCFLAGS = $(SCALAPACK_FCFLAGS) $(OPENMP_FCFLAGS) @FC_MODINC@modules @FC_MODOUT@modules
AM_LDFLAGS = $(SCALAPACK_LDFLAGS) $(OPENMP_FCFLAGS)
AM_FCFLAGS = $(SCALAPACK_FCFLAGS) @FC_MODINC@modules @FC_MODOUT@modules
AM_LDFLAGS = $(SCALAPACK_LDFLAGS)
# libelpa
if WITH_OPENMP
lib_LTLIBRARIES = libelpa-@PACKAGE_VERSION@_mt.la
libelpa_@PACKAGE_VERSION@_mt_la_LINK = $(FCLINK)
libelpa_@PACKAGE_VERSION@_mt_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(ELPA_SO_VERSION) -lstdc++
else
lib_LTLIBRARIES = libelpa-@PACKAGE_VERSION@.la
libelpa_@PACKAGE_VERSION@_la_LINK = $(FCLINK)
libelpa_@PACKAGE_VERSION@_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(ELPA_SO_VERSION) -lstdc++
endif
##rule to produce fortran config file:
#config_f90.h: ./config.h
# grep "^#define" ./config.h > $@
......@@ -136,12 +141,6 @@ endif
#endif
#endif
if WITH_OPENMP
libelpa_@PACKAGE_VERSION@_mt_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(ELPA_SO_VERSION) -lstdc++
else
libelpa_@PACKAGE_VERSION@_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(ELPA_SO_VERSION) -lstdc++
endif
# install any .mod files in the include/ dir
elpa_includedir = $(includedir)/elpa-@PACKAGE_VERSION@
nobase_elpa_include_HEADERS = $(wildcard modules/*)
......@@ -286,5 +285,8 @@ distclean-local:
EXTRA_DIST = fdep/fortran_dependencies.pl fdep/fortran_dependencies.mk
LIBTOOL_DEPS = @LIBTOOL_DEPS@
libtool: $(LIBTOOL_DEPS)
$(SHELL) ./config.status libtool
@FORTRAN_MODULE_DEPS@
......@@ -129,7 +129,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_gnu_make.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/fdep/fortran_dependencies.m4 \
$(top_srcdir)/m4/ax_prog_cxx_mpi.m4 \
$(top_srcdir)/m4/ax_prog_fc_mpi.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
......@@ -208,14 +207,6 @@ am__dirstamp = $(am__leading_dot)dirstamp
@WITH_OPENMP_FALSE@ $(am__objects_12) $(am__objects_13)
libelpa_@PACKAGE_VERSION@_la_OBJECTS = \
$(am_libelpa_@PACKAGE_VERSION@_la_OBJECTS)
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
am__v_lt_0 = --silent
am__v_lt_1 =
libelpa_@PACKAGE_VERSION@_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \
$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \
$(AM_CXXFLAGS) $(CXXFLAGS) \
$(libelpa_@PACKAGE_VERSION@_la_LDFLAGS) $(LDFLAGS) -o $@
@WITH_OPENMP_FALSE@am_libelpa_@PACKAGE_VERSION@_la_rpath = -rpath \
@WITH_OPENMP_FALSE@ $(libdir)
libelpa_@PACKAGE_VERSION@_mt_la_LIBADD =
......@@ -255,16 +246,16 @@ am__libelpa_@PACKAGE_VERSION@_mt_la_SOURCES_DIST = src/elpa1.F90 \
@WITH_OPENMP_TRUE@ $(am__objects_25) $(am__objects_26)
libelpa_@PACKAGE_VERSION@_mt_la_OBJECTS = \
$(am_libelpa_@PACKAGE_VERSION@_mt_la_OBJECTS)
libelpa_@PACKAGE_VERSION@_mt_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \
$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \
$(AM_CXXFLAGS) $(CXXFLAGS) \
$(libelpa_@PACKAGE_VERSION@_mt_la_LDFLAGS) $(LDFLAGS) -o $@
@WITH_OPENMP_TRUE@am_libelpa_@PACKAGE_VERSION@_mt_la_rpath = -rpath \
@WITH_OPENMP_TRUE@ $(libdir)
PROGRAMS = $(bin_PROGRAMS)
am_elpa1_test_complex_OBJECTS = test/test_complex.$(OBJEXT)
elpa1_test_complex_OBJECTS = $(am_elpa1_test_complex_OBJECTS)
elpa1_test_complex_DEPENDENCIES = $(build_lib)
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
am__v_lt_0 = --silent
am__v_lt_1 =
am_elpa1_test_real_OBJECTS = test/test_real.$(OBJEXT)
elpa1_test_real_OBJECTS = $(am_elpa1_test_real_OBJECTS)
elpa1_test_real_DEPENDENCIES = $(build_lib)
......@@ -685,13 +676,11 @@ MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
MPICXX = @MPICXX@
MPIFC = @MPIFC@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OPENMP_CXXFLAGS = @OPENMP_CXXFLAGS@
OPENMP_FCFLAGS = @OPENMP_FCFLAGS@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
......@@ -772,12 +761,16 @@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
with_amd_bulldozer_kernel = @with_amd_bulldozer_kernel@
ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS} -I m4
AM_FCFLAGS = $(SCALAPACK_FCFLAGS) $(OPENMP_FCFLAGS) @FC_MODINC@modules @FC_MODOUT@modules
AM_LDFLAGS = $(SCALAPACK_LDFLAGS) $(OPENMP_FCFLAGS)
AM_FCFLAGS = $(SCALAPACK_FCFLAGS) @FC_MODINC@modules @FC_MODOUT@modules
AM_LDFLAGS = $(SCALAPACK_LDFLAGS)
@WITH_OPENMP_FALSE@lib_LTLIBRARIES = libelpa-@PACKAGE_VERSION@.la
# libelpa
@WITH_OPENMP_TRUE@lib_LTLIBRARIES = libelpa-@PACKAGE_VERSION@_mt.la
@WITH_OPENMP_TRUE@libelpa_@PACKAGE_VERSION@_mt_la_LINK = $(FCLINK)
@WITH_OPENMP_TRUE@libelpa_@PACKAGE_VERSION@_mt_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(ELPA_SO_VERSION) -lstdc++
@WITH_OPENMP_FALSE@libelpa_@PACKAGE_VERSION@_la_LINK = $(FCLINK)
@WITH_OPENMP_FALSE@libelpa_@PACKAGE_VERSION@_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(ELPA_SO_VERSION) -lstdc++
#config_f90.h: ./config.h
# grep "^#define" ./config.h > $@
......@@ -807,8 +800,6 @@ AM_LDFLAGS = $(SCALAPACK_LDFLAGS) $(OPENMP_FCFLAGS)
# src/elpa2_kernels/elpa2_kernels_complex_sse-avx_1hv.cpp
#endif
#endif
@WITH_OPENMP_TRUE@libelpa_@PACKAGE_VERSION@_mt_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(ELPA_SO_VERSION) -lstdc++
@WITH_OPENMP_FALSE@libelpa_@PACKAGE_VERSION@_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(ELPA_SO_VERSION) -lstdc++
# install any .mod files in the include/ dir
elpa_includedir = $(includedir)/elpa-@PACKAGE_VERSION@
......@@ -882,6 +873,7 @@ CLEANFILES = \
*.i
EXTRA_DIST = fdep/fortran_dependencies.pl fdep/fortran_dependencies.mk
LIBTOOL_DEPS = @LIBTOOL_DEPS@
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-am
......@@ -1025,10 +1017,10 @@ src/elpa2_kernels/elpa2_kernels_complex_sse-avx_2hv.lo: \
src/elpa2_kernels/$(DEPDIR)/$(am__dirstamp)
libelpa-@PACKAGE_VERSION@.la: $(libelpa_@PACKAGE_VERSION@_la_OBJECTS) $(libelpa_@PACKAGE_VERSION@_la_DEPENDENCIES) $(EXTRA_libelpa_@PACKAGE_VERSION@_la_DEPENDENCIES)
$(AM_V_CXXLD)$(libelpa_@PACKAGE_VERSION@_la_LINK) $(am_libelpa_@PACKAGE_VERSION@_la_rpath) $(libelpa_@PACKAGE_VERSION@_la_OBJECTS) $(libelpa_@PACKAGE_VERSION@_la_LIBADD) $(LIBS)
$(AM_V_GEN)$(libelpa_@PACKAGE_VERSION@_la_LINK) $(am_libelpa_@PACKAGE_VERSION@_la_rpath) $(libelpa_@PACKAGE_VERSION@_la_OBJECTS) $(libelpa_@PACKAGE_VERSION@_la_LIBADD) $(LIBS)
libelpa-@PACKAGE_VERSION@_mt.la: $(libelpa_@PACKAGE_VERSION@_mt_la_OBJECTS) $(libelpa_@PACKAGE_VERSION@_mt_la_DEPENDENCIES) $(EXTRA_libelpa_@PACKAGE_VERSION@_mt_la_DEPENDENCIES)
$(AM_V_CXXLD)$(libelpa_@PACKAGE_VERSION@_mt_la_LINK) $(am_libelpa_@PACKAGE_VERSION@_mt_la_rpath) $(libelpa_@PACKAGE_VERSION@_mt_la_OBJECTS) $(libelpa_@PACKAGE_VERSION@_mt_la_LIBADD) $(LIBS)
$(AM_V_GEN)$(libelpa_@PACKAGE_VERSION@_mt_la_LINK) $(am_libelpa_@PACKAGE_VERSION@_mt_la_rpath) $(libelpa_@PACKAGE_VERSION@_mt_la_OBJECTS) $(libelpa_@PACKAGE_VERSION@_mt_la_LIBADD) $(LIBS)
install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL)
@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
......@@ -1968,6 +1960,8 @@ clean-local:
distclean-local:
-rm config-f90.h
libtool: $(LIBTOOL_DEPS)
$(SHELL) ./config.status libtool
@FORTRAN_MODULE_DEPS@
......
This diff is collapsed.
......@@ -46,13 +46,7 @@ AM_PROG_CC_C_O
AM_PROG_AR
AM_PROG_AS
# C++
m4_include([m4/ax_prog_cxx_mpi.m4])
AX_PROG_CXX_MPI([],[have_mpi=yes],[have_mpi=no
if test x"${have_mpi}" = x"no"; then
AC_MSG_ERROR([no mpi found])
fi])
AC_PROG_CXX
dnl variables needed for the tests
......@@ -758,19 +752,10 @@ AC_ARG_WITH([openmp],
if test x"${with_openmp}" = x"yes"; then
AC_DEFINE([WITH_OPENMP], [1], [use OpenMP threading])
# Fortran
AC_LANG_PUSH([Fortran])
AX_ELPA_OPENMP
AC_LANG_POP()
# C++
AC_LANG_PUSH([C++])
AX_ELPA_OPENMP
AC_LANG_POP()
AX_ELPA_OPENMP
# Append to flags as this influences which
# kind of MPI library has to be used (thread-safe or not)
CXXFLAGS="$OPENMP_CXXFLAGS $CXXFLAGS"
FCFLAGS="$OPENMP_FCFLAGS $FCFLAGS"
LDFLAGS="$OPENMP_CXXFLAGS $LDFLAGS"
fi
......@@ -1242,6 +1227,17 @@ mkdir modules
#define HIDDEN
#endif])
# Some part of libtool is too smart and tries to parse the output of
# gfortran -v
# and catches anything that resembles a -l library link specification.
# Unfortunately, recent versions of gfortran emit
# -l gfortran
# with a space between -l and gfortran. The empty -l is then included
# into "postdeps_FC" and causes linking errors later on.
postdeps_FC=$(echo $postdeps_FC | sed 's/-l //g')
echo "postdeps_FC=$postdeps_FC"
AC_CONFIG_FILES([
Makefile
elpa-${PACKAGE_VERSION}.pc:elpa.pc.in
......
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