Created
January 8, 2019 14:01
-
-
Save mozhata/d219d6b19465f48e1951573a71436b1f to your computer and use it in GitHub Desktop.
archlinux 安装xlearn 报cmake未安装
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## 环境: | |
基础docker镜像: | |
base/archlinux:2019.01.01 | |
``` | |
[root@aa1890dac708 xlearn-0.40a1]# uname -a | |
Linux aa1890dac708 4.4.0-127-generic #153-Ubuntu SMP Sat May 19 10:58:46 UTC 2018 x86_64 GNU/Linux | |
[root@aa1890dac708 xlearn-0.40a1]# cat /proc/version | |
Linux version 4.4.0-127-generic (buildd@lcy01-amd64-023) (gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.9) ) #153-Ubuntu SMP Sat May 19 10:58:46 UTC 2018 | |
``` | |
## 问题: | |
我成功了安装了cmake, 并且在PATH下: | |
``` | |
[root@aa1890dac708 xlearn-0.40a1]# cmake --version | |
cmake version 3.13.2 | |
[root@2abf73ae1a0a /]# which cmake | |
/usr/sbin/cmake | |
[root@2abf73ae1a0a /]# echo $PATH | |
/opt/conda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin | |
``` | |
在安装xlearn的时候出现异常,提示cmake未安装 | |
``` | |
[root@aa1890dac708 xlearn-0.40a1]# pip install --no-cache-dir xlearn -i https://mirrors.aliyun.com/pypi/simple/ | |
Looking in indexes: https://mirrors.aliyun.com/pypi/simple/ | |
Collecting xlearn | |
Downloading https://mirrors.aliyun.com/pypi/packages/ab/1b/9ad0093cac05d6f95d3d768bc855804b18723c72120ce45cd930bd303587/xlearn-0.40a1.tar.gz (4.9MB) | |
100% |################################| 4.9MB 9.4MB/s | |
Installing collected packages: xlearn | |
Running setup.py install for xlearn ... error | |
Complete output from command /opt/conda/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-5rpxigrx/xlearn/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-adppx5w3/install-record.txt --single-version-externally-managed --compile: | |
/opt/conda/lib/python3.5/site-packages/setuptools/dist.py:398: UserWarning: Normalizing '0.40.a1' to '0.40a1' | |
normalized_version, | |
running install | |
running build | |
running build_py | |
Traceback (most recent call last): | |
File "/tmp/pip-install-5rpxigrx/xlearn/setup.py", line 37, in silent_call | |
subprocess.check_output(cmd, stderr=shut_up) | |
File "/opt/conda/lib/python3.5/subprocess.py", line 316, in check_output | |
**kwargs).stdout | |
File "/opt/conda/lib/python3.5/subprocess.py", line 398, in run | |
output=stdout, stderr=stderr) | |
subprocess.CalledProcessError: Command '['cmake', '../compile']' returned non-zero exit status 1 | |
During handling of the above exception, another exception occurred: | |
Traceback (most recent call last): | |
File "<string>", line 1, in <module> | |
File "/tmp/pip-install-5rpxigrx/xlearn/setup.py", line 126, in <module> | |
url='https://github.com/aksnzhy/xlearn') | |
File "/opt/conda/lib/python3.5/site-packages/setuptools/__init__.py", line 140, in setup | |
return distutils.core.setup(**attrs) | |
File "/opt/conda/lib/python3.5/distutils/core.py", line 148, in setup | |
dist.run_commands() | |
File "/opt/conda/lib/python3.5/distutils/dist.py", line 955, in run_commands | |
self.run_command(cmd) | |
File "/opt/conda/lib/python3.5/distutils/dist.py", line 974, in run_command | |
cmd_obj.run() | |
File "/tmp/pip-install-5rpxigrx/xlearn/setup.py", line 93, in run | |
install.run(self) | |
File "/opt/conda/lib/python3.5/site-packages/setuptools/command/install.py", line 61, in run | |
return orig.install.run(self) | |
File "/opt/conda/lib/python3.5/distutils/command/install.py", line 539, in run | |
self.run_command('build') | |
File "/opt/conda/lib/python3.5/distutils/cmd.py", line 313, in run_command | |
self.distribution.run_command(command) | |
File "/opt/conda/lib/python3.5/distutils/dist.py", line 974, in run_command | |
cmd_obj.run() | |
File "/opt/conda/lib/python3.5/distutils/command/build.py", line 135, in run | |
self.run_command(cmd_name) | |
File "/opt/conda/lib/python3.5/distutils/cmd.py", line 313, in run_command | |
self.distribution.run_command(command) | |
File "/opt/conda/lib/python3.5/distutils/dist.py", line 974, in run_command | |
cmd_obj.run() | |
File "/tmp/pip-install-5rpxigrx/xlearn/setup.py", line 104, in run | |
compile_cpp() | |
File "/tmp/pip-install-5rpxigrx/xlearn/setup.py", line 75, in compile_cpp | |
silent_call(cmake_cmd, raise_error=True, error_msg='Please install CMake first') | |
File "/tmp/pip-install-5rpxigrx/xlearn/setup.py", line 41, in silent_call | |
raise Exception(error_msg); | |
Exception: Please install CMake first | |
---------------------------------------- | |
Command "/opt/conda/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-5rpxigrx/xlearn/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-adppx5w3/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-5rpxigrx/xlearn/ | |
``` | |
## 排查过程 | |
1. 怀疑cmake, 安装的有问题, 用pip重新安装了一下 | |
``` | |
pip install --no-cache-dir cmake -i https://mirrors.aliyun.com/pypi/simple/ | |
``` | |
没什么卵用 | |
2. 网络上有相同问题, 因为gcc版本过高, 将之从 8.2.1 降到 7.4.1 | |
``` | |
[root@2abf73ae1a0a /]# gcc -v | |
Using built-in specs. | |
COLLECT_GCC=gcc | |
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/8.2.1/lto-wrapper | |
Target: x86_64-pc-linux-gnu | |
Configured with: /build/gcc/src/gcc/configure --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ --enable-shared --enable-threads=posix --enable-libmpx --with-system-zlib --with-isl --enable-__cxa_atexit --disable-libunwind-exceptions --enable-clocale=gnu --disable-libstdcxx-pch --disable-libssp --enable-gnu-unique-object --enable-linker-build-id --enable-lto --enable-plugin --enable-install-libiberty --with-linker-hash-style=gnu --enable-gnu-indirect-function --enable-multilib --disable-werror --enable-checking=release --enable-default-pie --enable-default-ssp --enable-cet=auto | |
Thread model: posix | |
gcc version 8.2.1 20181127 (GCC) | |
[root@aa1890dac708 xlearn-0.40a1]# gcc -v | |
Using built-in specs. | |
COLLECT_GCC=gcc | |
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/7.4.1/lto-wrapper | |
Target: x86_64-pc-linux-gnu | |
Configured with: /build/gcc7/src/gcc/configure --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --enable-languages=c,c++,lto --enable-shared --enable-threads=posix --enable-libmpx --with-system-zlib --with-isl --enable-__cxa_atexit --disable-libunwind-exceptions --enable-clocale=gnu --disable-libstdcxx-pch --disable-libssp --enable-gnu-unique-object --enable-linker-build-id --enable-lto --enable-plugin --enable-install-libiberty --with-linker-hash-style=gnu --enable-gnu-indirect-function --disable-werror --enable-checking=release --enable-default-pie --enable-default-ssp --program-suffix=-7 --enable-version-specific-runtime-libs | |
Thread model: posix | |
gcc version 7.4.1 20181207 (GCC) | |
``` | |
依然没什么卵用 | |
3. 手动下载解压安装 | |
依然报相同错误 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
手动安装, 把setup.py 中cmake的地址改成绝对路径,依然失败
报错信息: