当前位置:   article > 正文

linux编译ld返回1,如何修复:collect2:错误:ld返回1退出状态错误:命令“x86_64linuxgnugcc”失败,退出状态为1...

collect2:ld returned 1

我试图安装一个pygrib包。在python2中。

我安装所有必需的软件包。(https://jswhit.github.io/pygrib/docs/pygrib-module.html)

命令pip安装pygrib。但它有一个错误。

我在错误脚本中找不到错误。有很多警告。但我认为不安装也没问题。在

如何修复此错误?在ERROR: Command errored out with exit status 1:

command: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-KuwhgZ/pygrib/setup.py'"'"'; __file__='"'"'/tmp/pip-install-KuwhgZ/pygrib/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-TKG3Ld --python-tag cp27

cwd: /tmp/pip-install-KuwhgZ/pygrib/

Complete output (38 lines):

running bdist_wheel

running build

running build_py

creating build

creating build/lib.linux-x86_64-2.7

copying ncepgrib2.py -> build/lib.linux-x86_64-2.7

running build_ext

skipping 'pygrib.c' Cython extension (up-to-date)

building 'pygrib' extension

creating build/temp.linux-x86_64-2.7

x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/local/lib/python2.7/dist-packages/numpy/core/include -Ig2clib_src -I/usr/include/python2.7 -c pygrib.c -o build/temp.linux-x86_64-2.7/pygrib.o

In file included from /usr/local/lib/python2.7/dist-packages/numpy/core/include/numpy/ndarraytypes.h:1822:0,

from /usr/local/lib/python2.7/dist-packages/numpy/core/include/numpy/ndarrayobject.h:12,

from /usr/local/lib/python2.7/dist-packages/numpy/core/include/numpy/arrayobject.h:4,

from pygrib.c:613:

/usr/local/lib/python2.7/dist-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]

#warning "Using deprecated NumPy API, disable it with " \

^

pygrib.c: In function '__pyx_pf_6pygrib_11gribmessage_16keys':

pygrib.c:13996:18: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]

__pyx_v_name = grib_keys_iterator_get_name(__pyx_v_gi);

^

pygrib.c: In function '__pyx_pf_6pygrib_11gribmessage_18_read_only_keys':

pygrib.c:14427:18: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]

__pyx_v_name = grib_keys_iterator_get_name(__pyx_v_gi);

^

pygrib.c: In function '__pyx_pf_6pygrib_11gribmessage_30tostring':

pygrib.c:18559:53: warning: passing argument 2 of 'grib_get_message' from incompatible pointer type [-Wincompatible-pointer-types]

__pyx_v_err = grib_get_message(__pyx_v_self->_gh, (&__pyx_v_message), (&__pyx_v_size));

^

In file included from pygrib.c:614:0:

/usr/include/grib_api.h:554:5: note: expected 'const void **' but argument is of type 'void **'

int grib_get_message(grib_handle* h ,const void** message, size_t *message_length);

^

x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wl,-Bsymbolic-functions -Wl,-z,relro -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security build/temp.linux-x86_64-2.7/pygrib.o -leccodes -o build/lib.linux-x86_64-2.7/pygrib.so

/usr/bin/ld: cannot find -leccodes

collect2: error: ld returned 1 exit status

error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

----------------------------------------

ERROR: Failed building wheel for pygrib

Running setup.py clean for pygrib

Failed to build pygrib

Installing collected packages: pygrib

Running setup.py install for pygrib ... error

ERROR: Command errored out with exit status 1:

command: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-KuwhgZ/pygrib/setup.py'"'"'; __file__='"'"'/tmp/pip-install-KuwhgZ/pygrib/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-NTYS3Y/install-record.txt --single-version-externally-managed --compile

cwd: /tmp/pip-install-KuwhgZ/pygrib/

Complete output (38 lines):

running install

running build

running build_py

creating build

creating build/lib.linux-x86_64-2.7

copying ncepgrib2.py -> build/lib.linux-x86_64-2.7

running build_ext

skipping 'pygrib.c' Cython extension (up-to-date)

building 'pygrib' extension

creating build/temp.linux-x86_64-2.7

x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/local/lib/python2.7/dist-packages/numpy/core/include -Ig2clib_src -I/usr/include/python2.7 -c pygrib.c -o build/temp.linux-x86_64-2.7/pygrib.o

In file included from /usr/local/lib/python2.7/dist-packages/numpy/core/include/numpy/ndarraytypes.h:1822:0,

from /usr/local/lib/python2.7/dist-packages/numpy/core/include/numpy/ndarrayobject.h:12,

from /usr/local/lib/python2.7/dist-packages/numpy/core/include/numpy/arrayobject.h:4,

from pygrib.c:613:

/usr/local/lib/python2.7/dist-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]

#warning "Using deprecated NumPy API, disable it with " \

^

pygrib.c: In function '__pyx_pf_6pygrib_11gribmessage_16keys':

pygrib.c:13996:18: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]

__pyx_v_name = grib_keys_iterator_get_name(__pyx_v_gi);

^

pygrib.c: In function '__pyx_pf_6pygrib_11gribmessage_18_read_only_keys':

pygrib.c:14427:18: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]

__pyx_v_name = grib_keys_iterator_get_name(__pyx_v_gi);

^

pygrib.c: In function '__pyx_pf_6pygrib_11gribmessage_30tostring':

pygrib.c:18559:53: warning: passing argument 2 of 'grib_get_message' from incompatible pointer type [-Wincompatible-pointer-types]

__pyx_v_err = grib_get_message(__pyx_v_self->_gh, (&__pyx_v_message), (&__pyx_v_size));

^

In file included from pygrib.c:614:0:

/usr/include/grib_api.h:554:5: note: expected 'const void **' but argument is of type 'void **'

int grib_get_message(grib_handle* h ,const void** message, size_t *message_length);

^

x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wl,-Bsymbolic-functions -Wl,-z,relro -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security build/temp.linux-x86_64-2.7/pygrib.o -leccodes -o build/lib.linux-x86_64-2.7/pygrib.so

/usr/bin/ld: cannot find -leccodes

collect2: error: ld returned 1 exit status

error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

----------------------------------------

ERROR: Command errored out with exit status 1: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-KuwhgZ/pygrib/setup.py'"'"'; __file__='"'"'/tmp/pip-install-KuwhgZ/pygrib/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-NTYS3Y/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/weixin_40725706/article/detail/189258?site
推荐阅读
相关标签
  

闽ICP备14008679号