Skip to content

Commit 27fd44f

Browse files
committed
install DB
1 parent 9598a6c commit 27fd44f

File tree

3 files changed

+236
-0
lines changed

3 files changed

+236
-0
lines changed

feelpp-db/Dockerfile.template

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
MAINTAINER Feel++ Support <support@feelpp.org>
2+
3+
ARG BRANCH=develop
4+
ARG BUILD_JOBS=16
5+
ARG CMAKE_FLAGS=""
6+
ARG CXX=g++
7+
ARG CC=gcc
8+
9+
USER feelpp
10+
ENV HOME /home/feelpp
11+
12+
COPY feelpp.conf.sh $HOME/feelpp.conf.sh
13+
14+
# Source config for further use
15+
RUN bash -c 'echo -e "# Source configuration for Feel++\nsource $HOME/feelpp.conf.sh" >> ${HOME}/.bashrc'
16+
17+
# Install Feel++
18+
RUN bash -c "source $HOME/feelpp.conf.sh && install_feelpp_crb ${BRANCH} ${BUILD_JOBS} ${CMAKE_FLAGS}"
19+
20+
COPY WELCOME $HOME/WELCOME
21+
22+
ENV FEELPP_REPOSITORY /feel
23+
24+
# COPY WELCOME $HOME/WELCOME
25+
USER feelpp
26+
#ENTRYPOINT ["/sbin/my_init","--quiet","--","sudo","-u","feelpp","/bin/sh","-c"]
27+
CMD ["/bin/bash"]

feelpp-db/WELCOME

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Feel++ CRB applications
2+
3+
This image provides the Feel++ CRB applications. The testcases are in
4+
$HOME/Testcases/ and the results will be stored in /feel

feelpp-db/feelpp.conf.sh

Lines changed: 205 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,205 @@
1+
#!/bin/bash
2+
3+
DEFAULT_BRANCH=develop
4+
DEFAULT_NJOBS=1
5+
6+
# set feelpp home
7+
export FEELPP_SRC_DIR=${HOME}/src
8+
mkdir -p ${FEELPP_SRC_DIR}
9+
10+
export FEELPP_BUILD_DIR=${HOME}/build
11+
mkdir -p ${FEELPP_BUILD_DIR}
12+
13+
export FEELPP_HOME=/usr/local
14+
mkdir -p ${FEELPP_HOME}
15+
16+
export PATH=${FEELPP_HOME}/bin:${PATH}
17+
export LD_LIBRARY_PATH=${FEELPP_HOME}/lib:$LD_LIBRARY_PATH
18+
export PKG_CONFIG_PATH=${FEELPP_HOME}/lib/pkgconfig:$PKG_CONFIG_PATH
19+
export PYTHONPATH=${FEELPP_HOME}/lib/python2.7/site-packages:$PYTHONPATH
20+
export MANPATH=${FEELPP_HOME}/share/man:$MANPATH
21+
22+
# bash functions
23+
pull_feelpp ()
24+
{
25+
echo "Pulling feelpp..."
26+
git config --global user.name "Docker Robot"
27+
git config --global user.email "docker@feelpp.org"
28+
cd ${FEELPP_SRC_DIR}
29+
if [ -d feelpp ]
30+
then
31+
cd feelpp
32+
git pull --depth 1 origin ${1:-${DEFAULT_BRANCH}}
33+
else
34+
git clone --depth 1 --branch ${1:-${DEFAULT_BRANCH}} https://www.github.com/feelpp/feelpp.git
35+
cd feelpp
36+
git submodule update --init --recursive contrib/nlopt
37+
fi
38+
}
39+
configure_feelpp()
40+
{
41+
cd ${FEELPP_BUILD_DIR}/
42+
if [[ $CXXFLAGS ]]; then
43+
${FEELPP_SRC_DIR}/feelpp/configure -r --cxxflags="${CXXFLAGS}" --cmakeflags="-DCMAKE_INSTALL_PREFIX=${FEELPP_HOME} $*";
44+
else
45+
${FEELPP_SRC_DIR}/feelpp/configure -r --cmakeflags="-DCMAKE_INSTALL_PREFIX=${FEELPP_HOME} $*";
46+
fi
47+
}
48+
build_feelpp_libs()
49+
{
50+
echo "Building Feel++ Libs..."
51+
if [ -d ${FEELPP_SRC_DIR}/feelpp ]
52+
then
53+
# Get the number of jobs to be used
54+
NJOBS=${1:-${DEFAULT_NJOBS}}
55+
shift
56+
# $* now contains possible additional cmake flags
57+
configure_feelpp $*
58+
echo "Travis: ${TRAVIS}"
59+
if [ ${TRAVIS} ]; then
60+
sudo make -j 4 contrib
61+
fi
62+
sudo make -j $NJOBS install-feelpp-lib
63+
else
64+
echo "Feel++ source cannot be found. Please run pull_feelpp first."
65+
fi
66+
}
67+
clean_feelpp()
68+
{
69+
rm -rf ${FEELPP_BUILD_DIR}/*
70+
echo -e "\033[33;32m--- Cleaning done. \033[0m"
71+
}
72+
73+
# install Feel++ libs
74+
install_feelpp_libs()
75+
{
76+
pull_feelpp ${1:-${DEFAULT_BRANCH}}
77+
build_feelpp_libs ${2:-${DEFAULT_NJOBS}}
78+
clean_feelpp
79+
}
80+
81+
#
82+
# Feel++ Base
83+
configure_feelpp_base()
84+
{
85+
echo "--- Configuring Feel++ Base..."
86+
cd $HOME
87+
cd ${FEELPP_BUILD_DIR}/
88+
if [[ $CXXFLAGS ]]; then
89+
${FEELPP_SRC_DIR}/feelpp/quickstart/configure -r --root="${FEELPP_SRC_DIR}/feelpp/quickstart" --cxxflags="${CXXFLAGS}" --cmakeflags="-DCMAKE_INSTALL_PREFIX=${FEELPP_HOME} $*";
90+
else
91+
${FEELPP_SRC_DIR}/feelpp/quickstart/configure -r --root="${FEELPP_SRC_DIR}/feelpp/quickstart" --cmakeflags="-DCMAKE_INSTALL_PREFIX=${FEELPP_HOME} $*";
92+
fi
93+
echo -e "\033[33;32m--- Configuring Feel++ Base done. \033[0m"
94+
}
95+
96+
build_feelpp_base()
97+
{
98+
echo "--- Building Feel++ Base..."
99+
if [ -d ${FEELPP_SRC_DIR}/feelpp ]
100+
then
101+
# Get the number of jobs to be used
102+
NJOBS=${2:-${DEFAULT_NJOBS}}
103+
echo $NJOBS
104+
#shift
105+
# $* now contains possible additional cmake flags
106+
configure_feelpp_base ${@:3}
107+
sudo make -j $NJOBS install-feelpp-base
108+
else
109+
echo "Feel++ source cannot be found. Please run pull_feelpp first."
110+
fi
111+
echo -e "\033[33;32m--- Build Feel++ Base done. \033[0m"
112+
}
113+
114+
# install_feelpp_base <NJOBS:1>
115+
install_feelpp_base()
116+
{
117+
build_feelpp_base ${1:-${DEFAULT_NJOBS}} ${*:2}
118+
clean_feelpp
119+
}
120+
121+
122+
#
123+
# Feel++ Toolboxes
124+
configure_feelpp_toolboxes()
125+
{
126+
echo "--- Configuring Feel++ Toolboxes..."
127+
cd $HOME
128+
cd ${FEELPP_BUILD_DIR}/
129+
if [[ $CXXFLAGS ]]; then
130+
${FEELPP_SRC_DIR}/feelpp/configure -r --root="${FEELPP_SRC_DIR}/feelpp/toolboxes" --cxxflags="${CXXFLAGS}" --cmakeflags="-DCMAKE_INSTALL_PREFIX=${FEELPP_HOME} $*";
131+
else
132+
${FEELPP_SRC_DIR}/feelpp/configure -r --root="${FEELPP_SRC_DIR}/feelpp/toolboxes" --cmakeflags="-DCMAKE_INSTALL_PREFIX=${FEELPP_HOME} $*";
133+
fi
134+
echo -e "\033[33;32m--- Configuring Feel++ Base done. \033[0m"
135+
}
136+
137+
build_feelpp_toolboxes()
138+
{
139+
echo "--- Building Feel++ Toolboxes..."
140+
if [ -d ${FEELPP_SRC_DIR}/feelpp ]
141+
then
142+
# Get the number of jobs to be used
143+
NJOBS=${2:-${DEFAULT_NJOBS}}
144+
echo $NJOBS
145+
#shift
146+
# $* now contains possible additional cmake flags
147+
configure_feelpp_toolboxes ${@:3}
148+
sudo make -j $NJOBS install
149+
else
150+
echo "Feel++ source cannot be found. Please run pull_feelpp first."
151+
fi
152+
echo -e "\033[33;32m--- Build Feel++ Toolboxes done. \033[0m"
153+
}
154+
155+
# install_feelpp_toolboxes <NJOBS:1>
156+
install_feelpp_toolboxes()
157+
{
158+
build_feelpp_toolboxes ${1:-${DEFAULT_NJOBS}} ${*:2}
159+
clean_feelpp
160+
}
161+
162+
163+
#
164+
# Feel++ CRB
165+
configure_feelpp_db()
166+
{
167+
echo "--- Configuring Feel++ DB..."
168+
cd $HOME
169+
cd ${FEELPP_BUILD_DIR}/
170+
if [[ $CXXFLAGS ]]; then
171+
${FEELPP_SRC_DIR}/feelpp/configure -r --root="${FEELPP_SRC_DIR}/feelpp/applications/databases" --cxxflags="${CXXFLAGS}" --cmakeflags="-DCMAKE_INSTALL_PREFIX=${FEELPP_HOME} $*";
172+
else
173+
${FEELPP_SRC_DIR}/feelpp/configure -r --root="${FEELPP_SRC_DIR}/feelpp/applications/databases" --cmakeflags="-DCMAKE_INSTALL_PREFIX=${FEELPP_HOME} $*";
174+
fi
175+
echo -e "\033[33;32m--- Configuring Feel++ DB done. \033[0m"
176+
}
177+
178+
build_feelpp_db()
179+
{
180+
echo "--- Building Feel++ DB..."
181+
if [ -d ${FEELPP_SRC_DIR}/feelpp ]
182+
then
183+
# Get the number of jobs to be used
184+
NJOBS=${2:-${DEFAULT_NJOBS}}
185+
echo $NJOBS
186+
#shift
187+
# $* now contains possible additional cmake flags
188+
configure_feelpp_db ${@:3}
189+
sudo make -j $NJOBS install
190+
else
191+
echo "Feel++ source cannot be found. Please run pull_feelpp first."
192+
fi
193+
echo -e "\033[33;32m--- Build Feel++ DB done. \033[0m"
194+
}
195+
196+
# install_feelpp_db <NJOBS:1>
197+
install_feelpp_db()
198+
{
199+
build_feelpp_db ${1:-${DEFAULT_NJOBS}} ${*:2}
200+
clean_feelpp
201+
}
202+
203+
204+
205+

0 commit comments

Comments
 (0)