Oracle Linux 6.8 install ansible 2.3.2 get gcc error

Oracle Linux 6.8 install ansible 2.3.2 get gcc error

 

Oracle Linux 上安装ansible 2.3.2,在ansible 软件包里面requirements.txt明确指出了需要的软件包:

jinja2
PyYAML
paramiko
pycrypto >= 2.6
setuptools

 

其中paramiko在OL6.8的DVD中是包含的,包的名字是python-paramiko,版本是1.7,如果缺少了这个包,而且正好你的机器是可以链接intenet的,那么python的安装程序就会自动连接internet,寻找并下载paramiko软件,但是自动联网下载的paramiko是2.x版本的,其又依赖一系列其他的包,安装程序会继续下载并安装paramiko依赖的包,而有些包的版本比较高,最终在OL6.8上编译不通过,导致了ansible 2.3.2整体安装失败。

 

输出类似:

。。。。。。

Searching for pynacl>=1.0.1
Reading http://pypi.python.org/simple/pynacl/
Best match: PyNaCl 1.1.2
Downloading https://pypi.python.org/packages/8d/f3/02605b056e465bf162508c4d1635a2bccd9abd1ee3ed2a1bb4e9676eac33/PyNaCl-1.1.2.tar.gz#md5=1963c14272a42585676e74cf6292f4e3
Processing PyNaCl-1.1.2.tar.gz
Running PyNaCl-1.1.2/setup.py -q bdist_egg –dist-dir /tmp/easy_install-t5V409/PyNaCl-1.1.2/egg-dist-tmp-KCZgGL
Checking .pth file support in .
/usr/bin/python -E -c pass
Searching for cffi>=1.4.1
Reading http://pypi.python.org/simple/cffi/
Best match: cffi 1.10.0
Downloading https://pypi.python.org/packages/5b/b9/790f8eafcdab455bcd3bd908161f802c9ce5adbf702a83aa7712fcc345b7/cffi-1.10.0.tar.gz#md5=2b5fa41182ed0edaf929a789e602a070
Processing cffi-1.10.0.tar.gz
Running cffi-1.10.0/setup.py -q bdist_egg –dist-dir /tmp/easy_install-t5V409/PyNaCl-1.1.2/temp/easy_install-C2DHjo/cffi-1.10.0/egg-dist-tmp-SVaijE
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing `libffi.pc’
to the PKG_CONFIG_PATH environment variable
No package ‘libffi’ found
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing `libffi.pc’
to the PKG_CONFIG_PATH environment variable
No package ‘libffi’ found
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing `libffi.pc’
to the PKG_CONFIG_PATH environment variable
No package ‘libffi’ found
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing `libffi.pc’
to the PKG_CONFIG_PATH environment variable
No package ‘libffi’ found
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing `libffi.pc’
to the PKG_CONFIG_PATH environment variable
No package ‘libffi’ found
compiling ‘_configtest.c’:
__thread int some_threadlocal_variable_42;
gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector –param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector –param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -c _configtest.c -o _configtest.o
success!
removing: _configtest.c _configtest.o
compiling ‘_configtest.c’:
int main(void) { __sync_synchronize(); return 0; }
gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector –param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector –param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -c _configtest.c -o _configtest.o
gcc -pthread _configtest.o -o _configtest
success!
removing: _configtest.c _configtest.o _configtest
c/_cffi_backend.c:15:17: error: ffi.h: No such file or directory
In file included from c/_cffi_backend.c:63:
c/malloc_closure.h:81: error: expected specifier-qualifier-list before ‘ffi_closure’
c/malloc_closure.h: In function ‘more_core’:
c/malloc_closure.h:117: warning: division by zero
c/malloc_closure.h:149: error: ‘union mmaped_block’ has no member named ‘next’
c/malloc_closure.h: At top level:
c/malloc_closure.h:158: error: expected ‘)’ before ‘*’ token
c/malloc_closure.h:166: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
c/_cffi_backend.c:259: error: expected specifier-qualifier-list before ‘ffi_cif’
c/_cffi_backend.c: In function ‘cdataowninggc_dealloc’:
c/_cffi_backend.c:1681: error: ‘ffi_closure’ undeclared (first use in this function)
c/_cffi_backend.c:1681: error: (Each undeclared identifier is reported only once
c/_cffi_backend.c:1681: error: for each function it appears in.)
c/_cffi_backend.c:1681: error: ‘closure’ undeclared (first use in this function)
c/_cffi_backend.c:1681: error: expected expression before ‘)’ token
c/_cffi_backend.c:1684: warning: implicit declaration of function ‘cffi_closure_free’
c/_cffi_backend.c: In function ‘cdataowninggc_traverse’:
c/_cffi_backend.c:1701: error: ‘ffi_closure’ undeclared (first use in this function)
c/_cffi_backend.c:1701: error: ‘closure’ undeclared (first use in this function)
c/_cffi_backend.c:1701: error: expected expression before ‘)’ token
c/_cffi_backend.c: In function ‘cdataowninggc_clear’:
c/_cffi_backend.c:1722: error: ‘ffi_closure’ undeclared (first use in this function)
c/_cffi_backend.c:1722: error: ‘closure’ undeclared (first use in this function)
c/_cffi_backend.c:1722: error: expected expression before ‘)’ token
c/_cffi_backend.c: In function ‘cdataowninggc_repr’:
c/_cffi_backend.c:1928: error: ‘ffi_closure’ undeclared (first use in this function)
c/_cffi_backend.c:1928: error: expected expression before ‘)’ token
c/_cffi_backend.c: At top level:
c/_cffi_backend.c:2618: error: expected declaration specifiers or ‘…’ before ‘ffi_abi’
c/_cffi_backend.c: In function ‘cdata_call’:
c/_cffi_backend.c:2751: error: ‘ffi_abi’ undeclared (first use in this function)
c/_cffi_backend.c:2751: error: expected ‘;’ before ‘fabi’
c/_cffi_backend.c:2793: error: ‘fabi’ undeclared (first use in this function)
c/_cffi_backend.c:2797: error: too many arguments to function ‘fb_prepare_cif’
c/_cffi_backend.c:2802: error: ‘cif_description_t’ has no member named ‘exchange_size’
c/_cffi_backend.c:2812: error: ‘cif_description_t’ has no member named ‘exchange_offset_arg’
c/_cffi_backend.c:2842: error: ‘cif_description_t’ has no member named ‘exchange_offset_arg’
c/_cffi_backend.c:2847: warning: implicit declaration of function ‘ffi_call’
c/_cffi_backend.c:2847: error: ‘cif_description_t’ has no member named ‘cif’
c/_cffi_backend.c: In function ‘new_primitive_type’:
c/_cffi_backend.c:4042: error: ‘ffi_type’ undeclared (first use in this function)
c/_cffi_backend.c:4042: error: ‘ffitype’ undeclared (first use in this function)
c/_cffi_backend.c:4060: error: ‘ffi_type_sint8’ undeclared (first use in this function)
c/_cffi_backend.c:4061: error: ‘ffi_type_sint16’ undeclared (first use in this function)
c/_cffi_backend.c:4062: error: ‘ffi_type_sint32’ undeclared (first use in this function)
c/_cffi_backend.c:4063: error: ‘ffi_type_sint64’ undeclared (first use in this function)
c/_cffi_backend.c:4069: error: ‘ffi_type_float’ undeclared (first use in this function)
c/_cffi_backend.c:4071: error: ‘ffi_type_double’ undeclared (first use in this function)
c/_cffi_backend.c:4079: error: ‘ffi_type_longdouble’ undeclared (first use in this function)
c/_cffi_backend.c:4086: error: ‘ffi_type_uint8’ undeclared (first use in this function)
c/_cffi_backend.c:4087: error: ‘ffi_type_uint16’ undeclared (first use in this function)
c/_cffi_backend.c:4088: error: ‘ffi_type_uint32’ undeclared (first use in this function)
c/_cffi_backend.c:4089: error: ‘ffi_type_uint64’ undeclared (first use in this function)
c/_cffi_backend.c: At top level:
c/_cffi_backend.c:4736: error: expected specifier-qualifier-list before ‘ffi_type’
c/_cffi_backend.c:4761: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
c/_cffi_backend.c:4771: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
c/_cffi_backend.c: In function ‘fb_build’:
c/_cffi_backend.c:4923: error: ‘struct funcbuilder_s’ has no member named ‘atypes’
c/_cffi_backend.c:4923: error: ‘ffi_type’ undeclared (first use in this function)
c/_cffi_backend.c:4923: error: expected expression before ‘)’ token
c/_cffi_backend.c:4924: error: ‘struct funcbuilder_s’ has no member named ‘nargs’
c/_cffi_backend.c:4927: error: ‘struct funcbuilder_s’ has no member named ‘rtype’
c/_cffi_backend.c:4927: warning: implicit declaration of function ‘fb_fill_type’
c/_cffi_backend.c:4935: error: ‘cif_description_t’ has no member named ‘exchange_offset_arg’
c/_cffi_backend.c:4938: error: ‘struct funcbuilder_s’ has no member named ‘rtype’
c/_cffi_backend.c:4939: error: ‘ffi_arg’ undeclared (first use in this function)
c/_cffi_backend.c:4949: error: ‘atype’ undeclared (first use in this function)
c/_cffi_backend.c:4962: error: ‘struct funcbuilder_s’ has no member named ‘atypes’
c/_cffi_backend.c:4963: error: ‘struct funcbuilder_s’ has no member named ‘atypes’
c/_cffi_backend.c:4966: error: ‘cif_description_t’ has no member named ‘exchange_offset_arg’
c/_cffi_backend.c:4975: error: ‘cif_description_t’ has no member named ‘exchange_size’
c/_cffi_backend.c: In function ‘fb_build_name’:
c/_cffi_backend.c:4999: error: ‘struct funcbuilder_s’ has no member named ‘nargs’
c/_cffi_backend.c:5011: error: ‘struct funcbuilder_s’ has no member named ‘fct’
c/_cffi_backend.c:5014: error: ‘struct funcbuilder_s’ has no member named ‘fct’
c/_cffi_backend.c: In function ‘fb_prepare_ctype’:
c/_cffi_backend.c:5058: error: ‘struct funcbuilder_s’ has no member named ‘fct’
c/_cffi_backend.c:5075: error: ‘struct funcbuilder_s’ has no member named ‘fct’
c/_cffi_backend.c: At top level:
c/_cffi_backend.c:5095: error: expected declaration specifiers or ‘…’ before ‘ffi_abi’
c/_cffi_backend.c: In function ‘fb_prepare_cif’:
c/_cffi_backend.c:5122: warning: implicit declaration of function ‘ffi_prep_cif’
c/_cffi_backend.c:5122: error: ‘cif_description_t’ has no member named ‘cif’
c/_cffi_backend.c:5122: error: ‘fabi’ undeclared (first use in this function)
c/_cffi_backend.c:5122: error: ‘struct funcbuilder_s’ has no member named ‘nargs’
c/_cffi_backend.c:5123: error: ‘struct funcbuilder_s’ has no member named ‘rtype’
c/_cffi_backend.c:5123: error: ‘struct funcbuilder_s’ has no member named ‘atypes’
c/_cffi_backend.c:5123: error: ‘FFI_OK’ undeclared (first use in this function)
c/_cffi_backend.c: In function ‘new_function_type’:
c/_cffi_backend.c:5167: error: too many arguments to function ‘fb_prepare_cif’
c/_cffi_backend.c:5181: error: ‘struct funcbuilder_s’ has no member named ‘nargs’
c/_cffi_backend.c:5191: error: ‘struct funcbuilder_s’ has no member named ‘nargs’
c/_cffi_backend.c:5201: error: ‘struct funcbuilder_s’ has no member named ‘nargs’
c/_cffi_backend.c:5204: error: ‘struct funcbuilder_s’ has no member named ‘nargs’
c/_cffi_backend.c:5205: error: ‘struct funcbuilder_s’ has no member named ‘nargs’
c/_cffi_backend.c:5207: error: ‘struct funcbuilder_s’ has no member named ‘nargs’
c/_cffi_backend.c: In function ‘b_new_function_type’:
c/_cffi_backend.c:5218: error: ‘FFI_DEFAULT_ABI’ undeclared (first use in this function)
c/_cffi_backend.c: In function ‘convert_from_object_fficallback’:
c/_cffi_backend.c:5238: error: ‘ffi_arg’ undeclared (first use in this function)
c/_cffi_backend.c: At top level:
c/_cffi_backend.c:5420: error: expected ‘)’ before ‘*’ token
c/_cffi_backend.c: In function ‘prepare_callback_info_tuple’:
c/_cffi_backend.c:5462: error: ‘ffi_arg’ undeclared (first use in this function)
c/_cffi_backend.c: In function ‘b_callback’:
c/_cffi_backend.c:5495: error: ‘ffi_closure’ undeclared (first use in this function)
c/_cffi_backend.c:5495: error: ‘closure’ undeclared (first use in this function)
c/_cffi_backend.c:5505: warning: implicit declaration of function ‘cffi_closure_alloc’
c/_cffi_backend.c:5523: warning: implicit declaration of function ‘ffi_prep_closure’
c/_cffi_backend.c:5523: error: ‘cif_description_t’ has no member named ‘cif’
c/_cffi_backend.c:5524: error: ‘invoke_callback’ undeclared (first use in this function)
c/_cffi_backend.c:5524: error: ‘FFI_OK’ undeclared (first use in this function)
In file included from c/cffi1_module.c:3,
from c/_cffi_backend.c:6896:
c/realize_c_type.c: In function ‘realize_c_type_or_func’:
c/realize_c_type.c:577: error: ‘FFI_DEFAULT_ABI’ undeclared (first use in this function)
c/_cffi_backend.c: In function ‘init_cffi_backend’:
c/_cffi_backend.c:6988: error: ‘FFI_DEFAULT_ABI’ undeclared (first use in this function)
error: Setup script exited with error: command ‘gcc’ failed with exit status 1

 

在这个时候,即使重新安装了OL6.8自带的1.7版本的paramiko,也不能解决问题,必须删除由easy_install安装的paramiko 2.x版本。

要做这个事,必须先安装pip,下载地址https://pypi.python.org/pypi/pip,下载源码包,编译安装比较简单,会提示python版本过低,下个版本pip将不再支持之类的信息,不影响使用。

 

pip list,找到安装的paramiko包的名字,然后用 pip uninstall <包名字>来删除这个包,确保系统安装了OL6.8自带的低版本的paramiko包,然后再运行ansible的安装脚本,就可以正常完成了。

Comments are closed.