Pythonのgccバインディングをgcc4.8バージョンに変更するにはどうすればよいですか?

ミスリル

に依存するauto-sklearnパッケージをインストールしたいpyrfr

インストールコマンドはcurl https://raw.githubusercontent.com/automl/auto-sklearn/master/requirements.txt | xargs -n 1 -L 1 pip installです。

私の環境:ubuntu 12.04、python3.5-dev(virtualenv内)、gcc4.8およびg ++ 4.8がインストールされています。

gccとg ++を次の方法でインストールします。

sudo apt-get install python-software-properties
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update

sudo apt-get install gcc-4.8
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 50

デフォルトのgccが正しく設定されている:

➜  ~ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.8/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.8.1-2ubuntu1~12.04' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.8.1 (Ubuntu 4.8.1-2ubuntu1~12.04)

しかし、Pythonシェルがまだ[GCC4.6.3]を表示していることがわかりました。

➜  ~ python
Python 3.5.2 (default, Jul 17 2016, 17:38:18)
[GCC 4.6.3] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>

そして、pyrfrまだ言ってインストールします(gcc 4.7以上が必要なため):

cc1plus: error: unrecognized command line option ‘-std=c++11’
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

より詳細なエラーログ:

Collecting pyrfr
  Downloading http://mirrors.aliyun.com/pypi/packages/95/90/95f77f76c2e3d44577ff2b96b0d365429797d9f83632b84d2c91d2b7a73a/pyrfr-0.2.0.tar.gz (340kB)
    100% |████████████████████████████████| 348kB 4.9MB/s
Building wheels for collected packages: pyrfr
  Running setup.py bdist_wheel for pyrfr ... error
  Complete output from command /root/.virtualenvs/py35/bin/python3.5 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-wt1wfz_q/pyrfr/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/tmpcdvohh34pip-wheel- --python-tag cp35:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.5
  creating build/lib.linux-x86_64-3.5/pyrfr
  copying pyrfr/__init__.py -> build/lib.linux-x86_64-3.5/pyrfr
  running build_ext
  building 'pyrfr.regression' extension
  creating build/temp.linux-x86_64-3.5
  creating build/temp.linux-x86_64-3.5/pyrfr
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -I./include -I/root/.virtualenvs/py35/lib/python3.5/site-packages/numpy/core/include -I/usr/include/python3.5m -I/root/.virtualenvs/py35/include/python3.5m -c pyrfr/regression.cpp -o build/temp.linux-x86_64-3.5/pyrfr/regression.o -O2 -std=c++11
  cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for Ada/C/ObjC but not for C++ [enabled by default]
  cc1plus: error: unrecognized command line option ‘-std=c++11’
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

  ----------------------------------------
  Failed building wheel for pyrfr
  Running setup.py clean for pyrfr
Failed to build pyrfr
Installing collected packages: pyrfr
  Running setup.py install for pyrfr ... error
    Complete output from command /root/.virtualenvs/py35/bin/python3.5 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-wt1wfz_q/pyrfr/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-qrvy2ohy-record/install-record.txt --single-version-externally-managed --compile --install-headers /root/.virtualenvs/py35/include/site/python3.5/pyrfr:
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.5
    creating build/lib.linux-x86_64-3.5/pyrfr
    copying pyrfr/__init__.py -> build/lib.linux-x86_64-3.5/pyrfr
    running build_ext
    building 'pyrfr.regression' extension
    creating build/temp.linux-x86_64-3.5
    creating build/temp.linux-x86_64-3.5/pyrfr
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -I./include -I/root/.virtualenvs/py35/lib/python3.5/site-packages/numpy/core/include -I/usr/include/python3.5m -I/root/.virtualenvs/py35/include/python3.5m -c pyrfr/regression.cpp -o build/temp.linux-x86_64-3.5/pyrfr/regression.o -O2 -std=c++11
    cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for Ada/C/ObjC but not for C++ [enabled by default]
    cc1plus: error: unrecognized command line option ‘-std=c++11’
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

    ----------------------------------------
Command "/root/.virtualenvs/py35/bin/python3.5 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-wt1wfz_q/pyrfr/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-qrvy2ohy-record/install-record.txt --single-version-externally-managed --compile --install-headers /root/.virtualenvs/py35/include/site/python3.5/pyrfr" failed with error code 1 in /tmp/pip-build-wt1wfz_q/pyrfr/

私が思う重要な問題は、python3.5がgcc-4.8にリンクしていないことです(システムのデフォルトのpython2.7もリンクしていません)が、googleはあまり役に立ちません。

ミスリル

最後に私は解決策を見つけます..それx86_64-linux-gnu-gccはコマンドのようには見えませんが、それはコマンドです...

ubuntu 12のpythonは代わりに/usr/bin/x86_64-linux-gnu-gcc(link to /usr/bin/gcc-4.6)を使用しないようです/usr/bin/gcc、私は彼らがこれを行う理由を完全に理解していません...

sulotionは単純です、ただ

cd /usr/bin
rm x86_64-linux-gnu-gcc
ln -sf gcc-4.8 x86_64-linux-gnu-gcc

g ++とcppを変更したい場合は、

rm x86_64-linux-gnu-cpp
ln -sf cpp-4.8 x86_64-linux-gnu-cpp
rm x86_64-linux-gnu-g++
ln -sf g++-4.8 x86_64-linux-gnu-g++

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

PycharmPythonのバージョンをPython3に変更するにはどうすればよいですか?

分類Dev

gccのマニュアルページのデフォルトバージョンを変更するにはどうすればよいですか?

分類Dev

AnacondaでPythonのバージョンを変更するにはどうすればよいですか?

分類Dev

Bokehが使用するPythonバージョンを変更するにはどうすればよいですか?

分類Dev

既存のvirtualenvのPythonバージョンを変更するにはどうすればよいですか?

分類Dev

使用する糸のバージョンを変更するにはどうすればよいですか?

分類Dev

使用する糸のバージョンを変更するにはどうすればよいですか?

分類Dev

Python3のバージョンを変更するにはどうすればよいですか

分類Dev

STS4からJavaバージョンを変更するにはどうすればよいですか

分類Dev

Paramiko SSHバナー/バージョンを変更するにはどうすればよいですか?

分類Dev

PyCharmでdjangoのバージョンを変更するにはどうすればよいですか?

分類Dev

EclipseでJSFのバージョンを変更するにはどうすればよいですか?

分類Dev

Zapierノードのバージョンを変更するにはどうすればよいですか?

分類Dev

Crashlyticsでリリースバージョンを変更するにはどうすればよいですか?

分類Dev

JitPackのバージョンを変更するにはどうすればよいですか?

分類Dev

NPMのバージョンを変更するにはどうすればよいですか?

分類Dev

libstdc ++。so.6のバージョンを変更するにはどうすればよいですか?

分類Dev

Laravel Artisan CLI PHPのバージョンを変更するにはどうすればよいですか?

分類Dev

TerraformProvider.awsのバージョンを変更するにはどうすればよいですか

分類Dev

Chromeのバージョンを変更するにはどうすればよいですか?

分類Dev

Javaのバージョンを変更するにはどうすればよいですか?

分類Dev

単一バージョンのPYTHONPATHを変更するにはどうすればよいですか?

分類Dev

Kubernetesのバージョンを変更するにはどうすればよいですか

分類Dev

Ubuntu 14.04でphp-cliバージョンを変更するにはどうすればよいですか?

分類Dev

Google ColabでJavaバージョンを変更するにはどうすればよいですか?

分類Dev

Proof GeneralでCoqバージョンを変更するにはどうすればよいですか?

分類Dev

Big SurでJDKバージョンを変更するにはどうすればよいですか?

分類Dev

smartAdmin AngularJs 1.8バージョンでURLを変更するにはどうすればよいですか?

分類Dev

AnacondaディストリビューションでPythonバージョンを2.7.8に変更するにはどうすればよいですか?

Related 関連記事

  1. 1

    PycharmPythonのバージョンをPython3に変更するにはどうすればよいですか?

  2. 2

    gccのマニュアルページのデフォルトバージョンを変更するにはどうすればよいですか?

  3. 3

    AnacondaでPythonのバージョンを変更するにはどうすればよいですか?

  4. 4

    Bokehが使用するPythonバージョンを変更するにはどうすればよいですか?

  5. 5

    既存のvirtualenvのPythonバージョンを変更するにはどうすればよいですか?

  6. 6

    使用する糸のバージョンを変更するにはどうすればよいですか?

  7. 7

    使用する糸のバージョンを変更するにはどうすればよいですか?

  8. 8

    Python3のバージョンを変更するにはどうすればよいですか

  9. 9

    STS4からJavaバージョンを変更するにはどうすればよいですか

  10. 10

    Paramiko SSHバナー/バージョンを変更するにはどうすればよいですか?

  11. 11

    PyCharmでdjangoのバージョンを変更するにはどうすればよいですか?

  12. 12

    EclipseでJSFのバージョンを変更するにはどうすればよいですか?

  13. 13

    Zapierノードのバージョンを変更するにはどうすればよいですか?

  14. 14

    Crashlyticsでリリースバージョンを変更するにはどうすればよいですか?

  15. 15

    JitPackのバージョンを変更するにはどうすればよいですか?

  16. 16

    NPMのバージョンを変更するにはどうすればよいですか?

  17. 17

    libstdc ++。so.6のバージョンを変更するにはどうすればよいですか?

  18. 18

    Laravel Artisan CLI PHPのバージョンを変更するにはどうすればよいですか?

  19. 19

    TerraformProvider.awsのバージョンを変更するにはどうすればよいですか

  20. 20

    Chromeのバージョンを変更するにはどうすればよいですか?

  21. 21

    Javaのバージョンを変更するにはどうすればよいですか?

  22. 22

    単一バージョンのPYTHONPATHを変更するにはどうすればよいですか?

  23. 23

    Kubernetesのバージョンを変更するにはどうすればよいですか

  24. 24

    Ubuntu 14.04でphp-cliバージョンを変更するにはどうすればよいですか?

  25. 25

    Google ColabでJavaバージョンを変更するにはどうすればよいですか?

  26. 26

    Proof GeneralでCoqバージョンを変更するにはどうすればよいですか?

  27. 27

    Big SurでJDKバージョンを変更するにはどうすればよいですか?

  28. 28

    smartAdmin AngularJs 1.8バージョンでURLを変更するにはどうすればよいですか?

  29. 29

    AnacondaディストリビューションでPythonバージョンを2.7.8に変更するにはどうすればよいですか?

ホットタグ

アーカイブ