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 fails for MacOS (ocrd-fork-pycocotools) #64

Open
stweil opened this issue Nov 12, 2022 · 7 comments
Open

Build fails for MacOS (ocrd-fork-pycocotools) #64

stweil opened this issue Nov 12, 2022 · 7 comments

Comments

@stweil
Copy link
Contributor

stweil commented Nov 12, 2022

Running make all for ocrd_all or pip install . for ocrd_segment fails on MacOS with Homebrew:

      Compiling pycocotools/_mask.pyx because it changed.
      [1/1] Cythonizing pycocotools/_mask.pyx
      /private/var/folders/wf/g2hmm5bd72v2r_p0r1smct_00000gn/T/pip-install-0xp4jh31/ocrd-fork-pycocotools_7b0159a305264f708a622a0e4daa80bd/.eggs/Cython-3.0.0a11-py3.9.egg/Cython/Compiler/Main.py:345: FutureWarning: Cython directive 'language_level' not set, using '3str' for now (Py3). This has changed from earlier releases! File: /private/var/folders/wf/g2hmm5bd72v2r_p0r1smct_00000gn/T/pip-install-0xp4jh31/ocrd-fork-pycocotools_7b0159a305264f708a622a0e4daa80bd/pycocotools/_mask.pyx
        tree = Parsing.p_module(s, pxd, full_module_name)
      building 'pycocotools._mask' extension
      creating build/common
      creating build/temp.macosx-12-arm64-cpython-39
      creating build/temp.macosx-12-arm64-cpython-39/common
      creating build/temp.macosx-12-arm64-cpython-39/pycocotools
      clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -I/OCR-D/venv-20221112/lib/python3.9/site-packages/numpy/core/include -I./common -I/OCR-D/venv-20221112/include -I/opt/homebrew/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c ../common/maskApi.c -o build/temp.macosx-12-arm64-cpython-39/../common/maskApi.o -Wno-cpp -Wno-unused-function -std=c99
      clang: error: no such file or directory: '../common/maskApi.c'
      clang: error: no input files
      error: command '/usr/bin/clang' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for ocrd-fork-pycocotools
@stweil stweil changed the title Build fails for MacOS Build fails for MacOS (ocrd-fork-pycocotools) Nov 12, 2022
@bertsky
Copy link
Collaborator

bertsky commented Nov 12, 2022

No idea. Note that ocrd-fork-pycocotools is https://github.com/bertsky/cocoapi – I only added a few fixes.

Meanwhile, I have merged from upstream. Please try again now (I have made a release 2.0.6.post1).

If it does not work, please try out upstream https://github.com/ppwwyyxx/cocoapi directly (make -C PythonAPI), and perhaps open an issue there.

@stweil
Copy link
Contributor Author

stweil commented Nov 12, 2022

python -m pip install --use-feature=in-tree-build does not work there. Just python -m pip install . is fine.

@bertsky
Copy link
Collaborator

bertsky commented Nov 12, 2022

I don't know what in-tree-build is.

So you are saying that MacOS works if you install manually? Or that you can pip install from the new src tarball on PyPI?

@stweil
Copy link
Contributor Author

stweil commented Nov 12, 2022

The failing command is here and is also wrong in upstream.

@bertsky
Copy link
Collaborator

bertsky commented Nov 13, 2022

Ah, got it. Hard to tell from here. But could you try python setup.py build_ext install (which is in upstream's upstream)?

@bertsky
Copy link
Collaborator

bertsky commented Nov 13, 2022

Another thing you could try: setting ARCHFLAGS="-arch x86_64" during compilation.

@stweil
Copy link
Contributor Author

stweil commented Nov 13, 2022

Why? I don't want to build for x86_64 on my M1.

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

No branches or pull requests

2 participants