This repository has been archived by the owner on Apr 23, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
142 lines (117 loc) · 4.31 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# Makefile for Simphony Framework
# You can set these variables from the command line.
SIMPHONYENV ?= $(HOME)/simphony
# end
UBUNTU_CODENAME=$(shell lsb_release -cs)
SIMPHONY_COMMON_VERSION ?= master
SIMPHONY_OPENFOAM_VERSION ?= master
# Path for MPI in HDF5 suport
MPI_INCLUDE_PATH ?= /usr/include/mpi
OPENFOAM_VERSION=231
.PHONY: clean \
provision \
base \
apt-simphony-deps \
apt-openfoam-deps \
fix-pip \
simphony-env \
simphony \
simphony-common \
simphony-openfoam \
test-plugins \
test-framework \
test-openfoam \
test-simphony
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " provision to install the dependencies (requires sudo)"
@echo " venv to create a simphony virtualenv"
@echo " simphony to build and install the simphony framework"
@echo " test run the tests for the simphony-framework"
@echo " clean remove any temporary folders"
clean:
@echo
@echo "Removed temporary folders"
provision: base apt-simphony-deps apt-openfoam-deps fix-pip
venv: simphony-env solvers
solvers:
simphony: simphony-common simphony-openfoam
@echo
@echo "Simphony plugins installed"
test-plugins: test-simphony
@echo
@echo "Tests for simphony plugins done"
test: test-plugins
@echo
@echo "Tests for the simphony framework done"
# ----------------------
# Individual rules
base:
apt-get install -y --force-yes software-properties-common apt-transport-https python-software-properties
add-apt-repository ppa:git-core/ppa -y
apt-get update -qq
apt-get install -y --force-yes build-essential git subversion
apt-simphony-deps:
ifeq ($(UBUNTU_CODENAME),precise)
apt-get install -y --force-yes libhdf5-serial-1.8.4 libhdf5-serial-dev
else ifeq ($(UBUNTU_CODENAME),trusty)
apt-get install -y --force-yes libhdf5-7 libhdf5-dev
else
$(error "Unrecognized ubuntu version $(UBUNTU_CODENAME)")
endif
apt-get install -y --force-yes python-dev libatlas-dev libatlas3gf-base
@echo
@echo "Build dependencies for simphony installed"
apt-openfoam-deps:
ifeq ($(UBUNTU_CODENAME),precise)
echo "deb http://dl.openfoam.org/ubuntu precise main" > /etc/apt/sources.list.d/openfoam.list
add-apt-repository "deb http://us.archive.ubuntu.com/ubuntu/ precise multiverse"
else ifeq ($(UBUNTU_CODENAME),trusty)
echo "deb http://dl.openfoam.org/ubuntu trusty main" > /etc/apt/sources.list.d/openfoam.list
else
$(error "Unrecognized ubuntu version $(UBUNTU_CODENAME)")
endif
wget -O - http://dl.openfoam.org/gpg.key | apt-key add -
apt-get update -qq
ifeq ($(UBUNTU_CODENAME),precise)
apt-get install -y libcgal8 libcgal-dev
endif
apt-get install -y --force-yes openfoam$(OPENFOAM_VERSION)
@echo
@echo "Openfoam installed use . /opt/openfoam$(OPENFOAM_VERSION)/etc/bashrc to setup the environment"
fix-pip:
wget https://bootstrap.pypa.io/get-pip.py
python get-pip.py
rm get-pip.py
pip install --upgrade setuptools
pip install --upgrade virtualenv
@echo
pip --version
@echo "Latest pip installed"
simphony-env:
rm -rf $(SIMPHONYENV)
virtualenv $(SIMPHONYENV) --system-site-packages
# Put the site-packages as well. some .so files from liggghts end up there.
echo "export LD_LIBRARY_PATH=$(SIMPHONYENV)/lib:$(SIMPHONYENV)/lib/python2.7/site-packages/:\$$LD_LIBRARY_PATH" >> "$(SIMPHONYENV)/bin/activate"
echo ". /opt/openfoam$(OPENFOAM_VERSION)/etc/bashrc" >> "$(SIMPHONYENV)/bin/activate"
@echo
@echo "Simphony virtualenv created"
simphony-common:
pip install git+https://github.com/simphony/simphony-common.git@$(SIMPHONY_COMMON_VERSION)#egg=simphony
@echo
@echo "Simphony library installed"
simphony-openfoam:
rm -Rf src/simphony-openfoam
(mkdir -p src/simphony-openfoam/pyfoam; wget https://openfoamwiki.net/images/3/3b/PyFoam-0.6.4.tar.gz -O src/simphony-openfoam/pyfoam/pyfoam.tgz --no-check-certificate)
tar -xzf src/simphony-openfoam/pyfoam/pyfoam.tgz -C src/simphony-openfoam/pyfoam
(pip install src/simphony-openfoam/pyfoam/PyFoam-0.6.4; rm -Rf src/simphony-openfoam/pyfoam)
pip install git+https://github.com/simphony/simphony-openfoam.git@$(SIMPHONY_OPENFOAM_VERSION)#egg=foam_wrappers
@echo "Simphony OpenFoam plugin installed"
test-openfoam:
haas foam_controlwrapper foam_internalwrapper -v
@echo
@echo "Tests for the openfoam plugin done"
test-simphony:
haas simphony -v
@echo
@echo "Tests for simphony library done"