Commit c4220dc7 authored by thomas.forbriger's avatar thomas.forbriger Committed by thomas.forbriger
Browse files

started new project

This is a legacy commit from before 2015-03-01.
It may be incomplete as well as inconsistent.
See COPYING.legacy and README.history for details.


SVN Path:     http://gpitrsvn.gpi.uni-karlsruhe.de/repos/TFSoftware/trunk
SVN Revision: 3907
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent 2e2ae5a8
This is a legacy version of the repository. It may be incomplete as well as
inconsistent. See README.history for details. For the old stock of the
repository copyright and licence conditions apply as specified for versions
commited after 2015-03-01. Use recent versions as a base for new development.
The legacy version is only stored to keep a record of history.
# this is <Makefile>
# ----------------------------------------------------------------------------
# $Id$
#
# Copyright (c) 2011 by Thomas Forbriger (BFO Schiltach)
#
# create library for source time function inversion (libstfinv)
#
# ----
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# ----
#
#
# REVISIONS and CHANGES
# 05/05/2011 V1.0 Thomas Forbriger
#
# ============================================================================
#
.PHONY: all
all: install doxydoc
.PHONY: doc
doc: doxydoc
LIBRARIES=libstfinv.a
.PHONY: install
install:
$(MAKE) install-include
$(MAKE) $(LIBRARIES)
/bin/mv -fv $(LIBRARIES) $(LOCLIBDIR)
# ============================================================================
#
CHECKVAR=$(if $($(1)),,$(error ERROR: missing variable $(1)))
CHECKVARS=$(foreach var,$(1),$(call CHECKVAR,$(var)))
#
$(call CHECKVARS,LOCINCLUDEDIR LOCLIBDIR LOCBINDIR)
$(call CHECKVARS,TF_BROWSER TF_WWWBASEDIR)
LIBHEADERS=$(filter-out none,$(wildcard *.h))
LIBSRC=$(filter-out none,$(wildcard *.cc))
TESTHEADERS=$(wildcard tests/*.h)
TESTSRC=$(wildcard tests/*.cc)
INCINSTALLPATH=$(LOCINCLUDEDIR)/stfinv
LIBINSTALLPATH=$(LOCLIBDIR)
# name of headers with comments stripped off
STRIPHEADER=$(addsuffix .strip,$(notdir $(LIBHEADERS)))
# name of installed (exported) header files
INSTHEADER=$(addprefix $(INCINSTALLPATH)/,$(notdir $(LIBHEADERS)))
# if defined, empty lines are kept in stripped comment headers
# to synchronize line numbers
EMPTYPRINT=1
#EMPTYPRINT=0
# define this to be cat in case you do not have remcmmnt available
ifndef TF_REMCMMNT
TF_REMCMMNT=cat
endif
#
# general part
# ------------
#
FLAGS=
FLAGS+=-fPIC $(MYFLAGS)
CXXFLAGS+=-Wall $(FLAGS)
LDFLAGS+=-L$(LOCLIBDIR)
CPPFLAGS+=-I$(LOCINCLUDEDIR) $(FLAGS)
EDITFILES=Makefile README $(wildcard *.cfg *.h *.cc)
flist: $(EDITFILES)
echo $^ | tr ' ' '\n' | sort > $@
.PHONY: edit
edit: flist; vim $<
.PHONY: clean
clean: ;
-find . -name \*.bak | xargs --no-run-if-empty /bin/rm -v
-find . -name \*.o | xargs --no-run-if-empty /bin/rm -v
-find . -name \*.d | xargs --no-run-if-empty /bin/rm -v
-find . -name \*.hd | xargs --no-run-if-empty /bin/rm -v
-find . -name \*.strip | xargs --no-run-if-empty /bin/rm -v
-/bin/rm -vf flist *.a *.so *.xxx
#======================================================================
# pattern rules
# -------------
%.d: %.cc
$(SHELL) -ec '$(CXX) -M $(CPPFLAGS) $< \
| sed '\''s,\($(notdir $*)\)\.o[ :]*,$(dir $@)\1.o $@ : ,g'\'' \
> $@; \
[ -s $@ ] || rm -f $@'
#======================================================================
# library part
# ------------
include $(patsubst %.cc,%.d,$(LIBSRC) $(TESTSRC))
libstfinv.a: $(patsubst %.cc,%.o,$(LIBSRC))
ar rcv $@ $^
ranlib $@
libstfinv.so: $(patsubst %.cc,%.o,$(LIBSRC))
$(CXX) $(CXXFLAGS) -shared -o $@ $^
#----------------------------------------------------------------------
# comment stripping
%.hd: %.h; echo $(notdir $<.strip): $< > $@
include $(patsubst %.h,%.hd,$(LIBHEADERS) $(TESTHEADERS))
# first awk rule assumes that the first non-comment line starts with '#'
# and that the first (copyright) comment end with pattern "^ */"
%.h.strip:
awk 'BEGIN {hot=1;} /^ \*\// { if (hot) { hot=2; print; next;} }\
/^#/ { hot=0; } \
{ if (hot==2) { print ""; } else if (hot) { print; } }' $< > $@
$(TF_REMCMMNT) $< | awk 'BEGIN {hot=0;} \
/^ *$$/ { if ((hot) && ($(EMPTYPRINT))) { print; } next; } \
/^#/ { hot=1; } { if (hot) print; }' >> $@
#----------------------------------------------------------------------
$(INCINSTALLPATH)/%.h: %.h.strip
mkdir -p $(INCINSTALLPATH)
-rm -fv $@
/bin/cp -vpd $< $@
.PHONY: install-include
install-include: $(INSTHEADER)
#======================================================================
# reinstall target
# is necessary in case of header file problems (e.g. remcmmnt not installed)
.PHONY: clean-include
clean-include:
/bin/rm -fv $(INSTHEADER)
.PHONY: reinstall
reinstall:
$(MAKE) clean
$(MAKE) clean-include
$(MAKE) install
#======================================================================
# documentation part
# ------------------
#
# targets commonly used:
# ----------------------
#
# make doxyclean removes all documentation
# make doxydoc creates doxygen documentation in the DOXYWWWPATH
# make doxyview creates doxygen documentation and launches netscape to
# browse in the documentation
# make doxyconf edit the doxygen configuration file
#
# If you launch "make doxydoc" the documentation will be written to
# DOXYWWWPATH (see below). This is meant to export the documentation through
# your homepage. The doxyfull directory is just a symbolic link to this
# directory.
#
$(call CHECKVARS,TF_WWWBASEDIR TF_BROWSER)
DOXYWWWPATH=$(TF_WWWBASEDIR)/libstfinv
.PHONY: doxyclean doxyview doxydoc doxyconf
doxyclean: ;/bin/rm -rfv $(DOXYWWWPATH) doxydoc.xxx
DOXYSRC=$(LIBSRC) $(LIBHEADERS) README $(TESTSRC)
PWD=$(shell env pwd)
# create doxygen intermediate configuration
doxydoc.xxx: doxydoc.cfg
sed 's,<OUTPUTDIRECTORY>,$(DOXYWWWPATH),g;s,<STRIPFROMPATH>,$(PWD),g' \
$< > $@
# create commented version of doxygen configuration
doxycomm.xxx: doxydoc.cfg
/bin/cp -vf $< $@; doxygen -u $@
$(DOXYWWWPATH)/html/index.html: doxydoc.xxx $(DOXYSRC)
mkdir -vp $(DOXYWWWPATH)
doxygen $<
doxydoc: $(DOXYWWWPATH)/html/index.html
doxyview: $(DOXYWWWPATH)/html/index.html
$(TF_BROWSER) file:$< &
#======================================================================
# create package
# --------------
# is delegated to Makefile.packages
ifdef TF_MAKEPKG
.PHONY: package
package: $(TF_MAKEPKG)
$(MAKE) -f $< \
PACKAGE=libstfinv \
PACKAGEEXPORT="trunk/src/libs/libstfinv:src" \
PACKAGETARGETS="src:all:" \
PACKAGELIBS="-"
endif
#======================================================================
# test code
# ---------
writetest sactest hpmotest mseedtest pdastest tfasciitest\
tsofttest sfftest sutest: %: tests/%.o libdatrwxx.a
$(CXX) $(FLAGS) -o $@ $< -I$(LOCINCLUDEDIR) \
-ldatrwxx -lsffxx -lgsexx -ltsxx -ltfxx -laff -ltime++ \
-L$(LOCLIBDIR)
/bin/mv -fv $@ $(LOCBINDIR)
# ----- END OF Makefile -----
This diff is collapsed.
/*! \file debug.h
* \brief suport debugging in libstfinv (prototypes)
*
* ----------------------------------------------------------------------------
*
* $Id$
* \author Thomas Forbriger
* \date 05/05/2011
*
* suport debugging in libstfinv (prototypes)
*
* Copyright (c) 2011 by Thomas Forbriger (BFO Schiltach)
*
* ----
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
* ----
*
*
* REVISIONS and CHANGES
* - 05/05/2011 V1.0 Thomas Forbriger
*
* ============================================================================
*/
// include guard
#ifndef STFINV_DEBUG_H_VERSION
#define STFINV_DEBUG_H_VERSION \
"STFINV_DEBUG_H V1.0 "
#define STFINV_DEBUG_H_CVSID \
"$Id$"
/*! \brief produce debug output
* \ingroup misc_h
*
* \param C output will be generated if C == true
* \param N name of function
* \param M message to print
*/
#define STFINV_debug(C,N,M) \
if (C) { \
std::cerr << "DEBUG (" << N << ", " \
<< __FILE__ << " line #" << __LINE__ << "):" << std::endl \
<< " " << M << std::endl; \
std::cerr.flush(); \
}
#endif // STFINV_DEBUG_H_VERSION (includeguard)
/* ----- END OF debug.h ----- */
/* ----- END OF debug.h ----- */
# Doxyfile 1.6.3
#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
DOXYFILE_ENCODING = UTF-8
PROJECT_NAME = "STFINV library: invert for optimal source time function"
PROJECT_NUMBER =
OUTPUT_DIRECTORY = <OUTPUTDIRECTORY>
CREATE_SUBDIRS = NO
OUTPUT_LANGUAGE = English
BRIEF_MEMBER_DESC = YES
REPEAT_BRIEF = YES
ABBREVIATE_BRIEF =
ALWAYS_DETAILED_SEC = YES
INLINE_INHERITED_MEMB = YES
FULL_PATH_NAMES = YES
STRIP_FROM_PATH = <STRIPFROMPATH>
STRIP_FROM_INC_PATH =
SHORT_NAMES = NO
JAVADOC_AUTOBRIEF = YES
QT_AUTOBRIEF = NO
MULTILINE_CPP_IS_BRIEF = YES
INHERIT_DOCS = YES
SEPARATE_MEMBER_PAGES = YES
TAB_SIZE = 8
ALIASES =
OPTIMIZE_OUTPUT_FOR_C = NO
OPTIMIZE_OUTPUT_JAVA = NO
OPTIMIZE_FOR_FORTRAN = NO
OPTIMIZE_OUTPUT_VHDL = NO
EXTENSION_MAPPING =
BUILTIN_STL_SUPPORT = YES
CPP_CLI_SUPPORT = NO
SIP_SUPPORT = NO
IDL_PROPERTY_SUPPORT = YES
DISTRIBUTE_GROUP_DOC = YES
SUBGROUPING = YES
TYPEDEF_HIDES_STRUCT = NO
SYMBOL_CACHE_SIZE = 0
#---------------------------------------------------------------------------
# Build related configuration options
#---------------------------------------------------------------------------
EXTRACT_ALL = YES
EXTRACT_PRIVATE = YES
EXTRACT_STATIC = YES
EXTRACT_LOCAL_CLASSES = YES
EXTRACT_LOCAL_METHODS = YES
EXTRACT_ANON_NSPACES = YES
HIDE_UNDOC_MEMBERS = NO
HIDE_UNDOC_CLASSES = NO
HIDE_FRIEND_COMPOUNDS = NO
HIDE_IN_BODY_DOCS = NO
INTERNAL_DOCS = YES
CASE_SENSE_NAMES = YES
HIDE_SCOPE_NAMES = NO
SHOW_INCLUDE_FILES = YES
FORCE_LOCAL_INCLUDES = NO
INLINE_INFO = YES
SORT_MEMBER_DOCS = YES
SORT_BRIEF_DOCS = YES
SORT_MEMBERS_CTORS_1ST = YES
SORT_GROUP_NAMES = YES
SORT_BY_SCOPE_NAME = YES
GENERATE_TODOLIST = YES
GENERATE_TESTLIST = YES
GENERATE_BUGLIST = YES
GENERATE_DEPRECATEDLIST= YES
ENABLED_SECTIONS = internal
MAX_INITIALIZER_LINES = 30
SHOW_USED_FILES = YES
SHOW_DIRECTORIES = YES
SHOW_FILES = YES
SHOW_NAMESPACES = YES
FILE_VERSION_FILTER =
LAYOUT_FILE =
#---------------------------------------------------------------------------
# configuration options related to warning and progress messages
#---------------------------------------------------------------------------
QUIET = NO
WARNINGS = YES
WARN_IF_UNDOCUMENTED = YES
WARN_IF_DOC_ERROR = YES
WARN_NO_PARAMDOC = NO
WARN_FORMAT = "$file:$line: $text"
WARN_LOGFILE =
#---------------------------------------------------------------------------
# configuration options related to the input files
#---------------------------------------------------------------------------
INPUT = ./
INPUT_ENCODING = UTF-8
FILE_PATTERNS = README \
*.h \
*.cc
RECURSIVE = YES
EXCLUDE =
EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS =
EXCLUDE_SYMBOLS =
EXAMPLE_PATH = tests
EXAMPLE_PATTERNS =
EXAMPLE_RECURSIVE = NO
IMAGE_PATH =
INPUT_FILTER =
FILTER_PATTERNS =
FILTER_SOURCE_FILES = NO
#---------------------------------------------------------------------------
# configuration options related to source browsing
#---------------------------------------------------------------------------
SOURCE_BROWSER = YES
INLINE_SOURCES = YES
STRIP_CODE_COMMENTS = YES
REFERENCED_BY_RELATION = YES
REFERENCES_RELATION = YES
REFERENCES_LINK_SOURCE = YES
USE_HTAGS = NO
VERBATIM_HEADERS = YES
#---------------------------------------------------------------------------
# configuration options related to the alphabetical class index
#---------------------------------------------------------------------------
ALPHABETICAL_INDEX = YES
COLS_IN_ALPHA_INDEX = 5
IGNORE_PREFIX =
#---------------------------------------------------------------------------
# configuration options related to the HTML output
#---------------------------------------------------------------------------
GENERATE_HTML = YES
HTML_FOOTER_DESCRIPTION= NO
HTML_OUTPUT = html
HTML_FILE_EXTENSION = .html
HTML_HEADER =
HTML_FOOTER =
HTML_STYLESHEET =
HTML_TIMESTAMP = YES
HTML_ALIGN_MEMBERS = YES
HTML_DYNAMIC_SECTIONS = NO
GENERATE_DOCSET = NO
DOCSET_FEEDNAME = "Doxygen generated docs"
DOCSET_BUNDLE_ID = org.doxygen.Project
GENERATE_HTMLHELP = NO
CHM_FILE =
HHC_LOCATION =
GENERATE_CHI = NO
CHM_INDEX_ENCODING =
BINARY_TOC = NO
TOC_EXPAND = NO
GENERATE_QHP = NO
QCH_FILE =
QHP_NAMESPACE = org.doxygen.Project
QHP_VIRTUAL_FOLDER = doc
QHP_CUST_FILTER_NAME =
QHP_CUST_FILTER_ATTRS =
QHP_SECT_FILTER_ATTRS =
QHG_LOCATION =
GENERATE_ECLIPSEHELP = NO
ECLIPSE_DOC_ID = org.doxygen.Project
DISABLE_INDEX = NO
ENUM_VALUES_PER_LINE = 4
GENERATE_TREEVIEW = ALL
USE_INLINE_TREES = NO
TREEVIEW_WIDTH = 250
FORMULA_FONTSIZE = 10
SEARCHENGINE = NO
SERVER_BASED_SEARCH = NO
#---------------------------------------------------------------------------
# configuration options related to the LaTeX output
#---------------------------------------------------------------------------
GENERATE_LATEX = NO
LATEX_OUTPUT = latex
LATEX_CMD_NAME = latex
MAKEINDEX_CMD_NAME = makeindex
COMPACT_LATEX = YES
PAPER_TYPE = a4wide
EXTRA_PACKAGES = pslatex
LATEX_HEADER =
PDF_HYPERLINKS = NO
USE_PDFLATEX = NO
LATEX_BATCHMODE = NO
LATEX_HIDE_INDICES = NO
LATEX_SOURCE_CODE = NO
#---------------------------------------------------------------------------
# configuration options related to the RTF output
#---------------------------------------------------------------------------
GENERATE_RTF = NO
RTF_OUTPUT = rtf
COMPACT_RTF = NO
RTF_HYPERLINKS = NO
RTF_STYLESHEET_FILE =
RTF_EXTENSIONS_FILE =
#---------------------------------------------------------------------------
# configuration options related to the man page output
#---------------------------------------------------------------------------
GENERATE_MAN = YES
MAN_OUTPUT = man
MAN_EXTENSION = .3
MAN_LINKS = NO
#---------------------------------------------------------------------------
# configuration options related to the XML output
#---------------------------------------------------------------------------
GENERATE_XML = NO
XML_OUTPUT = xml
XML_SCHEMA =
XML_DTD =
XML_PROGRAMLISTING = YES
#---------------------------------------------------------------------------
# configuration options for the AutoGen Definitions output
#---------------------------------------------------------------------------
GENERATE_AUTOGEN_DEF = NO
#---------------------------------------------------------------------------
# configuration options related to the Perl module output
#---------------------------------------------------------------------------
GENERATE_PERLMOD = NO
PERLMOD_LATEX = NO
PERLMOD_PRETTY = YES
PERLMOD_MAKEVAR_PREFIX =
#---------------------------------------------------------------------------
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = NO
EXPAND_ONLY_PREDEF = NO
SEARCH_INCLUDES = YES
INCLUDE_PATH =
INCLUDE_FILE_PATTERNS =
PREDEFINED = DOXYGEN_MUST_SKIP_THIS
EXPAND_AS_DEFINED =
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------
# Configuration::additions related to external references
#---------------------------------------------------------------------------
TAGFILES =
GENERATE_TAGFILE =
ALLEXTERNALS = NO
EXTERNAL_GROUPS = YES
PERL_PATH = /usr/bin/perl
#---------------------------------------------------------------------------
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
CLASS_DIAGRAMS = YES
MSCGEN_PATH =
HIDE_UNDOC_RELATIONS = NO
HAVE_DOT = YES
DOT_FONTNAME = FreeSans
DOT_FONTSIZE = 10
DOT_FONTPATH =
CLASS_GRAPH = YES
COLLABORATION_GRAPH = YES
GROUP_GRAPHS = YES
UML_LOOK = NO
TEMPLATE_RELATIONS = YES
INCLUDE_GRAPH = YES
INCLUDED_BY_GRAPH = YES
CALL_GRAPH = YES
CALLER_GRAPH = YES
GRAPHICAL_HIERARCHY = YES
DIRECTORY_GRAPH = YES
DOT_IMAGE_FORMAT = png
DOT_PATH =
DOTFILE_DIRS =
DOT_GRAPH_MAX_NODES = 50
MAX_DOT_GRAPH_DEPTH = 0
DOT_TRANSPARENT = NO
DOT_MULTI_TARGETS = NO
GENERATE_LEGEND = YES
DOT_CLEANUP = YES
/*! \file error.cc
* \brief handle error conditions in libstfinv (implementation)
*
* ----------------------------------------------------------------------------
*
* $Id$
* \author Thomas Forbriger
* \date 05/05/2011
*
* handle error conditions in libstfinv (implementation)
*
* Copyright (c) 2011 by Thomas Forbriger (BFO Schiltach)
*
* ----
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
* ----
*
*
* REVISIONS and CHANGES
* - 05/05/2011 V1.0 Thomas Forbriger
*
* ============================================================================
*/
#define STFINV_ERROR_CC_VERSION \
"STFINV_ERROR_CC V1.0 "
#define STFINV_ERROR_CC_CVSID \
"$Id$"
#include <iostream>
#include <stfinv/error.h>
using std::cerr;
using std::endl;
namespace stfinv {
//! initialize and instantiate
bool Exception::Mreport_on_construct=true;
//! construct from nothing
Exception::Exception():
Mmessage(0), Mfile(0), Mline(0), Mcondition(0)
{ if (Mreport_on_construct) { report(); } }