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

Compilation Error #78

Closed
ericmillsio opened this issue Dec 30, 2012 · 17 comments
Closed

Compilation Error #78

ericmillsio opened this issue Dec 30, 2012 · 17 comments

Comments

@ericmillsio
Copy link

I'm trying to install python for android, but it gets caught up at this point and I've tried everything to get around it... Fails on jnius compilation. Anyone have a similar issue?

I am currently on arch.

Leaving ARM enviromnent
Call build_pyjnius
Entering in ARM enviromnent
Compiler found at /opt/android-ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc
/home/eric/workspace/python-for-android/build/python-install/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'install_requires'
warnings.warn(msg)
running build_ext
building 'jnius' extension
arm-linux-androideabi-gcc -mandroid -fomit-frame-pointer --sysroot /opt/android-ndk//platforms/android-14/arch-arm -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -mandroid -fomit-frame-pointer --sysroot /opt/android-ndk//platforms/android-14/arch-arm -fPIC -I/home/eric/workspace/python-for-android/build/python-install/include/python2.7 -c jnius/jnius.c -o build/temp.linux-x86_64-2.7/jnius/jnius.o
jnius/jnius.c:1:2: error: #error Do not use this file, it is the result of a failed Cython compilation.
error: command 'arm-linux-androideabi-gcc' failed with exit status 1
find: `cython': No such file or directory
/home/eric/workspace/python-for-android/build/python-install/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'install_requires'
warnings.warn(msg)
running build_ext
building 'jnius' extension
arm-linux-androideabi-gcc -mandroid -fomit-frame-pointer --sysroot /opt/android-ndk//platforms/android-14/arch-arm -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -mandroid -fomit-frame-pointer --sysroot /opt/android-ndk//platforms/android-14/arch-arm -fPIC -I/home/eric/workspace/python-for-android/build/python-install/include/python2.7 -c jnius/jnius.c -o build/temp.linux-x86_64-2.7/jnius/jnius.o
jnius/jnius.c:1:2: error: #error Do not use this file, it is the result of a failed Cython compilation.
error: command 'arm-linux-androideabi-gcc' failed with exit status 1

@paulocheque
Copy link

I had this issue too. If you fixed your environment, could you add a comment here telling what you did? I am googling again.. thanks

Edited:

  • I am using a MacOS 10
  • Python 2.7
  • Kivy 1.5.1
  • Android SDK and NDK installed newest versions of each one (considering the date of this post)

@xaos3k
Copy link

xaos3k commented Jan 14, 2013

I have the same problem, except I'm building on a x86-machine.

I just realised that I'm using Python3 as standard on my machine, maybe the whole process fails because of this. Will try that when I'm home again, in about 4h or so.

@ericmillsio
Copy link
Author

I'm not quite sure what it was I did to fix it (I tried a ton of stuff), but I think what @xaos3k is saying about Python3 happened to me. I kept accidently installing dependencies in python3 instead of 2. Make sure all of your dependencies are installed correctly. Cython I had some problems with. When installing remember to run pip2 not pip.

@xaos3k
Copy link

xaos3k commented Jan 15, 2013

Sorry for the long waiting time, but I couldn't do anything after work yesterday. Unfortunately changing the Pythonversion didn't do the trick. As someone mentioned on #kivy, a special version gets compiled for this package. I guess I'll open up another ticket for this issue this evening.

@lzzy
Copy link

lzzy commented Jan 16, 2013

I had fixed it by : apt-get install cython .

@tito
Copy link
Member

tito commented Jan 16, 2013

Yes, you need cython, but cython for python 2.7 of course. Python3 is not supported anywhere yet.
So you can do easy-install-2.7, pip-2.7 or apt-get install (but cython might be outdated with apt-get).

@paulocheque
Copy link

I have the default python installed in MacOS. 2.7.1. I believe that is the CPython.
Maybe I need some extra package.. lib..

@xaos3k
Copy link

xaos3k commented Jan 17, 2013

Someone else had a hard time compiling this and found a solution (look at Issue #86).
I just discovered that I'm getting a little different errormessage. Instead of

'error: command 'arm-linux-androideabi-gcc' failed with exit status 1'

I get

'error: command 'ccache' failed with exit status 1'

Do I need any special version of ccache?

@xaos3k
Copy link

xaos3k commented Feb 20, 2013

I finally gave it another try, after not doing anything on this for a month or so. I actually found the solution to this problem on my machine. I actually started from scratch installing everything when I noticed that "pip" was installed for Python 3, not Python 2.

So I installed the corresponding pip-version and now everything compiles just fine. The problem actually wasn't with ccache or cython (although I'm currently still running v0.17.1 instead of the most recent 0.18).

@yurkomik
Copy link

Can you please xaos3k help others to fix same problem?
how to install pip for python 2.7?

@AndreMiras
Copy link
Member

Hi I also had the issue first mentioned by crearc under a Gentoo environment.
I had Cython 0.16 installed system wide using my distribution package manager.
Uninstalling it and installing Cython 0.19 with pip in the virtualenv solved the issue for me.

@bonhag
Copy link

bonhag commented Oct 8, 2013

@yurkomik, this is the easiest way (in Ubuntu, because I don't know which distro you're using):

sudo apt-get install python-pip python-dev
sudo pip install cython

@ghe
Copy link

ghe commented Oct 22, 2013

I ran into this on Arch, using cython 0.19.2, following http://kivy.org/docs/guide/packaging-android.html#packaging-android
The Arch cython package is apparently for python3, but there is also a cython2 package. Installing that and simlinking 'cython' to 'cython2' made the compile finish successfully. Cython 0.19 also has a command line option (-2 or -3) to set python compatibility, so another option may be to alias 'cython' to use the one you need (-2 in this case).

@brywil
Copy link

brywil commented Mar 26, 2014

Ubuntu Quantal:
sudo apt-get install gcc-arm-linux-androideabi

fixed the problem for me

@brywil
Copy link

brywil commented Mar 26, 2014

I think 'pip install --upgrade cython' is supposed to fix this step. I got an error later on after manually running 'apt-get install gcc-arm-linux-androideabi'

@peteristhegreat
Copy link

On Mavericks and clang, it needs to be this:

$ sudo ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future pip cython

http://bruteforce.gr/bypassing-clang-error-unknown-argument.html

@tobigue
Copy link

tobigue commented Sep 15, 2014

Had the same problem on Ubuntu 14.04, fixed it by installing an older Cython version (0.17.1).

http://stackoverflow.com/questions/13485364/cant-install-kivy-cython-gcc-error

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