Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to fcl 0.6.1 and ci build for linux/win/mac using github actions #29

Merged
merged 20 commits into from
Sep 9, 2021
Merged
Show file tree
Hide file tree
Changes from 17 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
18 changes: 18 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Build

on: [push, pull_request]

jobs:
build_wheels:
name: Build wheel on ${{matrix.platform}}
runs-on: ${{matrix.platform}}
strategy:
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v2
- name: Build wheels
uses: pypa/[email protected]
- uses: actions/upload-artifact@v2
with:
path: ./wheelhouse/*.whl
27 changes: 27 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Release

on: release

jobs:
build_wheels:
name: Build wheel on ${{matrix.platform}}
runs-on: ${{matrix.platform}}
strategy:
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v2
- name: Build wheels
uses: pypa/[email protected]
- uses: actions/upload-artifact@v2
with:
path: ./wheelhouse/*.whl
- uses: xresloader/upload-to-github-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
file: ./wheelhouse/*.whl
overwrite: true
draft: false
update_latest_release: true
tag_name: v0.6.1
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ wheels/
.installed.cfg
*.egg
MANIFEST
deps/

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

# mypy
.mypy_cache/

# vscode settings
.vscode/
6 changes: 0 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
env:
global:
- CIBW_BEFORE_BUILD="yum install -y gcc && yum install -y glibc.i686 && pip install
numpy cython && cd requirements && bash install_cmake.bash && bash clone.bash
&& bash build.bash"
- CIBW_TEST_REQUIRES="nose2"
- CIBW_TEST_COMMAND="cd {project}/test && nose2"
- CIBW_SKIP="cp33-* cp34-*"
- TWINE_USERNAME=mmatl
matrix:
include:
Expand Down
5 changes: 0 additions & 5 deletions MANIFEST.in

This file was deleted.

4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
# python-fcl
### Python Interface for the Flexible Collision Library

[![Build Status](https://travis-ci.org/BerkeleyAutomation/python-fcl.svg?branch=master)](https://travis-ci.org/BerkeleyAutomation/python-fcl)

Python-FCL is an (unofficial) Python interface for the [Flexible Collision Library (FCL)](https://github.com/flexible-collision-library/fcl),
an excellent C++ library for performing proximity and collision queries on pairs of geometric models.
Currently, this package is targeted for FCL 0.5.0.
Currently, this package is targeted for FCL 0.6.1.

This package supports three types of proximity queries for pairs of geometric models:
* __Collision Detection__: Detecting whether two models overlap (and optionally where).
Expand Down
2 changes: 2 additions & 0 deletions blender_requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
numpy==1.19.5
Cython
25 changes: 8 additions & 17 deletions requirements/Dockerfile → build_dependencies/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,24 @@
# ln -sf requirements/Dockerfile .
# docker build . -t pythonfcl

FROM quay.io/pypa/manylinux1_x86_64:latest


RUN yum install -y gcc

# install cmake 2.8.12
COPY requirements/install_cmake.bash .
RUN bash install_cmake.bash

# clone FCL and libccd
# the exact checkouts are in clone.bash
COPY requirements/clone.bash .
RUN bash clone.bash
FROM quay.io/pypa/manylinux2010_x86_64:latest

# build and install libccd and fcl using cmake
COPY requirements/build.bash .
RUN bash build.bash
COPY build_dependencies/install_linux.sh .
RUN bash install_linux.sh

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

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

# build the python-fcl module
COPY . /python_fcl
RUN cd /python_fcl && python setup.py build_ext
RUN pip wheel /python_fcl --no-deps -w wheelhouse/
RUN pip install /python_fcl --no-index -f /wheelhouse
RUN ls /wheelhouse
RUN auditwheel repair wheelhouse/python_fcl-0.6.1-cp39-cp39-linux_x86_64.whl --plat manylinux2010_x86_64 -w /wheelhouse
41 changes: 41 additions & 0 deletions build_dependencies/install_linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
mkdir -p deps
cd deps
get eigen
curl -OL https://gitlab.com/libeigen/eigen/-/archive/3.3.9/eigen-3.3.9.tar.gz
tar -zxf eigen-3.3.9.tar.gz

rm -rf libccd
git clone --depth 1 --branch v2.1 https://github.com/danfis/libccd.git

rm -rf octomap
git clone --depth 1 --branch v1.8.0 https://github.com/OctoMap/octomap.git

rm -rf fcl
git clone --depth 1 --branch v0.6.1 https://github.com/flexible-collision-library/fcl.git

echo "Install eigen"
cmake -B build -S eigen-3.3.9
cmake --install build

echo "Build and install libccd"
cd libccd
cmake .
make -j4
make install
cd ..

echo "Build and install octomap"
cd octomap
cmake .
make -j4
make install
cd ..

echo "Build and install fcl"
cd fcl
cmake .
make -j4
make install
cd ..

cd ..
23 changes: 23 additions & 0 deletions build_dependencies/install_macos.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
brew update > /dev/null

# brew install git
# brew install cmake
# brew install eigen
# brew install libccd
brew install fcl

# mkdir -p deps
# cd deps
# # Octomap
# git clone https://github.com/OctoMap/octomap
# cd octomap
# git checkout tags/v1.8.0
# mkdir build
# cd build
# cmake ..
# make
# sudo make install

# cd ..
# cd ..
# cd ..
104 changes: 104 additions & 0 deletions build_dependencies/install_windows.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
<#
Originally based on script written by Pebaz (https://github.com/Pebaz/python-fcl/blob/master/requirements/build_win32.ps1)
but with many modification in order to use fcl 0.6.1 and install dependencies without admin rights.
This script builds fcl and it's dependencies for python-fcl on Windows.
It downloads, builds, installs:
* fcl
* libccd
* eigen
* octomap
#>

# Remember starting location for future usage
$base_dir = Get-Location

# Create a directory that encapsulates all dependencies
mkdir -p deps; Set-Location deps

# Build options
$generator = "Visual Studio 16 2019"

# All compiled depencies will be install in following folder
$install_dir = "$base_dir\deps\install"


#------------------------------------------------------------------------------
# Eigen
Write-Host "Building Eigen"
$eigen_ver = "3.3.9"
Invoke-WebRequest -Uri https://gitlab.com/libeigen/eigen/-/archive/$eigen_ver/eigen-$eigen_ver.tar.gz -Outfile eigen-$eigen_ver.tar.gz
tar -zxf "eigen-$eigen_ver.tar.gz"
Set-Location "eigen-$eigen_ver"

cmake -B build `
-D CMAKE_BUILD_TYPE=Release `
-G $generator `
-D BUILD_SHARED_LIBS=ON `
-D CMAKE_INSTALL_PREFIX=$install_dir
cmake --install build

Set-Location ..


# ------------------------------------------------------------------------------
# LibCCD
Write-Host "Building LibCCD"
git clone --depth 1 --branch v2.1 https://github.com/danfis/libccd
Set-Location libccd

cmake -B build `
-D CMAKE_BUILD_TYPE=Release `
-G $generator `
-D BUILD_SHARED_LIBS=ON `
-D CMAKE_INSTALL_PREFIX=$install_dir
cmake --build build --config Release --target install

Set-Location ..


# ------------------------------------------------------------------------------
# Octomap
Write-Host "Building Octomap"
git clone --depth 1 --branch v1.8.0 https://github.com/OctoMap/octomap
Set-Location octomap

cmake -B build `
-D CMAKE_PREFIX_PATH=$install_dir `
-D CMAKE_BUILD_TYPE=Release `
-G $generator `
-D BUILD_SHARED_LIBS=ON `
-D CMAKE_INSTALL_PREFIX=$install_dir `
-D BUILD_OCTOVIS_SUBPROJECT=OFF `
-D BUILD_DYNAMICETD3D_SUBPROJECT=OFF
cmake --build build --config Release
cmake --build build --config Release --target install

Set-Location ..

# ------------------------------------------------------------------------------
# FCL
Write-Host "Building FCL"
git clone --depth 1 --branch v0.6.1 https://github.com/flexible-collision-library/fcl
Set-Location fcl

cmake -B build `
-D CMAKE_PREFIX_PATH=$install_dir `
-D CMAKE_BUILD_TYPE=Release `
-G $generator `
-D CMAKE_INSTALL_PREFIX=$install_dir

cmake --build build --config Release --target install
Set-Location ..

# ------------------------------------------------------------------------------
# Python-FCL

Write-Host "Copying dependent DLLs"
Copy-Item $install_dir\bin\octomap.dll $base_dir\src\fcl
Copy-Item $install_dir\bin\octomath.dll $base_dir\src\fcl
Copy-Item $install_dir\bin\ccd.dll $base_dir\src\fcl

Set-Location $base_dir
Write-Host "All done!"
29 changes: 29 additions & 0 deletions build_dependencies/install_windows_ci.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<#
This script install precompiled dependencies to build python-fcl on Windows:
* fcl
* libccd
* eigen
* octomap
#>

# Remember starting location for future usage
$base_dir = Get-Location
# Binaries folder
$install_dir = "$base_dir\deps\install"


$file_name = "PrecompiledDependenciesWindows.zip"
Invoke-WebRequest -Uri "https://github.com/CyrilWaechter/python-fcl/releases/download/v0.6.1/$file_name" -Outfile $file_name
Expand-Archive $file_name -DestinationPath deps


# ------------------------------------------------------------------------------
# Python-FCL

Write-Host "Copying dependent DLLs"
Copy-Item $install_dir\bin\octomap.dll $base_dir\src\fcl
Copy-Item $install_dir\bin\octomath.dll $base_dir\src\fcl
Copy-Item $install_dir\bin\ccd.dll $base_dir\src\fcl

Set-Location $base_dir
Write-Host "All done!"
5 changes: 0 additions & 5 deletions fcl/__init__.py

This file was deleted.

Loading