command 'gcc' failed with exit status 1

This is the place for queries that don't fit in any of the other categories.

command 'gcc' failed with exit status 1

Postby Cal » Mon Dec 02, 2013 8:41 pm

Hi guys,
I am trying to install cffi on to my raspberry pi! I get this error: command 'gcc' failed with exit status 1. I have installed all the development packages and it still does not work. However when i run apt-get update i receive an error that some index files could not be downloaded. Could this be my problem? How do i fix it? Any ideas?
Thanks in advance!
Last edited by micseydel on Mon Dec 02, 2013 8:49 pm, edited 1 time in total.
Reason: Locked.
Cal
 
Posts: 6
Joined: Mon Dec 02, 2013 8:35 pm

Re: command 'gcc' failed with exit status 1

Postby micseydel » Mon Dec 02, 2013 8:54 pm

This sounds like a problem related more to Linux than Python, but we can still probably help you. It would help us to help you though if you posted the entire error output that you receive.
Join the #python-forum IRC channel on irc.freenode.net!

Please do not PM members regarding questions which are meant to be discussed publicly. The point of the forum is so that others can benefit from it. We don't want to help you over PMs or emails.
User avatar
micseydel
 
Posts: 1293
Joined: Tue Feb 12, 2013 2:18 am
Location: Mountain View, CA

Re: command 'gcc' failed with exit status 1

Postby metulburr » Mon Dec 02, 2013 9:16 pm

when you ask questions such as this. You need to give precise information.
Based on the package manager 'apt-get' we can already decipher what operating system and what distro, ubuntu/debian, but it would still be helpful to explicitly say what operating system, and what linux distro you are using.
What exact command did you use to get the error? Like micseydel said, what is the error exactly? What exactly are the development packages you installed?
I am not currently on an Ubuntu system, so i cannot see the repos...Are you installing this "cffi" from the repo or are you compiling it from scratch, and if so what is the command you are using to compile?
New Users, Read This
OS Ubuntu 14.04, Arch Linux, Gentoo, Windows 7/8
https://github.com/metulburr
steam
User avatar
metulburr
 
Posts: 1449
Joined: Thu Feb 07, 2013 4:47 pm
Location: Elmira, NY

Re: command 'gcc' failed with exit status 1

Postby Cal » Mon Dec 02, 2013 9:52 pm

Sorry i am an extreme beginner to this. I actually solved my problem by installing libffi-dev. However this led on to a new issue similar to the first. I was installing the cffi from a download using the "python setup.py install" command. After the successful install i wen to to install smbus-cffi which now give me the same error i got from the cffi install. Unfortunately i will be unable to post the full error until tomorrow.
Thanks for your help!
Cal
 
Posts: 6
Joined: Mon Dec 02, 2013 8:35 pm

Re: command 'gcc' failed with exit status 1

Postby Cal » Tue Dec 03, 2013 4:07 pm

here is the full error message i get when attempting to install smbus-cffi0.2

Code: Select all
root@raspberrypi:/home/pi/smbus-cffi-0.2# python /home/pi/smbus-cffi-0.2/setup.py install
smbus/__pycache__/_cffi__x8a88d46dx176f443a.c: In function ‘_cffi_f_i2c_smbus_access’:
smbus/__pycache__/_cffi__x8a88d46dx176f443a.c:209: warning: implicit declaration of function ‘i2c_smbus_access’
smbus/__pycache__/_cffi__x8a88d46dx176f443a.c: In function ‘_cffi_f_i2c_smbus_process_call’:
smbus/__pycache__/_cffi__x8a88d46dx176f443a.c:244: warning: implicit declaration of function ‘i2c_smbus_process_call’
smbus/__pycache__/_cffi__x8a88d46dx176f443a.c: In function ‘_cffi_f_i2c_smbus_read_byte’:
smbus/__pycache__/_cffi__x8a88d46dx176f443a.c:263: warning: implicit declaration of function ‘i2c_smbus_read_byte’
smbus/__pycache__/_cffi__x8a88d46dx176f443a.c: In function ‘_cffi_f_i2c_smbus_read_byte_data’:
smbus/__pycache__/_cffi__x8a88d46dx176f443a.c:292: warning: implicit declaration of function ‘i2c_smbus_read_byte_data’
smbus/__pycache__/_cffi__x8a88d46dx176f443a.c: In function ‘_cffi_f_i2c_smbus_read_word_data’:
smbus/__pycache__/_cffi__x8a88d46dx176f443a.c:321: warning: implicit declaration of function ‘i2c_smbus_read_word_data’
smbus/__pycache__/_cffi__x8a88d46dx176f443a.c: In function ‘_cffi_f_i2c_smbus_write_byte’:
smbus/__pycache__/_cffi__x8a88d46dx176f443a.c:350: warning: implicit declaration of function ‘i2c_smbus_write_byte’
smbus/__pycache__/_cffi__x8a88d46dx176f443a.c: In function ‘_cffi_f_i2c_smbus_write_byte_data’:
smbus/__pycache__/_cffi__x8a88d46dx176f443a.c:385: warning: implicit declaration of function ‘i2c_smbus_write_byte_data’
smbus/__pycache__/_cffi__x8a88d46dx176f443a.c: In function ‘_cffi_f_i2c_smbus_write_quick’:
smbus/__pycache__/_cffi__x8a88d46dx176f443a.c:414: warning: implicit declaration of function ‘i2c_smbus_write_quick’
smbus/__pycache__/_cffi__x8a88d46dx176f443a.c: In function ‘_cffi_f_i2c_smbus_write_word_data’:
smbus/__pycache__/_cffi__x8a88d46dx176f443a.c:449: warning: implicit declaration of function ‘i2c_smbus_write_word_data’
smbus/__pycache__/_cffi__x8a88d46dx176f443a.c: In function ‘_cffi_const_I2C_SMBUS_BLOCK_DATA’:
smbus/__pycache__/_cffi__x8a88d46dx176f443a.c:498: error: ‘I2C_SMBUS_BLOCK_DATA’ undeclared (first use in this function)
smbus/__pycache__/_cffi__x8a88d46dx176f443a.c:498: error: (Each undeclared identifier is reported only once
smbus/__pycache__/_cffi__x8a88d46dx176f443a.c:498: error: for each function it appears in.)
smbus/__pycache__/_cffi__x8a88d46dx176f443a.c: In function ‘_cffi_const_I2C_SMBUS_BLOCK_MAX’:
smbus/__pycache__/_cffi__x8a88d46dx176f443a.c:517: error: ‘I2C_SMBUS_BLOCK_MAX’ undeclared (first use in this function)
smbus/__pycache__/_cffi__x8a88d46dx176f443a.c: In function ‘_cffi_const_I2C_SMBUS_BLOCK_PROC_CALL’:
smbus/__pycache__/_cffi__x8a88d46dx176f443a.c:536: error: ‘I2C_SMBUS_BLOCK_PROC_CALL’ undeclared (first use in this function)
smbus/__pycache__/_cffi__x8a88d46dx176f443a.c: In function ‘_cffi_const_I2C_SMBUS_BYTE’:
smbus/__pycache__/_cffi__x8a88d46dx176f443a.c:555: error: ‘I2C_SMBUS_BYTE’ undeclared (first use in this function)
smbus/__pycache__/_cffi__x8a88d46dx176f443a.c: In function ‘_cffi_const_I2C_SMBUS_BYTE_DATA’:
smbus/__pycache__/_cffi__x8a88d46dx176f443a.c:574: error: ‘I2C_SMBUS_BYTE_DATA’ undeclared (first use in this function)
smbus/__pycache__/_cffi__x8a88d46dx176f443a.c: In function ‘_cffi_const_I2C_SMBUS_I2C_BLOCK_BROKEN’:
smbus/__pycache__/_cffi__x8a88d46dx176f443a.c:593: error: ‘I2C_SMBUS_I2C_BLOCK_BROKEN’ undeclared (first use in this function)
smbus/__pycache__/_cffi__x8a88d46dx176f443a.c: In function ‘_cffi_const_I2C_SMBUS_I2C_BLOCK_DATA’:
smbus/__pycache__/_cffi__x8a88d46dx176f443a.c:612: error: ‘I2C_SMBUS_I2C_BLOCK_DATA’ undeclared (first use in this function)
smbus/__pycache__/_cffi__x8a88d46dx176f443a.c: In function ‘_cffi_const_I2C_SMBUS_PROC_CALL’:
smbus/__pycache__/_cffi__x8a88d46dx176f443a.c:631: error: ‘I2C_SMBUS_PROC_CALL’ undeclared (first use in this function)
smbus/__pycache__/_cffi__x8a88d46dx176f443a.c: In function ‘_cffi_const_I2C_SMBUS_QUICK’:
smbus/__pycache__/_cffi__x8a88d46dx176f443a.c:650: error: ‘I2C_SMBUS_QUICK’ undeclared (first use in this function)
smbus/__pycache__/_cffi__x8a88d46dx176f443a.c: In function ‘_cffi_const_I2C_SMBUS_READ’:
smbus/__pycache__/_cffi__x8a88d46dx176f443a.c:669: error: ‘I2C_SMBUS_READ’ undeclared (first use in this function)
smbus/__pycache__/_cffi__x8a88d46dx176f443a.c: In function ‘_cffi_const_I2C_SMBUS_WORD_DATA’:
smbus/__pycache__/_cffi__x8a88d46dx176f443a.c:688: error: ‘I2C_SMBUS_WORD_DATA’ undeclared (first use in this function)
smbus/__pycache__/_cffi__x8a88d46dx176f443a.c: In function ‘_cffi_const_I2C_SMBUS_WRITE’:
smbus/__pycache__/_cffi__x8a88d46dx176f443a.c:707: error: ‘I2C_SMBUS_WRITE’ undeclared (first use in this function)
smbus/__pycache__/_cffi__x8a88d46dx176f443a.c: In function ‘_cffi_check_union_i2c_smbus_data’:
smbus/__pycache__/_cffi__x8a88d46dx176f443a.c:725: error: dereferencing pointer to incomplete type
smbus/__pycache__/_cffi__x8a88d46dx176f443a.c:726: error: dereferencing pointer to incomplete type
smbus/__pycache__/_cffi__x8a88d46dx176f443a.c:727: error: dereferencing pointer to incomplete type
smbus/__pycache__/_cffi__x8a88d46dx176f443a.c: In function ‘_cffi_layout_union_i2c_smbus_data’:
smbus/__pycache__/_cffi__x8a88d46dx176f443a.c:732: error: field ‘y’ has incomplete type
smbus/__pycache__/_cffi__x8a88d46dx176f443a.c:734: error: invalid application of ‘sizeof’ to incomplete type ‘union i2c_smbus_data’
smbus/__pycache__/_cffi__x8a88d46dx176f443a.c:736: error: invalid use of undefined type ‘union i2c_smbus_data’
smbus/__pycache__/_cffi__x8a88d46dx176f443a.c:737: error: dereferencing pointer to incomplete type
smbus/__pycache__/_cffi__x8a88d46dx176f443a.c:738: error: invalid use of undefined type ‘union i2c_smbus_data’
smbus/__pycache__/_cffi__x8a88d46dx176f443a.c:739: error: dereferencing pointer to incomplete type
smbus/__pycache__/_cffi__x8a88d46dx176f443a.c:740: error: invalid use of undefined type ‘union i2c_smbus_data’
smbus/__pycache__/_cffi__x8a88d46dx176f443a.c:741: error: dereferencing pointer to incomplete type
Traceback (most recent call last):
  File "/home/pi/smbus-cffi-0.2/setup.py", line 7, in <module>
    import smbus
  File "/home/pi/smbus-cffi-0.2/smbus/__init__.py", line 1, in <module>
    from .smbus import ffi
  File "/home/pi/smbus-cffi-0.2/smbus/smbus.py", line 93, in <module>
    """, ext_package='smbus')
  File "/usr/local/lib/python2.6/dist-packages/cffi-0.8.1-py2.6-linux-armv6l.egg/cffi/api.py", line 339, in verify
    lib = self.verifier.load_library()
  File "/usr/local/lib/python2.6/dist-packages/cffi-0.8.1-py2.6-linux-armv6l.egg/cffi/verifier.py", line 74, in load_library
    self._compile_module()
  File "/usr/local/lib/python2.6/dist-packages/cffi-0.8.1-py2.6-linux-armv6l.egg/cffi/verifier.py", line 139, in _compile_module
    outputfilename = ffiplatform.compile(tmpdir, self.get_extension())
  File "/usr/local/lib/python2.6/dist-packages/cffi-0.8.1-py2.6-linux-armv6l.egg/cffi/ffiplatform.py", line 25, in compile
    outputfilename = _build(tmpdir, ext)
  File "/usr/local/lib/python2.6/dist-packages/cffi-0.8.1-py2.6-linux-armv6l.egg/cffi/ffiplatform.py", line 50, in _build
    raise VerificationError('%s: %s' % (e.__class__.__name__, e))
cffi.ffiplatform.VerificationError: CompileError: command 'gcc' failed with exit status 1


i am very new to this system so if you have any ideas i would appreciate it if you could explain to me exactly what to do. Thanks in advance!
Cal
 
Posts: 6
Joined: Mon Dec 02, 2013 8:35 pm

Re: command 'gcc' failed with exit status 1

Postby micseydel » Tue Dec 03, 2013 9:27 pm

From the compiler output it looks like the C code is incorrect. If I were you, I'd contact the provider of that code and send them the information you've provided here.
Join the #python-forum IRC channel on irc.freenode.net!

Please do not PM members regarding questions which are meant to be discussed publicly. The point of the forum is so that others can benefit from it. We don't want to help you over PMs or emails.
User avatar
micseydel
 
Posts: 1293
Joined: Tue Feb 12, 2013 2:18 am
Location: Mountain View, CA


Return to General Coding Help

Who is online

Users browsing this forum: No registered users and 3 guests