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

failed to build under android #195

Closed
ghost opened this issue Feb 14, 2022 · 7 comments
Closed

failed to build under android #195

ghost opened this issue Feb 14, 2022 · 7 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@ghost
Copy link

ghost commented Feb 14, 2022

after v1.9.1 it started to fail in building using pip under android (termux)
logs: log.txt

@maxbachmann
Copy link
Member

Hm the relevant part appears to be:

-- The C compiler identification is Clang 13.0.1
-- The CXX compiler identification is Clang 13.0.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: /data/data/com.termux/files/usr/bin/cc
-- Check for working C compiler: /data/data/com.termux/files/usr/bin/cc - broken
CMake Error at /data/data/com.termux/files/usr/share/cmake-3.22/Modules/CMakeTestCCompiler.cmake:69 (message):
  The C compiler

   "/data/data/com.termux/files/usr/bin/cc"

is not able to compile a simple test program.

It fails with the following output:

Change Dir: /data/data/com.termux/files/usr/tmp/pip-install-sprqv_pr/cmake_54c1939fa7834215b577bcb5f5feb3b0/_skbuild/linux-aarch64-3.10/cmake-build/CMakeProject-build/CMakeFiles/CMakeTmp

Run Build Command(s):/data/data/com.termux/files/usr/bin/ninja cmTC_9236a && [1/2] Building C object CMakeFiles/cmTC_9236a.dir/testCCompiler.c.o
[2/2] Linking C executable cmTC_9236a
FAILED: cmTC_9236a
: && /data/data/com.termux/files/usr/bin/cc -D_POSIX_C_SOURCE=199506L -D_POSIX_SOURCE=1 -D_SVID_SOURCE=1 -D_BSD_SOURCE=1  -O2 -g -DNDEBUG -lstdc++ -lgcc -lrt CMakeFiles/cmTC_9236a.dir/testCCompiler.c.o -o cmTC_9236a   && :
ld.lld: error: unable to find library -lgcc
clang-13: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.

Are you sure this currently works with v1.9.1? It sounds like this could be caused by termux/termux-packages#7788.

@ghost
Copy link
Author

ghost commented Feb 14, 2022

Are you sure this currently works with v1.9.1?

yes, v1.9.1 was working fine
IMG_20220214_141424

@maxbachmann maxbachmann added bug Something isn't working help wanted Extra attention is needed labels Feb 14, 2022
@maxbachmann
Copy link
Member

  1. It appears rapidfuzz is already installed in this case. Did you try uninstalling it and recompiling it?
  2. Could you send me the output of the successful install when calling pip with pip install rapidfuzz==1.9.1 -vvv, so I can compare how the compiler is invoked.

The build system changed in between 1.9.1 and 2.0.0 from setuptools to scikit-build + cmake. So I assume, that cmake is invoking clang with different command line arguments.

@ghost
Copy link
Author

ghost commented Feb 15, 2022

It appears rapidfuzz is already installed in this case. Did you try uninstalling it and recompiling it?

yes i did

Could you send me the output of the successful install when calling pip with pip install rapidfuzz==1.9.1 -vvv, so I can compare how the compiler is invoked.

log.txt

@maxbachmann
Copy link
Member

maxbachmann commented Feb 16, 2022

Hm, looking at this again it appears to build cmake from source and is triggered by https://github.com/scikit-build/cmake-python-distributions/blob/0895db3c6de81da3091fc03dcc425ae8d53357a3/CMakeLists.txt#L193-L196. So you should run into the same issue when running pip install cmake.

It appears like this is an issue with the clang packaged in termux, so it would make sense to report it to them as well. I could not find any open issues on this over in the termux issue tracker for clang 13.0.1, even though similar issues existed for clang 12.0.1 (termux/termux-packages#7788). Maybe one of the workarounds for clang 12.0.1 works here as well.

@henryiii linking you here, since this might be of interest to you given your one of the maintainers of the cmake distribution for Python and scikit-build, so others could run into similar issues when transitioning.

@henryiii
Copy link
Contributor

That's weird, why is it downloading ninja but building cmake? Also, why is ninja-1.10.2.3-cp310-cp310-linux_aarch64.whl being downloaded instead of... Actually, what is that at all? https://pypi.org/project/ninja/#files has ninja-1.10.2.3-py2.py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl, not this thing. It's not manylinux, so - ahh, it's an old build. Okay. Hmm, it succeeded, though.

Guessing android is not manylinux? What version of pip is that?

@maxbachmann
Copy link
Member

building in termux works with v2.0.13, as long as you have cmake and ninja natively installed.

@ghost ghost closed this as completed Jun 23, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants