Skip to content

Commit

Permalink
Merge pull request #493 from pierre-guillou/dev
Browse files Browse the repository at this point in the history
Create Ubuntu 18.04 & 20.04 packages with GitHub Actions
  • Loading branch information
julien-tierny authored Sep 18, 2020
2 parents 449dfd6 + 2c016ee commit fc099a5
Show file tree
Hide file tree
Showing 13 changed files with 289 additions and 73 deletions.
198 changes: 198 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,198 @@
# This is a basic workflow to help you get started with Actions

name: CI

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branch-ignore:
- '*'
tags:
- 'v*'
- 'dev*'

env:
PV_PLUGIN_PATH: /usr/lib/paraview-5.8/plugins/TopologyToolKit

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-18.04, ubuntu-20.04]

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

- name: Install Ubuntu dependencies
run: |
sudo apt update
# TTK dependencies
sudo apt install -y \
libboost-system-dev \
libeigen3-dev \
libgraphviz-dev \
libsqlite3-dev \
graphviz \
python3-sklearn \
zlib1g-dev \
dpkg-dev
- name: Install Spectra dependency
run: |
git clone --depth 1 https://github.com/yixuan/spectra
mkdir build_spectra && cd build_spectra
cmake ../spectra
sudo make install
- name: Install ZFP dependency
run: |
git clone --depth 1 https://github.com/LLNL/zfp
mkdir build_zfp && cd build_zfp
cmake \
-DBUILD_SHARED_LIBS=OFF \
-DBUILD_TESTING=OFF \
../zfp
sudo make -j$(nproc) install
- uses: dsaltares/fetch-gh-release-asset@master
with:
repo: "topology-tool-kit/ttk-paraview"
version: "tags/v5.8.0"
file: "ttk-paraview-${{ matrix.os }}.deb"

- name: Install ParaView .deb
run: |
sudo apt install ./ttk-paraview-${{ matrix.os }}.deb
- name: Create & configure TTK build directory
run: |
mkdir build
cd build
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DTTK_BUILD_PARAVIEW_PLUGINS=TRUE \
-DTTK_BUILD_VTK_WRAPPERS=TRUE \
-DTTK_BUILD_STANDALONE_APPS=TRUE \
-DTTK_ENABLE_KAMIKAZE=TRUE \
-DTTK_ENABLE_DOUBLE_TEMPLATING=TRUE \
-DTTK_ENABLE_CPU_OPTIMIZATION=FALSE \
-DTTK_ENABLE_SHARED_BASE_LIBRARIES=TRUE \
$GITHUB_WORKSPACE
- name: Build TTK
run: |
cd build
make -j$(nproc) package
- name: Update package informations
run: |
cd build
# unpack deb package to access control file
mkdir tmp
dpkg-deb --extract ttk.deb tmp
dpkg-deb --control ttk.deb tmp/DEBIAN
# modify control file, remove libgcc-s1 dependency
sed 's/libgcc-s1[^,]*, //g' -i tmp/DEBIAN/control
# build updated deb package
dpkg -b tmp ttk-${{ matrix.os }}.deb
- name: Upload TTK .deb package
uses: actions/upload-artifact@v2
with:
name: ttk-${{ matrix.os }}.deb
path: build/ttk-${{ matrix.os }}.deb

test:
needs: build
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-18.04, ubuntu-20.04]
steps:
- uses: actions/checkout@v2

- uses: dsaltares/fetch-gh-release-asset@master
with:
repo: "topology-tool-kit/ttk-paraview"
version: "tags/v5.8.0"
file: "ttk-paraview-${{ matrix.os }}.deb"

- name: Fetch TTK .deb artifact
uses: actions/download-artifact@v2
with:
name: ttk-${{ matrix.os }}.deb

- name: Install generated .deb packages
run: |
sudo apt update
sudo apt install ./ttk-paraview-${{ matrix.os }}.deb
sudo apt install ./ttk-${{ matrix.os }}.deb
- name: Test TTK examples
run: |
source /etc/profile
# base layer
cd $GITHUB_WORKSPACE/examples/c++
mkdir build && cd build
cmake ..
make
./ttkExample-c++ -i ../../data/inputData.off
# VTK layer
cd $GITHUB_WORKSPACE/examples/vtk-c++
mkdir build && cd build
cmake ..
make
./ttkExample-vtk-c++ -i ../../data/inputData.vtu
# pure Python
cd $GITHUB_WORKSPACE/examples/python
python3 example.py ../data/inputData.vtu
# pvpython
cd $GITHUB_WORKSPACE/examples/pvpython
pvpython example.py ../data/inputData.vtu
create-release:
runs-on: ubuntu-latest
needs: test
steps:

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

- name: Fetch all uploaded artifacts
uses: actions/download-artifact@v2

- name: Upload Ubuntu Bionic .deb as Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ttk-ubuntu-18.04.deb/ttk-ubuntu-18.04.deb
asset_name: ttk-ubuntu-18.04.deb
asset_content_type: application/vnd.debian.binary-package

- name: Upload Ubuntu Focal .deb as Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ttk-ubuntu-20.04.deb/ttk-ubuntu-20.04.deb
asset_name: ttk-ubuntu-20.04.deb
asset_content_type: application/vnd.debian.binary-package
15 changes: 6 additions & 9 deletions CMake/BaseCode.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@
function(ttk_add_base_library library)
cmake_parse_arguments(ARG "" "" "SOURCES;HEADERS;DEPENDS;OPTIONAL_DEPENDS" ${ARGN})

add_library(${library}
STATIC
${ARG_SOURCES}
${ARG_HEADERS}
)
if(TTK_ENABLE_SHARED_BASE_LIBRARIES)
add_library(${library} SHARED ${ARG_SOURCES} ${ARG_HEADERS})
else()
add_library(${library} STATIC ${ARG_SOURCES} ${ARG_HEADERS})
endif()

set_target_properties(${library}
PROPERTIES
POSITION_INDEPENDENT_CODE TRUE
Expand Down Expand Up @@ -168,10 +169,6 @@ function(ttk_set_compile_options library)
target_compile_definitions(${library} PUBLIC TTK_ENABLE_SCIKIT_LEARN)
endif()

if (TTK_ENABLE_ZLIB)
target_compile_definitions(${library} PUBLIC TTK_ENABLE_ZLIB)
endif()

# TODO per module
if (TTK_ENABLE_GRAPHVIZ AND GRAPHVIZ_FOUND)
target_compile_definitions(${library} PUBLIC TTK_ENABLE_GRAPHVIZ)
Expand Down
1 change: 1 addition & 0 deletions CMake/Print.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ function(ttk_print_summary)
message(STATUS "TTK_ENABLE_64BIT_IDS: ${TTK_ENABLE_64BIT_IDS}")
message(STATUS "TTK_ENABLE_CPU_OPTIMIZATION: ${TTK_ENABLE_CPU_OPTIMIZATION}")
message(STATUS "TTK_ENABLE_DOUBLE_TEMPLATING: ${TTK_ENABLE_DOUBLE_TEMPLATING}")
message(STATUS "TTK_ENABLE_SHARED_BASE_LIBRARIES: ${TTK_ENABLE_SHARED_BASE_LIBRARIES}")
message(STATUS "TTK_ENABLE_EIGEN: ${TTK_ENABLE_EIGEN}")
message(STATUS "TTK_ENABLE_GRAPHVIZ: ${TTK_ENABLE_GRAPHVIZ}")
message(STATUS "TTK_ENABLE_KAMIKAZE: ${TTK_ENABLE_KAMIKAZE}")
Expand Down
27 changes: 27 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,22 @@ endif()
# like the TopologyToolKit.so file for paraview
option(BUILD_SHARED_LIBS "Build TTK as shared lib" ON)

set(CPACK_PACKAGE_NAME "TTK")
set(CPACK_PACKAGE_FILE_NAME "ttk")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "The Topology ToolKit")
set(CPACK_PACKAGE_VERSION_MAJOR ${TTK_VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${TTK_VERSION_MINOR})
set(CPACK_PACKAGE_VERSION_PATCH ${TTK_VERSION_PATCH})
set(CPACK_GENERATOR "DEB")
set(CPACK_PACKAGE_CONTACT "Julien Tierny <julien.tierny@sorbonne-universite.fr>")
set(CPACK_PACKAGE_VENDOR "LIP6 - Sorbonne Université")
set(CPACK_PACKAGE_HOMEPAGE_URL "https://topology-tool-kit.github.io/")
set(CPACK_DEBIAN_PACKAGE_DEPENDS
"ttk-paraview (= 5.8.0), python3-sklearn, libboost-system-dev, python3-dev, libgraphviz-dev, libsqlite3-dev")
# autogenerate dependency information
set (CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
include(CPack)

if(TTK_BUILD_STANDALONE_APPS AND NOT TTK_BUILD_VTK_WRAPPERS)
message(WARNING "Can't build standalones without the VTK wrappers: disable")
set(TTK_BUILD_STANDALONE_APPS OFF CACHE BOOL "Build the cmd and gui commands" FORCE)
Expand Down Expand Up @@ -154,6 +170,17 @@ if(TTK_BUILD_STANDALONE_APPS)
add_subdirectory(standalone)
endif()

# Environment variables
# ---------------------

if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
configure_file(ttk-env.sh.in ttk-env.sh)
install(
FILES "${PROJECT_BINARY_DIR}/ttk-env.sh"
DESTINATION "${CMAKE_INSTALL_FULL_SYSCONFDIR}/profile.d"
)
endif()

# Status
# ------

Expand Down
3 changes: 3 additions & 0 deletions config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ mark_as_advanced(TTK_ENABLE_CPU_OPTIMIZATION)
option(TTK_ENABLE_DOUBLE_TEMPLATING "Use double templating for bivariate data" OFF)
mark_as_advanced(TTK_ENABLE_DOUBLE_TEMPLATING)

option(TTK_ENABLE_SHARED_BASE_LIBRARIES "Generate shared base libraries instead of static ones" OFF)
mark_as_advanced(TTK_ENABLE_SHARED_BASE_LIBRARIES)

option(TTK_BUILD_DOCUMENTATION "Build doxygen developer documentation" OFF)
if(TTK_BUILD_DOCUMENTATION)
find_package(Doxygen)
Expand Down
16 changes: 0 additions & 16 deletions core/base/TTKBaseConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ find_dependency(Boost REQUIRED COMPONENTS system)

# Was TTK built with optional dependencies?

if (@TTK_ENABLE_EIGEN@)
find_dependency(Eigen3 REQUIRED NO_MODULE)
endif()

if (@TTK_ENABLE_MPI@)
find_package(MPI REQUIRED)
endif()
Expand All @@ -17,17 +13,5 @@ if (@TTK_ENABLE_OPENMP@)
find_dependency(OpenMP REQUIRED)
endif()

if (@TTK_ENABLE_ZFP@)
set(ZFP_DIR "@ZFP_DIR@" CACHE PATH "Use TTK ZFP dir" FORCE)
find_dependency(ZFP REQUIRED @ZFP_DIR@)
endif()

if (@TTK_ENABLE_ZLIB@)
find_dependency(ZLIB REQUIRED)
endif()



# Include the actual targets for TTK Base
include("${CMAKE_CURRENT_LIST_DIR}/TTKBaseTargets.cmake")

8 changes: 2 additions & 6 deletions core/base/eigenField/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,11 @@ ttk_add_base_library(eigenField
geometry
laplacian
triangulation
OPTIONAL_DEPENDS
Eigen3::Eigen
)

if (EIGEN3_FOUND)
target_compile_definitions(eigenField PUBLIC TTK_ENABLE_EIGEN)
endif()

if(TTK_ENABLE_SPECTRA)
target_compile_definitions(eigenField PRIVATE TTK_ENABLE_EIGEN)
target_include_directories(eigenField SYSTEM PRIVATE ${EIGEN3_INCLUDE_DIR})
target_compile_definitions(eigenField PRIVATE TTK_ENABLE_SPECTRA)
target_include_directories(eigenField SYSTEM PRIVATE ${SPECTRA_INCLUDE_DIR})
endif()
5 changes: 2 additions & 3 deletions core/base/harmonicField/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@ ttk_add_base_library(harmonicField
geometry
laplacian
triangulation
OPTIONAL_DEPENDS
Eigen3::Eigen
)

if (EIGEN3_FOUND)
target_compile_definitions(harmonicField PUBLIC TTK_ENABLE_EIGEN)
target_compile_definitions(harmonicField PRIVATE TTK_ENABLE_EIGEN)
target_include_directories(harmonicField SYSTEM PRIVATE ${EIGEN3_INCLUDE_DIR})
endif()
5 changes: 2 additions & 3 deletions core/base/laplacian/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@ ttk_add_base_library(laplacian
DEPENDS
geometry
triangulation
OPTIONAL_DEPENDS
Eigen3::Eigen
)

if (EIGEN3_FOUND)
target_compile_definitions(laplacian PUBLIC TTK_ENABLE_EIGEN)
target_compile_definitions(laplacian PRIVATE TTK_ENABLE_EIGEN)
target_include_directories(laplacian SYSTEM PRIVATE ${EIGEN3_INCLUDE_DIR})
endif()
11 changes: 6 additions & 5 deletions core/base/topologicalCompression/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,16 @@ ttk_add_base_library(topologicalCompression
triangulation
topologicalSimplification
ftmTreePP
OPTIONAL_DEPENDS
zfp::zfp
ZLIB::ZLIB
)

if (TTK_ENABLE_ZLIB)
target_include_directories(topologicalCompression PUBLIC ${ZLIB_INCLUDE_DIR})
if(TTK_ENABLE_ZLIB)
target_compile_definitions(topologicalCompression PUBLIC TTK_ENABLE_ZLIB)
target_include_directories(topologicalCompression SYSTEM PRIVATE ${ZLIB_INCLUDE_DIR})
target_link_libraries(topologicalCompression PRIVATE ${ZLIB_LIBRARIES})
endif()

if(TTK_ENABLE_ZFP)
target_compile_definitions(topologicalCompression PUBLIC TTK_ENABLE_ZFP)
target_include_directories(topologicalCompression SYSTEM PRIVATE ${ZFP_INCLUDE_DIR})
target_link_libraries(topologicalCompression PRIVATE ${ZFP_LIBRARIES})
endif()
Loading

0 comments on commit fc099a5

Please sign in to comment.