Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 88 additions & 0 deletions .github/workflows/conda-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: parallel-preprocessor-conda
# https://github.com/marketplace/actions/setup-miniconda
on: [push]

jobs:
ppp-conda-ci:
name: Ex1 (${{ matrix.python-version }}, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest", "windows-latest"]
python-version: ["3.6", "3.7"]
steps:
- uses: actions/checkout@v2
- uses: goanpeca/setup-miniconda@v1
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
channels: conda-forge
channel-priority: flexible
activate-environment: foo # the default env
#activate-environment: anaconda-client-env
#environment-file: etc/example-environment.yml

# - name: Conda install dependencies
# shell: bash -l {0}
# run: |
# conda info
# conda install cmake
# #only cmake installed from conda can find the conda install package?
# conda install -c conda-forge occt=7.4

# - name: compile on windows
# shell: bash -l {0}
# run: |
# mkdir condabuild
# cd condabuild
# cmake -G "NMake Makefiles" ..
# cmake --build .
# if: matrix.os == 'windows-latest'

# - name: compile on unix-like OS
# shell: bash -l {0}
# run: |
# mkdir condabuild
# cd condabuild
# cmake ..
# cmake --build .
# if: matrix.os != 'windows-latest'

- name: build conda package on windows and Linux
#shell: bash -l {0}
run: |
conda info
conda install conda-build
conda build ../recipe/meta.yaml

- name: test built package
shell: bash -l {0}
run: |
conda install -c local ppp
echo "start unit test in the folder:$(pwd)"
if [ ! -f "run_all_tests.sh" ]; then cp ../scripts/run_all_tests.sh ./ ; fi
bash run_all_tests.sh
if: matrix.os != 'windows-latest'

- name: Create Release
id: create_release
uses: actions/create-release@v1 #https://github.com/actions/upload-release-asset
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false

- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./my-artifact.zip # todo: tar.gz file on Linux
asset_name: my-artifact.zip
asset_content_type: application/zip
37 changes: 24 additions & 13 deletions .github/workflows/docker-ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: parallel-preprocessor-docker
name: fedora-debian

on: [push, pull_request]

Expand Down Expand Up @@ -28,28 +28,39 @@ jobs:
# compiler: gcc
# compilerpp: g++
# package_suffix: 'rpm'
# docker-image: "centos:8"
- os: 'debian-10'
compiler: gcc
compilerpp: g++
package_suffix: 'deb'
docker-image: "debian:10" # version 10 buster
container:
image: fedora:32
image: ${{ matrix.docker-image }}
steps:
- name: 'install git'
id: 'install-git'
- name: 'install dependencies on fedora'
id: 'install-dep-fedora'
run: |
yum install g++ gcc cmake make rpm-build git wget copr-cli -y && yum update -y

- uses: actions/checkout@v2
# GitHub's actions/checkout requires git version 2.18 or later, if run inside docker
#- name: Checkout submodules
# uses: textbook/git-checkout-submodule-action@master

- name: 'install dependencies'
id: 'install-dep'
run: |
yum install tbb tbb-devel freetype freetype-devel freeimage freeimage-devel \
glew-devel SDL2-devel SDL2_image-devel glm-devel libXmu-devel libXi-devel \
python3 python3-devel boost-devel -y
yum install opencascade-foundation opencascade-modeling opencascade-ocaf \
opencascade-visualization opencascade-devel -y
if: matrix.os == 'fedora-31' || matrix.os == 'fedora-32'

- name: 'install dependencies on debian'
id: 'install-dep-debian'
run: |
apt-get update
apt-get install -y g++ cmake git gcc build-essential
apt-get install -y libtbb*-dev libocct-*-dev occt-misc python3-dev python3-pybind11 libboost-dev
apt-get install -y libx11-dev libxmu-dev libxi-dev
if: matrix.os == 'debian-10'

- uses: actions/checkout@v2
# GitHub's actions/checkout requires git version 2.18 or later, if run inside docker
#- name: Checkout submodules
# uses: textbook/git-checkout-submodule-action@master

- name: 'build package'
id: 'build-package'
Expand Down
26 changes: 13 additions & 13 deletions .github/workflows/github-ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: parallel-preprocessor
name: ubuntu-macos
# adapted from: https://github.com/ScottishCovidResponse/Covid19_EERAModel/blob/dev/.github/workflows/eera.yml
# Supported runners and hardware resources
# https://docs.github.com/en/free-pro-team@latest/actions/reference/specifications-for-github-hosted-runners#supported-runners-and-hardware-resources
Expand All @@ -19,17 +19,17 @@ jobs:
matrix:
include:
- os: 'ubuntu-20.04'
comiler: gcc
comilerpp: g++
compiler: gcc
compilerpp: g++
package_suffix: 'deb'
- os: 'ubuntu-18.04'
comiler: gcc
comilerpp: g++
compiler: gcc
compilerpp: g++
package_suffix: 'deb'
# - os: 'macos-latest'
# comiler: gcc
# comilerpp: g++
# package_suffix: 'dmg'
- os: 'macos-latest'
compiler: gcc
compilerpp: g++
package_suffix: 'dmg'
steps:
- uses: actions/checkout@v2

Expand All @@ -39,7 +39,7 @@ jobs:
#sudo apt-get upgrade
sudo apt-get install -y g++ cmake clang cppcheck similarity-tester flawfinder
sudo apt-get install -y lcov htmldoc poppler-utils graphviz doxygen
sudo apt-get install -y libtbb*-dev libocct-*-dev occt-misc python3-dev python3-pybind11 freecad
sudo apt-get install -y libtbb*-dev libocct-*-dev occt-misc python3-dev python3-pybind11 libboost-dev freecad
sudo apt-get install -y libx11-dev libxmu-dev libxi-dev
if: matrix.os == 'ubuntu-20.04'
# ubuntu-20.04 has opencascade in official repo, PPA not needed, python3-pybind11 is also latest enough
Expand All @@ -49,15 +49,15 @@ jobs:
sudo add-apt-repository ppa:freecad-maintainers/freecad-stable
sudo apt-get update
#sudo apt-get upgrade
sudo apt-get install -y libtbb*-dev libocct-*-dev occt-misc python3-dev freecad
sudo apt-get install -y libtbb*-dev libocct-*-dev occt-misc python3-dev freecad libboost-dev
sudo apt-get install -y g++ cmake clang lcov cppcheck similarity-tester flawfinder clang-format clang-tidy
sudo apt-get install -y libx11-dev libxmu-dev libxi-dev
if: matrix.os == 'ubuntu-18.04'

- name: Compile on Linux (debug)
# env:
# CC: ${{ matrix.config.compiler }}
# CXX: ${{ matrix.config.compilerpp }}
# CC: ${{ matrix.compiler }}
# CXX: ${{ matrix.compilerpp }}
run: |
git submodule update --init --recursive
mkdir build
Expand Down
23 changes: 13 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -247,24 +247,25 @@ if (UNIX)
if (${CMAKE_OS_NAME} STREQUAL "Debian" OR ${CMAKE_OS_NAME} STREQUAL "Ubuntu")
# Tell CPack to generate a .deb package
set(CPACK_GENERATOR "DEB")
set(CPACK_PACKAGE_NAME "parallel-preprocessor_${CMAKE_OS_ID}-${CMAKE_OS_VERSION}")
# -${CPACK_DEBIAN_PACKAGE_ARCHITECTURE} not defined variable
string( TOLOWER "${PACKAGE_NAME}-${PACKAGE_VERSION_NAME}_${CMAKE_OS_ID}-${CMAKE_OS_VERSION}"
CPACK_PACKAGE_FILE_NAME )
set(CPACK_PACKAGE_NAME ${PACKAGE_NAME})
endif()
if (${CMAKE_OS_NAME} STREQUAL "RedHat" OR ${CMAKE_OS_NAME} STREQUAL "Fedora")
set(CPACK_GENERATOR "RPM")
set(CPACK_PACKAGE_NAME "parallel-preprocessor_${CMAKE_OS_ID}-${CMAKE_OS_VERSION}")
set(CPACK_PACKAGE_NAME ${PACKAGE_NAME})
endif()
if (APPLE)
set(CPACK_GENERATOR "DragNDrop")
set(CPACK_PACKAGE_NAME "parallel-preprocessor_${CMAKE_OS_ID}-${CMAKE_OS_VERSION}")
set(CPACK_PACKAGE_NAME ${PACKAGE_NAME})
endif()

# -${CPACK_DEBIAN_PACKAGE_ARCHITECTURE} not defined variable
string( TOLOWER "${PACKAGE_NAME}-${PACKAGE_VERSION_NAME}_${CMAKE_OS_ID}-${CMAKE_OS_VERSION}"
CPACK_PACKAGE_FILE_NAME )
endif()
if(WIN32)
# NSIS can be generated by opencascade and Qt dll are not bundled, so not quite working
set(CPACK_GENERATOR "NSIS64") # zip 7z are other choices
set(CPACK_PACKAGE_NAME "parallel-preprocessor-${CMAKE_OS_VERSION}_${CMAKE_OS_ID}")
set(CPACK_PACKAGE_NAME ${PACKAGE_NAME})
set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY ${PACKAGE_NAME})
endif()

Expand All @@ -275,16 +276,18 @@ set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Qingfeng Xia @ UKAEA")
set(CPACK_PACKAGE_DESCRIPTION, "${CMAKE_CURRENT_SOURCE_DIR}/Readme.md")
# Set a Package Version
set(CPACK_PACKAGE_VERSION ${PACKAGE_VERSION_NAME})
#set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}")
if (NOT APPLE)
# this LICENSE file's end of line caused problem during dmg package generation on MacOS
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
endif()

message(STATUS "CPACK_PACKAGE_FILE_NAME: ${CPACK_PACKAGE_FILE_NAME}")

################################################################

#set(CPACK_IGNORE_FILES "\.psd$;/\.git/;/backup/;\.#;/#;\.tar.gz$;/stage/;/build/;/condabuild/;\.diff$;\.DS_Store")
set(CPACK_SOURCE_GENERATOR "TGZ")
set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}")
set(CPACK_SOURCE_GENERATOR "ZIP")
set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${PACKAGE_VERSION_NAME}")
set(CPACK_SOURCE_IGNORE_FILES ${CPACK_IGNORE_FILES})

#################################################################
Expand Down
50 changes: 32 additions & 18 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,20 @@ Dr Andrew Davis of UKAEA, has contributed his technical insight, test geometrie

[**doxygen generated API documentation with wiki pages**](https://ukaea.github.io/parallel-preprocessor/site/doxygen-docs.html)

## Overview
## Feature overview

Although this software aims to be a framework for more CAE/CAE preprocessing operatons, currently, this software provides only multi-threading geometry imprint and collision check, via command line user interface. This software has demonstrated faster and more controllable geometry imprinting on large geometry assemblies (10k+ parts) that is not possible on most existing CAD tools.
This software aims to be a framework for more CAE/CAE **preprocessing operatons** for large geometry assemblies upto 1 millions parts, such as such as fusion reactor, areoplane, areo-engine as a whole, using high performance computation infrastructure like Exa-scale super-computer. see more [Technical Overview](./wiki/TechOverview.md) on why a parallel preprocessor is needed in the era of E-scale (10^18 FLops) computation.

Technical backgroud will be added later
Currently, this software provides only multi-threading geometry imprint and collision check, via command line user interface. This software has demonstrated faster and more controllable geometry **collision-detection, imprinting** on **large geometry assemblies (10k+ parts)** that is not possible on most existing CAD tools.

![CPU usage of parallel-preprocessor using 64 threads on a 32-core CPU](./wiki/assets/ppp_multithreading_cpu_usage.png)

Screenshot for the CPU usage of parallel-preprocessor using 64 threads on a 32-core CPU (Source: Dr Andy Davis)


## Future plan

[wiki/Roadmap.md](wiki/Roadmap.md): lists short-term and long-term plan, depends on funding status. Partially sponsoring this project is welcomed to enhance existing modules or develop new modules.

## Disclaimer

Expand All @@ -32,39 +41,50 @@ According to the open source [license](./LICENSE), **there is no warranty for t

This project has been designed to be cross-platform, but only Linux is supported as the baseline platform.

+ Ubuntu as the primary/baseline development platform, with deb binary package generated
+ Ubuntu latest LTS as the primary/baseline development platform, with deb binary package generated
- Debian package should be achievable, since OpenCASCADE are available in official repository

+ Fedora, Centos can compile ppp from source, with OpenCascade 7.x source code or copr package.
+ Fedora 30+ with OpenCascade 7.x package available from official repository, with rpm binary package generated.

+ Centos8 should work without much effort; Centos7 software stack is outdated, using docker/singularity instead.
+ Compiling from source code for other Linux platforms is straight-forward, driven by cmake and cpack, guidance provided.
- Centos8 should work without much effort, but OpenCASCADE must be compiled from source at first.
- Centos7 software stack is outdated for compiler and cmake , using docker/singularity instead.

+ Windows 10 users are encouraged to use WSL with one of the supported Linux distributions, while guide to compile on Windows has been added.

+ MacOS should be possible through homebrew, and compiling instruction has been provided.
+ MacOS compiling and packaging is done via homebrew, DragNDrop binary package is available.

Conda package and Linux native package for Ubuntu LTS may be available in the future, see [packaging.md](wiki/Packaging.md)

## Installation guide

### Download binary package
**Note: user must install runtime dependencies (TBB, OpenCASCADE, etc, see Compile guide wiki pages for each platform) then install the downloaded binary package. Hint: if user have freecad installed, then all dependencies should have installed**

### Download (x86_64 architecture) binary packages
Ubuntu deb package and fedora 30+ rpm package, conda packages for windows, it should be available to download on **github Release** for this public github. The unstable package build from the latest code on the main branch can be downloaded here <https://github.com/ukaea/parallel-preprocessor/releases/tag/dev>

**Note: choose the correct operation system, and the package is targeting at system-wide python3**

The package file has the name pattern: `parallel-preprocessor-<this_software_version>-dev_<OS name>-<OS version>.<package_suffix>`
If your OS is not supported, you need to compile it by yourself, there is documentation for installation dependency and build for all major platforms.
The package file has the name pattern: `parallel-preprocessor-<this_software_version>-dev_<OS name>-<OS version>.<package_suffix>` If your OS is not supported, you need to compile it by yourself, there is documentation for installation dependency and build for all major platforms.

`apt remove parallel-preprocessor`
`dpkg -i parallel-preprocessor*.deb`
[Download parallel-preprocessor for ubuntu version 18.04](https://github.com/ukaea/parallel-preprocessor/releases/download/dev/parallel-preprocessor-0.3-dev_ubuntu-18.04.deb)

[Download parallel-preprocessor for ubuntu version 20.04](https://github.com/ukaea/parallel-preprocessor/releases/download/dev/parallel-preprocessor-0.3-dev_ubuntu-20.04.deb)

[Download parallel-preprocessor for debian version 10](https://github.com/ukaea/parallel-preprocessor/releases/download/dev/parallel-preprocessor-0.3-dev_debian-10.deb)


[Download parallel-preprocessor for fedora version 31](https://github.com/ukaea/parallel-preprocessor/releases/download/dev/parallel-preprocessor-0.3-dev_fedora-31.rpm)

[Download parallel-preprocessor for fedora version 32](https://github.com/ukaea/parallel-preprocessor/releases/download/dev/parallel-preprocessor-0.3-dev_fedora-32.rpm)

Coming soon:
[Download parallel-preprocessor for MacOS 10.15](https://github.com/ukaea/parallel-preprocessor/releases/download/dev/parallel-preprocessor-0.3-dev_macos-latest.dmg)

Coming later: Conda package for Windows 10.

### Compile from source
[wiki/BuildOnLinux.md](wiki/BuildOnLinux.md): Guide to install dependencies and compile on Linux (Centos, Fedora, Ubuntu), build instructions.

Expand Down Expand Up @@ -105,13 +125,6 @@ If your OS is not supported, you need to compile it by yourself, there is docum
### Guide to packaging
[wiki/Packaging.md](wiki/Packaging.md) deb/rpm package generation by CPack, distribution strategy.

---

## Future plan

[wiki/Roadmap.md](wiki/Roadmap.md): lists short-term and long-term plan, depends on funding status. Partially sponsoring this project is welcomed to enhance existing modules or develop new modules.


---

## License consideration
Expand All @@ -125,4 +138,5 @@ Note: the main branch of this repo is `main` not `master`.

## Acknowledgement

Funding source: STEP project in UKAEA <http://www.ccfe.ac.uk/step.aspx>
Funding from August 2019 ~ April 2020: STEP project in UKAEA <http://www.ccfe.ac.uk/step.aspx>

3 changes: 1 addition & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,8 @@ endif(PPP_USE_PYTHON)


############################################################
# unit test module
# unit test module, PropertyContainer is header only
############################################################
if(PPP_USE_TEST)
add_subdirectory(test)
add_subdirectory (PropertyContainer) # Catch2 must be add() before this subdirectionary
endif()
10 changes: 9 additions & 1 deletion src/Geom/GeomTests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,19 @@ if(OCC_FOUND)
target_link_libraries(geom_tests ${OCC_LIBS}) # list should be used without quote
endif()

####################### standalone app #####################
add_executable(UniqueIdValidator "UniqueIdValidator.cpp") #
target_link_libraries(UniqueIdValidator ${OCC_LIBS})

install(TARGETS UniqueIdValidator
RUNTIME DESTINATION bin
COMPONENT applications)

##################### standalone app ###########################
if (${PPP_USE_QT})
# relies on QT, but user may not enable QT GUI
add_executable(OccBVHdemo "OccBVHdemo.cpp") #
target_link_libraries(OccBVHdemo ${OCC_LIBS}) # compiled but does not work with OCCT 7.3
target_link_libraries(OccBVHdemo ${OCC_LIBS})
target_link_libraries(OccBVHdemo ${OCC_VIZ_LIBRARIES}) # list should be used without quote
install(TARGETS OccBVHdemo
RUNTIME DESTINATION bin
Expand Down
Loading