Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
dune-fem-dg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
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
dune-fem
dune-fem-dg
Commits
2783f0ee
Commit
2783f0ee
authored
4 years ago
by
Robert K
Browse files
Options
Downloads
Patches
Plain Diff
[feature][scripts] improve build script.
parent
bf2a9c33
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#34432
passed
4 years ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/build-dune-fem-dg.sh
+48
-13
48 additions, 13 deletions
scripts/build-dune-fem-dg.sh
with
48 additions
and
13 deletions
scripts/build-dune-fem-dg.sh
+
48
−
13
View file @
2783f0ee
...
...
@@ -45,7 +45,7 @@ DUNEFEMMODULES="dune-fem dune-fempy dune-fem-dg"
# change according to your needs
if
test
-f
config.opts
;
then
read
-p
"Found config.opts. Overwrite with default? (y,n) "
YN
if
[
"
$YN
"
!
=
"y"
]
;
then
if
[
"
$YN
"
=
=
"y"
]
;
then
echo
"Overwriting config.opts!"
rm
-f
config.opts
fi
...
...
@@ -72,35 +72,70 @@ if [ "$FOUND_DUNE_ACTIVATE" == "" ]; then
echo
"
## DUNE_VENV_SPECIFIC_SETUP
# set current main working directory
export DUNE_CONTROL_PATH=
\$
{PWD}
# setVariable( varname newvalue )
setVariable() {
if [ -n
\"\$
{!1}
\"
]; then
export _OLD_VIRTUAL_
\$
{1}=
\$
{!1}
fi
export
\$
{1}=
\"\$
{2}
\"
}
#source
\$
DUNE_CONTROL_PATH/dune-venv/bin/activate
# set current main working directory
setVariable DUNE_CONTROL_PATH
\$
PWD
setVariable DUNE_LOG_LEVEL
\"
info
\"
# defines CMAKE_FLAGS
source
\$
{DUNE_CONTROL_PATH}/config.opts
# critical, debug, info, none
export DUNE_LOG_LEVEL=info
export DUNE_LOG_FORMAT='%(asctime)s - %(name)s - %(levelname)s - %(message)s'
export DUNE_PY_DIR=
\$
{DUNE_CONTROL_PATH}/cache/
export DUNE_CMAKE_FLAGS="
\$
{
CMAKE_FLAGS
}
"
setVariable DUNE_PY_DIR
\$
{DUNE_CONTROL_PATH}/cache/
setVariable DUNE_CMAKE_FLAGS
\"\$
CMAKE_FLAGS
\"
DUNEPYTHONPATH=
MODULES=
\`\$
DUNE_CONTROL_PATH/dune-common/bin/dunecontrol --print 2> /dev/null
\`
for MOD in
\$
MODULES; do
MODPATH=
\"\$
{PWD}/
\$
{MOD}/build-cmake/python
\"
MODFOUND=
\`
echo
\$
PYTHONPATH | grep
\$
MODPATH
\`
MODFOUND=
\`
echo
\$
DUNE
PYTHONPATH | grep
\$
MODPATH
\`
if [
\"\$
MODFOUND
\"
==
\"\"
]; then
export
PYTHONPATH=
\$
PYTHONPATH:
\$
MODPATH
DUNE
PYTHONPATH=
\$
DUNE
PYTHONPATH:
\$
MODPATH
fi
done
setVariable PYTHONPATH
\$
DUNEPYTHONPATH
echo
\"
DUNE_LOG_LEVEL=
\$
DUNE_LOG_LEVEL
\"
echo
\"
Change with 'export DUNE_LOG_LEVEL={none,critical,info,debug}' if necessary!
\"
# python
\$
DUNE_CONTROL_PATH/dune-common/bin/setup-dunepy.py
save_function() {
local ORIG_FUNC=
\$
(declare -f
\$
1)
local NEWNAME_FUNC=
\"\$
2
\$
{ORIG_FUNC#
\$
1}
\"
eval
\"\$
NEWNAME_FUNC
\"
}
restoreVariable() {
VARNAME=_OLD_VIRTUAL_
\$
1
if [ -n
\"\$
{!VARNAME}
\"
]; then
export
\$
{1}=
\$
{!VARNAME}
unset
\$
{VARNAME}
else
unset
\$
{1}
fi
}
save_function deactivate venv_deactivate
deactivate() {
restoreVariable DUNE_CONTROL_PATH
restoreVariable DUNE_PY_DIR
restoreVariable DUNE_CMAKE_FLAGS
restoreVariable DUNE_LOG_LEVEL
restoreVariable PYTHONPATH
# call original deactivate
venv_deactivate
# self destroy
unset venv_deactivate
unset deactivate
}
"
>>
$WORKDIR
/dune-venv/bin/activate
#> activate.sh
fi
...
...
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