ducha-aiki / pydegensac

Advanced RANSAC (DEGENSAC) with bells and whistles for H and F estimation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mac os wheels for pypi

johnwlambert opened this issue · comments

Thanks for providing this repo and the linux wheels on pypi.

Would you consider adding wheels for macosx to https://pypi.org/project/pydegensac/#files? Ran into some nasty errors when building locally on mac os x

/Users/johnlambert/Documents/pydegensac/src/pydegensac/matutls/./complex.h:44:16: note: 'catanh' is a builtin
      with type '_Complex double (_Complex double)'
/Users/johnlambert/Documents/pydegensac/src/pydegensac/matutls/cmprt.c:12:28: error: implicitly declaring
      library function 'printf' with type 'int (const char *, ...)' [-Werror,-Wimplicit-function-declaration]
    for(j=0; j<n ;++j,++p) printf(f,p->re,p->im);
                           ^
/Users/johnlambert/Documents/pydegensac/src/pydegensac/matutls/cmprt.c:12:28: note: include the header
      <stdio.h> or explicitly provide a declaration for 'printf'
16 warnings and 1 error generated.
make[2]: *** [src/pydegensac/matutls/CMakeFiles/matutls.dir/cmprt.c.o] Error 1
make[2]: *** Waiting for unfinished jobs....

By the way, if I do include <stdio.h> in src/pydegensac/matutls/cmprt.c, the compilation continues, but then crashes at

[ 82%] Building C object CMakeFiles/pydegensac.dir/src/pydegensac/degensac/DegUtils.c.o
[ 83%] Building C object CMakeFiles/pydegensac.dir/src/pydegensac/degensac/exp_ranF.c.o
error: invalid argument '-std=c++14' not allowed with 'C'
error: invalid argument '-std=c++14' not allowed with 'C'

since it seems the C code is not wrapped with "extern C" and mixed with C++.

@johnwlambert unfortunately, I have no idea how to do macos wheels. By any chance, you or @ProfFan could help me?

Hi @ducha-aiki,

I think I can help by setting automatic builds and unit tests on Github Actions, would you like me to submit a PR doing this?

That would be great!

Hi @ProfFan, @johnwlambert

I have successfully build the pydegensac on macOS locally, but the solution via GitHub actions does not work:
wheels are built and installed, but crash on import with "no suitable image" error.

The macOS on GitHub Actions is x86 only, so no wonder why it crash with no suitable image. This issue is tracked here

I think you can build the wheel locally and upload to GitHub releases (and PyPI) for now, as a temporary solution.

I see, thank you!
Could you please try to install pydegensac for Mac from pip? I have pushed local M1 version + bunch of macOS x86 versions now.