Skip to content

Commit ffea96f

Browse files
authored
Merge pull request #29 from CyrilWaechter/master
Update to fcl 0.6.1 and ci build for linux/win/mac using github actions
2 parents 779798d + 9c19f8a commit ffea96f

27 files changed

Lines changed: 1019 additions & 704 deletions

.github/workflows/push.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Build
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build_wheels:
7+
name: Build wheel on ${{matrix.platform}}
8+
runs-on: ${{matrix.platform}}
9+
strategy:
10+
matrix:
11+
platform: [ubuntu-latest, macos-latest, windows-latest]
12+
steps:
13+
- uses: actions/checkout@v2
14+
- name: Build wheels
15+
uses: pypa/cibuildwheel@v2.0.0
16+
- uses: actions/upload-artifact@v2
17+
with:
18+
path: ./wheelhouse/*.whl

.github/workflows/release.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Release
2+
3+
on: release
4+
5+
jobs:
6+
build_wheels:
7+
name: Build wheel on ${{matrix.platform}}
8+
runs-on: ${{matrix.platform}}
9+
strategy:
10+
matrix:
11+
platform: [ubuntu-latest, macos-latest, windows-latest]
12+
steps:
13+
- uses: actions/checkout@v2
14+
- name: Build wheels
15+
uses: pypa/cibuildwheel@v2.0.0
16+
- uses: actions/upload-artifact@v2
17+
with:
18+
path: ./wheelhouse/*.whl
19+
- uses: xresloader/upload-to-github-release@v1
20+
env:
21+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22+
with:
23+
file: ./wheelhouse/*.whl
24+
overwrite: true
25+
draft: false
26+
update_latest_release: true
27+
tag_name: v0.6.1

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ wheels/
2525
.installed.cfg
2626
*.egg
2727
MANIFEST
28+
deps/
2829

2930
# PyInstaller
3031
# Usually these files are written by a python script from a template
@@ -103,3 +104,6 @@ venv.bak/
103104

104105
# mypy
105106
.mypy_cache/
107+
108+
# vscode settings
109+
.vscode/

.travis.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
env:
22
global:
3-
- CIBW_BEFORE_BUILD="yum install -y gcc && yum install -y glibc.i686 && pip install
4-
numpy cython && cd requirements && bash install_cmake.bash && bash clone.bash
5-
&& bash build.bash"
6-
- CIBW_TEST_REQUIRES="nose2"
7-
- CIBW_TEST_COMMAND="cd {project}/test && nose2"
8-
- CIBW_SKIP="cp33-* cp34-*"
93
- TWINE_USERNAME=mmatl
104
matrix:
115
include:

MANIFEST.in

Lines changed: 0 additions & 5 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
# python-fcl
22
### Python Interface for the Flexible Collision Library
33

4-
[![Build Status](https://travis-ci.org/BerkeleyAutomation/python-fcl.svg?branch=master)](https://travis-ci.org/BerkeleyAutomation/python-fcl)
5-
64
Python-FCL is an (unofficial) Python interface for the [Flexible Collision Library (FCL)](https://github.com/flexible-collision-library/fcl),
75
an excellent C++ library for performing proximity and collision queries on pairs of geometric models.
8-
Currently, this package is targeted for FCL 0.5.0.
6+
Currently, this package is targeted for FCL 0.6.1.
97

108
This package supports three types of proximity queries for pairs of geometric models:
119
* __Collision Detection__: Detecting whether two models overlap (and optionally where).
Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,33 +6,24 @@
66
# ln -sf requirements/Dockerfile .
77
# docker build . -t pythonfcl
88

9-
FROM quay.io/pypa/manylinux1_x86_64:latest
10-
11-
12-
RUN yum install -y gcc
13-
14-
# install cmake 2.8.12
15-
COPY requirements/install_cmake.bash .
16-
RUN bash install_cmake.bash
17-
18-
# clone FCL and libccd
19-
# the exact checkouts are in clone.bash
20-
COPY requirements/clone.bash .
21-
RUN bash clone.bash
9+
FROM quay.io/pypa/manylinux2010_x86_64:latest
2210

2311
# build and install libccd and fcl using cmake
24-
COPY requirements/build.bash .
25-
RUN bash build.bash
12+
COPY build_dependencies/install_linux.sh .
13+
RUN bash install_linux.sh
2614

2715
# manylinux includes a bunch of pythons
2816
# to test with others change this env variable
2917
#ENV PATH=/opt/python/cp27-cp27m/bin:$PATH
30-
ENV PATH=/opt/python/cp36-cp36m/bin:$PATH
18+
ENV PATH=/opt/python/cp39-cp39/bin:$PATH
3119

3220
# we need numpy to build python-fcl
3321
# since we set our path we'll be using the right pip
3422
RUN pip install numpy cython
3523

3624
# build the python-fcl module
3725
COPY . /python_fcl
38-
RUN cd /python_fcl && python setup.py build_ext
26+
RUN pip wheel /python_fcl --no-deps -w wheelhouse/
27+
RUN pip install /python_fcl --no-index -f /wheelhouse
28+
RUN ls /wheelhouse
29+
RUN auditwheel repair wheelhouse/python_fcl-0.6.1-cp39-cp39-linux_x86_64.whl --plat manylinux2010_x86_64 -w /wheelhouse
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
mkdir -p deps
2+
cd deps
3+
get eigen
4+
curl -OL https://gitlab.com/libeigen/eigen/-/archive/3.3.9/eigen-3.3.9.tar.gz
5+
tar -zxf eigen-3.3.9.tar.gz
6+
7+
rm -rf libccd
8+
git clone --depth 1 --branch v2.1 https://github.com/danfis/libccd.git
9+
10+
rm -rf octomap
11+
git clone --depth 1 --branch v1.8.0 https://github.com/OctoMap/octomap.git
12+
13+
rm -rf fcl
14+
git clone --depth 1 --branch v0.6.1 https://github.com/flexible-collision-library/fcl.git
15+
16+
echo "Install eigen"
17+
cmake -B build -S eigen-3.3.9
18+
cmake --install build
19+
20+
echo "Build and install libccd"
21+
cd libccd
22+
cmake .
23+
make -j4
24+
make install
25+
cd ..
26+
27+
echo "Build and install octomap"
28+
cd octomap
29+
cmake .
30+
make -j4
31+
make install
32+
cd ..
33+
34+
echo "Build and install fcl"
35+
cd fcl
36+
cmake .
37+
make -j4
38+
make install
39+
cd ..
40+
41+
cd ..
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
brew update > /dev/null
2+
3+
# brew install git
4+
# brew install cmake
5+
# brew install eigen
6+
# brew install libccd
7+
brew install fcl
8+
9+
# mkdir -p deps
10+
# cd deps
11+
# # Octomap
12+
# git clone https://github.com/OctoMap/octomap
13+
# cd octomap
14+
# git checkout tags/v1.8.0
15+
# mkdir build
16+
# cd build
17+
# cmake ..
18+
# make
19+
# sudo make install
20+
21+
# cd ..
22+
# cd ..
23+
# cd ..
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
<#
2+
Originally based on script written by Pebaz (https://github.com/Pebaz/python-fcl/blob/master/requirements/build_win32.ps1)
3+
but with many modification in order to use fcl 0.6.1 and install dependencies without admin rights.
4+
5+
This script builds fcl and it's dependencies for python-fcl on Windows.
6+
7+
It downloads, builds, installs:
8+
* fcl
9+
* libccd
10+
* eigen
11+
* octomap
12+
#>
13+
14+
# Remember starting location for future usage
15+
$base_dir = Get-Location
16+
17+
# Create a directory that encapsulates all dependencies
18+
mkdir -p deps; Set-Location deps
19+
20+
# Build options
21+
$generator = "Visual Studio 16 2019"
22+
23+
# All compiled depencies will be install in following folder
24+
$install_dir = "$base_dir\deps\install"
25+
26+
27+
#------------------------------------------------------------------------------
28+
# Eigen
29+
Write-Host "Building Eigen"
30+
$eigen_ver = "3.3.9"
31+
Invoke-WebRequest -Uri https://gitlab.com/libeigen/eigen/-/archive/$eigen_ver/eigen-$eigen_ver.tar.gz -Outfile eigen-$eigen_ver.tar.gz
32+
tar -zxf "eigen-$eigen_ver.tar.gz"
33+
Set-Location "eigen-$eigen_ver"
34+
35+
cmake -B build `
36+
-D CMAKE_BUILD_TYPE=Release `
37+
-G $generator `
38+
-D BUILD_SHARED_LIBS=ON `
39+
-D CMAKE_INSTALL_PREFIX=$install_dir
40+
cmake --install build
41+
42+
Set-Location ..
43+
44+
45+
# ------------------------------------------------------------------------------
46+
# LibCCD
47+
Write-Host "Building LibCCD"
48+
git clone --depth 1 --branch v2.1 https://github.com/danfis/libccd
49+
Set-Location libccd
50+
51+
cmake -B build `
52+
-D CMAKE_BUILD_TYPE=Release `
53+
-G $generator `
54+
-D BUILD_SHARED_LIBS=ON `
55+
-D CMAKE_INSTALL_PREFIX=$install_dir
56+
cmake --build build --config Release --target install
57+
58+
Set-Location ..
59+
60+
61+
# ------------------------------------------------------------------------------
62+
# Octomap
63+
Write-Host "Building Octomap"
64+
git clone --depth 1 --branch v1.8.0 https://github.com/OctoMap/octomap
65+
Set-Location octomap
66+
67+
cmake -B build `
68+
-D CMAKE_PREFIX_PATH=$install_dir `
69+
-D CMAKE_BUILD_TYPE=Release `
70+
-G $generator `
71+
-D BUILD_SHARED_LIBS=ON `
72+
-D CMAKE_INSTALL_PREFIX=$install_dir `
73+
-D BUILD_OCTOVIS_SUBPROJECT=OFF `
74+
-D BUILD_DYNAMICETD3D_SUBPROJECT=OFF
75+
cmake --build build --config Release
76+
cmake --build build --config Release --target install
77+
78+
Set-Location ..
79+
80+
# ------------------------------------------------------------------------------
81+
# FCL
82+
Write-Host "Building FCL"
83+
git clone --depth 1 --branch v0.6.1 https://github.com/flexible-collision-library/fcl
84+
Set-Location fcl
85+
86+
cmake -B build `
87+
-D CMAKE_PREFIX_PATH=$install_dir `
88+
-D CMAKE_BUILD_TYPE=Release `
89+
-G $generator `
90+
-D CMAKE_INSTALL_PREFIX=$install_dir
91+
92+
cmake --build build --config Release --target install
93+
Set-Location ..
94+
95+
# ------------------------------------------------------------------------------
96+
# Python-FCL
97+
98+
Write-Host "Copying dependent DLLs"
99+
Copy-Item $install_dir\bin\octomap.dll $base_dir\src\fcl
100+
Copy-Item $install_dir\bin\octomath.dll $base_dir\src\fcl
101+
Copy-Item $install_dir\bin\ccd.dll $base_dir\src\fcl
102+
103+
Set-Location $base_dir
104+
Write-Host "All done!"

0 commit comments

Comments
 (0)