Commit 77526d73 authored by Dion Haefner's avatar Dion Haefner

initial commit

parents
# Prevent build directory from being added to the image
build-cmake/
# Exclude build folder
build-cmake/
# Ignore temporary and auto-generated files #
*~
*.pyc
*.log
*.DS_Store
*/__pycache__/
*./DS_Store
*/.DS_Store?
*/._*
*/.Spotlight-V100
*/.Trashes
*/ehthumbs.db
*/Thumbs.db
*.egg-info/
stages:
- main
build_job:
script:
- export SUDO="sudo DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true"
- bash install.sh
- export PATH=/usr/local/bin:$PATH
- doriecontrol install all
- doriecontrol make doc
- doriecontrol make test
stage: main
cmake_minimum_required(VERSION 2.8.12)
project(dorie 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)
# set some variables
set(CMAKE_DISABLE_FIND_PACKAGE_Python2Interp 1)
# start a dune project with information from dune.module
dune_project()
dune_enable_all_packages()
dune_require_cxx_standard(MODULE "dorie" VERSION 14)
# add subdirectories
add_subdirectory("src")
add_subdirectory("bin")
add_subdirectory("m4")
add_subdirectory("dune")
add_subdirectory("python")
add_subdirectory("doc")
if(dune-testtools_FOUND)
add_subdirectory("testing")
endif()
add_subdirectory("cmake/modules")
# finalize the dune project, e.g. generating config.h etc.
finalize_dune_project(GENERATE_CONFIG_H_CMAKE)
FROM ubuntu:latest
MAINTAINER Dion Häfner
RUN locale-gen en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
RUN apt-get update
RUN apt-get install -y \
git \
gcc-5 \
g++-5 \
gfortran-5 \
python3-dev \
python3-pip \
flex \
bison \
doxygen \
libpng-dev \
libfreetype6-dev \
libxft-dev \
cmake \
libopenmpi-dev \
libsuperlu-dev \
libhdf5-mpi-dev \
libfftw3-dev \
libfftw3-mpi-dev \
libmetis-dev \
libscotchparmetis-dev \
libatlas-base-dev \
autoconf
RUN python3 -m pip install virtualenv
WORKDIR /opt/dorie
RUN git clone https://gitlab.dune-project.org/ug/ug -b v3.12.1
RUN git clone https://gitlab.dune-project.org/core/dune-common -b v2.4.1
RUN git clone https://gitlab.dune-project.org/core/dune-geometry -b v2.4.1
RUN git clone https://gitlab.dune-project.org/core/dune-grid -b v2.4.1
RUN git clone https://gitlab.dune-project.org/core/dune-istl -b v2.4.1
RUN git clone https://gitlab.dune-project.org/core/dune-localfunctions -b v2.4.1
RUN git clone https://gitlab.dune-project.org/pdelab/dune-pdelab -b v2.4.1
RUN git clone https://gitlab.dune-project.org/pdelab/dune-typetree -b v2.4.1
RUN git clone https://gitlab.dune-project.org/quality/dune-python -b releases/2.4
RUN git clone https://gitlab.dune-project.org/quality/dune-testtools -b releases/2.4
WORKDIR /opt/dorie/ug
RUN autoreconf -is
RUN ./configure --enable-parallel --without-x --enable-dune --enable-system-heap
RUN make && make install
ADD . /opt/dorie/dorie/
WORKDIR /opt/dorie
RUN ./dune-common/bin/dunecontrol all -DCMAKE_CXX_FLAGS="-O3"
RUN ./dune-common/bin/dunecontrol make install
RUN ./dune-common/bin/dunecontrol make test
# Welcome to DORiE!
(__D__UNE-__O__perated __Ri__chards equation solving __E__nvironment)
[![build status](http://shangrila.iup.uni-heidelberg.de:30000/ci/projects/1/status.png?ref=master)](http://shangrila.iup.uni-heidelberg.de:30000/ci/projects/1?ref=master)
## Quick installation
More comprehensive installation instructions of the current `master` branch can be found [in the online documentation](http://dorie-docs.gitballoon.com) (password: `richards`).
0. __Mac OS:__ Make sure you have the most recent version of the Command Line Tools installed (just run `xcode-select --install`).
1. Follow our [Git Tutorial](http://shangrila.iup.uni-heidelberg.de:30000/dorie/dorie/wikis/git-tutorial) to clone the repository to a suitable location on your computer. Make sure the path to the repository does not contain any spaces, as this will break most of the configure scripts.
2. Run the install.sh script by calling
bash install.sh
You will be prompted to enter your password. You need to have `sudo` rights on your machine to install DORiE.
*Note*: This will try to install some large dependencies with the package managers `apt-get` (Linux) or MacPorts (OSX). If this fails for some reason, you will have to make sure to install these packages to your system manually.
3. The DORiE installation routine provides multiple options:
* `doriecontrol install core`: Install only packages needed to compile and run DORiE (minimal installation).
* `doriecontrol install all`: Install the core packages as well as documentation tools and the testing suite (full installation).
Choose one of the two commands and run it from the command line.
4. Grab a cup of your favorite beverage.
5. Once everything is installed without errors, you can start runs with
dorie run INIFILE
For more information, type
bash install.sh help
or
doriecontrol help
or
dorie help
## Usage
1. Create some folder(s) that you would like to hold the input and output files of the run.
2. Call
dorie create
to create a set of dummy input files in your current folder.
3. Modify the input to your liking. Make sure to specify all parameters that are set to `UNDEFINED`. The Parameter Cheat Sheet in the `doc/` directory of the repository provides information on the meaning of all parameters, including recommended values.
4. Start the run with
dorie run INIFILE [OPTIONS]
You may get a list of the available commands and options by executing
dorie help
## Recommended third-party software
The following software packages are too large or too specialized to be bundled with DORiE, but are nonetheless recommended.
They are cross-platform, so you should be able to find a release that fits your operating system.
* [Gmsh](http://gmsh.info/): An open-source CAD that can be used to create the `.msh` files used by DORiE to define triangular meshes.
* [ParaView](http://www.paraview.org/): A powerful post-processing tool for VTK files. Offers both visualization and data analysis tools.
* [Python VTK tools](http://www.vtk.org/Wiki/VTK/Examples/Python): If you want to write your own post-processing in python, you may use these tools which supply readers for binary VTK files.
## Documentation
The documentation of the current `master` branch can be found [online](http://dorie-docs.gitballoon.com) (password: `richards`).
If you want to install the dependencies and build the documentation yourself (e.g. because you are using an older version of DORiE), you can use some convenience functions provided by `doriecontrol`.
If you did not choose the full installation routine, you have to install the documentation tools separately before building the doc. Do so by calling
doriecontrol install doc
_After_ installing DORiE, you can create the documentation by calling
doriecontrol make doc
It can then be found in the `doc/` directory of your repository.
## Troubleshooting
In case you encounter errors or strange behavior, you should first take a look at the [List of Known Bugs](http://shangrila.iup.uni-heidelberg.de:30000/dorie/dorie/issues?assignee_id=&author_id=&label_name=bug&milestone_id=&scope=all&sort=created_desc&state=opened). For problems related to the installation, refer to the sections below.
### Something went wrong during the install.sh script
* Make sure you ran the script with `bash`.
* Look through the output of the script. If you see any errors, try to resolve them.
* If nothing works, open an issue, or send the output of the script to the [DORiE developer mailing list](mailto:dorieteam@iup.uni-heidelberg.de).
### I ran 'doriecontrol install all / core', but DORiE doesn't work
This is probably due to an error while building one of the dependencies. Have a look at the installation.log file in the main directory. Search for errors, maybe you can detect which package failed to build, and resolve the error yourself. If this doesn't work, open an issue, or send the installation.log file to the [DORiE developer mailing list](mailto:dorieteam@iup.uni-heidelberg.de).
Note that if you just want to rebuild one specific package, you don't have to work through the whole build process again - just use the command
doriecontrol install PACKAGES
e.g.,
doriecontrol install openmpi dune dorie
to rebuild OpenMPI, DUNE, and DORiE.
### DORiE is running, but I suspect that something is wrong
You can execute system tests in order to ensure that DORiE is running correctly and producing the expected results. You will need to install the testing suite first (this is _not_ done by default) and rebuild DORiE:
doriecontrol install testing dorie
Then, you can run the system tests:
doriecontrol test
You will be informed whether each test has been passed or failed, and you may find additional output in the DORiE build directory.
### Further help
Open an issue, or write to the [DORiE developer mailing list](mailto:dorieteam@iup.uni-heidelberg.de).
\ No newline at end of file
configure_file(dorie.in dorie @ONLY)
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/dorie DESTINATION ${CMAKE_INSTALL_BINDIR})
#!/bin/bash
###### set by CMake ########
DORIEDIR=@CMAKE_BINARY_DIR@
MPIRUN=@MPIEXEC@
############################
DORIE_EXECUTABLE=$DORIEDIR/src/dorie
PARAMETERDIR=$DORIEDIR/doc/parameters
DORIE_PYTHON=$DORIEDIR/dune-env
run_dorie_sequential()
{
echo "###################################################"
echo "EXECUTING DORIE IN SEQUENTIAL MODE (Single Process)"
echo "###################################################"
$DORIE_EXECUTABLE $1
}
run_dorie_parallel()
{
echo "################################"
echo "EXECUTING DORIE IN PARALLEL MODE"
echo "################################"
$MPIRUN -n $2 $DORIE_EXECUTABLE $1
}
initialize_folder()
{
echo "###################"
echo "INITIALIZING FOLDER"
echo "###################"
cp -iv $PARAMETERDIR/default.ini parameter.ini
cp -iv $PARAMETERDIR/default_bc.dat bc.dat
echo "Initialization done"
}
plot_vtk()
{
$DORIE_PYTHON plot_vtk.py --vtk $1 --var $2
}
###################
# CHECK IF DORIE WAS INSTALLED
if [[ ! -e $DORIE_EXECUTABLE ]]; then
echo -e "ERROR: DORiE executable not found at $DORIE_EXECUTABLE.\nMake sure you have built and installed DORiE."
exit
fi
RUN=0
PLOT=0
CREATE=0
PARALLEL=0
# NO ARGUMENTS SUPPLIED
if [[ $# = 0 ]]; then
echo "Usage: dorie COMMAND [COMMAND-OPTIONS]. For more information try 'dorie help'"
exit
fi
# PARSE EACH ARGUMENT
case $1 in
run)
RUN=1
shift
if [[ $# > 0 ]]; then
INIFILE=$1
else
echo "ERROR: No parameter file specified"
exit
fi
shift
if [[ $# > 0 ]]; then
case $1 in
--parallel|--par)
shift
if [[ $# > 0 ]]; then
PARALLEL=$1
else
echo "ERROR: Specify the number of threads when using --parallel"
exit
fi
;;
--sequential|--seq)
PARALLEL=0
;;
*)
echo "ERROR: Unrecognized option $1"
exit
;;
esac
fi
;;
plot)
PLOT=1
shift
if [[ $# = 0 ]]; then
echo "ERROR: Specify a VTK file to plot"
exit
fi
while [[ $# > 0 && ! $1 = "--var" ]]; do
if [[ -e $1 && -f $1 && -s $1 ]]; then
VTKFILE+="$1 "
else
echo "ERROR: Invalid VTK file $1"
exit
fi
shift
done
if [[ $1 = "--var" ]]; then
shift
VARIABLES=""
while [[ $# > 0 ]]; do
VARIABLES+="$1 "
shift
done
fi
;;
create)
CREATE=1
;;
help)
echo -e "Usage: dorie COMMAND [COMMAND-OPTIONS]\n"
echo -e "COMMANDS:"
echo -e "\t'run INIFILE [OPTIONS]'\tstarts DORiE with parameter file INIFILE"
echo -e "\tOPTIONS:"
echo -e "\t\t'--parallel NPROC'\tstarts DORiE in parallel with NPROC processes"
echo -e "\t\t'--sequential'\t\tstarts DORiE in sequential mode (default)"
echo -e "\t'create'\t\tcreates dummy parameter files in the current directory"
echo -e "\t'plot VTK [--var VAR]'\tplots the variables VAR (default: all variables) from the VTK file(s) VTK"
echo -e "\t'help'\t\t\tdisplays this message"
exit
;;
*)
echo -e "ERROR: Command not recognized: $1. For more information run 'dorie help'"
exit
;;
esac
# RUN DORIE
if [[ $RUN = 1 ]]; then
if [[ -e $INIFILE && -f $INIFILE && -s $INIFILE ]]; then
if [[ $PARALLEL > 0 ]]; then
run_dorie_parallel $INIFILE $PARALLEL
else
run_dorie_sequential $INIFILE
fi
else
echo "ERROR: Invalid parameter file $INIFILE"
fi
exit
fi
# INITIALIZE FOLDER
if [[ $CREATE = 1 ]]; then
initialize_folder
exit
fi
# PLOT VTK FILES
if [[ $PLOT = 1 ]]; then
plot_vtk "$VTKFILE" "$VARIABLES"
exit
fi
set(modules "DorieMacros.cmake")
install(FILES ${modules} DESTINATION ${DUNE_INSTALL_MODULEDIR})
# CMake generated Testfile for
# Source directory: /home/dion/codes/dorie/dorie/cmake/modules
# Build directory: /home/dion/codes/dorie/dorie/cmake/modules
#
# This file includes the relevant testing commands required for
# testing this directory and lists subdirectories to be tested as well.
# File for module specific CMake tests.
# find all required packages
FIND_PACKAGE(HDF5 REQUIRED COMPONENTS C)
FIND_PACKAGE(FFTW REQUIRED)
FIND_PACKAGE(SuperLU REQUIRED)
FIND_PACKAGE(MPI REQUIRED)
FIND_PACKAGE(METIS REQUIRED)
FIND_PACKAGE(ParMETIS REQUIRED)
FIND_PACKAGE(UG REQUIRED)
include_directories(${FFTW_INCLUDES})
include_directories(${HDF5_INCLUDE_DIRS})
set(DUNE_LIBS ${DUNE_LIBS} ${FFTW_LIBRARIES} ${HDF5_LIBRARIES})
MESSAGE(STATUS "DUNE Libraries: ${DUNE_LIBS}")
# - Find the FFTW library
#
# Usage:
# find_package(FFTW [REQUIRED] [QUIET] )
#
# It sets the following variables:
# FFTW_FOUND ... true if fftw is found on the system
# FFTW_LIBRARIES ... full path to fftw library
# FFTW_INCLUDES ... fftw include directory
#
# The following variables will be checked by the function
# FFTW_USE_STATIC_LIBS ... if true, only static libraries are found
# FFTW_ROOT ... if set, the libraries are exclusively searched
# under this path
# FFTW_LIBRARY ... fftw library to use
# FFTW_INCLUDE_DIR ... fftw include directory
#
#If environment variable FFTWDIR is specified, it has same effect as FFTW_ROOT
if( NOT FFTW_ROOT AND ENV{FFTWDIR} )
set( FFTW_ROOT $ENV{FFTWDIR} )
endif()
# Check if we can use PkgConfig
find_package(PkgConfig)
#Determine from PKG
if( PKG_CONFIG_FOUND AND NOT FFTW_ROOT )
pkg_check_modules( PKG_FFTW QUIET "fftw3" )
endif()
#Check whether to search static or dynamic libs
set( CMAKE_FIND_LIBRARY_SUFFIXES_SAV ${CMAKE_FIND_LIBRARY_SUFFIXES} )
if( FFTW_ROOT )
#find libs
find_library(
FFTW_LIB
NAMES "fftw3"
PATHS ${FFTW_ROOT}
PATH_SUFFIXES "lib" "lib64"
NO_DEFAULT_PATH
)
find_library(
FFTWF_LIB
NAMES "fftw3_mpi"
PATHS ${FFTW_ROOT}
PATH_SUFFIXES "lib" "lib64"
NO_DEFAULT_PATH
)
find_library(
FFTWL_LIB
NAMES "fftw3l"
PATHS ${FFTW_ROOT}
PATH_SUFFIXES "lib" "lib64"
NO_DEFAULT_PATH
)
#find includes
find_path(
FFTW_INCLUDES
NAMES "fftw3.h"
PATHS ${FFTW_ROOT}
PATH_SUFFIXES "include"
NO_DEFAULT_PATH
)
else()
find_library(
FFTW_LIB
NAMES "fftw3"
PATHS ${PKG_FFTW_LIBRARY_DIRS} ${LIB_INSTALL_DIR}
)
find_library(
FFTWF_LIB
NAMES "fftw3_mpi"
PATHS ${PKG_FFTW_LIBRARY_DIRS} ${LIB_INSTALL_DIR}
)
find_library(
FFTWL_LIB
NAMES "fftw3l"
PATHS ${PKG_FFTW_LIBRARY_DIRS} ${LIB_INSTALL_DIR}
)
find_path(
FFTW_INCLUDES
NAMES "fftw3.h"
PATHS ${PKG_FFTW_INCLUDE_DIRS} ${INCLUDE_INSTALL_DIR}
)
endif( FFTW_ROOT )
set(FFTW_LIBRARIES ${FFTWF_LIB} ${FFTW_LIB})
if(FFTWL_LIB)
set(FFTW_LIBRARIES ${FFTWL_LIB} ${FFTW_LIBRARIES})
endif()
set( CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_SAV} )
MESSAGE(STATUS "Found FFTW library: ${FFTW_LIBRARIES}")
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(FFTW DEFAULT_MSG
FFTW_INCLUDES FFTW_LIBRARIES)
mark_as_advanced(FFTW_INCLUDES FFTW_LIBRARIES)
# CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 3.5
# Default target executed when no arguments are given to make.
default_target: all
.PHONY : default_target
# Allow only one "make -f Makefile2" at a time, but pass parallelism.
.NOTPARALLEL:
#=============================================================================
# Special targets provided by cmake.
# Disable implicit rules so canonical targets will work.
.SUFFIXES:
# Remove some rules from gmake that .SUFFIXES does not remove.
SUFFIXES =
.SUFFIXES: .hpux_make_needs_suffix_list
# Suppress display of executed commands.
$(VERBOSE).SILENT:
# A target that is always out of date.
cmake_force:
.PHONY : cmake_force
#=============================================================================
# Set environment variables for the build.
# The shell in which to execute make rules.
SHELL = /bin/sh
# The CMake executable.
CMAKE_COMMAND = /usr/bin/cmake
# The command to remove a file.
RM = /usr/bin/cmake -E remove -f
# Escaping for special characters.
EQUALS = =
# The top-level source directory on which CMake was run.
CMAKE_SOURCE_DIR = /home/dion/codes/dorie/dorie
# The top-level build directory on which CMake was run.
CMAKE_BINARY_DIR = /home/dion/codes/dorie/dorie
#=============================================================================
# Targets provided globally by CMake.
# Special rule for the target test
test:
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running tests..."
/usr/bin/ctest --force-new-ctest-process $(ARGS)
.PHONY : test
# Special rule for the target test
test/fast: test
.PHONY : test/fast
# Special rule for the target package
package: preinstall
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Run CPack packaging tool..."
cd /home/dion/codes/dorie/dorie && /usr/bin/cpack --config ./CPackConfig.cmake
.PHONY : package
# Special rule for the target package
package/fast: package
.PHONY : package/fast
# Special rule for the target edit_cache
edit_cache:
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake cache editor..."
/usr/bin/cmake-gui -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
.PHONY : edit_cache
# Special rule for the target edit_cache
edit_cache/fast: edit_cache
.PHONY : edit_cache/fast
# Special rule for the target package_source
package_source:
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Run CPack packaging tool for source..."
cd /home/dion/codes/dorie/dorie && /usr/bin/cpack --config ./CPackSourceConfig.cmake /home/dion/codes/dorie/dorie/CPackSourceConfig.cmake
.PHONY : package_source
# Special rule for the target package_source
package_source/fast: package_source
.PHONY : package_source/fast
# Special rule for the target rebuild_cache
rebuild_cache:
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..."
/usr/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
.PHONY : rebuild_cache
# Special rule for the target rebuild_cache
rebuild_cache/fast: rebuild_cache
.PHONY : rebuild_cache/fast
# Special rule for the target install/strip
install/strip: preinstall
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..."
/usr/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake
.PHONY : install/strip
# Special rule for the target install/strip
install/strip/fast: install/strip
.PHONY : install/strip/fast
# Special rule for the target install/local