forked from FreeCAD/FreeCAD
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Linux_Debian_09_Buster_compile_FreeCAD_no_externals_Qt5_Py3.sh
189 lines (155 loc) · 5.44 KB
/
Linux_Debian_09_Buster_compile_FreeCAD_no_externals_Qt5_Py3.sh
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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
#!/bin/bash
# Released under GPL v2.0
# bernd@bimstatik.org
# Linux_Debian_09_Buster_compile_FreeCAD_no_externals_Qt5_Py3.sh
# tested on Debian Buster = 10.0
#sudo rm -rf build_FC
#sudo rm -rf /opt/local/FreeCAD-0.17
mkdir build_FC
cd build_FC
base_dir=`pwd`
cd $base_dir
# *******************************************
echo START THE FreeCAD JOURNEY !!!
echo -----------------------------
# *******************************************
# update and upgrade system
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get dist-upgrade -y
sudo apt-get autoremove -y
sudo apt-get update
sudo apt-get clean
# *******************************************
# get Dependencies from distribution
packages_build=" \
git \
cmake \
g++ \
libboost-all-dev \
"
sudo apt-get install -y $packages_build
packages_hard_dependencies=" \
debhelper \
dh-exec \
dh-python \
libcoin80-dev \
libopencv-dev \
libeigen3-dev \
libgts-bin \
libgts-dev \
libkdtree++-dev \
libmedc-dev \
libocct-data-exchange-dev \
libocct-ocaf-dev \
libocct-visualization-dev \
libproj-dev \
libpyside2-dev \
libqt5opengl5-desktop-dev \
libqt5svg5-dev \
libqt5webkit5-dev \
libqt5x11extras5-dev \
libshiboken2-dev \
libspnav-dev \
libvtk6-dev \
libx11-dev \
libxerces-c-dev \
libzipios++-dev \
lsb-release \
occt-draw \
pyside2-tools \
python-pyside2.qtcore \
python-pyside2.qtgui \
python-pyside2.qtsvg \
python-pyside2.qtwidgets \
python-dev \
python-ply \
qtbase5-dev \
qttools5-dev \
swig \
"
sudo apt-get install -y $packages_hard_dependencies
# may be some of the above are not needed for Python 3 build ...
packages_opt_dependencies=" \
python-matplotlib \
"
sudo apt-get install -y $packages_opt_dependencies
packages_div=" \
gmsh \
calculix-ccx \
"
sudo apt-get install -y $packages_div
packages_pivy=" \
python-dbg \
python-setuptools \
python3-dbg \
python3-numpy \
python3-setuptools \
python-pyside2.qtopengl \
python3-pyside2.qtcore \
python3-pyside2.qtgui \
python3-pyside2.qtopengl \
python3-pyside2.qtwidgets \
libsoqt4-dev \
libsimage-dev \
"
sudo apt-get install -y $packages_pivy
sudo apt-get install -y python3-six # FEM needs six for sure
# *******************************************
# update and clean the system
sudo apt-get update
sudo apt-get clean
# *******************************************
# get, compile and install pivy for Python3
# https://forum.freecadweb.org/viewtopic.php?f=4&t=32389#p270460
cd $base_dir
git clone https://github.com/FreeCAD/pivy
cd pivy
python3 setup_old.py build
sudo python3 setup_old.py install
cd $base_dir
# *******************************************
# get FreeCAD latest Github commit
cd $base_dir
git clone https://github.com/FreeCAD/FreeCAD freecad
# *******************************************
# cmake, compile and install FreeCAD
mkdir build
cd build
cmake \
-DCMAKE_INSTALL_PREFIX:PATH=/opt/local/FreeCAD-0.18 \
-DBUILD_QT5=ON \
-DCMAKE_BUILD_TYPE="DEBUG" \
-DFREECAD_BUILD_DEBIAN=ON \
-DOCC_INCLUDE_DIR="/usr/include/occt" \
-DFREECAD_USE_OCCT_VARIANT="Official" \
-DPYTHON_BASENAME=".cpython-37m-x86_64-linux-gnu" \
-DPYTHON_CONFIG_SUFFIX=".cpython-37m-x86_64-linux-gnu" \
-DPYTHON_EXECUTABLE="/usr/bin/python3.7" \
../freecad
# https://forum.freecadweb.org/viewtopic.php?f=10&t=30340&start=190#p274393
# https://forum.freecadweb.org/viewtopic.php?f=4&t=32286#p269617
# -DBUILD_QT5=ON \
# https://forum.freecadweb.org/viewtopic.php?f=4&t=32328#p269678
# -DOCCT_CMAKE_FALLBACK=True \
# glaube entweder das oder -DFREECAD_USE_OCCT_VARIANT="Official"
# https://forum.freecadweb.org/viewtopic.php?f=4&t=32286&start=20#p269806
# -DPYTHON_CONFIG_SUFFIX="-python2.7.x86_64-linux-gnu" \
make -j 2
sudo make install
sudo ln -s /opt/local/FreeCAD-0.18/bin/FreeCAD /usr/local/bin/FreeCAD # make link
sudo ln -s /opt/local/FreeCAD-0.18/bin/FreeCADCmd /usr/local/bin/FreeCADCmd # make link
# *******************************************
# run FreeCAD unit test
FreeCADCmd --run-test 0 # all
FreeCADCmd --run-test "TestFem"
# *******************************************
echo -----------------------------
echo END THE FreeCAD JOURNEY !!!
# *******************************************
# get back to bas dir
cd $base_dir
# *******************************************
# delete build_FC (all git clone and all build dirs)
cd ..
# sudo rm -rf build_FC