Commit 70181f84 authored by Christoph Gersbacher's avatar Christoph Gersbacher

Initial import of new Dune project

parents
cmake_minimum_required(VERSION 2.8.6)
project(dune-prismgrid CXX)
if(NOT (dune-common_DIR OR dune-common_ROOT OR
"${CMAKE_PREFIX_PATH}" MATCHES ".*dune-common.*"))
string(REPLACE ${CMAKE_PROJECT_NAME} dune-common dune-common_DIR
${PROJECT_BINARY_DIR})
endif()
#find dune-common and set the module path
find_package(dune-common REQUIRED)
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/modules"
${dune-common_MODULE_PATH})
#include the dune macros
include(DuneMacros)
# start a dune project with information from dune.module
dune_project()
add_subdirectory("src")
add_subdirectory("m4")
add_subdirectory("dune")
add_subdirectory("doc")
add_subdirectory("cmake/modules")
# finalize the dune project, e.g. generating config.h etc.
finalize_dune_project(GENERATE_CONFIG_H_CMAKE)
# $Id$
# we need the module file to be able to build via dunecontrol
EXTRA_DIST = dune.module \
CMakeLists.txt \
config.h.cmake
SUBDIRS = src m4 dune doc cmake
if BUILD_DOCS
# TODO: set up documentation tree automatically
#SUBDIRS += doc
endif
# don't follow the full GNU-standard
# we need automake 1.9 or newer
AUTOMAKE_OPTIONS = foreign 1.9
# pass most important options when "make distcheck" is used
DISTCHECK_CONFIGURE_FLAGS = --with-dune-grid=$(DUNE_GRID_ROOT) CXX="$(CXX)" CC="$(CC)"
include $(top_srcdir)/am/top-rules
include $(top_srcdir)/am/global-rules
# Generate package configuration files for finding
# installed modules with CMake
include $(top_srcdir)/am/cmake-pkg-config
Preparing the Sources
=========================
Additional to the software mentioned in README you'll need the
following programs installed on your system:
automake >= 1.9
autoconf >= 2.62
libtool
Getting started
---------------
If these preliminaries are met, you should run
dunecontrol all
which will find all installed dune modules as well as all dune modules
(not installed) which sources reside in a subdirectory of the current
directory. Note that if dune is not installed properly you will either
have to add the directory where the dunecontrol script resides (probably
./dune-common/bin) to your path or specify the relative path of the script.
On your project and all uninstalled DUNE source modules found the script
will then calls the GNU autoconf/automake to create a ./configure-script
and the Makefiles. Afterwards that configure script will be called and the
modules will be build using make all
Most probably you'll have to provide additional information to dunecontrol
(e. g. compilers, configure options) and/or make options.
The most convenient way is to use options files in this case. The files
defining three variables:
AUTOGEN_FLAGS flags passed to autogen
CONFIGURE_FLAGS flags passed to configure
MAKE_FLAGS flags passed to make
An example options file might look like this:
#use this options to autogen, configure and make if no other options are given
AUTOGEN_FLAGS="--ac=2.50 --ac=1.8" #Forces automake 2,50 and autoconf 1.8
CONFIGURE_FLAGS="CXX=g++-3.4 --prefix=/install/path" #force g++-3.4 as compiler
MAKE_FLAGS=install #Per default run make install instead of simply make
If you save this information into example.opts you can path the opts file to
dunecontrol via the --opts option, e. g.
dunecontrol --opts=example.opts all
To get a full list of available configure flags just run
dunecontrol configure --help
after running at least
dunecontrol autogen
More info
---------
See
dunecontrol --help
for further options.
The full build-system is described in the dune-common/doc/buildsystem (SVN version) or under share/doc/dune-common/buildsystem if you installed DUNE!
$Id$
SUBDIRS = modules
include $(top_srcdir)/am/global-rules
set(modules "DunePrismgridMacros.cmake")
install(FILES ${modules} DESTINATION ${DUNE_INSTALL_MODULEDIR})
# File for module specific CMake tests.
MODULES = DunePrismgridMacros.cmake
modulesdir = $(datadir)/dune/cmake/modules
dist_modules_DATA = ${MODULES}
include $(top_srcdir)/am/global-rules
EXTRA_DIST = CMakeLists.txt
/* begin dune-prismgrid
put the definitions for config.h specific to
your project here. Everything above will be
overwritten
*/
/* begin private */
/* Name of package */
#define PACKAGE "@DUNE_MOD_NAME"
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "@DUNE_MAINTAINER@"
/* Define to the full name of this package. */
#define PACKAGE_NAME "@DUNE_MOD_NAME@"
/* Define to the full name and version of this package. */
#define PACKAGE_STRING "@DUNE_MOD_NAME@ @DUNE_MOD_VERSION@"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "@DUNE_MOD_NAME@"
/* Define to the home page for this package. */
#define PACKAGE_URL "@DUNE_MOD_URL@"
/* Define to the version of this package. */
#define PACKAGE_VERSION "@DUNE_MOD_VERSION@"
/* end private */
/* Define to the version of dune-prismgrid */
#define DUNE_PRISMGRID_VERSION "@DUNE_PRISMGRID_VERSION@"
/* Define to the major version of dune-prismgrid */
#define DUNE_PRISMGRID_VERSION_MAJOR @DUNE_PRISMGRID_VERSION_MAJOR@
/* Define to the minor version of dune-prismgrid */
#define DUNE_PRISMGRID_VERSION_MINOR @DUNE_PRISMGRID_VERSION_MINOR@
/* Define to the revision of dune-prismgrid */
#define DUNE_PRISMGRID_VERSION_REVISION @DUNE_PRISMGRID_VERSION_REVISION@
/* end dune-prismgrid
Everything below here will be overwritten
*/
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.62])
DUNE_AC_INIT # gets module version from dune.module file
AC_CONFIG_SRCDIR([src/dune_prismgrid.cc])
AC_CONFIG_HEADERS([config.h])
# we need no more than the standard DE-stuff
# this module depends on dune-grid
# this implies checking for [dune-common], [dune-geometry], [dune-grid]
DUNE_CHECK_ALL
# implicitly set the Dune-flags everywhere
AC_SUBST(AM_CPPFLAGS, $DUNE_CPPFLAGS)
AC_SUBST(AM_LDFLAGS, $DUNE_LDFLAGS)
LIBS="$DUNE_LIBS"
AC_CONFIG_FILES([
Makefile
src/Makefile
cmake/Makefile
cmake/modules/Makefile
doc/Makefile
doc/doxygen/Makefile
doc/doxygen/Doxyfile
dune/Makefile
dune/prismgrid/Makefile
m4/Makefile
dune-prismgrid.pc
])
AC_OUTPUT
# finally print the summary information
DUNE_SUMMARY_ALL
add_subdirectory("doxygen")
SUBDIRS = doxygen
CURDIR = doc
BASEDIR = ..
# add list of html files to generate from wml
PAGES=
docdir=$(datadir)/doc/dune-prismgrid
EXTRA_DIST = CMakeLists.txt
include $(top_srcdir)/am/webstuff
include $(top_srcdir)/am/global-rules
# shortcut for creating the Doxyfile.in and Doxyfile
add_doxygen_target()
# This file contains local changes to the doxygen configuration
# please us '+=' to add file/directories to the lists
# The INPUT tag can be used to specify the files and/or directories that contain
# documented source files. You may enter file names like "myfile.cpp" or
# directories like "/usr/src/myproject". Separate the files or directories
# with spaces.
INPUT += @top_srcdir@/dune/
# see e.g. dune-grid for the examples of mainpage and modules
# INPUT += @srcdir@/mainpage # @srcdir@/modules
# The EXCLUDE tag can be used to specify files and/or directories that should
# excluded from the INPUT source files. This way you can easily exclude a
# subdirectory from a directory tree whose root is specified with the INPUT tag.
# EXCLUDE += @top_srcdir@/dune/prismgrid/test
# The EXAMPLE_PATH tag can be used to specify one or more files or
# directories that contain example code fragments that are included (see
# the \include command).
# EXAMPLE_PATH += @top_srcdir@/src
# The IMAGE_PATH tag can be used to specify one or more files or
# directories that contain image that are included in the documentation (see
# the \image command).
# IMAGE_PATH += @top_srcdir@/dune/prismgrid/pics
BASEDIR=../..
CURDIR=doc/doxygen
EXTRA_DIST = CMakeLists.txt
include $(top_srcdir)/am/doxygen
include $(top_srcdir)/am/global-rules
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
CXX=@CXX@
CC=@CC@
DEPENDENCIES=@REQUIRES@
Name: @PACKAGE_NAME@
Version: @VERSION@
Description: dune-prismgrid module
URL: http://dune-project.org/
Requires: dune-grid
Libs: -L${libdir}
Cflags: -I${includedir}
################################
# Dune module information file #
################################
#Name of the module
Module: dune-prismgrid
Version: 2.3
Maintainer: christoph.gersbacher@mathematik.uni-freiburg.de
#depending on
Depends: dune-grid
add_subdirectory(prismgrid)
SUBDIRS = prismgrid
EXTRA_DIST = CMakeLists.txt
include $(top_srcdir)/am/global-rules
#install headers
install(FILES prismgrid.hh DESTINATION include/dune/prismgrid)
prismgridincludedir = $(includedir)/dune/prismgrid
prismgridinclude_HEADERS = prismgrid.hh
EXTRA_DIST = CMakeLists.txt
include $(top_srcdir)/am/global-rules
#ifndef DUNE_PRISMGRID.hh
#define DUNE_PRISMGRID.hh
// add your classes here
#endif // DUNE_PRISMGRID.hh
install(PROGRAMS dune-prismgrid.m4 DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/dune/aclocal)
M4FILES = dune-prismgrid.m4
aclocaldir = $(datadir)/dune/aclocal
aclocal_DATA = $(M4FILES)
EXTRA_DIST = $(M4FILES) CMakeLists.txt
include $(top_srcdir)/am/global-rules
dnl -*- autoconf -*-
# Macros needed to find dune-prismgrid and dependent libraries. They are called by
# the macros in ${top_src_dir}/dependencies.m4, which is generated by
# "dunecontrol autogen"
# Additional checks needed to build dune-prismgrid
# This macro should be invoked by every module which depends on dune-prismgrid, as
# well as by dune-prismgrid itself
AC_DEFUN([DUNE_PRISMGRID_CHECKS])
# Additional checks needed to find dune-prismgrid
# This macro should be invoked by every module which depends on dune-prismgrid, but
# not by dune-prismgrid itself
AC_DEFUN([DUNE_PRISMGRID_CHECK_MODULE],
[
DUNE_CHECK_MODULES([dune-prismgrid],[prismgrid/prismgrid.hh])
])
add_executable("dune_prismgrid" dune_prismgrid.cc)
target_link_dune_default_libraries("dune_prismgrid")
SUBDIRS =
noinst_PROGRAMS = dune_prismgrid
dune_prismgrid_SOURCES = dune_prismgrid.cc
dune_prismgrid_CPPFLAGS = $(AM_CPPFLAGS) \
$(DUNEMPICPPFLAGS) \
$(UG_CPPFLAGS) \
$(AMIRAMESH_CPPFLAGS) \
$(ALBERTA_CPPFLAGS) \
$(ALUGRID_CPPFLAGS)
# The libraries have to be given in reverse order (most basic libraries
# last). Also, due to some misunderstanding, a lot of libraries include the
# -L option in LDFLAGS instead of LIBS -- so we have to include the LDFLAGS
# here as well.
dune_prismgrid_LDADD = \
$(DUNE_LDFLAGS) $(DUNE_LIBS) \
$(ALUGRID_LDFLAGS) $(ALUGRID_LIBS) \
$(ALBERTA_LDFLAGS) $(ALBERTA_LIBS) \
$(AMIRAMESH_LDFLAGS) $(AMIRAMESH_LIBS) \
$(UG_LDFLAGS) $(UG_LIBS) \
$(DUNEMPILIBS) \
$(LDADD)
dune_prismgrid_LDFLAGS = $(AM_LDFLAGS) \
$(DUNEMPILDFLAGS) \
$(UG_LDFLAGS) \
$(AMIRAMESH_LDFLAGS) \
$(ALBERTA_LDFLAGS) \
$(ALUGRID_LDFLAGS) \
$(DUNE_LDFLAGS)
# don't follow the full GNU-standard
# we need automake 1.9
AUTOMAKE_OPTIONS = foreign 1.9
# pass most important options when "make distcheck" is used
DISTCHECK_CONFIGURE_FLAGS = --with-dune-grid=$(DUNE_GRID_ROOT) CXX="$(CXX)" CC="$(CC)"
EXTRA_DIST = CMakeLists.txt
include $(top_srcdir)/am/global-rules
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <iostream>
#include <dune/common/parallel/mpihelper.hh> // An initializer of MPI
#include <dune/common/exceptions.hh> // We use exceptions
int main(int argc, char** argv)
{
try{
//Maybe initialize Mpi
Dune::MPIHelper& helper = Dune::MPIHelper::instance(argc, argv);
std::cout << "Hello World! This is dune-prismgrid." << std::endl;
if(Dune::MPIHelper::isFake)
std::cout<< "This is a sequential program." << std::endl;
else
std::cout<<"I am rank "<<helper.rank()<<" of "<<helper.size()
<<" processes!"<<std::endl;
return 0;
}
catch (Dune::Exception &e){
std::cerr << "Dune reported error: " << e << std::endl;
}
catch (...){
std::cerr << "Unknown exception thrown!" << std::endl;
}
}
A stamp file to signify that this directory comes from a version control system, not an unpacked tarball
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