RMP*_*MPR 7 linux gcc python-3.x pytorch
我尝试在 Fedora 31 上安装 CUDA 但在最后一步卡住了,因为 CUDA 官方支持 Fedora 29 (gcc 8.2) 而 Fedora 31 附带的版本是 9.2,然后我安装了支持 CUDA 的 Pytorch,不出所料,CUDA 支持是不存在:
>>> import torch
>>> device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
>>> device
device(type='cpu')
Run Code Online (Sandbox Code Playgroud)
然后我尝试在pkgs上搜索 gcc、g++ 和 gfortran ,但陷入了依赖地狱,例如:
sudo dnf install gcc-8.2.1-2.fc29.x86_64.rpm gcc-gfortran-8.2.1-2.fc29.x86_64.rpm gcc-c++-8.2.1-2.fc29.x86_64.rpm -y
Error:
Problem 1: conflicting requests
- nothing provides cpp = 8.2.1-2.fc29 needed by gcc-8.2.1-2.fc29.x86_64
- nothing provides libgomp = 8.2.1-2.fc29 needed by gcc-8.2.1-2.fc29.x86_64
Problem 2: conflicting requests
- nothing provides libgfortran = 8.2.1-2.fc29 needed by gcc-gfortran-8.2.1-2.fc29.x86_64
- nothing provides libquadmath = 8.2.1-2.fc29 needed by gcc-gfortran-8.2.1-2.fc29.x86_64
- nothing provides libquadmath-devel = 8.2.1-2.fc29 needed by gcc-gfortran-8.2.1-2.fc29.x86_64
Problem 3: conflicting requests
- nothing provides libstdc++ = 8.2.1-2.fc29 needed by gcc-c++-8.2.1-2.fc29.x86_64
- nothing provides libstdc++-devel = 8.2.1-2.fc29 needed by gcc-c++-8.2.1-2.fc29.x86_64
Run Code Online (Sandbox Code Playgroud)
我在这篇文章中找到了一堆有用的链接,但不幸的是最后一个版本是 gcc 7.3 我的最后一个选择是从源代码构建,但除此之外还有其他选择吗?我不确定我的计算机能否在相当长的时间内处理编译。
构建 gcc-8.2.0
# dnf install gcc-c++ flex bison binutils-devel elfutils-devel elfutils-libelf-devel texinfo doxygen
tar xvf gcc-8.2.0.tar.xz
cd gcc-8.2.0/
tar xvf mpfr-4.0.2.tar.xz && mv -v mpfr-4.0.2 mpfr
tar xvf gmp-6.1.2.tar.xz && mv -v gmp-6.1.2 gmp
tar xvf mpc-1.1.0.tar.gz && mv -v mpc-1.1.0 mpc
cd ../
mkdir build-gcc820
cd build-gcc820/
../gcc-8.2.0/configure --prefix=/usr/local/gcc82 --program-suffix=82 --enable-languages=c,c++,fortran --disable-multilib --disable-libstdcxx-pch --with-system-zlib
make
# make install
Run Code Online (Sandbox Code Playgroud)
结果:gcc82-c++-8.2.0-2.fc29.x86_64.rpm https : //drive.google.com/file/d/1qGPvF9jc6CiI1a0-c3I4Zj4vxajEwSzc/view?
usp = sharing/usr/bin/{gcc8, g++8, gfortran8}
安装 : # dnf install Downloads/gcc82-c++-8.2.0-2.fc29.x86_64.rpm
| 归档时间: |
|
| 查看次数: |
4125 次 |
| 最近记录: |