Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • jakub.both/dune-common
  • samuel.burbulla/dune-common
  • patrick.jaap/dune-common
  • tobias.leibner/dune-common
  • alexander.mueller/dune-common
  • pipping/dune-common
  • Xinyun.Li/dune-common
  • felix.schindler/dune-common
  • simon.praetorius/dune-common
  • ani.anciaux-sedrakian/dune-common
  • henrik.stolzmann/dune-common
  • matthew.t.collins/dune-common
  • liam.keegan/dune-common
  • felix.mueller/dune-common
  • ansgar/dune-common
  • dominic/dune-common
  • lars.lubkoll/dune-common
  • exadune/dune-common
  • felix.gruber/dune-common
  • govind.sahai/dune-common
  • michael.sghaier/dune-common
  • core/dune-common
  • kilian.weishaupt/dune-common
  • markus.blatt/dune-common
  • joscha.podlesny/dune-common
  • andreas.thune/dune-common
  • lars.bilke/dune-common
  • daniel.kienle/dune-common
  • lukas.renelt/dune-common
  • smuething/dune-common
  • stephan.hilb/dune-common
  • tkoch/dune-common
  • nils.dreier/dune-common
  • rene.milk/dune-common
  • lasse.hinrichsen/dune-common
  • yunus.sevinchan/dune-common
  • lisa_julia.nebel/dune-common
  • claus-justus.heine/dune-common
  • lorenzo.cerrone/dune-common
  • eduardo.bueno/dune-common
40 results
Show changes
Commits on Source (30)
Showing
with 545 additions and 101 deletions
......@@ -764,7 +764,7 @@ def create_cmake_dirs_and_file(dirname, module_name):
'set(@DUNE_MOD_NAME@_LIBRARIES "")\n',
'set(@DUNE_MOD_NAME@_DEPENDS "@DUNE_DEPENDS@")\n',
'set(@DUNE_MOD_NAME@_SUGGESTS "@DUNE_SUGGESTS@")\n',
'set(@DUNE_MOD_NAME@_MODULE_PATH "@DUNE_INSTALL_MODULEDIR@")\n',
'set(@DUNE_MOD_NAME@_MODULE_PATH "\${_prefix}/@DUNE_INSTALL_MODULEDIR@")\n',
'endif(NOT @DUNE_MOD_NAME@_FOUND)\n']
text = ''.join(lines)
output=open(os.path.join(dirs['pkg'], module_name+'-config.cmake.in'), 'w')
......
......@@ -27,13 +27,13 @@ rm -f dune-all.m4
rm -f $name.m4
# add current dir to PATH
PATH=`dirname $0`:$PATH
PATH=`dirname "$0"`:$PATH
# guess libtool prefix
if test -n "$LIBTOOLIZE"; then
LIBTOOL_prefix=`dirname \`dirname $LIBTOOLIZE\``
LIBTOOL_prefix=`dirname "\`dirname "$LIBTOOLIZE"\`"`
PATH=$LIBTOOL_prefix:$PATH
ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I $LIBTOOL_prefix/share/aclocal"
ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I \"$LIBTOOL_prefix/share/aclocal\""
fi
for OPT in "$@"; do
......@@ -61,7 +61,7 @@ for OPT in "$@"; do
-h|--help) usage ; exit 0 ;;
*)
if test -d "$OPT/m4"; then
ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I $OPT/m4"
ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I \"$OPT/m4\""
fi
if test -f "$OPT/dune-common.pc.in" ; then
# if test \( -d "$OPT/am" \) -a ! \( -h "$OPT/am" \) ; then
......@@ -121,14 +121,14 @@ dunecontrol --only=$name m4create
echo "--> aclocal..."
rm -f aclocal.m4
rm -rf autom4te.cache
aclocal$AMVERSION -I . $ACLOCAL_FLAGS
eval aclocal$AMVERSION "-I . $ACLOCAL_FLAGS"
# create a link to the dune-common am directory
if [ "$name" != "dune-common" ]; then
if [ -n "$am_dir" ] && [ -d $am_dir ]; then
if [ -n "$am_dir" ] && [ -d "$am_dir" ]; then
echo "--> linking dune-common/am..."
rm -f am
ln -s $am_dir am
ln -s "$am_dir" am
else
echo
echo "Error: Could not find dune-common/am!"
......
......@@ -58,7 +58,7 @@ canonicalpath(){
echo Usage: canonicalpath path >&2
return 1
fi
dirname `canonicalname "$1"`
dirname "`canonicalname "$1"`"
}
checkdebug () {
......@@ -78,7 +78,7 @@ if test "x$DEBUG" = "xyes"; then
set -v
fi
export PREFIX_DIR="`canonicalpath $0`/.."
export PREFIX_DIR="`canonicalpath "$0"`/.."
# create PKG_CONFIG_PATH for installed dune modules
if test -d "$PREFIX_DIR/lib/pkgconfig"; then
......@@ -91,7 +91,7 @@ fi
###############################################
onbuildfailure() {
echo "Terminating $(basename $0) due to previous errors!" >&2
echo "Terminating $(basename "$0") due to previous errors!" >&2
exit 1
}
......@@ -136,14 +136,14 @@ build_module() {
local runcommand=run_$command
# build the modules
local path=$(eval "echo \$PATH_${module}")
local path="$(eval "echo \$PATH_${module}")"
eval echo "--- calling $command for \$NAME_${module} ---"
trap onbuildfailure EXIT
if ! (
set -e
cd "$path"
export module
eval_control $runcommand $path/$CONTROL
eval_control $runcommand "$path/$CONTROL"
); then eval echo "--- Failed to build \$NAME_${module} ---"; exit 1; fi
trap onfailure EXIT
......@@ -530,22 +530,22 @@ run_default_update () {
}
run_default_autogen () {
if test "x$USE_CMAKE" != "xyes" || test ! -e $(eval "echo \$PATH_$module")/CMakeLists.txt ; then
if test "x$USE_CMAKE" != "xyes" || test ! -e "$(eval "echo \$PATH_$module")/CMakeLists.txt" ; then
PARAMS="$CMD_FLAGS"
local M4_PATH=""
if test -f configure.ac && \
( test -d .svn || test -d .git || test -d CVS || test -f stamp-vc ); then
sort_modules $FOUND_MODULES
for m in $FOUND_MODULES; do
path=$(eval "echo \$PATH_$m")
MODULE_PATHS="$MODULE_PATHS$path "
path="$(eval "echo \$PATH_$m")"
MODULE_PATHS="$MODULE_PATHS\"$path\" "
done
if test -f autogen.sh; then
eval echo "WARNING: \$NAME_$module contains obsolete autogen.sh," \
>&2
echo " dune-autogen is used instead." >&2
fi
eval "$PREFIX_DIR/bin/dune-autogen" "$MODULE_PATHS" "$PARAMS" || exit 1
eval "\"$PREFIX_DIR/bin/dune-autogen\"" "$MODULE_PATHS" "$PARAMS" || exit 1
else
echo Skipping dune-autogen
fi
......@@ -556,7 +556,7 @@ run_default_autogen () {
run_default_configure () {
PARAMS="$CMD_FLAGS"
if test "x$USE_CMAKE" = "xyes" && test -e $(eval "echo \$PATH_$module")/CMakeLists.txt; then
if test "x$USE_CMAKE" = "xyes" && test -e "$(eval "echo \$PATH_$module")/CMakeLists.txt"; then
LOCAL_USE_CMAKE=yes
else
LOCAL_USE_CMAKE=no
......@@ -571,7 +571,7 @@ run_default_configure () {
# get dependencies & suggestions
sort_modules $module
for m in $MODULES; do
path=$(eval "echo \$PATH_$m")
path="$(eval "echo \$PATH_$m")"
if test "x$LOCAL_USE_CMAKE" = "xyes"; then
#
# Translate the configure PARMS to cmake
......@@ -623,8 +623,8 @@ run_default_configure () {
test -d "$BUILDDIR" || mkdir "$BUILDDIR"
SRCDIR="$PWD"
cd "$BUILDDIR"
echo "$PREPARAMS $CMAKE -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_MODULE_PATH=\"$CMAKE_MODULE_PATH\" $CMAKE_PARAMS $CMAKE_FLAGS $SRCDIR"
eval $PREPARAMS $CMAKE "-DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_MODULE_PATH=\"$CMAKE_MODULE_PATH\" $CMAKE_PARAMS $CMAKE_FLAGS $SRCDIR" || exit 1
echo "$PREPARAMS $CMAKE -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_MODULE_PATH=\"$CMAKE_MODULE_PATH\" $CMAKE_PARAMS $CMAKE_FLAGS \"$SRCDIR\""
eval $PREPARAMS $CMAKE "-DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_MODULE_PATH=\"$CMAKE_MODULE_PATH\" $CMAKE_PARAMS $CMAKE_FLAGS \"$SRCDIR\"" || exit 1
else
PARAMS="$PARAMS ACLOCAL_AMFLAGS=\"$ACLOCAL_FLAGS\""
echo ./configure "$PARAMS"
......@@ -686,13 +686,13 @@ run_default_git () {
###
onfailure() {
echo "Execution of $(basename $0) terminated due to errors!" >&2
echo "Execution of $(basename "$0") terminated due to errors!" >&2
exit 1
}
usage () {
(
echo "Usage: $(basename $0) [OPTIONS] COMMANDS [COMMAND-OPTIONS]"
echo "Usage: $(basename "$0") [OPTIONS] COMMANDS [COMMAND-OPTIONS]"
echo ""
echo " Execute COMMANDS for all Dune modules found. All entries in the"
echo " DUNE_CONTROL_PATH variable are scanned recursively for Dune modules."
......@@ -747,7 +747,7 @@ create_module_list() {
fi
export MODULES=
RESUME="`cat $RESUME_FILE`"
RESUME="`cat "$RESUME_FILE"`"
for a in $RESUME ; do
export NAME_`fix_variable_name $a`="$a"
fix_and_assign MODULE "$a"
......@@ -795,6 +795,9 @@ export RESUME_FLAG=no
export REVERSE_FLAG=no
export SKIPFIRST=no
# read environment variable USE_CMAKE
export DUNE_USE_CMAKE="$(echo $USE_CMAKE)"
# parse commandline parameters
while test $# -gt 0; do
# get option
......@@ -902,9 +905,12 @@ while test $# -gt 0; do
--skipfirst)
export SKIPFIRST=yes
;;
--use-cmake)
--use-cmake|--cmake)
export DUNE_USE_CMAKE=yes
;;
--no-cmake)
export DUNE_USE_CMAKE=no
;;
--debug) true ;; # ignore this option, it is handled right at the beginning
--*)
usage
......@@ -940,7 +946,7 @@ case "$command" in
create_module_list
DUNE_CONTROL_PATH=""
for mod in $MODULES; do
path=$(eval echo \$PATH_$mod)
path="$(eval echo \$PATH_$mod)"
name=$(eval echo \$NAME_$mod)
if test -f "$path/dune.module"; then
export DUNE_CONTROL_PATH="$DUNE_CONTROL_PATH:$path/dune.module"
......@@ -982,7 +988,7 @@ case "$command" in
exit 1
fi
mainmod=`echo $SEARCH_MODULES`
eval mainmodpath=\$PATH_$mainmod
eval mainmodpath="\$PATH_$mainmod"
fname="$mainmodpath/dependencies.m4"
name=`eval echo \\${NAME_$mainmod}`
version=`eval echo \\${VERS_$mainmod}`
......@@ -1044,7 +1050,7 @@ case "$command" in
echo " suggests $suggestsall"
AC_MACRO_DIR="."
test ! -d m4 || AC_MACRO_DIR=m4
cat > $fname <<EOF
cat > "$fname" <<EOF
# dependencies.m4 generated by dunecontrol
m4_define([DUNE_AC_INIT],[
......@@ -1067,7 +1073,7 @@ EOF
mod=$(fix_variable_name $name)
MOD=`echo $mod | tr [:lower:] [:upper:]`
if test "x$(eval echo \$HAVE_$mod)" = "x"; then
cat >> $fname <<EOF
cat >> "$fname" <<EOF
### add a conditional check for $name,
# just in case the module is not available at autogen time
AM_CONDITIONAL([HAVE_${MOD}], false)
......@@ -1080,7 +1086,7 @@ EOF
for mod in $SORTEDMODULES_DEPS; do
name=`eval echo \\$NAME_$mod`
MOD=`echo $mod | tr [:lower:] [:upper:]`
cat >> $fname <<EOF
cat >> "$fname" <<EOF
### check dependency $name
# invoke checks required by this module
AC_REQUIRE([${MOD}_CHECKS])
......@@ -1095,7 +1101,7 @@ EOF
for mod in $SORTEDMODULES_SUGS; do
name=`eval echo \\$NAME_$mod`
MOD=`echo $mod | tr [:lower:] [:upper:]`
cat >> $fname <<EOF
cat >> "$fname" <<EOF
### check suggestion $name
# invoke checks required by this module
AC_REQUIRE([${MOD}_CHECKS])
......@@ -1112,12 +1118,12 @@ EOF
mod=$mainmod
name=`eval echo \\$NAME_$mod`
MOD=`echo $mod | tr [:lower:] [:upper:]`
cat >> $fname <<EOF
cat >> "$fname" <<EOF
### invoke checks for $name
AC_REQUIRE([${MOD}_CHECKS])
EOF
fi
cat >> $fname <<EOF
cat >> "$fname" <<EOF
])
EOF
;;
......@@ -1128,6 +1134,17 @@ EOF
usage
;;
*)
set +e
if test "x$USE_CMAKE" = "xno"; then
echo "$PREFIX_DIR" |grep "[ ]" >/dev/null
if test "$?" -eq "0"; then
echo "ERROR: The prefix directory path ($PREFIX_DIR) contains spaces. This is not"
echo " supported when using autotools."
echo " Either rename the path or activate CMake with --use-cmake switch."
exit 1
fi
fi
set -e
if test "$1" = "update"; then export SKIPVERSIONCHECK=yes; fi
check_commands "$@"
create_module_list
......@@ -1152,7 +1169,7 @@ EOF
if test -n "$RESUME_FILE"; then
# remove the current module from the resume file
modules_togo=`cat $RESUME_FILE`
modules_togo=`cat "$RESUME_FILE"`
for mod_togo in $modules_togo ; do
if test "$mod_togo" != "$mod" ; then
echo "$mod_togo"
......
......@@ -10,9 +10,9 @@ DOXYDIR="doc/doxygen/"
find_doxystyle()
{
for i in `dirname $0`/../doc/doxygen/Doxystyle `dirname $0`/../share/dune-common/doc/doxygen/Doxystyle; do
for i in "`dirname "$0"`/../doc/doxygen/Doxystyle" "`dirname "$0"`/../share/dune-common/doc/doxygen/Doxystyle"; do
if [ -f "$i" ]; then
export DOXYSTYLE=$i
export DOXYSTYLE="$i"
return 0
fi
done
......@@ -92,7 +92,7 @@ generate_doxyout()
{
echo "Generating $DOXYOUT from "
echo " global style"
cat $DOXYSTYLE > $DOXYOUT
cat "$DOXYSTYLE" > "$DOXYOUT"
while [ -n "$1" ]; do
for DOXY in Doxylocal Doxyfile.in Doxyfile; do
if [ "$1/$DOXYDIR/$DOXY" -ef "$DOXYOUT" ]; then continue; fi
......
......@@ -51,7 +51,7 @@ canonicalpath(){
echo Usage: canonicalpath path >&2
return 1
fi
dirname $(canonicalname "$1")
dirname "$(canonicalname "$1")"
}
pkg_config_dependencies(){
......@@ -145,10 +145,10 @@ echo
################## FIND AVAILABLE MODULES ##################
. $(canonicalpath $0)/../lib/dunemodules.lib
. "$(canonicalpath $0)/../lib/dunemodules.lib"
# create PKG_CONFIG_PATH for installed dune modules
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$(canonicalpath $0)/../lib/pkgconfig"
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:\"$(canonicalpath $0)/../lib/pkgconfig\""
# search for modules, both installed and src modules
find_modules_in_path
......@@ -944,7 +944,7 @@ set(@DUNE_MOD_NAME@_CXX_FLAGS_DEBUG "@CMAKE_CXX_FLAGS_DEBUG@")
set(@DUNE_MOD_NAME@_CXX_FLAGS_MINSIZEREL "@CMAKE_CXX_FLAGS_MINSIZEREL@")
set(@DUNE_MOD_NAME@_CXX_FLAGS_RELEASE "@CMAKE_CXX_FLAGS_RELEASE@")
set(@DUNE_MOD_NAME@_CXX_FLAGS_RELWITHDEBINFO "@CMAKE_CXX_FLAGS_RELWITHDEBINFO@")
set(@DUNE_MOD_NAME@_MODULE_PATH "@DUNE_INSTALL_MODULEDIR@")
set(@DUNE_MOD_NAME@_MODULE_PATH "\${_prefix}/@DUNE_INSTALL_MODULEDIR@")
set(@DUNE_MOD_NAME@_LIBRARIES "") # list libraries
set(@DUNE_MOD_NAME@_DEPENDS "@DUNE_DEPENDS@")
set(@DUNE_MOD_NAME@_SUGGESTS "@DUNE_SUGGESTS@")
......
......@@ -34,15 +34,42 @@ if(MPI_CXX_FOUND)
set(MPI_DUNE_LIBRARIES ${CMAKE_THREAD_LIBS_INIT} ${MPI_C_LIBRARIES} CACHE STRING
"Libraries used by DUNE when linking MPI programs")
set_property(GLOBAL APPEND PROPERTY ALL_PKG_FLAGS "-DENABLE_MPI=1 -DMPICH_SKIP_MPICXX -DMPIPP_H")
foreach(dir ${MPI_DUNE_INCLUDE_PATH})
set_property(GLOBAL APPEND PROPERTY ALL_PKG_FLAGS "-I${dir}")
endforeach()
# Check whether the MPI-2 standard is supported
include(CMakePushCheckState)
include(CheckFunctionExists)
include(CheckCXXSourceCompiles)
cmake_push_check_state()
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES};${MPI_DUNE_LIBRARIES})
set(CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} "-DENABLE_MPI=1 -DMPICH_SKIP_MPICXX -DMPIPP_H")
set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES};${MPI_DUNE_INCLUDE_PATH})
check_function_exists(MPI_Finalized MPI_2)
# proper version check
check_cxx_source_compiles("
#include <mpi.h>
#if !((MPI_VERSION > 2) || (MPI_VERSION == 2 && MPI_SUBVERSION >= 1))
fail with a horribe compilation error due to old MPI version
#endif
int main(int argc, char** argv)
{
MPI_Init(&argc,&argv);
MPI_Finalize();
}
" MPI_VERSION_SUPPORTED)
cmake_pop_check_state()
# TODO: Turn into an error after 2.3 release
if(NOT MPI_VERSION_SUPPORTED)
MESSAGE(WARNING "Support for your MPI implementation is DEPRECATED and will be removed after the next release. Please upgrade to an MPI-2.1 compliant version.")
endif()
endif(MPI_CXX_FOUND)
# adds MPI flags to the targets
......
......@@ -23,7 +23,7 @@ include(CMakePushCheckState)
cmake_push_check_state()
set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${GMP_INCLUDE_DIR})
include(CheckIncludeFileCXX)
check_include_file_cxx("gmpxx.h" GMP_FOUND)
check_include_file_cxx("gmpxx.h" GMP_HEADER_WORKS)
# look for library gmp, only at positions given by the user
find_library(GMP_LIB gmp
......@@ -44,10 +44,9 @@ find_library(GMPXX_LIB gmpxx
find_library(GMPXX_LIB gmpxx)
# check if library works
set(GMP_FOUND "GMP_FOUND-NOTFOUND")
if(GMP_LIB AND GMPXX_LIB)
include(CheckSymbolExists)
check_symbol_exists(__gmpz_abs ${GMP_LIB} GMP_FOUND)
check_symbol_exists(__gmpz_abs ${GMP_LIB} GMPXX_LIB_WORKS)
endif(GMP_LIB AND GMPXX_LIB)
cmake_pop_check_state()
......@@ -56,7 +55,7 @@ include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(
"GMP"
DEFAULT_MSG
GMP_INCLUDE_DIR GMP_LIB GMPXX_LIB GMP_FOUND
GMP_INCLUDE_DIR GMP_LIB GMPXX_LIB GMP_HEADER_WORKS GMPXX_LIB_WORKS
)
mark_as_advanced(GMP_LIB GMPXX_LIB GMP_INCLUDE_DIR)
......@@ -81,7 +80,7 @@ else(GMP_FOUND)
endif(GMP_FOUND)
# set HAVE_GMP for config.h
set(HAVE_GMP GMP_FOUND)
set(HAVE_GMP ${GMP_FOUND})
#add all GMP related flags to ALL_PKG_FLAGS, this must happen regardless of a target using add_dune_gmp_flags
if(HAVE_GMP)
......
......@@ -20,5 +20,5 @@ set(@DUNE_MOD_NAME@_SCRIPT_SOURCE_DIR "${_prefix}/share/cmake/scripts")
set(DOXYSTYLE_FILE "${_prefix}/share/doc/dune-common/doxygen/Doxystyle")
set(@DUNE_MOD_NAME@_DEPENDS "@DUNE_DEPENDS@")
set(@DUNE_MOD_NAME@_SUGGESTS "@DUNE_SUGGESTS@")
set(@DUNE_MOD_NAME@_MODULE_PATH "@DUNE_INSTALL_MODULEDIR@")
endif(NOT @DUNE_MOD_NAME@_FOUND)
\ No newline at end of file
set(@DUNE_MOD_NAME@_MODULE_PATH "${_prefix}/@DUNE_INSTALL_MODULEDIR@")
endif(NOT @DUNE_MOD_NAME@_FOUND)
......@@ -4,6 +4,5 @@ MACRO(get_directory_test_target _target _dir)
ENDMACRO(get_directory_test_target _target _dir)
get_directory_test_target(_build_test_target "@CMAKE_CURRENT_BINARY_DIR@")
message("binary_dir=@CMAKE_CURRENT_BINARY_DIR@")
execute_process(COMMAND @CMAKE_COMMAND@ --build @CMAKE_BINARY_DIR@
--target ${_build_test_target})
......@@ -17,6 +17,8 @@ DOCFILES_EXTRA = example.opts
EXTRA_DIST = CMakeLists.txt $(PAGES) example.opts
dist_man_MANS = dunecontrol.1
# include rules for wml -> html transformation
include $(top_srcdir)/am/webstuff
......
.\" First parameter, NAME, should be all caps
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
.\" other parameters are allowed: see man(7), man(1)
.TH DUNECONTROL 1 "November 26, 2013"
.\" Please adjust this date whenever revising the manpage.
.\"
.\" Some roff macros, for reference:
.\" .nh disable hyphenation
.\" .hy enable hyphenation
.\" .ad l left justify
.\" .ad b justify to both left and right margins
.\" .nf disable filling
.\" .fi enable filling
.\" .br insert line break
.\" .sp <n> insert n+1 empty lines
.\" for manpage-specific macros, see man(7)
.SH NAME
dunecontrol \- Control program for the Dune build system
.SH SYNOPSIS
.B dunecontrol
[\fIOPTIONS\fP] \fICOMMANDS\fP [\fICOMMAND-OPTIONS\fP]
.SH DESCRIPTION
.B dunecontrol
is the control program for the build system of the Dune libraries.
The Dune libraries form a set of modules. Each can be built independently using either
the AutoTools or cmake. Additionally, though, there are dependencies between modules,
which are expected to form a directed acyclic graph. These dependencies are set in a
file called
.B dune.module
contained in the main directory of a Dune module.
The
.B dunecontrol
program helps to build sets of inter-dependent modules. It allows to construct
the entire dependency graph and obtain information about it. Then it allows to give various build-related
commands for all modules. These are executed in the order mandated by the dependency graph.
.SH COMMANDS
Colon-separated list of commands. Available commands are:
.HP
.B help
.IP
Shows a help message and exits
.HP
.B print
.IP
Print the list of modules sorted after their dependencies
.HP
.B info
.IP
Same as `print', but including whether it is a dependency or suggestion
.HP
.B printdeps
.IP
Print recursive dependencies of a module
.HP
.B vcsetup
.IP
Setup version control repository (Git etc.) or working copy (SVN)
.HP
.B update
.IP
Update all modules from the repository
.HP
.B autogen
.IP
Run the autogen.sh script for each module. Does nothing, if CMake is activated
.HP
.B configure
.IP
Run configure or cmake for each module
.HP
.B make
.IP
Run make for each module
.HP
.B all
.IP
Run the 'autogen', 'configure' and 'make' commands for each module
.HP
.B exec
.IP
Execute an arbitrary command in each module source directory
.HP
.B bexec
.IP
Execute an arbitrary command in each module build directory
.HP
.B status
.IP
Show version control status for all modules
.HP
.B svn
.IP
Run svn command for each svn managed module
.HP
.B git
.IP
Run git command for each git managed module
.HP
.B export
.IP
Run eval `dunecontrol export` to save the list of dune.module files to the DUNE_CONTROL_PATH variable
.SH OPTIONS
.HP
\fB\-h\fP, \fB\-\-help\fP
.IP
Show this help
.HP
\fB--debug\fP
.IP
Run with debuggin output enabled
.HP
\fB--use-cmake\fP
.IP
Use cmake instead of the AutoTools for building individual modules
.HP
\fB--module=\fP\fImod\fP
.IP
Only apply the actions on module
.I mod
and all modules it depends on
.HP
\fB--only=\fP\fImod\fP
.IP
Only apply the actions on module
.I mod
, but not the modules it depends on
.HP
\fB--current\fP
.IP
Only apply the actions on the current module, the one whose source tree we are in
.HP
\fB--resume\fP
.IP
Resume a previous run (only consider the modules not built successfully on the previous run)
.HP
\fB--skipfirst\fP
.IP
Skip the first module (use with --resume)
.HP
\fB--opts=\fP\fIfile\fP
.IP
Load default options from \fIfile\fP (see dune-common/doc/example.opts)
.HP
\fB--builddir=\fP\fIname\fP
.IP
Make out-of-source builds in a subdir \fIname\fP. This directory is created inside each module.
.HP
\fB--[COMMAND]-opts=\fP\fIopts\fP
.IP
Set options for COMMAND (this is mainly useful for the 'all' COMMAND)
.SH ENVIRONMENT VARIABLES
.B dunecontrol
looks for Dune modules in all directories given in the
.B DUNE_CONTROL_PATH
variable, and additionally recursively in all subdirectories of those directories.
The default for the case that DUNE_CONTROL_PATH is empty is the current directory,
plus a system-wide installation in /usr.
.SH AUTHOR
Dune was written by the Dune team (www.dune-project.org/people).
.PP
This manual page was written by Oliver Sander.
.SH COPYRIGHT
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved. This file is offered as-is,
without any warranty.
Module: dune-common
Version: 2.3-svn
Version: 2.3
Maintainer: dune-devel@dune-project.org
Whitespace-Hook: Yes
......@@ -58,6 +58,7 @@ install(FILES
genericiterator.hh
gmpfield.hh
hash.hh
identitymatrix.hh
indent.hh
interfaces.hh
ios_state.hh
......
......@@ -54,6 +54,7 @@ commoninclude_HEADERS = \
genericiterator.hh \
gmpfield.hh \
hash.hh \
identitymatrix.hh \
indent.hh \
interfaces.hh \
ios_state.hh \
......
......@@ -61,43 +61,118 @@ namespace Dune
representing a field and a compile-time given number of rows and columns.
*/
/**
\brief you have to specialize this function for any type T that should be assignable to a DenseMatrix
\tparam M Type of the matrix implementation class implementing the dense matrix
\brief you have to specialize this structure for any type that should be assignable to a DenseMatrix
\tparam DenseMatrix Some type implementing the dense matrix interface
\tparam RHS Right hand side type
*/
template<typename M, typename T>
void istl_assign_to_fmatrix(DenseMatrix<M>& f, const T& t)
template< class DenseMatrix, class RHS >
struct DenseMatrixAssigner;
template< class DenseMatrix, class K, int N, int M >
void istl_assign_to_fmatrix ( DenseMatrix &denseMatrix, const K (&values)[ M ][ N ] )
{
DUNE_THROW(NotImplemented, "You need to specialise the method istl_assign_to_fmatrix(DenseMatrix<M>& f, const T& t) "
<< "(with M being " << className<M>() << ") "
<< "for T == " << className<T>() << "!");
for( int i = 0; i < N; ++i )
for( int j = 0; j < M; ++j )
denseMatrix[ i ][ j ] = values[ i ][ j ];
}
#ifndef DOXYGEN
namespace
{
template<bool b>
struct DenseMatrixAssigner
template< class DenseMatrix, class RHS,
bool primitive = Conversion< RHS, typename DenseMatrix::field_type >::exists >
class DenseMatrixAssignerImplementation;
template< class DenseMatrix, class RHS >
class DenseMatrixAssignerImplementation< DenseMatrix, RHS, true >
{
template<typename M, typename T>
static void assign(DenseMatrix<M>& fm, const T& t)
public:
static void apply ( DenseMatrix &denseMatrix, const RHS &rhs )
{
istl_assign_to_fmatrix(fm, t);
}
typedef typename DenseMatrix::field_type field_type;
};
const field_type value = static_cast< field_type >( rhs );
const std::size_t size = denseMatrix.size();
for( std::size_t i = 0; i < size; ++i )
denseMatrix[ i ] = value;
}
};
template<>
struct DenseMatrixAssigner<true>
template< class DenseMatrix, class RHS >
class DenseMatrixAssignerImplementation< DenseMatrix, RHS, false >
{
template<typename M, typename T>
static void assign(DenseMatrix<M>& fm, const T& t)
template< class M, class T>
struct have_istl_assign_to_fmatrix
{
struct yes { char dummy[ 1 ]; };
struct no { char dummy[ 2 ]; };
template< class C>
static C &get_ref();
template< class C>
static yes test( decltype( istl_assign_to_fmatrix( get_ref< M >(), get_ref< C >() ) ) * );
template< class C >
static no test(...);
public:
static const bool v = sizeof( test< const T >( 0 ) ) == sizeof( yes );
};
template< class M, class T, bool = have_istl_assign_to_fmatrix< M, T >::v >
struct DefaultImplementation;
// forward to istl_assign_to_fmatrix()
template< class M, class T >
struct DefaultImplementation< M, T, true >
{
fm = static_cast<const typename DenseMatVecTraits<M>::value_type>(t);
static void apply ( M &m, const T &t )
{
istl_assign_to_fmatrix( m, t );
}
};
// static_cast
template< class M, class T >
struct DefaultImplementation< M, T, false >
{
static void apply ( M &m, const T &t )
{
dune_static_assert( (Conversion< const T, const M >::exists), "No template specialization of DenseMatrixAssigner found" );
m = static_cast< const M & >( t );
}
};
public:
static void apply ( DenseMatrix &denseMatrix, const RHS &rhs )
{
DefaultImplementation< DenseMatrix, RHS >::apply( denseMatrix, rhs );
}
};
}
template< class DenseMatrix, class RHS >
struct DenseMatrixAssigner
{
static void apply ( DenseMatrix &denseMatrix, const RHS &rhs )
{
DenseMatrixAssignerImplementation< DenseMatrix, RHS >::apply( denseMatrix, rhs );
}
};
#endif // #ifndef DOXYGEN
/** @brief Error thrown if operations of a FieldMatrix fail. */
class FMatrixError : public Exception {};
......@@ -243,20 +318,15 @@ namespace Dune
return ConstIterator(*this,-1);
}
//===== assignment from scalar
DenseMatrix& operator= (const field_type& f)
{
for (size_type i=0; i<rows(); i++)
(*this)[i] = f;
return *this;
}
//===== assignment
template<typename T>
DenseMatrix& operator= (const T& t)
template< class RHS >
DenseMatrix &operator= ( const RHS &rhs )
{
DenseMatrixAssigner<Conversion<T,field_type>::exists>::assign(*this, t);
DenseMatrixAssigner< MAT, RHS >::apply( asImp(), rhs );
return *this;
}
//===== vector space arithmetic
//! vector space addition
......
......@@ -7,17 +7,19 @@
\brief This file implements a quadratic diagonal matrix of fixed size.
*/
#include <cassert>
#include <cmath>
#include <cstddef>
#include <complex>
#include <cstddef>
#include <iostream>
#include <memory>
#include <dune/common/densematrix.hh>
#include <dune/common/exceptions.hh>
#include <dune/common/fmatrix.hh>
#include <dune/common/fvector.hh>
#include <dune/common/typetraits.hh>
#include <dune/common/genericiterator.hh>
#include <dune/common/typetraits.hh>
namespace Dune {
......@@ -562,13 +564,6 @@ namespace Dune {
(*this)[0][0] = scalar;
}
//! Constructor initializing the whole matrix with a scalar from convertible type
template<typename T>
DiagonalMatrix(const T& t)
{
DenseMatrixAssigner<Conversion<T,K>::exists>::assign(*this, t);
}
//! Get const reference to diagonal entry
const K& diagonal(size_type) const
{
......@@ -1071,6 +1066,8 @@ namespace Dune {
template<class M, class K, int n>
void istl_assign_to_fmatrix(DenseMatrix<M>& fm, const DiagonalMatrix<K,n>& s)
{
assert( fm.rows() == n );
assert( fm.cols() == n );
fm = K();
for(int i=0; i<n; ++i)
fm[i][i] = s.diagonal()[i];
......
......@@ -90,15 +90,10 @@ namespace Dune
/** \brief Constructor initializing the whole matrix with a scalar
*/
explicit FieldMatrix (const K& k)
template< class Other >
FieldMatrix ( const Other &other )
{
for (size_type i=0; i<rows; i++) _data[i] = k;
}
template<typename T>
explicit FieldMatrix (const T& t)
{
DenseMatrixAssigner<Conversion<T,K>::exists>::assign(*this, t);
DenseMatrixAssigner< FieldMatrix< K, ROWS, COLS >, Other >::apply( *this, other );
}
//===== assignment
......@@ -234,10 +229,11 @@ namespace Dune
{
_data[0] = k;
}
template<typename T>
FieldMatrix(const T& t)
template< class Other >
FieldMatrix ( const Other &other )
{
DenseMatrixAssigner<Conversion<T,K>::exists>::assign(*this, t);
DenseMatrixAssigner< FieldMatrix< K, 1, 1 >, Other >::apply( *this, other );
}
//===== solve
......
#ifndef DUNE_COMMON_IDENTITYMATRIX_HH
#define DUNE_COMMON_IDENTITYMATRIX_HH
#include <dune/common/fmatrix.hh>
#include <dune/common/ftraits.hh>
#include <dune/common/math.hh>
#include <dune/common/std/constexpr.hh>
/**
* \file
* \ingroup DenseMatVec
* \brief Implementation of an identity matrix that does not store
* any data.
* \author Christoph Gersbacher
*/
namespace Dune
{
// IdentityMatrix
// --------------
/** \class IdentityMatrix
*
* \ingroup DenseMatVec
*
* \brief Read-only identity matrix.
*
* Implementation of an identity matrix that does not store any data.
*
* \tparam K field type
* \tparam N dimension
*/
template< class K, int N >
struct IdentityMatrix
{
/** \brief field type */
typedef K field_type;
/** \brief size type */
typedef std::size_t size_type;
/** \brief return number of rows */
DUNE_CONSTEXPR size_type rows () const { return N; }
/** \brief return number of columns */
DUNE_CONSTEXPR size_type cols () const { return N; }
/** \copydoc Dune::DenseMatrix::mv */
template< class X, class Y >
void mv ( const X &x, Y &y ) const
{
y = x;
}
/** \copydoc Dune::DenseMatrix::mtv */
template< class X, class Y >
void mtv ( const X &x, Y &y ) const
{
y = x;
}
/** \copydoc Dune::DenseMatrix::umv */
template< class X, class Y >
void umv ( const X &x, Y &y ) const
{
y += x;
}
/** \copydoc Dune::DenseMatrix::umtv */
template< class X, class Y >
void umtv ( const X &x, Y &y ) const
{
y += x;
}
/** \copydoc Dune::DenseMatrix::umhv */
template< class X, class Y >
void umhv ( const X &x, Y &y ) const
{
y += x;
}
/** \copydoc Dune::DenseMatrix::mmv */
template< class X, class Y >
void mmv ( const X &x, Y &y ) const
{
y -= x;
}
/** \copydoc Dune::DenseMatrix::mmtv */
template< class X, class Y >
void mmtv ( const X &x, Y &y ) const
{
y -= x;
}
/** \copydoc Dune::DenseMatrix::mmhv */
template< class X, class Y >
void mmhv ( const X &x, Y &y ) const
{
y -= x;
}
/** \copydoc Dune::DenseMatrix::usmv */
template< class X, class Y >
void usmv ( const field_type &alpha, const X &x, Y &y ) const
{
y.axpy( alpha, x );
}
/** \copydoc Dune::DenseMatrix::usmtv */
template< class X, class Y >
void usmtv ( const field_type &alpha, const X &x, Y &y ) const
{
y.axpy( alpha, x );
}
/** \copydoc Dune::DenseMatrix::usmhv */
template< class X, class Y >
void usmhv ( const field_type &alpha, const X &x, Y &y ) const
{
y.axpy( alpha, x );
}
/** \copydoc Dune::DenseMatrix::frobenius_norm */
typename FieldTraits< field_type >::real_type frobenius_norm () const
{
return std::sqrt( frobenius_norm2() );
}
/** \copydoc Dune::DenseMatrix::frobenius_norm2 */
typename FieldTraits< field_type >::real_type frobenius_norm2 () const
{
return FieldTraits< field_type >::real_type( N );
}
/** \copydoc Dune::DenseMatrix::infinity_norm */
typename FieldTraits< field_type >::real_type infinity_norm () const
{
return FieldTraits< field_type >::real_type( 1 );
}
/** \copydoc Dune::DenseMatrix::infinity_norm_real */
typename FieldTraits< field_type >::real_type infinity_norm_real () const
{
return FieldTraits< field_type >::real_type( 1 );
}
/** \brief cast to FieldMatrix */
operator FieldMatrix< field_type, N, N > () const
{
FieldMatrix< field_type, N, N > fieldMatrix( 0 );
for( int i = 0; i < N; ++i )
fieldMatrix[ i ][ i ] = field_type( 1 );
return fieldMatrix;
}
};
} // namespace Dune
#endif // #ifndef DUNE_COMMON_IDENTITYMATRIX_HH
......@@ -15,5 +15,6 @@ install(FILES
plocalindex.hh
remoteindices.hh
selection.hh
variablesizecommunicator.hh
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dune/common/parallel)
......@@ -16,7 +16,8 @@ parallelinclude_HEADERS = \
mpitraits.hh \
plocalindex.hh \
remoteindices.hh \
selection.hh
selection.hh \
variablesizecommunicator.hh
include $(top_srcdir)/am/global-rules
......