Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
elpa
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
11
Issues
11
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Environments
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
elpa
elpa
Commits
06b170c4
Commit
06b170c4
authored
Sep 05, 2017
by
Andreas Marek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test project for 2stage case
parent
443d327d
Changes
13
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
927 additions
and
16 deletions
+927
-16
.gitlab-ci.yml
.gitlab-ci.yml
+99
-0
Makefile.am
Makefile.am
+7
-1
test_project/src/test_real.F90
test_project/src/test_real.F90
+13
-15
test_project_2stage/Makefile.am
test_project_2stage/Makefile.am
+13
-0
test_project_2stage/autogen.sh
test_project_2stage/autogen.sh
+8
-0
test_project_2stage/configure.ac
test_project_2stage/configure.ac
+94
-0
test_project_2stage/fdep/LICENSE
test_project_2stage/fdep/LICENSE
+19
-0
test_project_2stage/fdep/README
test_project_2stage/fdep/README
+99
-0
test_project_2stage/fdep/fortran_dependencies.m4
test_project_2stage/fdep/fortran_dependencies.m4
+19
-0
test_project_2stage/fdep/fortran_dependencies.mk
test_project_2stage/fdep/fortran_dependencies.mk
+80
-0
test_project_2stage/fdep/fortran_dependencies.pl
test_project_2stage/fdep/fortran_dependencies.pl
+77
-0
test_project_2stage/m4/ax_prog_fc_mpi.m4
test_project_2stage/m4/ax_prog_fc_mpi.m4
+162
-0
test_project_2stage/src/test_real2.F90
test_project_2stage/src/test_real2.F90
+237
-0
No files found.
.gitlab-ci.yml
View file @
06b170c4
...
...
@@ -3426,6 +3426,32 @@ distcheck:
# stupid 'make distcheck' leaves behind write-protected files that the stupid gitlab runner cannot remove
-
make distcheck DISTCHECK_CONFIGURE_FLAGS="--with-mpi=no --disable-sse-assembly --disable-sse --disable-avx --disable-avx2" TASKS=2 TEST_FLAGS='150 50 16' || { chmod u+rwX -R . ; exit 1 ; }
# test test_project
test_project
:
tags
:
-
buildtest
script
:
-
mkdir build
-
pushd build
-
../autogen.sh
-
../configure --enable-option-checking=fatal FCFLAGS="-march=native" CFLAGS="-march=native" --disable-avx2 SCALAPACK_LDFLAGS="$MKL_GFORTRAN_SCALAPACK_LDFLAGS_MPI_NO_OMP" SCALAPACK_FCFLAGS="$MKL_GFORTRAN_SCALAPACK_FCFLAGS_MPI_NO_OMP" FC=mpif90 --prefix=$PWD/installdest --disable-avx2 || { cat config.log; exit 1; }
-
make -j
8
-
make install
-
popd
-
mkdir test_project/build
-
pushd test_project/build
-
../autogen.sh
-
../configure --enable-option-checking=fatal PKG_CONFIG_PATH=../../build/installdest/lib/pkgconfig FC=mpif90 || { cat config.log; exit 1; }
-
make -j
8
-
export LD_LIBRARY_PATH=$MKL_HOME/lib/intel64:$LD_LIBRARY_PATH
-
./test_real
-
make distclean
-
popd
-
pushd build
-
make distclean
-
rm -rf installdest
-
popd
# test test_project_legacy_api
test_project_legacy_api
:
tags
:
...
...
@@ -3452,6 +3478,32 @@ test_project_legacy_api:
-
rm -rf installdest
-
popd
# test test_project_2stage
test_project_2stage
:
tags
:
-
buildtest
script
:
-
mkdir build
-
pushd build
-
../autogen.sh
-
../configure --enable-option-checking=fatal FCFLAGS="-march=native" CFLAGS="-march=native" SCALAPACK_LDFLAGS="$MKL_GFORTRAN_SCALAPACK_LDFLAGS_MPI_NO_OMP" SCALAPACK_FCFLAGS="$MKL_GFORTRAN_SCALAPACK_FCFLAGS_MPI_NO_OMP" FC=mpif90 --prefix=$PWD/installdest --disable-avx2 || { cat config.log; exit 1; }
-
make -j
8
-
make install
-
popd
-
mkdir test_project_2stage/build
-
pushd test_project_2stage/build
-
../autogen.sh
-
../configure --enable-option-checking=fatal PKG_CONFIG_PATH=../../build/installdest/lib/pkgconfig FC=mpif90 || { cat config.log; exit 1; }
-
make -j
8
-
export LD_LIBRARY_PATH=$MKL_HOME/lib/intel64:$LD_LIBRARY_PATH
-
./test_real2
-
make distclean
-
popd
-
pushd build
-
make distclean
-
rm -rf installdest
-
popd
# test test_project_2stage_legacy_api
test_project_2stage_legacy_api
:
...
...
@@ -3479,6 +3531,29 @@ test_project_2stage_legacy_api:
-
rm -rf installdest
-
popd
test_project_intel
:
tags
:
-
buildtest
script
:
-
mkdir build
-
pushd build
-
../autogen.sh
-
../configure --enable-option-checking=fatal SCALAPACK_LDFLAGS="$MKL_INTEL_SCALAPACK_LDFLAGS_MPI_NO_OMP" SCALAPACK_FCFLAGS="$MKL_INTEL_SCALAPACK_FCFLAGS_MPI_NO_OMP" FC=mpiifort --prefix=$PWD/installdest --disable-sse-assembly --disable-sse --disable-avx --disable-avx2 || { cat config.log; exit 1; }
-
make -j
8
-
make install
-
popd
-
mkdir test_project/build
-
pushd test_project/build
-
../autogen.sh
-
../configure --enable-option-checking=fatal PKG_CONFIG_PATH=../../build/installdest/lib/pkgconfig FC=mpiifort || { cat config.log; exit 1; }
-
make -j
8
-
export LD_LIBRARY_PATH=$MKL_HOME/lib/intel64:$LD_LIBRARY_PATH
-
./test_real
-
make distclean
-
popd
-
pushd build
-
make distclean
-
rm -rf installdest
test_project_intel_legacy_api
:
tags
:
...
...
@@ -3504,6 +3579,30 @@ test_project_intel_legacy_api:
-
make distclean
-
rm -rf installdest
test_project_2stage_intel
:
tags
:
-
buildtest
script
:
-
mkdir build
-
pushd build
-
../autogen.sh
-
../configure --enable-option-checking=fatal SCALAPACK_LDFLAGS="$MKL_INTEL_SCALAPACK_LDFLAGS_MPI_NO_OMP" SCALAPACK_FCFLAGS="$MKL_INTEL_SCALAPACK_FCFLAGS_MPI_NO_OMP" FC=mpiifort --prefix=$PWD/installdest --disable-sse-assembly --disable-sse --disable-avx --disable-avx2 || { cat config.log; exit 1; }
-
make -j
8
-
make install
-
popd
-
mkdir test_project_2stage/build
-
pushd test_project_2stage/build
-
../autogen.sh
-
../configure --enable-option-checking=fatal PKG_CONFIG_PATH=../../build/installdest/lib/pkgconfig FC=mpiifort || { cat config.log; exit 1; }
-
make -j
8
-
export LD_LIBRARY_PATH=$MKL_HOME/lib/intel64:$LD_LIBRARY_PATH
-
./test_real2
-
make distclean
-
popd
-
pushd build
-
make distclean
-
rm -rf installdest
test_project_2stage_intel_legacy_api
:
tags
:
...
...
Makefile.am
View file @
06b170c4
...
...
@@ -649,7 +649,13 @@ EXTRA_DIST = \
test_project/configure.ac
\
test_project/fdep
\
test_project/m4
\
test_project/src/test_real.F90
test_project/src/test_real.F90
\
test_project_2stage/Makefile.am
\
test_project_2stage/autogen.sh
\
test_project_2stage/configure.ac
\
test_project_2stage/fdep
\
test_project_2stage/m4
\
test_project_2stage/src/test_real2.F90
if
ENABLE_LEGACY
EXTRA_DIST
+=
\
...
...
test_project/src/test_real.F90
View file @
06b170c4
...
...
@@ -107,18 +107,16 @@ program test_real_example
integer
::
iseed
(
4096
)
! Random seed, size should be sufficient for every generator
integer
::
STATUS
tinter
::
success
integer
::
success
character
(
len
=
8
)
::
task_suffix
integer
::
j
integer
,
parameter
::
error_unit
=
0
class
(
elpa_t
),
pointer
::
e
lpa
class
(
elpa_t
),
pointer
::
e
!-------------------------------------------------------------------------------
success
=
.true.
! default parameters
na
=
1000
nev
=
500
...
...
@@ -197,19 +195,19 @@ program test_real_example
print
*
,
"ELPA API version not supported"
stop
endif
e
lpa
=>
elpa_allocate
()
e
=>
elpa_allocate
()
! set parameters decribing the matrix and it's MPI distribution
call
e
lpa
%
set
(
"na"
,
na
,
success
)
call
e
lpa
%
set
(
"nev"
,
nev
,
success
)
call
e
lpa
%
set
(
"local_nrows"
,
na_rows
,
success
)
call
e
lpa
%
set
(
"local_ncols"
,
na_cols
,
success
)
call
e
lpa
%
set
(
"nblk"
,
nblk
,
success
)
call
e
lpa
%
set
(
"mpi_comm_parent"
,
mpi_comm_world
,
success
)
call
e
lpa
%
set
(
"process_row"
,
my_prow
,
success
)
call
e
lpa
%
set
(
"process_col"
,
my_pcol
,
success
)
succes
=
elpa
%
setup
()
call
e
%
set
(
"na"
,
na
,
success
)
call
e
%
set
(
"nev"
,
nev
,
success
)
call
e
%
set
(
"local_nrows"
,
na_rows
,
success
)
call
e
%
set
(
"local_ncols"
,
na_cols
,
success
)
call
e
%
set
(
"nblk"
,
nblk
,
success
)
call
e
%
set
(
"mpi_comm_parent"
,
mpi_comm_world
,
success
)
call
e
%
set
(
"process_row"
,
my_prow
,
success
)
call
e
%
set
(
"process_col"
,
my_pcol
,
success
)
succes
s
=
e
%
setup
()
call
e
%
set
(
"solver"
,
elpa_solver_1stage
,
success
)
...
...
test_project_2stage/Makefile.am
0 → 100644
View file @
06b170c4
## Process this file with automake to produce Makefile.in
ACLOCAL_AMFLAGS
=
${ACLOCAL_FLAGS}
-I
m4
AM_FCFLAGS
=
@FC_MODINC@modules @FC_MODOUT@modules
$(ELPA_FCFLAGS)
AM_LDFLAGS
=
$(ELPA_LIBS)
#bindir = $(abs_top_builddir)
bin_PROGRAMS
=
test_real2
test_real2_SOURCES
=
src/test_real2.F90
distclean-local
:
-
rm
config-f90.h
test_project_2stage/autogen.sh
0 → 100755
View file @
06b170c4
#!/bin/sh -e
mkdir
-p
m4/
test
-n
"
$srcdir
"
||
srcdir
=
`
dirname
"
$0
"
`
test
-n
"
$srcdir
"
||
srcdir
=
.
autoreconf
--force
--install
--verbose
"
$srcdir
"
test_project_2stage/configure.ac
0 → 100644
View file @
06b170c4
AC_PREREQ([2.69])
AC_INIT([elpa_test_project],[2017.05.002], elpa-library@rzg.mpg.de)
elpaversion="2017.05.002"
AC_CONFIG_SRCDIR([src/test_real2.F90])
AM_INIT_AUTOMAKE([foreign -Wall subdir-objects])
# Without this, automake tries to be smart and rebuilt
# the autoconf generated files such as configure, aclocal.m4, etc.,
# in case the timestamps of files such as configure.ac are newer
#
# This only makes trouble for end users with out-of-date autoconf versions
# that cannot produce these files
AM_MAINTAINER_MODE([disable])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS([config.h])
AM_SILENT_RULES([yes])
rm -rf config.h config-f90.h
AX_CHECK_GNU_MAKE()
if test x$_cv_gnu_make_command = x ; then
AC_MSG_ERROR([Need GNU Make])
fi
AC_CHECK_PROG(CPP_FOUND,cpp,yes,no)
if test x"${CPP_FOUND}" = xno; then
AC_MSG_ERROR([no cpp found])
fi
# gnu-make fortran module dependencies
m4_include([fdep/fortran_dependencies.m4])
FDEP_F90_GNU_MAKE_DEPS
AC_PROG_INSTALL
AM_PROG_CC_C_O
AM_PROG_AR
AM_PROG_AS
AC_LANG([Fortran])
m4_include([m4/ax_prog_fc_mpi.m4])
dnl check whether an mpi compiler is available;
dnl if not abort since it is mandatory
AX_PROG_FC_MPI([],[have_mpi=yes],[have_mpi=no
if test x"${have_mpi}" = xno; then
AC_MSG_ERROR([no mpi found])
fi])
AC_FC_FREEFORM
AC_FC_MODULE_FLAG
AC_FC_MODULE_OUTPUT_FLAG
AC_MSG_CHECKING(whether OpenMP usage is specified)
AC_ARG_WITH([openmp],
AS_HELP_STRING([--with-openmp],
[use OpenMP threading, default no.]),
[with_openmp=yes],
[with_openmp=no])
AC_MSG_RESULT([${with_openmp}])
if test x"${enable_openmp}" = x"yes"; then
with_openmp=yes
AC_MSG_CHECKING(whether --enable-openmp is specified)
AC_MSG_RESULT([${enable_openmp}])
fi
AM_CONDITIONAL([WITH_OPENMP],[test x"$with_openmp" = x"yes"])
if test x"${with_openmp}" = x"yes"; then
AC_DEFINE([WITH_OPENMP], [1], [use OpenMP threading])
AX_ELPA_OPENMP
elpa="elpa_openmp-$elpaversion"
else
elpa="elpa-$elpaversion"
fi
# Here comes the ELPA specific part
PKG_PROG_PKG_CONFIG
PKG_CHECK_MODULES([ELPA],[${elpa}],[],[AC_MSG_ERROR(["Need ${elpa}"])])
PKG_CHECK_VAR([ELPA_FCFLAGS],[${elpa}],[fcflags])
LT_INIT
AC_SUBST([FC_MODINC])
AC_SUBST([FC_MODOUT])
rm -rf modules/ .fortran_dependencies/
mkdir modules
AC_CONFIG_FILES([
Makefile
])
AC_OUTPUT
grep "^#define" config.h > config-f90.h
test_project_2stage/fdep/LICENSE
0 → 100644
View file @
06b170c4
Copyright (c) 2013 Lorenz Hüdepohl
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
test_project_2stage/fdep/README
0 → 100644
View file @
06b170c4
fdep
----
fdep is a small set of scripts to teach autoconf/automake (using GNU make)
about the additional dependencies in Fortran 90 files due to modules.
With this, Fortran files can be listed in any order in Makefile.am and parallel
builds work.
Usage
-----
Put this project as a directory "fdep" in your source code, place the two
lines
m4_include([fdep/fortran_dependencies.m4])
FDEP_F90_GNU_MAKE_DEPS
in your configure.ac, and add a single line
@FORTRAN_MODULE_DEPS@
in your Makefile.am. All .F90 files of all programs in bin_PROGRAMS and all
libraries in lib_LTLIBRARIES will now be scanned for modules and the
resulting dependencies will be honoured.
What is the problem with Fortran 90 modules and make dependencies?
------------------------------------------------------------------
In Fortran 90 source files one can define any number of "modules", containing
variable and function definitions. The names of the modules defined in a file
can be arbitrary.
In another source file these modules can be used, informing the Fortran
compiler about the definitions in these modules (e.g. to do type-checking).
This creates a problem, as the compiler has to know somehow where the module
is defined.
The usual solution employed by almost every Fortran compiler is to create
special "module" files for each module contained in a source file during
compilation. Their file name is derived by a compiler-specific recipe of the
modules identifier (usually the lower-cased module's identifier plus ".mod",
so "foo_module.mod" and "some_other_module.mod"). When the compiler
encounters a "use" statement during the compilation of another file, it
confers to this file to import the definitions of the module.
That means, you cannot compile files using modules defined in yet un-compiled
files, one has to tell make about this dependency.
(A primitive solution to this problem is listing the file in a pre-sorted
order, so that files defining modules are compiled first.
However, that way the dependency-graph make knows about is incomplete and
parallel builds will fail with a high probability)
How does fdep solve this problem technically?
---------------------------------------------
As the name of the module files can be an arbitrary (and some compilers might
even save the module definitions in some completely different way), fdep
tells make about the module dependencies as a relation directly between
object files, e.g. when a file 'b.f90' is using any module of file 'a.f90',
fdep adds a dependency of
b.o: a.o
More specifically, the perl-script fortran_dependencies.pl is run by make to
create a file .fortran_dependencies/dependencies.mk, which is then included.
To do this, first every source file (for every defined program and library)
is scanned for lines with "module" or "use" statements. These are saved in
two additional files (.use_mods and .def_mods) per source file and contain
lists of defined and required modules. The perl script then reads these in
and produces the appropriate rules.
Drawbacks
---------
GNU make is required. The detailed dependency graph due to "module" and "use"
statements is only available after pre-processing, when autoconf and even
configure is long over. To still get proper dependencies, fdep uses GNU
make's feature to include generated sub-Makefiles during a running make
invocation.
License
-------
fdep is released under the MIT License. See the LICENSE file for details.
Contributing
------------
Send your patches or pull-request to dev@stellardeath.org
test_project_2stage/fdep/fortran_dependencies.m4
0 → 100644
View file @
06b170c4
AC_DEFUN([FDEP_F90_GNU_MAKE_DEPS],[
AC_MSG_CHECKING([for GNU make])
for a in "$MAKE" make gmake gnumake ; do
if test -z "$a" ; then continue ; fi ;
if ( sh -c "$a --version" 2> /dev/null | grep GNU 2>&1 > /dev/null ) ; then
_fdep_gnu_make_command=$a ;
break;
fi
done ;
AC_MSG_RESULT([$_fdep_gnu_make_command])
if test x$_fdep_gnu_make_command = x ; then
AC_MSG_ERROR([Need GNU Make])
fi
AC_SUBST([FORTRAN_MODULE_DEPS], ["
CLEANFILES +=
include ${srcdir}/fdep/fortran_dependencies.mk
"])
AM_SUBST_NOTMAKE([FORTRAN_MODULE_DEPS])
])
test_project_2stage/fdep/fortran_dependencies.mk
0 → 100644
View file @
06b170c4
_f90_verbose
=
$
(
_f90_verbose_
$(V)
)
_f90_verbose_
=
$
(
_f90_verbose_
$(AM_DEFAULT_VERBOSITY)
)
_f90_verbose_0
=
@echo
"
$1
"
;
_f90_targets
=
$(
subst
-,_,
$(
patsubst
%.la,%_la,
$(
patsubst
%.a,%_a,
$(
patsubst
%.so,%_so,
$(PROGRAMS)
$(LTLIBRARIES)
))))
FORTRAN_CPP
?=
cpp
-P
-traditional
-Wall
-Werror
# $1 source files
#
# returns: file without any .F90 .f90 .F .f extension
define
strip_fortran_ext
$(patsubst
%.F90,%,$(patsubst
%.f90,%,$(patsubst
%.F,%,$(patsubst
%.f,%,$1))))
endef
# $1 program
#
# returns:
# '1' if object files for target $1 are prefixed due to 'per-target' flags,
# '' (the empty string) otherwise. See the automake manual for 'per-target'
# compilation
#
define
is_per_target
$(if
$(filter
$(call
strip_fortran_ext,$(firstword
$(call
fortran_sources,$1))),$(patsubst
%.o,%,$(patsubst
%.lo,%,$($1_OBJECTS)))),,1)
endef
# $1 top-level target name (i.e. an entry of _f90_targets)
#
# returns: all target source files matching *.F90 *.f90 *.F *.f
define
fortran_sources
$(filter
%.F90
%.f90
%.F
%.f,$($1_SOURCES))
endef
# $1 top-level target name
#
# returns: the appropriate extension (i.e. 'o' for normal programs, '.lo' for libraries)
define
object_extension
$(if
$(filter
$1,$(PROGRAMS)),o,lo)
endef
# $1 source_file
# $2 stem
# $3 program
define
module_targets
$(eval
_$3_use_mods
+=
$(
dir
$1
)
$2
$(
call
strip_fortran_ext,
$(
notdir
$1
))
.use_mods.
$3
.
$(
call
object_extension,
$3
)
)
$(dir $1)$2$(call strip_fortran_ext,$(notdir $1)).use_mods.$3.$(call object_extension,$3)
:
$1 $(dir $1)$(am__dirstamp)
$(
call
_f90_verbose,F90 USE
[
$3
]
$$
<
)
$(FORTRAN_CPP)
$(DEFS)
$(DEFAULT_INCLUDES)
$(INCLUDES)
$
(
$p_CPPFLAGS
)
$(CPPFLAGS)
-o
/dev/stdout
$$
< |
grep
-i
-o
'^ *use [^ ,!:]*'
|
sort
-u
>
$$
@
$(eval
_$3_def_mods
+=
$(
dir
$1
)
$2
$(
call
strip_fortran_ext,
$(
notdir
$1
))
.def_mods.
$3
.
$(
call
object_extension,
$3
)
)
$(dir $1)$2$(call strip_fortran_ext,$(notdir $1)).def_mods.$3.$(call object_extension,$3)
:
$1 $(dir $1)$(am__dirstamp)
$(
call
_f90_verbose,F90 MOD
[
$3
]
$$
<
)
$(FORTRAN_CPP)
$(DEFS)
$(DEFAULT_INCLUDES)
$(INCLUDES)
$
(
$p_CPPFLAGS
)
$(CPPFLAGS)
-o
/dev/stdout
$$
< |
grep
-i
-o
'^ *module [^!]*'
|
grep
-v
"
\<
procedure
\>
"
>
$$
@
||
true
endef
$(foreach
p,$(_f90_targets),$(if
$(call
is_per_target,$p),$(foreach
s,$(call
fortran_sources,$p),$(eval
$(call
module_targets,$s,$p-,$p))),$(foreach
s,$(call
fortran_sources,$p),$(eval
$(call
module_targets,$s,,$p)))))
_f90_depdir
=
$(abs_builddir)
/.fortran_dependencies
_f90_depfile
=
$(_f90_depdir)
/dependencies.mk
define
is_clean
$(if
$(filter-out
mostlyclean
clean
distclean
maintainer-clean,$(MAKECMDGOALS)),0,1)
endef
define
_fdep_newline
endef
ifneq
($(call is_clean),1)
include
$(_f90_depfile)
endif
$(_f90_depfile)
:
$(top_srcdir)/fdep/fortran_dependencies.pl $(foreach p
,
$(_f90_targets)
,
$(_$p_use_mods) $(_$p_def_mods)) | $(foreach p
,
$(_f90_targets)
,
$(_f90_depdir)/$p)
$(
call
_f90_verbose,F90 DEPS
$@
)
echo
>
$@
;
$(
foreach
p,
$(_f90_targets)
,
$(top_srcdir)
/fdep/fortran_dependencies.pl
$p
$
(
_
$p_use_mods
)
$
(
_
$p_def_mods
)
>>
$@
||
{
rm
$@
;
exit
1
;
}
;
$(_fdep_newline)
)
$(_f90_depdir)
:
@
mkdir
$@
$(foreach p,$(_f90_targets),$(_f90_depdir)/$p)
:
| $(_f90_depdir)
@
mkdir
$@
CLEANFILES
+=
$(
foreach
p,
$(_f90_targets)
,
$
(
_
$p_def_mods
)
$
(
_
$p_use_mods
))
CLEANFILES
+=
$(
foreach
p,
$(_f90_targets)
,
$(_f90_depdir)
/
$p
/
*
)
CLEANFILES
+=
$(_f90_depfile)
test_project_2stage/fdep/fortran_dependencies.pl
0 → 100755
View file @
06b170c4
#!/usr/bin/perl -w
use
strict
;
my
%defs
=
();
my
%uses
=
();
my
$use_re
=
qr/^\s*use\s+(\S+)\s*$/
;
my
$def_re
=
qr/^\s*module\s+(\S+)\s*$/
;
sub
add_use
{
my
(
$file
,
$module
)
=
@_
;
if
(
defined
(
$defs
{
$module
})
&&
$defs
{
$module
}
eq
$file
)
{
# do not add self-dependencies
return
;
}
if
(
!
defined
(
$uses
{
$file
}))
{
$uses
{
$file
}
=
{
$module
=>
1
};
}
else
{
$uses
{
$file
}{
$module
}
=
1
;
}
}
sub
add_def
{
my
(
$file
,
$module
)
=
@_
;
if
(
!
defined
(
$defs
{
$module
}))
{
$defs
{
$module
}
=
$file
;
if
(
defined
(
$uses
{
$file
})
&&
defined
(
$uses
{
$file
}{
$module
}))
{
delete
$uses
{
$file
}{
$module
};
}
}
else
{
die
"
Module
$module
both defined in
$file
,
$defs
{
$module
}
";
}
}
my
$p
=
shift
;
foreach
my
$file
(
@ARGV
)
{
my
$re
;
my
$add
;
my
$object
;
if
(
defined
(
$ENV
{
V
})
&&
$ENV
{
V
}
ge
"
2
")
{
print
STDERR
"
fdep: Considering file
$file
\n
";
}
if
(
$file
=~
/^(.*)\.def_mods.$p(\..*)$/
)
{
$re
=
$def_re
;
$add
=
\
&add_def
;
$object
=
$
1
.
$
2
;
}
elsif
(
$file
=~
/^(.*)\.use_mods.$p(\..*)$/
)
{
$re
=
$use_re
;
$add
=
\
&add_use
;
$object
=
$
1
.
$
2
;
}
else
{
die
"
Unrecognized file extension for '
$file
'
\n
Expected (.*)
\
.def_mods.
$p
(
\
..*) or (.*)
\
.use_mods.
$p
(
\
..*)
";
}
open
(
FILE
,"
<
",
$file
)
||
die
"
\n
Can't open
$file
: $!
\n\n
";
while
(
<
FILE
>
)
{
chomp
;
$_
=
lc
(
$_
);
if
(
$_
=~
$re
)
{
&$add
(
$object
,
$
1
);
}
else
{
die
"
Cannot parse module statement '
$_
', was expecting
$re
";
}
}
close
(
FILE
)
}
foreach
my
$object
(
sort
keys
%uses
)
{
for
my
$m
(
keys
%
{
$uses
{
$object
}})
{
if
(
defined
$defs
{
$m
})
{
print
"
$object
:
",
$defs
{
$m
},
"
\n
";
}
elsif
(
defined
(
$ENV
{
V
})
&&
$ENV
{
V
}
ge
"
1
")
{
print
STDERR
"
fdep: Warning: Cannot find definition of module
$m
in files for program
$p
, might be external
\n
";
}
}
}
test_project_2stage/m4/ax_prog_fc_mpi.m4
0 → 100644
View file @
06b170c4
# ===========================================================================
# http://www.gnu.org/software/autoconf-archive/ax_prog_fc_mpi.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_PROG_FC_MPI([MPI-WANTED-TEST[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]])
#
# DESCRIPTION
#
# This macro tries to find out how to compile Fortran77 programs that use
# MPI (Message Passing Interface), a standard API for parallel process
# communication (see http://www-unix.mcs.anl.gov/mpi/). The macro has to
# be used instead of the standard macro AC_PROG_FC and will replace the
# standard variable FC with the found compiler.
#
# MPI-WANTED-TEST is used to test whether MPI is actually wanted by the
# user. If MPI-WANTED_TEST is omitted or if it succeeds, the macro will
# try to find out how to use MPI, if it fails, the macro will call
# AC_PROG_CC to find a standard C compiler instead.
#
# When MPI is found, ACTION-IF-FOUND will be executed, if MPI is not found
# (or MPI-WANTED-TEST fails) ACTION-IF-NOT-FOUND is executed. If
# ACTION-IF-FOUND is not set, the macro will define HAVE_MPI.
#
# The following example demonstrates usage of the macro:
#
# # If --with-mpi=auto is used, try to find MPI, but use standard FC compiler if it is not found.
# # If --with-mpi=yes is used, try to find MPI and fail if it isn't found.
# # If --with-mpi=no is used, use a standard FC compiler instead.
# AC_ARG_WITH(mpi, [AS_HELP_STRING([--with-mpi],
# [compile with MPI (parallelization) support. If none is found,
# MPI is not used. Default: auto])