Commit 14d259f0 authored by Giovanni La Mura's avatar Giovanni La Mura
Browse files

Introduce conditional compilation of FORTRAN code

parent d871fe90
Loading
Loading
Loading
Loading
+24 −7
Original line number Diff line number Diff line
LDADD=libnptm/libnptm.la -L/usr/lib64 ${USER_LDFLAGS} ${HDF5_LDFLAGS} ${LAPACKLDFLAGS} ${MAGMALDFLAGS}
lib_LTLIBRARIES=libnptm/libnptm.la
libnptm_libnptm_la_SOURCES=../src/libnptm/algebraic.cpp ../src/libnptm/clu_subs.cpp ../src/libnptm/Commons.cpp ../src/libnptm/Configuration.cpp ../src/libnptm/file_io.cpp ../src/libnptm/lapack_calls.cpp ../src/libnptm/logging.cpp ../src/libnptm/magma_calls.cpp ../src/libnptm/Parsers.cpp ../src/libnptm/sph_subs.cpp ../src/libnptm/tfrfme.cpp ../src/libnptm/TransitionMatrix.cpp ../src/libnptm/tra_subs.cpp
bin_PROGRAMS=cluster/edfb_clu cluster/clu cluster/np_cluster sphere/edfb_sph sphere/sph sphere/np_sphere trapping/frfme trapping/lffft trapping/np_trapping testing/test_TEDF testing/test_TTMS
cluster_edfb_clu_SOURCES=../src/cluster/edfb_clu.f
cluster_clu_SOURCES=../src/cluster/clu.f
if BUILDFORTRAN
PROGS=cluster/edfb_clu cluster/clu cluster/np_cluster sphere/edfb_sph sphere/sph sphere/np_sphere trapping/frfme trapping/lffft trapping/np_trapping testing/test_TEDF testing/test_TTMS
EDFBCLUSOURCES=../src/cluster/edfb_clu.f
CLUSOURCES=../src/cluster/clu.f
EDFBSPHSOURCES=../src/sphere/edfb_sph.f
SPHSOURCES=../src/sphere/sph.f
FRFMESOURCES=../src/trapping/frfme.f
LFFFTSOURCES=../src/trapping/lffft.f
else
PROGS=cluster/np_cluster sphere/np_sphere trapping/np_trapping testing/test_TEDF testing/test_TTMS
EDFBCLUSOURCES=
CLUSOURCES=
EDFBSPHSOURCES=
SPHSOURCES=
FRFMESOURCES=
LFFFTSOURCES=
endif
bin_PROGRAMS=$(PROGS)
cluster_edfb_clu_SOURCES=$(EDFBCLUSOURCES)
cluster_clu_SOURCES=$(CLUSOURCES)
cluster_np_cluster_SOURCES=../src/cluster/np_cluster.cpp ../src/cluster/cluster.cpp
sphere_edfb_sph_SOURCES=../src/sphere/edfb_sph.f
sphere_sph_SOURCES=../src/sphere/sph.f
sphere_edfb_sph_SOURCES=$(EDFBSPHSOURCES)
sphere_sph_SOURCES=$(SPHSOURCES)
sphere_np_sphere_SOURCES=../src/sphere/np_sphere.cpp ../src/sphere/sphere.cpp
trapping_frfme_SOURCES=../src/trapping/frfme.f
trapping_lffft_SOURCES=../src/trapping/lffft.f
trapping_frfme_SOURCES=$(FRFMESOURCES)
trapping_lffft_SOURCES=$(LFFFTSOURCES)
trapping_np_trapping_SOURCES=../src/trapping/np_trapping.cpp ../src/trapping/cfrfme.cpp ../src/trapping/clffft.cpp
testing_test_TEDF_SOURCES=../src/testing/test_TEDF.cpp
testing_test_TTMS_SOURCES=../src/testing/test_TTMS.cpp
+65 −24
Original line number Diff line number Diff line
@@ -89,12 +89,7 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
bin_PROGRAMS = cluster/edfb_clu$(EXEEXT) cluster/clu$(EXEEXT) \
	cluster/np_cluster$(EXEEXT) sphere/edfb_sph$(EXEEXT) \
	sphere/sph$(EXEEXT) sphere/np_sphere$(EXEEXT) \
	trapping/frfme$(EXEEXT) trapping/lffft$(EXEEXT) \
	trapping/np_trapping$(EXEEXT) testing/test_TEDF$(EXEEXT) \
	testing/test_TTMS$(EXEEXT)
bin_PROGRAMS = $(am__EXEEXT_1)
subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
@@ -107,6 +102,22 @@ am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
mkinstalldirs = $(install_sh) -d
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
@BUILDFORTRAN_FALSE@am__EXEEXT_1 = cluster/np_cluster$(EXEEXT) \
@BUILDFORTRAN_FALSE@	sphere/np_sphere$(EXEEXT) \
@BUILDFORTRAN_FALSE@	trapping/np_trapping$(EXEEXT) \
@BUILDFORTRAN_FALSE@	testing/test_TEDF$(EXEEXT) \
@BUILDFORTRAN_FALSE@	testing/test_TTMS$(EXEEXT)
@BUILDFORTRAN_TRUE@am__EXEEXT_1 = cluster/edfb_clu$(EXEEXT) \
@BUILDFORTRAN_TRUE@	cluster/clu$(EXEEXT) \
@BUILDFORTRAN_TRUE@	cluster/np_cluster$(EXEEXT) \
@BUILDFORTRAN_TRUE@	sphere/edfb_sph$(EXEEXT) \
@BUILDFORTRAN_TRUE@	sphere/sph$(EXEEXT) \
@BUILDFORTRAN_TRUE@	sphere/np_sphere$(EXEEXT) \
@BUILDFORTRAN_TRUE@	trapping/frfme$(EXEEXT) \
@BUILDFORTRAN_TRUE@	trapping/lffft$(EXEEXT) \
@BUILDFORTRAN_TRUE@	trapping/np_trapping$(EXEEXT) \
@BUILDFORTRAN_TRUE@	testing/test_TEDF$(EXEEXT) \
@BUILDFORTRAN_TRUE@	testing/test_TTMS$(EXEEXT)
am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libdir)"
PROGRAMS = $(bin_PROGRAMS)
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
@@ -151,14 +162,18 @@ 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_cluster_clu_OBJECTS = ../src/cluster/clu.$(OBJEXT)
am__cluster_clu_SOURCES_DIST = ../src/cluster/clu.f
@BUILDFORTRAN_TRUE@am__objects_1 = ../src/cluster/clu.$(OBJEXT)
am_cluster_clu_OBJECTS = $(am__objects_1)
cluster_clu_OBJECTS = $(am_cluster_clu_OBJECTS)
cluster_clu_LDADD = $(LDADD)
am__DEPENDENCIES_1 =
cluster_clu_DEPENDENCIES = libnptm/libnptm.la $(am__DEPENDENCIES_1) \
	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
	$(am__DEPENDENCIES_1)
am_cluster_edfb_clu_OBJECTS = ../src/cluster/edfb_clu.$(OBJEXT)
am__cluster_edfb_clu_SOURCES_DIST = ../src/cluster/edfb_clu.f
@BUILDFORTRAN_TRUE@am__objects_2 = ../src/cluster/edfb_clu.$(OBJEXT)
am_cluster_edfb_clu_OBJECTS = $(am__objects_2)
cluster_edfb_clu_OBJECTS = $(am_cluster_edfb_clu_OBJECTS)
cluster_edfb_clu_LDADD = $(LDADD)
cluster_edfb_clu_DEPENDENCIES = libnptm/libnptm.la \
@@ -171,7 +186,9 @@ cluster_np_cluster_LDADD = $(LDADD)
cluster_np_cluster_DEPENDENCIES = libnptm/libnptm.la \
	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
am_sphere_edfb_sph_OBJECTS = ../src/sphere/edfb_sph.$(OBJEXT)
am__sphere_edfb_sph_SOURCES_DIST = ../src/sphere/edfb_sph.f
@BUILDFORTRAN_TRUE@am__objects_3 = ../src/sphere/edfb_sph.$(OBJEXT)
am_sphere_edfb_sph_OBJECTS = $(am__objects_3)
sphere_edfb_sph_OBJECTS = $(am_sphere_edfb_sph_OBJECTS)
sphere_edfb_sph_LDADD = $(LDADD)
sphere_edfb_sph_DEPENDENCIES = libnptm/libnptm.la \
@@ -184,7 +201,9 @@ sphere_np_sphere_LDADD = $(LDADD)
sphere_np_sphere_DEPENDENCIES = libnptm/libnptm.la \
	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
am_sphere_sph_OBJECTS = ../src/sphere/sph.$(OBJEXT)
am__sphere_sph_SOURCES_DIST = ../src/sphere/sph.f
@BUILDFORTRAN_TRUE@am__objects_4 = ../src/sphere/sph.$(OBJEXT)
am_sphere_sph_OBJECTS = $(am__objects_4)
sphere_sph_OBJECTS = $(am_sphere_sph_OBJECTS)
sphere_sph_LDADD = $(LDADD)
sphere_sph_DEPENDENCIES = libnptm/libnptm.la $(am__DEPENDENCIES_1) \
@@ -202,13 +221,17 @@ testing_test_TTMS_LDADD = $(LDADD)
testing_test_TTMS_DEPENDENCIES = libnptm/libnptm.la \
	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
am_trapping_frfme_OBJECTS = ../src/trapping/frfme.$(OBJEXT)
am__trapping_frfme_SOURCES_DIST = ../src/trapping/frfme.f
@BUILDFORTRAN_TRUE@am__objects_5 = ../src/trapping/frfme.$(OBJEXT)
am_trapping_frfme_OBJECTS = $(am__objects_5)
trapping_frfme_OBJECTS = $(am_trapping_frfme_OBJECTS)
trapping_frfme_LDADD = $(LDADD)
trapping_frfme_DEPENDENCIES = libnptm/libnptm.la $(am__DEPENDENCIES_1) \
	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
	$(am__DEPENDENCIES_1)
am_trapping_lffft_OBJECTS = ../src/trapping/lffft.$(OBJEXT)
am__trapping_lffft_SOURCES_DIST = ../src/trapping/lffft.f
@BUILDFORTRAN_TRUE@am__objects_6 = ../src/trapping/lffft.$(OBJEXT)
am_trapping_lffft_OBJECTS = $(am__objects_6)
trapping_lffft_OBJECTS = $(am_trapping_lffft_OBJECTS)
trapping_lffft_LDADD = $(LDADD)
trapping_lffft_DEPENDENCIES = libnptm/libnptm.la $(am__DEPENDENCIES_1) \
@@ -318,12 +341,16 @@ SOURCES = $(libnptm_libnptm_la_SOURCES) $(cluster_clu_SOURCES) \
	$(sphere_sph_SOURCES) $(testing_test_TEDF_SOURCES) \
	$(testing_test_TTMS_SOURCES) $(trapping_frfme_SOURCES) \
	$(trapping_lffft_SOURCES) $(trapping_np_trapping_SOURCES)
DIST_SOURCES = $(libnptm_libnptm_la_SOURCES) $(cluster_clu_SOURCES) \
	$(cluster_edfb_clu_SOURCES) $(cluster_np_cluster_SOURCES) \
	$(sphere_edfb_sph_SOURCES) $(sphere_np_sphere_SOURCES) \
	$(sphere_sph_SOURCES) $(testing_test_TEDF_SOURCES) \
	$(testing_test_TTMS_SOURCES) $(trapping_frfme_SOURCES) \
	$(trapping_lffft_SOURCES) $(trapping_np_trapping_SOURCES)
DIST_SOURCES = $(libnptm_libnptm_la_SOURCES) \
	$(am__cluster_clu_SOURCES_DIST) \
	$(am__cluster_edfb_clu_SOURCES_DIST) \
	$(cluster_np_cluster_SOURCES) \
	$(am__sphere_edfb_sph_SOURCES_DIST) \
	$(sphere_np_sphere_SOURCES) $(am__sphere_sph_SOURCES_DIST) \
	$(testing_test_TEDF_SOURCES) $(testing_test_TTMS_SOURCES) \
	$(am__trapping_frfme_SOURCES_DIST) \
	$(am__trapping_lffft_SOURCES_DIST) \
	$(trapping_np_trapping_SOURCES)
am__can_run_installinfo = \
  case $$AM_UPDATE_INFO_DIR in \
    n|no|NO) false;; \
@@ -521,14 +548,28 @@ top_srcdir = @top_srcdir@
LDADD = libnptm/libnptm.la -L/usr/lib64 ${USER_LDFLAGS} ${HDF5_LDFLAGS} ${LAPACKLDFLAGS} ${MAGMALDFLAGS}
lib_LTLIBRARIES = libnptm/libnptm.la
libnptm_libnptm_la_SOURCES = ../src/libnptm/algebraic.cpp ../src/libnptm/clu_subs.cpp ../src/libnptm/Commons.cpp ../src/libnptm/Configuration.cpp ../src/libnptm/file_io.cpp ../src/libnptm/lapack_calls.cpp ../src/libnptm/logging.cpp ../src/libnptm/magma_calls.cpp ../src/libnptm/Parsers.cpp ../src/libnptm/sph_subs.cpp ../src/libnptm/tfrfme.cpp ../src/libnptm/TransitionMatrix.cpp ../src/libnptm/tra_subs.cpp
cluster_edfb_clu_SOURCES = ../src/cluster/edfb_clu.f
cluster_clu_SOURCES = ../src/cluster/clu.f
@BUILDFORTRAN_FALSE@PROGS = cluster/np_cluster sphere/np_sphere trapping/np_trapping testing/test_TEDF testing/test_TTMS
@BUILDFORTRAN_TRUE@PROGS = cluster/edfb_clu cluster/clu cluster/np_cluster sphere/edfb_sph sphere/sph sphere/np_sphere trapping/frfme trapping/lffft trapping/np_trapping testing/test_TEDF testing/test_TTMS
@BUILDFORTRAN_FALSE@EDFBCLUSOURCES = 
@BUILDFORTRAN_TRUE@EDFBCLUSOURCES = ../src/cluster/edfb_clu.f
@BUILDFORTRAN_FALSE@CLUSOURCES = 
@BUILDFORTRAN_TRUE@CLUSOURCES = ../src/cluster/clu.f
@BUILDFORTRAN_FALSE@EDFBSPHSOURCES = 
@BUILDFORTRAN_TRUE@EDFBSPHSOURCES = ../src/sphere/edfb_sph.f
@BUILDFORTRAN_FALSE@SPHSOURCES = 
@BUILDFORTRAN_TRUE@SPHSOURCES = ../src/sphere/sph.f
@BUILDFORTRAN_FALSE@FRFMESOURCES = 
@BUILDFORTRAN_TRUE@FRFMESOURCES = ../src/trapping/frfme.f
@BUILDFORTRAN_FALSE@LFFFTSOURCES = 
@BUILDFORTRAN_TRUE@LFFFTSOURCES = ../src/trapping/lffft.f
cluster_edfb_clu_SOURCES = $(EDFBCLUSOURCES)
cluster_clu_SOURCES = $(CLUSOURCES)
cluster_np_cluster_SOURCES = ../src/cluster/np_cluster.cpp ../src/cluster/cluster.cpp
sphere_edfb_sph_SOURCES = ../src/sphere/edfb_sph.f
sphere_sph_SOURCES = ../src/sphere/sph.f
sphere_edfb_sph_SOURCES = $(EDFBSPHSOURCES)
sphere_sph_SOURCES = $(SPHSOURCES)
sphere_np_sphere_SOURCES = ../src/sphere/np_sphere.cpp ../src/sphere/sphere.cpp
trapping_frfme_SOURCES = ../src/trapping/frfme.f
trapping_lffft_SOURCES = ../src/trapping/lffft.f
trapping_frfme_SOURCES = $(FRFMESOURCES)
trapping_lffft_SOURCES = $(LFFFTSOURCES)
trapping_np_trapping_SOURCES = ../src/trapping/np_trapping.cpp ../src/trapping/cfrfme.cpp ../src/trapping/clffft.cpp
testing_test_TEDF_SOURCES = ../src/testing/test_TEDF.cpp
testing_test_TTMS_SOURCES = ../src/testing/test_TTMS.cpp
+63 −2
Original line number Diff line number Diff line
@@ -665,6 +665,8 @@ LAPACKLDFLAGS
LAPACKFLAGS
OMPFLAGS
OFFLOADFLAGS
BUILDFORTRAN_FALSE
BUILDFORTRAN_TRUE
HDF5_LDFLAGS
HDF5_LIB
HDF5_INCLUDE
@@ -811,6 +813,7 @@ with_aix_soname
with_gnu_ld
with_sysroot
enable_libtool_lock
enable_fortran
enable_offload
enable_openmp
with_lapack
@@ -1474,6 +1477,7 @@ Optional Features:
  --enable-fast-install[=PKGS]
                          optimize for fast installation [default=yes]
  --disable-libtool-lock  avoid locking (might break parallel builds)
  --enable-fortran        enable legacy FORTRAN compilation [default=auto]
  --enable-offload        enable target offloading (requires g++ version >=
                          13) [default=auto]
  --enable-openmp         enable OpneMP multi-threading [default=yes]
@@ -9979,7 +9983,7 @@ ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_f77_compiler_gnu
if test -n "$ac_tool_prefix"; then
  for ac_prog in gfortran f77
  for ac_prog in $F77 gfortran f77
  do
    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
set dummy $ac_tool_prefix$ac_prog; ac_word=$2
@@ -10029,7 +10033,7 @@ fi
fi
if test -z "$F77"; then
  ac_ct_F77=$F77
  for ac_prog in gfortran f77
  for ac_prog in $F77 gfortran f77
do
  # Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
@@ -24887,6 +24891,59 @@ esac
fi
# Configure the optional features
# Check whether --enable-fortran was given.
if test ${enable_fortran+y}
then :
  enableval=$enable_fortran;
    if test "x$enableval" = "xno"; then
      export BUILDF="false"
      { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Disabling FORTRAN compilation" >&5
printf "%s\n" "$as_me: Disabling FORTRAN compilation" >&6;}
    elif test "x$enableval" = "xyes"; then
      if test "x$F77" != "x"; then
        export BUILDF="true"
        { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Enabling FORTRAN compilation" >&5
printf "%s\n" "$as_me: Enabling FORTRAN compilation" >&6;}
      else
        as_fn_error $? "FORTRAN was requested, but no FORTRAN compiler was found!" "$LINENO" 5
      fi
    elif test "x$enableval" = "xauto"; then
      if test "x$F77" != "x"; then
        export BUILDF="true"
        { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Enabling FORTRAN compilation" >&5
printf "%s\n" "$as_me: Enabling FORTRAN compilation" >&6;}
      else
        export BUILDF="false"
        { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Disabling FORTRAN compilation" >&5
printf "%s\n" "$as_me: Disabling FORTRAN compilation" >&6;}
      fi
    fi
else case e in #(
  e)
    if test "x$F77" != "x"; then
      export BUILDF="true"
      { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Enabling FORTRAN compilation" >&5
printf "%s\n" "$as_me: Enabling FORTRAN compilation" >&6;}
    else
      export BUILDF="false"
      { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Disabling FORTRAN compilation" >&5
printf "%s\n" "$as_me: Disabling FORTRAN compilation" >&6;}
    fi
 ;;
esac
fi
 if test "x$BUILDF" = "xtrue"; then
  BUILDFORTRAN_TRUE=
  BUILDFORTRAN_FALSE='#'
else
  BUILDFORTRAN_TRUE='#'
  BUILDFORTRAN_FALSE=
fi
# Check whether --enable-offload was given.
if test ${enable_offload+y}
then :
@@ -25495,6 +25552,10 @@ if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
  as_fn_error $? "conditional \"am__fastdepCXX\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${BUILDFORTRAN_TRUE}" && test -z "${BUILDFORTRAN_FALSE}"; then
  as_fn_error $? "conditional \"BUILDFORTRAN\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
: "${CONFIG_STATUS=./config.status}"
ac_write_fail=0
+37 −1
Original line number Diff line number Diff line
@@ -212,7 +212,7 @@ AC_ARG_ENABLE(
  ]
)
AC_PROG_CXX([$CXX])
AC_PROG_F77([gfortran f77])
AC_PROG_F77([$F77 gfortran f77])
# Check whether the compiler is clang++ (needs additional flags)
CXX_IS_CLANG=$($CXX --version | grep clang)
AS_IF(
@@ -252,6 +252,42 @@ AS_IF(
)

# Configure the optional features
AC_ARG_ENABLE(
  [fortran],
  [AS_HELP_STRING([--enable-fortran], [enable legacy FORTRAN compilation [default=auto]])],
  [
    if test "x$enableval" = "xno"; then
      export BUILDF="false"
      AC_MSG_NOTICE([Disabling FORTRAN compilation])
    elif test "x$enableval" = "xyes"; then
      if test "x$F77" != "x"; then
        export BUILDF="true"
        AC_MSG_NOTICE([Enabling FORTRAN compilation])
      else
        AC_MSG_ERROR([FORTRAN was requested, but no FORTRAN compiler was found!])
      fi
    elif test "x$enableval" = "xauto"; then
      if test "x$F77" != "x"; then
        export BUILDF="true"
        AC_MSG_NOTICE([Enabling FORTRAN compilation])
      else
        export BUILDF="false"
        AC_MSG_NOTICE([Disabling FORTRAN compilation])
      fi
    fi
  ],
  [
    if test "x$F77" != "x"; then
      export BUILDF="true"
      AC_MSG_NOTICE([Enabling FORTRAN compilation])
    else
      export BUILDF="false"
      AC_MSG_NOTICE([Disabling FORTRAN compilation])
    fi
  ]
)
AM_CONDITIONAL([BUILDFORTRAN], [test "x$BUILDF" = "xtrue"])

AC_ARG_ENABLE(
  [offload],
  [AS_HELP_STRING([--enable-offload], [enable target offloading (requires g++ version >= 13) [default=auto]])],