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

installation fails on mac due to c++11 not being used #76

Closed
bzamecnik opened this issue Apr 19, 2023 · 4 comments · Fixed by #77
Closed

installation fails on mac due to c++11 not being used #76

bzamecnik opened this issue Apr 19, 2023 · 4 comments · Fixed by #77

Comments

@bzamecnik
Copy link
Contributor

bzamecnik commented Apr 19, 2023

It fails like in https://stackoverflow.com/questions/45047508/error-unknown-type-name-constexpr-during-make-in-mac-os-x:

 FAILED: src/cpp/document.cpython-310-darwin.so.p/document.cpp.o
c++ -Isrc/cpp/document.cpython-310-darwin.so.p -Isrc/cpp -I../../src/cpp -I../../subprojects/pybind11-2.10.3/include -I/opt/homebrew/Cellar/poppler/23.04.0/include/poppler/cpp -I/opt/homebrew/Cellar/poppler/23.04.0/include/poppler -I/opt/homebrew/opt/python@3.10/Frameworks/Python.framework/Versions/3.10/include/python3.10 -fvisibility=hidden -fvisibility-inlines-hidden -fcolor-diagnostics -DNDEBUG -Wall -Winvalid-pch -O3 -MD -MQ src/cpp/document.cpython-310-darwin.so.p/document.cpp.o -MF src/cpp/document.cpython-310-darwin.so.p/document.cpp.o.d -o src/cpp/document.cpython-310-darwin.so.p/document.cpp.o -c ../../src/cpp/document.cpp

      ../../subprojects/pybind11-2.10.3/include/pybind11/detail/common.h:547:15: error: unknown type name 'constexpr'
      inline static constexpr size_t size_in_ptrs(size_t s) {

To fix it add default_options : ['c_std=c11', 'cpp_std=c++11'] to project() in meson.build:

project(
    'python-poppler', 
    'cpp', 
    version: '0.4.0', 
    license: 'GNU General Public License v2 (GPLv2)', 
    # license_files: 'LICENSE.txt',
    meson_version: '>=1.0.0',
    default_options : ['c_std=c11', 'cpp_std=c++11']
)

Then installation works:

$ pip3 install meson meson-python
$ pip3 install python_poppler

Successfully installed python-poppler-0.4.0
bzamecnik added a commit to bzamecnik/python-poppler that referenced this issue Apr 19, 2023
bzamecnik added a commit to bzamecnik/python-poppler that referenced this issue Apr 19, 2023
@cbrunet
Copy link
Owner

cbrunet commented Apr 21, 2023

Thank you for reporting. If you are familiar with Github Actions, it could be great to add a pipeline for building and testing python-poppler on mac os. It could even be used to publish prebuild binaries on PyPI. Do not hesitate to open a PR for that!

bzamecnik added a commit to bzamecnik/python-poppler that referenced this issue Apr 21, 2023
@bzamecnik
Copy link
Contributor Author

@cbrunet Thanks for a tip. I was not aware that the GitHub CI runners already support MacOS. It could potentially reduce the need to install meson and some other libs. But once they're installed compilation from a wheel is very fast (10s on M1).

@cbrunet
Copy link
Owner

cbrunet commented Apr 21, 2023

It could potentially reduce the need to install meson and some other libs. But once they're installed compilation from a wheel is very fast (10s on M1).

It is more a matter of how easy it is to install the latest version of poppler-cpp? Distributing wheels would allow to distribute a working poppler-cpp together.

@bzamecnik
Copy link
Contributor Author

bzamecnik commented Apr 21, 2023

It's a matter of brew install poppler. Very easy.

Wheels would be bound to a given poppler version, which may not be the latest. Poppler gets released every month.

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