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

build: Remove manual CGAL install #315

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 5 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
1 change: 1 addition & 0 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ task:
gcc \
g++ \
libboost-dev \
libcgal-dev \
libmpfr-dev \
libgmp-dev \
swig \
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,14 @@ jobs:
- name: Install compiler tools on macOS
if: runner.os == 'macOS'
run: |
brew install make automake swig gmp mpfr boost
brew install make automake swig gmp mpfr boost cgal
export PATH="/usr/local/opt/make/libexec/gnubin:$PATH"

- name: Install extra deps on Linux
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y libboost-dev libmpfr-dev swig autoconf libtool
run: |
sudo apt-get update
sudo apt-get install -y libboost-dev libcgal-dev libmpfr-dev swig autoconf libtool

- name: Install package
run: |
Expand Down Expand Up @@ -89,7 +91,7 @@ jobs:
- name: Install compiler tools on macOS
if: runner.os == 'macOS'
run: |
brew install make automake swig mpfr boost
brew install make automake swig mpfr boost cgal
export PATH="/usr/local/opt/make/libexec/gnubin:$PATH"

- name: Clone gmp
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
- name: Install compiler tools on macOS
if: runner.os == 'macOS'
run: |
brew install make automake swig mpfr boost
brew install make automake swig mpfr boost cgal
export PATH="/usr/local/opt/make/libexec/gnubin:$PATH"

- name: Clone gmp
Expand Down Expand Up @@ -112,7 +112,9 @@ jobs:

- name: Install extra deps on Linux
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y libboost-dev swig autoconf libtool
run: |
sudo apt-get update
sudo apt-get install -y libboost-dev libcgal-dev swig autoconf libtool

- name: test sdist
run: python -m pip install dist/*.tar.gz
Expand Down
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,3 @@ cython_debug/
*.exe
*.out
*.app

# Build dependencies
CGAL*
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ To install the build-time dependencies run the following installation commands f
### Debian/Ubuntu

``` bash
sudo apt-get update && sudo apt-get install -y libboost-dev libmpfr-dev libgmp-dev swig autoconf libtool
sudo apt-get update && sudo apt-get install -y libboost-dev libcgal-dev libmpfr-dev libgmp-dev swig autoconf libtool
```

## Build and install
Expand Down
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@ manylinux-i686-image = "manylinux2014"
before-all = [
"yum update -y",
"yum install -y mpfr-devel",
"curl -L https://boostorg.jfrog.io/artifactory/main/release/1.84.0/source/boost_1_84_0.tar.bz2 -o boost_1_84_0.tar.bz2",
"curl -LO https://boostorg.jfrog.io/artifactory/main/release/1.84.0/source/boost_1_84_0.tar.bz2",
"tar --bzip2 -xf boost_1_84_0.tar.bz2",
"mv boost_1_84_0/boost /usr/include/boost",
"curl -LO https://github.com/CGAL/cgal/releases/download/v5.6.1/CGAL-5.6.1-library.zip",
"unzip -q CGAL-5.6.1-library.zip",
"mv CGAL-5.6.1/include/CGAL /usr/include/",
]
# Skip musllinux builds for the moment
skip = "*-musllinux_*"
15 changes: 0 additions & 15 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,10 @@
import subprocess
import sys
import sysconfig
import urllib.request
import zipfile

import setuptools.command.build_ext
import setuptools.command.install

CGAL_ZIP = "https://github.com/CGAL/cgal/releases/download/v5.6/CGAL-5.6-library.zip"

DIR = pathlib.Path(__file__).parent.resolve()
FASTJET = DIR / "extern" / "fastjet-core"
FASTJET_CONTRIB = DIR / "extern" / "fastjet-contrib"
Expand Down Expand Up @@ -56,16 +52,6 @@ def get_version() -> str:
class FastJetBuild(setuptools.command.build_ext.build_ext):
def build_extensions(self):
if not OUTPUT.exists():
zip_filename = DIR / pathlib.Path(CGAL_ZIP).parts[-1]

with urllib.request.urlopen(CGAL_ZIP) as http_obj:
with open(zip_filename, "wb") as file_obj:
shutil.copyfileobj(http_obj, file_obj)

with zipfile.ZipFile(zip_filename) as zip_obj:
cgal_dir = DIR / zip_obj.namelist()[0]
zip_obj.extractall(DIR)

# Patch for segfault of LimitedWarning
# For more info see https://github.com/scikit-hep/fastjet/pull/131
subprocess.run(
Expand All @@ -92,7 +78,6 @@ def build_extensions(self):
"--enable-allcxxplugins",
"--enable-cgal-header-only",
"--enable-cgal",
matthewfeickert marked this conversation as resolved.
Show resolved Hide resolved
f"--with-cgaldir={cgal_dir}",
"--enable-swig",
"--enable-pyext",
f'LDFLAGS={env["LDFLAGS"]}',
Expand Down
Loading