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

building with CGAL 5 #56

Closed
drew-parsons opened this issue Dec 6, 2019 · 8 comments · Fixed by #57
Closed

building with CGAL 5 #56

drew-parsons opened this issue Dec 6, 2019 · 8 comments · Fixed by #57

Comments

@drew-parsons
Copy link

pygalmesh needs some help to build against CGAL 5, which is now header-only.

Dropping the CGAL libraries themselves is easy enough. (I guess you'd want the build able to work with both CGAL 4 or 5)

But then there's a more subtle problem (on Debian unstable). setup.py seems to be invoking gcc to compile the extensions, but the files are C++. setup.py does refer to C++, but nevertheless the build proceeds with x86_64-linux-gnu-gcc instead of x86_64-linux-gnu-g++.

Consequently when running tests,

   dh_auto_test -O--buildsystem=pybuild
I: pybuild base:217: cd /home/projects/pygalmesh/.pybuild/cpython3_3.8_pygalmesh/build; python3.8 -m unittest discover -v 
pygalmesh (unittest.loader._FailedTest) ... ERROR

======================================================================
ERROR: pygalmesh (unittest.loader._FailedTest)
----------------------------------------------------------------------
ImportError: Failed to import test module: pygalmesh
Traceback (most recent call last):
  File "/usr/lib/python3.8/unittest/loader.py", line 470, in _find_test_path
    package = self._get_module_from_name(name)
  File "/usr/lib/python3.8/unittest/loader.py", line 377, in _get_module_from_name
    __import__(name)
  File "/home/projects/pygalmesh/.pybuild/cpython3_3.8_pygalmesh/build/pygalmesh/__init__.py", line 2, in <module>
    from _pygalmesh import (
ImportError: /home/projects/pygalmesh/.pybuild/cpython3_3.8_pygalmesh/build/_pygalmesh.cpython-38-x86_64-linux-gnu.so: undefined symbol: _ZTVN10__cxxabiv117__class_type_infoE

The missing symbol is in libstdc++.so.

@drew-parsons
Copy link
Author

Joachim Reichel suggests it needs
libraries=["stdc++", "gmp", "mpfr"]

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=946234

@drew-parsons
Copy link
Author

The relationship between cmake and setup.py seems to complicate the build conditions.

Joachim says the mere presence of cmake means it is invoked in pybuild build, https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=946233.

But it doesn't work that way for me. For me it's either dh --buildsystem=pybuild which does not invoke cmake, or dh --buildsystem=cmake, not clear what that does to the python build.

@nschloe
Copy link
Collaborator

nschloe commented Dec 6, 2019

This seems like it's related to pypa/setuptools#1732 (comment): setuptools indeed uses the C compiler, not C++, to compile C++ projects. Only the linker step uses CXX. Does it not on Debian?

@nschloe
Copy link
Collaborator

nschloe commented Dec 6, 2019

The relationship between cmake and setup.py seems to complicate the build conditions.

Hm. Well, the CMake files aren't terribly important to me, but sometimes I use them to debug which is why I don't want to toss them completely. If we can find another way of making this work, that'd be great.

@drew-parsons
Copy link
Author

drew-parsons commented Dec 6, 2019

If we're clear on the intended role of cmake (intended for developer debugging only) then Debian can just ignore it. Perhaps a comment could be added to CMakeLists.txt or README to make that clear

The failing CGAL 5 build is documented at https://buildd.debian.org/status/package.php?p=pygalmesh
x86_64-linux-gnu-gcc is used for the linking step. This is with python3.8, so it could be possible that setuptools needs to be updated for the python3.8 context.

@nschloe
Copy link
Collaborator

nschloe commented Dec 6, 2019

Fixing this right now.

@nschloe
Copy link
Collaborator

nschloe commented Dec 6, 2019

Alright, all done now.

@drew-parsons
Copy link
Author

Thanks, will test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants