CGAL / cgal-swig-bindings

CGAL bindings using SWIG
Other
338 stars 92 forks source link

Installation fails using conda-based Python #222

Closed ThomasAuzinger closed 1 year ago

ThomasAuzinger commented 1 year ago

I try to create a minimal docker image that runs the CGAL swig bindings. To manage the packages for the Python program, which ultimately uses these bindings, I use miniconda.

When building the following Dockerfile

FROM continuumio/miniconda3:latest
RUN apt-get update && apt-get install -y build-essential cmake git libcgal-dev libeigen3-dev swig
RUN cd /opt && git clone https://github.com/cgal/cgal-swig-bindings
RUN cd /opt/cgal-swig-bindings && mkdir build
RUN cd /opt/cgal-swig-bindings/build && cmake -DBUILD_JAVA=OFF -DBUILD_RUBY=OFF -DBUILD_PYTHON=ON -DCMAKE_BUILD_TYPE="Release" .. && make -j 4 && make install

The last line fails with a longer error message (see below), with the most relevant lines;

...
-- Found Python: /opt/conda/bin/python3.9 (found version "3.9.12") found components: Interpreter Development.Module
...
-- Found Eigen3: /usr/include/eigen3 (found suitable version "3.3.9", minimum required is "3.1.0")
CMake Error at SWIG_CGAL/Point_set_processing_3/CMakeLists.txt:6 (include):
  include could not find load file:

    CGAL_Eigen3_support

CMake Error at SWIG_CGAL/Shape_detection/CMakeLists.txt:6 (include):
  include could not find load file:

    CGAL_Eigen3_support
...

I do not understand, why it does not find the file CGAL_Eigen3_support.cmake, which exists in the expected folder of CGAL. How would I solve this error?

Full error message below:

-- The C compiler identification is GNU 10.2.1
-- The CXX compiler identification is GNU 10.2.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Using header-only CGAL
-- Targetting Unix Makefiles
-- Using /usr/bin/c++ compiler.
-- Found GMP: /usr/lib/x86_64-linux-gnu/libgmp.so
-- Found MPFR: /usr/lib/x86_64-linux-gnu/libmpfr.so
-- Found Boost: /usr/lib/x86_64-linux-gnu/cmake/Boost-1.74.0/BoostConfig.cmake (found suitable version "1.74.0", minimum required is "1.48")
-- Boost include dirs: /usr/include
-- Boost libraries:
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.11")
-- Using gcc version 4 or later. Adding -frounding-math
-- Found SWIG: /usr/bin/swig4.0 (found version "4.0.2")
-- Build type: Release
-- USING CXXFLAGS = ' -O3 -DNDEBUG'
-- USING EXEFLAGS = ' '
-- Requested component: ImageIO
-- Requested component: MPFR
-- Requested component: GMPXX
-- Requested component: GMP
-- NOTICE: Intel TBB was not found. Parallelism will be disabled.
-- Release mode with g++: using -fno-strict-aliasing flags
-- BUILD_RUBY is set to OFF: no CGAL-bindings for Ruby will be generated.
-- Found Python: /opt/conda/bin/python3.9 (found version "3.9.12") found components: Interpreter Development.Module
-- BUILD_JAVA is set to OFF: no CGAL-bindings for Java will be generated.
-- Found Python libs.
-- CGAL-SWIG Python files and libraries will be written in /opt/cgal-swig-bindings/build/build-python/CGAL.
-- Now adding packages
-- NOTICE : LAS IO requires LASlib and will not be available.
-- Found Eigen3: /usr/include/eigen3 (found suitable version "3.3.9", minimum required is "3.1.0")
CMake Error at SWIG_CGAL/Point_set_processing_3/CMakeLists.txt:6 (include):
  include could not find load file:

    CGAL_Eigen3_support

CMake Error at SWIG_CGAL/Shape_detection/CMakeLists.txt:6 (include):
  include could not find load file:

    CGAL_Eigen3_support

-- Found Boost: /usr/lib/x86_64-linux-gnu/cmake/Boost-1.74.0/BoostConfig.cmake (found version "1.74.0") found components: serialization missing components: iostreams
-- NOTICE: Classification IO functions require Boost IO Streams, and will not be compiled.
CMake Error at SWIG_CGAL/Classification/CMakeLists.txt:26 (include):
  include could not find load file:

    CGAL_Eigen3_support

-- Found Eigen3: /usr/include/eigen3 (found suitable version "3.3.9", minimum required is "3.2.0")
CMake Error at CMakeLists.txt:229 (include):
  include could not find load file:

    CGAL_Eigen3_support

-- Configuring incomplete, errors occurred!
lrineau commented 1 year ago

Hi Thomas, the Docker image continuumio/miniconda3 is based on Debian Stable (version 11 "bullseye"). That version shipoed libcgal-dev version 5.2.

But current main version of cgal-swig-bindings is only assured to be compatible with CGAL-5.5.1 or later.

Instead of installing libcgal-dev using apt-get, clone it, that way:

FROM continuumio/miniconda3:latest
RUN apt-get update && apt-get install -y build-essential cmake git libeigen3-dev swig
RUN apt-get install -y libboost-dev libgmp-dev libmpfr-dev
RUN cd /opt && git clone --depth 1 https://github.com/cgal/cgal-swig-bindings && git clone -b v5.5.1 --depth 1 https://github.com/cgal/CGAL
RUN cd /opt/cgal-swig-bindings && mkdir build
RUN cd /opt/cgal-swig-bindings/build && cmake -DBUILD_JAVA=OFF -DBUILD_RUBY=OFF -DBUILD_PYTHON=ON -DCMAKE_BUILD_TYPE="Release" .. && make -j 4 && make install