我正在尝试为我的ubuntu enter code here安装一个较旧版本的gcc-4,创建一个构建目录( mkdir gcc& build & command ),下载源文件: wget (调整此命令以使用适当的镜像站点)。解压缩文件(tar -xvjf ),安装一些额外的库(sudo apt-get install libgmp-dev libmpfr-dev libmpc libc6-dev),编译源代码:./gcc-4.8.0/配置-前缀=/app/gcc/4.8.0 Run make (这需要一些时间来完成。去煮点咖啡,或者烤点饼干。))安装代码: sudo
CPU体系结构
lscpu
Architecture: aarch64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 16
On-line CPU(s) list: 0-15
Thread(s) per core: 1
Core(s) per socket: 4
Socket(s): 4
NUMA node(s): 1
Vendor ID: ARM
Model: 3
Model name: Cortex-A72
Stepping: r0p3
BogoMIPS: 166.66
L1d cache: 512 KiB
L1i cache: 768 KiB
L2 cache: 8 MiB
NUMA node0 CPU(s): 0-15
Vulnerability Itlb multihit: Not affected
Vulnerability L1tf: Not affected
Vulnerability Mds: Not affected
Vulnerability Meltdown: Not affected
Vulnerability Spec store bypass: Not affected
Vulnerability Spectre v1: Mitigation; __user pointer sanitization
Vulnerability Spectre v2: Mitigation; Branch predictor hardening
Vulnerability Srbds: Not affected
Vulnerability Tsx async abort: Not affected
Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid最后运行sudo make 得到了这个错误
make[1]: Entering directory '/home/ubuntu/gcc-build'
/bin/bash ./gcc-4.8.0/mkinstalldirs /app/gcc/4.8.0 /app/gcc/4.8.0
/bin/bash: line 3: cd: ./fixincludes: No such file or directory
make[1]: *** [Makefile:3405: install-fixincludes] Error 1
make[1]: Leaving directory '/home/ubuntu/gcc-build'
make: *** [Makefile:2196: install] Error 2我如何解决这个问题?
发布于 2021-02-12 18:27:33
希望您已经更新了包管理器,怀疑您是否可以运行以下命令(按给定的顺序运行,这些命令应该没有错误地运行):
sudo apt-get update
sudo apt-get upgrade然后您需要确保安装了build-essential:
sudo apt-get install build-essential在此之后,您可以安装所需的gcc版本(例如: gcc-4):
sudo apt-get install gcc-4现在按照下面的命令选择gcc的具体版本:
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4 4
sudo update-alternatives --config gcc通过这种方式,你也可以在多种版本的gcc之间切换。最后一步中的第二个命令将为您提供一个菜单选项,以便在要设置的可用(安装) gcc版本中进行选择。
https://stackoverflow.com/questions/63593100
复制相似问题