Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-common
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Timo Koch
dune-common
Commits
bde3a671
Commit
bde3a671
authored
18 years ago
by
Christian Engwer
Browse files
Options
Downloads
Patches
Plain Diff
nearly finished buildsystem howto
[[Imported from SVN: r4515]]
parent
7b6e4f82
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
doc/buildsystem/.gitignore
+9
-0
9 additions, 0 deletions
doc/buildsystem/.gitignore
doc/buildsystem/buildsystem.tex
+216
-13
216 additions, 13 deletions
doc/buildsystem/buildsystem.tex
with
225 additions
and
13 deletions
doc/buildsystem/.gitignore
0 → 100644
+
9
−
0
View file @
bde3a671
*.aux
*.log
*.dvi
*.ps
*.toc
*.out
Makefile.in
Makefile
auto
This diff is collapsed.
Click to expand it.
doc/buildsystem/buildsystem.tex
+
216
−
13
View file @
bde3a671
...
...
@@ -165,9 +165,18 @@ create symlink; this is usually done by \autogen (see
How to write a
\configureac
for
\dune
is described in
\ref
{
configure.ac
}
\minisec
{
libtool
}
\libtool
is used to build libraries on all platforms. This way we
don't have to deal will platform specific issues.
\libtool
is a wrapper around the compiler and
linker. It offers a generic interface for creating static and shared
libraries, regardless of the platform it is running on.
\libtool
hides all the platform specific aspects of library creation
and library usage. When linking a library or an executable you (or
\automake
) can call the compiler via
\libtool
.
\libtool
will then take
care of
\begin{itemize}
\item
\em
platform specific
\em
commandline parameters for the linker
\item
library dependencies
\end{itemize}
\subsection
{
Makefile.am
}
\label
{
makefile.am
}
...
...
@@ -358,10 +367,9 @@ Webpages are created from wml sources, using the program \texttt{wml}
(
\texttt
{
\url
{
http://thewml.org/
}}
).
\\
\texttt
{
\$
(top
\_
srcdir)/am/webstuff
}
containes the necessary rules.
\begin{lst}
[File Makefile.am]
\mbox
{}
\lstinputlisting
[basicstyle=
\ttfamily\scriptsize
,numbers=
left
,
\lstinputlisting
[basicstyle=
\ttfamily\scriptsize
,numbers=
none
,
numberstyle=
\tiny
, numbersep=5pt]
{
../Makefile.am
}
\end{lst}
...
...
@@ -386,7 +394,7 @@ and transformed into a shell script.
\begin{lst}
[File dune-common/configure.ac]
\mbox
{}
\lstinputlisting
[basicstyle=
\ttfamily\scriptsize
,numbers=
left
,
\lstinputlisting
[basicstyle=
\ttfamily\scriptsize
,numbers=
none
,
numberstyle=
\tiny
, numbersep=5pt]
{
../../configure.ac
}
\end{lst}
...
...
@@ -428,6 +436,8 @@ For further information have a look at the autoconf manual \\
\subsection
{
autogen.sh
}
\label
{
autogen.sh
}
TODO
\subsection
{
dunecontrol
}
\label
{
dunecontrol
}
\dunecontrol
helps you building the different
\dune
modules in the
...
...
@@ -442,14 +452,14 @@ and extended in the \dunemodule file.
The commands you are interested in right now are
\begin{itemize}
\item
\texttt
{
autogen
}
runs
\autogen
sh
for each module. A list of
\item
\texttt
{
autogen
}
runs
\autogen
for each module. A list of
directories containing
\dunemodule
files and the parameters given on
the commandline are passed as paramters to
\autogen
sh
.
the commandline are passed as paramters to
\autogen
.
\item
\texttt
{
configure
}
runs
\configure
for each
module.
\texttt
{
--with-dune
\textit
{
module
}}
parameters are created
for a set of known
\dune
modules.
\item
\texttt
{
make
}
runs
\make
for each module.
\item
\texttt
{
all
}
runs
\autogen
sh
,
\configure
and
\make
for each module.
\item
\texttt
{
all
}
runs
\autogen
,
\configure
and
\make
for each module.
\end{itemize}
In order to build
\dune
the first time you will need the
\texttt
{
all
}
...
...
@@ -481,27 +491,220 @@ dunecontrol make clean
\minisec
{
opts files
}
You can also let
\dunecontrol
read the command parameters from a file.
For each command you can specify parameters. THe parameters are stored
in a varible called
\texttt
{
\textit
{
COMMAND
}
\,\_
FLAGS
}
with
\texttt
{
\textit
{
COMMAND
}}
writen in capital letters.
\begin{lst}
[File examle.opts]
\mbox
{}
\lstinputlisting
[basicstyle=
\ttfamily\scriptsize
,numbers=none,
numberstyle=
\tiny
, numbersep=5pt]
{
../../bin/example.opts
}
\end{lst}
When you specify an opts file and command line paramters
\begin{lstlisting}
[basicstyle=
\ttfamily\scriptsize
]
dunecontrol --opts=some.opts configure --with-foo=bar
\end{lstlisting}
dunecontrol will ignore the parameters specified in the opts file and
you will get a warning.
\minisec
{
dune.module
}
\begin{lst}
[File dune.module]
\mbox
{}
The
\dunemodule
file is split into two parts. First we have the
parameter section where you specify parameters describing the module.
Then we have the command section where you can overload the default
implementation of a command called via
\dunecontrol
.
\lstinputlisting
[basicstyle=
\ttfamily\scriptsize
,numbers=left,
numberstyle=
\tiny
, numbersep=5pt]
{
../../dune.module
}
\begin{lst}
[File dune.module]
\mbox
{}
\begin{lstlisting}
[basicstyle=
\ttfamily\scriptsize
,numbers=none,
numberstyle=
\tiny
, numbersep=5pt]
# paramters for dune control
Module: dune
_
grid
Depends: dune
_
common
Suggests: UG Alberta Alu3d
# overload the run
_
configure command
run
_
configure ()
{
# lets extend the paramter list
$
PARAMS
if test "x
$
HAVE
_
UG" == "xyes"; then
PARAMS="
$
PARAMS
\"
--
with
-
ug
=
$
PATH
_
UG
\"
"
fi
if test "x
$
HAVE
_
Alberta"
==
"xyes"; then
PARAMS
=
"
$
PARAMS
\"
--with-alberta=
$
PATH
_
Alberta
\"
"
fi
if test "x
$
HAVE
_
Alu3d" == "xyes"; then
PARAMS="
$
PARAMS
\"
--
with
-
alberta
=
$
PATH
_
Alu3d
\"
"
fi
# call the default implementation
run
_
default
_
configure
}
\end{lstlisting}
\end{lst}
The parameter section will be parsed by
\dunecontrol
will affect
i.e. the order in which the modules are built. The parameters and
their values are speperated by colon. Possible parameters are
\begin{itemize}
\item
\texttt
{
Module
}
(
\em
required
\em
) is the name of the module. The
name is of the form
\texttt
{
[a-zA-Z0-9
\_
]+
}
.
\item
\texttt
{
Depends
}
(
\em
required
\em
) takes a space seperated list
of required modules. This module is not functional without these
other modules.
\item
\texttt
{
Suggests
}
(
\em
optional
\em
) takes a space seperated list
of optional modules. This module is functional without these
other modules, but can offer further functionality if one or more of
the suggested modules are found.
\end{itemize}
The command section lets you overload the default implementation
provided by
\dunecontrol
. For each command
\dunecontrol
call the
function
\texttt
{
run
\_\textit
{
command
}}
. The parameters from the
commandline or the opts file are store in the variable
\texttt
{
\$
PARAMS
}
. If you just want to create additional parameters
you can add these to
\texttt
{
\$
PARAMS
}
and then call the default
implementation of the command via
\texttt
{
run
\_
default
\_\textit
{
command
}}
.
\section
{
Creating a new Dune module
}
\dune
modules are packages that offer a certain functionality that can
be used by
\dune
applications. Therefor
\dune
modules offer libraries
and/or header files.
In order to create new
\dune
module, you have to provide
\begin{itemize}
\item
a
\dunemodule
file
\\
Usually you will only need to specify the parameters
\texttt
{
Module
}
and
\texttt
{
Depends
}
.
\item
an
\autogen
script
\\
For most of the modules it should be sufficient to copy the
\autogen
from
\dunegrid
.
\item
a
\configureac
file
\\
Have look at the
\configureac
in
\dunegrid
for example. The most
important part is the call to
\texttt
{
DUNE
\_
CHECK
\_
ALL
\_
M
}
which
runs all checks needed for a
\dune
module, plus the checks for the
dependencies.
\end{itemize}
A
\dune
module should comply with the following rules:
\begin{itemize}
\item
Documentation is located under
\texttt
{
doc/
}
and gets
web-installed under
\texttt
{
BASEDIR/doc/
}
.
\item
\automake
includes are located in
\dunecommon
. To use them, you
will have to make a symbolic link to
\texttt
{
dune-common/am/
}
. The
symlink creation should be handled by the
\autogen
.
\item
The
\texttt
{
am/
}
directory does not get included in the tarball.
\item
Header files that can be used by other
\dune
modules should be
accessible via
\verb
!
#include <dune/foo/bar.hh>
!
. In order to work
with a freshly checkout version of your module you will usually need
to create a local symbolic link
\texttt
{
dune ->
\textit
{
module-direcotry/
}}
. This link gets created by the
\texttt
{
DUNE
\_
CHECK
\_
ALL
\_
M
}
command of your
\configureac
. When running
\texttt
{
make install
}
all header files should be installed into
\texttt
{
\textit
{
prefix
}
/include/dune/
}
.
\end{itemize}
\section
{
Creating a new Dune application
}
A
\dune
application does not differ a lot from a
\dune
module.
The only difference is that it does not offer functionality to other
\dune
projects. This make somethings a little bit easier.
\section
{
Futher questions
}
In order to create new
\dune
module, you have to provide
\begin{itemize}
\item
a
\dunemodule
file
\\
Usually you will only need to specify the parameters
\texttt
{
Module
}
and
\texttt
{
Depends
}
.
\item
an
\autogen
script
\\
For most of the application the
\autogen
following further below
should be sufficient.
\item
a
\configureac
file
\\
The
\configureac
looks more less the same as for a
\dune
module
except that you call
\texttt
{
DUNE
\_
CHECK
\_
ALL
}
instead of
\texttt
{
DUNE
\_
CHECK
\_
ALL
\_
M
}
.
\end{itemize}
\begin{lst}
{
Example autogen.sh for a
\dune
application
}
\label
{
example
_
autogen.sh
}
\begin{lstlisting}
[basicstyle=
\ttfamily\scriptsize
]
#!/bin/sh
set -e
usage ()
{
echo "Usage: ./autogen.sh [options]"
echo " --ac=, --acversion=VERSION use a specific VERSION of autoconf"
echo " --am=, --amversion=VERSION use a specific VERSION of automake"
echo " -h, --help you already found this :-)"
}
for OPT in "
$
@"; do
set
+
e
# stolen from configure...
# when no option is set, this returns an error code
arg
=
`expr "x
$
OPT" : 'x[
^
=]*=
\(
.
*
\)
'`
set -e
case "
$
OPT" in
--
ac
=*
|
--
acversion
=*)
if test "x
$
arg" == "x"; then
usage;
exit 1;
fi
ACVERSION=
$
arg
;;
--
am
=*
|
--
amversion
=*)
if test "x
$
arg" == "x"; then
usage;
exit 1;
fi
AMVERSION=
$
arg
;;
-
h|
--
help
)
usage ; exit
0
;;
*)
if test
-
f "
$
OPT/m4"; then
ACLOCAL
_
FLAGS="
$
ACLOCAL
_
FLAGS
-
I
$
(cd
$
OPT
/
m
4
; pwd
)
"
fi
if test
-
d "
$
OPT/am"; then
am
_
dir="
$
OPT
/
am"
fi
;;
esac
done
if test x
$
1 = "x" ; then
usage
exit 0
fi
if test "x
$
ACLOCAL
_
FLAGS"
=
"x"; then
echo dune
-
common
/
m
4
not found. Please supply directory
!
usage
exit
1
fi
if test
-
d m
4
; then
ACLOCAL
_
FLAGS
=
"
$
ACLOCAL
_
FLAGS -I m4"
fi
if test "x
$
AMVERS"
!=
x ; then
echo Warning: explicitly using automake version
$
AMVERS
# binaries are called automake-
$
AMVERS
AMVERS
=
"
-
$
AMVERS"
fi
aclocal
$
AMVERSION
$
ACLOCAL
_
FLAGS
libtoolize --automake --force
autoheader
$
ACVERSION
automake
$
AMVERSION --add-missing
autoconf
$
ACVERSION
\end
{
lstlisting
}
\end
{
lst
}
\section
{
Futher questions
}
\end
{
document
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment