Skip to content

Commit f0345c3

Browse files
authored
Merge pull request #17 from qingfengxia/dev
fix doxygen html path in doc page
2 parents 05a81d5 + 187f10b commit f0345c3

2 files changed

Lines changed: 51 additions & 75 deletions

File tree

scripts/site_generation.py

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,20 @@
66
this script will generate html site for doxygen doc, coverage and other QA report/
77
88
adapted from EERA: https://github.com/ScottishCovidResponse/Covid19_EERAModel/blob/dev/scripts/site_generation.py
9-
with hand-crafted: flawfinder, simalrity, clang_tidy parsers
9+
with hand-crafted: flawfinder, similarity, clang_tidy parsers
10+
11+
All generated html file are located in repo_root/site/,
12+
so all other resource path pathes should be relative to repo_root/site/
1013
1114
Changelog:
1215
- coverage_report_folder by default is located in `build` folder
1316
- generalized by extract out `my_project_name` as a variable
1417
- this python script works with generate_site.sh, run in build folder for local test
1518
- github CI works in project root folder, while build folder must be called `build`
1619
20+
1721
Todo: flowfinder.html page is missing
22+
CI badge URL is hardcoded to this repo,
1823
1924
"""
2025

@@ -23,9 +28,9 @@
2328
import os.path
2429

2530
my_project_name = "parallel-preprocessor"
26-
if os.path.exists("src"): # CI mode
27-
coverage_report_folder = "build/{}_coverage/index.html".format(my_project_name)
28-
doxygen_html_index = "doxygen/html/index.html"
31+
if os.path.exists("src"): # CI mode. all pathes should be relative to repo_root/site/
32+
coverage_report_folder = "../build/{}_coverage/index.html".format(my_project_name)
33+
doxygen_html_index = "../doxygen/html/index.html"
2934
else: # local build test mode
3035
coverage_report_folder = "{}_coverage/index.html".format(my_project_name)
3136
doxygen_html_index = "doxygen/html/index.html"
@@ -258,16 +263,16 @@ def build_index(self):
258263
</thead>
259264
<tbody>
260265
<tr>
261-
<td>master</td>
262-
<td> <img src="https://github.com/ScottishCovidResponse/Covid19_EERAModel/workflows/Covid19EERAModel/badge.svg?branch=master&event=push" class="img-rounded" alt="Master Status"> </td>
266+
<td>master branch on UKAEA</td>
267+
<td> <img src="https://github.com/ukaea/parallel-preprocessor/workflows/ubuntu-macos/badge.svg?branch=master&event=push" class="img-rounded" alt="Master Status"> </td>
263268
</tr>
264269
<tr>
265-
<td>dev</td>
266-
<td> <img src="https://github.com/ScottishCovidResponse/Covid19_EERAModel/workflows/Covid19EERAModel/badge.svg?branch=dev&event=push" class="img-rounded" alt="Dev Status"> </td>
270+
<td>dev of Qingfeng Xia fork</td>
271+
<td> <img src="https://github.com/qingfengxia/parallel-preprocessor/workflows/ubuntu-macos/badge.svg?branch=dev&event=push" class="img-rounded" alt="Dev Status"> </td>
267272
</tr>
268273
<tr>
269274
<td>gh-pages</td>
270-
<td> <img src="https://github.com/ScottishCovidResponse/Covid19_EERAModel/workflows/Covid19EERAModel/badge.svg?branch=gh-pages&event=push" class="img-rounded" alt="GitHub Pages Status"> </td>
275+
<td> <img src="https://github.com/ukaea/parallel-preprocessor/workflows/ubuntu-macos/badge.svg?branch=gh-pages&event=push" class="img-rounded" alt="GitHub Pages Status"> </td>
271276
</tr>
272277
</tbody>
273278
</table>

wiki/BuildOnLinux.md

Lines changed: 37 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ There are some third-party libraries already integrated into the source code tre
4646

4747
---
4848

49-
### Build from source
49+
## Build from source
5050

5151
Tested compiler: g++ 7.x, g++8.x, clang 6 (needs CMake 3.13+ ) on ubuntu 18.04
5252

@@ -62,16 +62,15 @@ CXX=clang++ cmake .. -DPYTHON_EXECUTABLE:FILEPATH=$(which python3) -DCMAKE_BUIL
6262

6363
clang++ shares header files and libstdc++.so with G++
6464

65-
Error with pybind11 when compiled by clang++10
65+
Error with pybind11 when compiled by clang++10, which has been fixed in latest pybind11 (v2.6).
6666

6767
```
6868
/usr/include/pybind11/pybind11.h:1010:9: error: no matching function for call to 'operator delete'
6969
::operator delete(p, s);
7070
^~~~~~~~~~~~~~~~~
71-
7271
```
7372

74-
73+
User can either sticks with g++ or upgrade pybind11 installation to fix this error.
7574

7675
### Method 1: building on local Linux
7776

@@ -157,9 +156,10 @@ yum install python3 python3-devel -y
157156
yum install qt5-devel qt5-qtwebsockets-devel qt5-qtwebsockets -y
158157
```
159158

160-
2. Install OpenCASCADE 7.x
159+
### Install OpenCASCADE 7.x
160+
161+
#### Option 1: Install opencascade 7.4 from package repository
161162

162-
2.1 option 1: Install opencascade 7.4 from package repository
163163
For fedora 30+ since Jan 2020, there are freecad (python3) and opencascade 7.4 in repository to install
164164

165165
```bash
@@ -168,7 +168,9 @@ yum install opencascade-draw, opencascade-foundation, opencascade-modeling, op
168168
opencascade-visualization opencascade-devel freecad -y
169169
```
170170

171-
2.2 Option 2: Download the opencascade source code and compile from source, if not in package repository
171+
#### Option 2: Download the opencascade source code and compile from source.
172+
173+
if not in package repository
172174

173175
```bash
174176
###### dependencies needed to build OpenCASCADE from source ##########
@@ -182,22 +184,29 @@ yum install tk tcl tk-devel tcl-devel -y
182184
yum install openmpi-devel boost-devel -y
183185
```
184186

185-
To get the latest source code from [OCCT official website](https://www.opencascade.com/), you need register (free of charge)
187+
To get the latest source code from [OCCT official website](https://www.opencascade.com/), you need register (free of charge). Registered user may setup public ssh key and get readonly access to the occt repo
188+
`git clone -b V7_4_0p1 gitolite@git.dev.opencascade.org:occt occt`
189+
<https://old.opencascade.com/doc/occt-7.4.0/overview/html/occt_dev_guides__git_guide.html>
190+
191+
To get the release source code, this can be downloaded by wget from a link
192+
`wget "http://git.dev.opencascade.org/gitweb/?p=occt.git;a=snapshot;h=V7_4_0p1;sf=tgz" `
193+
"V7_4_0p1" is the tag version name, more version tags can be found on `http://git.dev.opencascade.org/gitweb/?p=occt.git`
186194

187-
Note for UKAEA users: I put the source code on UKAEA one drive to share: user your webbrowser with UKAEA email login to open the link, otherwise login in office 365
188-
<https://ukaeauk-my.sharepoint.com/:u:/g/personal/qingfeng_xia_ukaea_uk/Efs6Dhazcb1MtH44bCyYSqUBpJ2nzvbb3wgytEjYtLIhXA?e=uo32mf>
189195

190196
```bash
191-
cd opencascade*
197+
198+
wget "http://git.dev.opencascade.org/gitweb/?p=occt.git;a=snapshot;h=V7_4_0p1;sf=tgz" -O occt.tar.gz
199+
tar -xzf occt.tar.gz
200+
cd occt-*
192201
mkdir build
193202
cd build
194-
cmake ..
203+
cmake ..
195204
make -j$(nproc)
196-
make install
205+
sudo make install
197206
# by default install to the prefix: /usr/local/
198207
```
199208

200-
## Compile parallel-preprocessor
209+
### Compile parallel-preprocessor
201210

202211
CMake build system is employed to simplify cross-platform development
203212

@@ -211,81 +220,43 @@ cd parallel-preprocessor
211220
#
212221
mkdir build
213222
cd build
214-
cmake ..
223+
cmake .. -DPYTHON_EXECUTABLE:FILEPATH=$(which python3) -DCMAKE_BUILD_TYPE=Release
215224
make -j$(nproc)
216225
```
217226

218-
If python3 is not detected by pybind11, then
219-
`cmake -DPYTHON_EXECUTABLE:FILEPATH=$(which python3) ..`
220-
Qt5 have not yet been configured to compile on fedora in docker
221-
222227

223-
### Method2: use docker image
224-
225-
This image is based on ubuntu 18.04 with OpenCASCADE and FreeCAD installed.
226-
```bash
227-
docker pull qingfengxia/freecad-daily-python3
228-
docker pull qingfengxia/ppp-fedora
228+
## Installation
229229

230-
# cd to your working folder
231-
# I can not git clone this internal repo inside image, so it is done outside docker VM
232-
# git clone will NOT download the external submodule loguru, so run this command
233-
git submodule update --init --recursive
230+
### install by "sudo make install"
234231

235-
# log into this image, using full host path for volume binding
236-
docker run -ti -u root -w /home/user/parallel-preprocessor -v $(pwd)/parallel-preprocessor:/home/user/parallel-preprocessor qingfengxia/freecad-daily-python3:latest /bin/bash
232+
`sudo make install` to install to `/usr` or any other defined by `CMAKE_INSTALL_PREFIX`
233+
`sudo make uninstall` in the build folder to uninstall.
237234

238-
# to run docker image locally, you can mapping dir and xwindows
239-
# https://github.com/mviereck/x11docker
235+
### Use after built the deb/rpm package
236+
#### Generate deb/rpm package
240237

241-
```
238+
After successfully build this software from source using cmake, `make package` will generate the platform binary package, deb or rpm (currently, only Ubuntu 18.04 and fedora 30+). see [./Packaging.md] for more details.
242239

243-
Inside the docker VM, or if you have managed all dep locally, change dir into the repo folder
244-
`mkdir build && cd build && cmake -DPython_EXECUTABLE=$(which python3) .. && make -j4`
240+
#### Install parallel processor package
241+
Precompiled binary packages may be provided in the future.
245242

246-
It is a CMake project. `rm -rf build` if you want to rebuild after some change in CMakeLists.txt
243+
Platform package rpm and deb has been generated in the build directory, install it.
244+
`sudo rpm -Uhv parallel-preprocessor*` on fedora/RedHat systems
245+
or `sudo dpkg -i parallel-preprocessor*` on debian/ubuntu
247246

248-
## Installation
249247
### Use without system-wide installation
250248

251249
Without installation, this software can be evaluated by running [geomPipeline.py path_to_geometry_file](./python/geomPipeline.py), after building from source.
252250

253-
After out of source build in the `parallel-preprocessor/build` folder by `cmake -DPython_EXECUTABLE=$(which python3) .. && make -j6`, change directory to `cd parallel-preprocessor/build/ppptest`, run `python3 geomPipeline.py path-to-your-geometry.stp`. User can user absolute or relative path for the input geometry file.
254-
255251
Note: change directory to the folder containing geomPipeline.py is not necessary, if user has put full path of `parallel-preprocessor/build/bin/` folder into user path. For example, by editing PATH varialbe in `~/.bashrc` on Ubuntu, it will just work as installed program.
256252

257-
#### add `bin` in the `build folder` to the user path
258-
259253
Just append the `bin` folder to user `path` in `~/.bashrc`, that is all. you should be able to imprint geometry by `geomPipeline.py input_geometry_path`. And also append `build/lib` to `LD_LIBRARY_PATH`
260254

261-
This is the recommended way in this development stage, then it is easier to pull and build the latest source. There is no need for super user privilege.
262-
263-
However, unit test application such as `pppGeomTests` must be run in the `build/ppptest` folder for the moment, since test data in `parallel-preprocessor/build/data` are referred using relative path.
264-
265-
266-
### Use after install the deb/rpm package
267-
#### Generate deb/rpm package
268-
269-
After successfully build this software from source using cmake, `make package` will generate the platform binary package, deb or rpm (currently, only Ubuntu 18.04 and fedora 30+). see [./Packaging.md] for more details.
270-
271-
#### Install parallel processor package
272-
Precompiled binary packages may be provided in the future.
273-
274-
Platform package rpm and deb has been generated in the build directory, install it.
275-
`sudo rpm -i parallel-preprocessor*` on RedHat systems
276-
or `sudo dpkg -i parallel-preprocessor*` on debian/ubuntu
277-
278-
Note, super user privilege may be needed, depending on install prefix specified in cmake configuraton.
255+
This is the recommended way in this development stage, then it is easier to pull and build the latest source. Super user privilege is needed.
279256

280-
#### Use after installation
281-
All python scripts and binary programs are installed to path, so there is no need to specify `geomPipeline.py` path. It can be run as a python3 script executable
282-
`geomPipeline.py <your_geometry_file_path>`
283257

284-
### Install python conda package
285258

286-
A conda package can be generated to support more Linux platforms.
287259

288-
However, it is not completed and tested yet since there is built C-extension module involved. User should install all the necessary dependency, such as OpenCASCADE 7.x, TBB, FreeCAD.
289260

290261

291262

0 commit comments

Comments
 (0)