1.第一步 clone 需要的源文件(sudo apt install git   如果你没有git)  以下都是给予ubuntu18.04

$ git clone --recursive https://github.com/riscv/riscv-gnu-toolchain
或者
$ git clone https://github.com/riscv/riscv-gnu-toolchain
$ cd riscv-gnu-toolchain
$ git submodule update --init --recursive

2.依赖项

$ sudo yum install autoconf automake libmpc-devel mpfr-devel gmp-devel gawk  bison flex texinfo patchutils gcc gcc-c++ zlib-devel expat-devel

3.installation(newlib) 构建newlib交叉编译器  我的内核使用32位所以下面介绍32位

cd riscv-gnu-toolchain
./configure --prefix=/opt/riscv --with-arch=rv32emc --with-abi=ilp32e
sudo make # sudo needed if installing under default /opt/riscv location

4.构建linux交叉编译器32位

./configure --prefix=/opt/riscv --with-arch=rv32gc --with-abi=ilp32d
make linux

可能出现的问题 centos和rhel编译器过久可能会失败

Troubleshooting Build Problems
Builds work best if installing into an empty directory. If you build a hard-float toolchain and then try to build a soft-float toolchain with the same --prefix directory, then the build scripts may get confused and exit with a linker error complaining that hard float code can't be linked with soft float code. Removing the existing toolchain first, or using a different prefix for the second build, avoids the problem. It is OK to build one newlib and one linux toolchain with the same prefix. But you should avoid building two newlib or two linux toolchains with the same prefix. If building a linux toolchain on a MacOS system, or on a Windows system using the Linux subsystem or cygwin, you must ensure that the filesystem is case-sensitive. A build on a case-insensitive filesystem will fail when building glibc because *.os and *.oS files will clobber each other during the build eventually resulting in confusing link errors. Centos (and RHEL) provide old GNU tools versions that may be too old to build a RISC-V toolchain. There is an alternate toolset provided that includes current versions of the GNU tools. This is the devtoolset provided as part of the Software Collection service. For more info, see the devtoolset-7 URL. There are various versions of the devtoolset that are available, so you can also try other versions of it, but we have at least one report that devtoolset-7 works.

参考网址

https://github.com/riscv/riscv-gnu-toolchain#installation-newlib

2021-5 注意:构建 sudo make 不使用 sudo linux  ,注意观察makefile 文件,使用clean 清除相关文件,相关文件夹应该有 777权限。在对应文件夹使用gcc进行编译生成对应文件。一遍后面可以使用。

gcc tools/bin2hex.c -o tools/bin2hex

注意事项:编译器path需要永久写入。,tools安装目录不可删除,一般在根目录操作。从pc传送过来的压缩文件可能编码改变导致编译错误,尽量从linux下使用git。quartus 19以下linux版本在ubuntu18使用会报错。或者无法运行在ubuntu18.04。quartus 16.1  17.1能够在ubuntu 16下运行。ubuntu 16某些版本可能存在异常尽量使用ubuntu18。quartus 19在ubuntu某些步骤也会报错,具体解决办法各位自己解决。  目前博主已经成功配置使用。工具大小应该为5个gb左右。各位可以在国内网友那里要到已经clone成功的文件,然后解压在自己电脑配置。直接下载git zip文件  文件将会是残缺无法使用的。

在ubuntu20 部署qsys 会有两个错误 1.缺少libpng12-0 ,安装也会出错,因为老版本/lib /usr/lib是两个文件夹,新系统使用链接方式代替。出现此问题使用新的软件包解决。

sudo add-apt-repository ppa:linuxuprising/libpng12
sudo apt update
sudo apt install libpng12-0

第二个错误

Gtk-Message: Failed to load module "canberra-gtk-module"  安装gtk和gtk3模块应该解决它
sudo apt install libcanberra-gtk-module libcanberra-gtk3-module

搭建riscv环境的更多相关文章

  1. Flume1 初识Flume和虚拟机搭建Flume环境

    前言:       工作中需要同步日志到hdfs,以前是找运维用rsync做同步,现在一般是用flume同步数据到hdfs.以前为了工作简单看个flume的一些东西,今天下午有时间自己利用虚拟机搭建了 ...

  2. 搭建LNAMP环境(七)- PHP7源码安装Memcached和Memcache拓展

    上一篇:搭建LNAMP环境(六)- PHP7源码安装MongoDB和MongoDB拓展 一.安装Memcached 1.yum安装libevent事件触发管理器 yum -y install libe ...

  3. 搭建LNAMP环境(二)- 源码安装Nginx1.10

    上一篇:搭建LNAMP环境(一)- 源码安装MySQL5.6 1.yum安装编译nginx需要的包 yum -y install pcre pcre-devel zlib zlib-devel ope ...

  4. 搭建LNAMP环境(一)- 源码安装MySQL5.6

    1.yum安装编译mysql需要的包 yum -y install gcc-c++ make cmake bison-devel ncurses-devel perl 2.为mysql创建一个新的用户 ...

  5. Linux 14.04lts 环境下搭建交叉编译环境arm-linux-gcc-4.5.1

    交叉编译工具链是为了编译.链接.处理和调试跨平台体系结构的程序代码,在该环境下编译出嵌入式Linux系统所需要的操作系统.应用程序等,然后再上传到目标板上. 首 先要明确gcc 和arm-linux- ...

  6. GJM : Unity3D HIAR -【 快速入门 】 二、搭建开发环境

    感谢您的阅读.喜欢的.有用的就请大哥大嫂们高抬贵手"推荐一下"吧!你的精神支持是博主强大的写作动力以及转载收藏动力.欢迎转载! 版权声明:本文原创发表于 [请点击连接前往] ,未经 ...

  7. Mac下maven工程的创建,并搭建SSH环境

    最近项目有用到maven,就特地学了一下.maven的一句话攻略就是,项目托管.帮你解决各种项目琐事:清理,导包....等等. 首先先到apach官网去下载一个maven的包,http://maven ...

  8. maven实战(01)_搭建开发环境

    一 下载maven 在maven官网上可下载maven:http://maven.apache.org/download.cgi 下载好后,解压.我的解压到了:D:\maven\apache-mave ...

  9. Sublime Text 2下搭建Python环境常见错误

    Sublime Text 2下搭建Python环境时,最容易出的错误就是Python环境配置错误,导致build(Ctrl+B)后没有任何反应. 关于Python编程环境的配置,网上很容易搜索到.先默 ...

随机推荐

  1. Linux创建ftp并设置权限以及忘记ftp帐号(密码)修改 (转)

      忘记ftp密码修改方法:1.登录服务器 cd  /etc/vsftpdcat ftpusers找到对应的ftp用户名 (如果用户名也忘记了 那么 cd /etc 然后cat passwd 查看用户 ...

  2. buu pyre

    一.下载附件是是pyc的字节码文件,找个在线网站反编译一下 思路还是挺清晰: 先逆着求出code, 这里就是求余,有点麻烦,那个+128%128其实没啥用的,省略就好了 算法里面再处理一下细节,跑一下 ...

  3. centos7 U盘安装及Raid划分的完整流程

    目录 一.Centos7的新特性: 二.安装方法与准备工作(U盘镜像) 1. 安装方法介绍 2. Centos iso 常用镜像下载地址: 3. UltraISO制作U盘系统镜像 3.1 准备工作: ...

  4. C语言typedef的用法详解

    C语言允许为一个数据类型起一个新的别名,就像给人起"绰号"一样. 起别名的目的不是为了提高程序运行效率,而是为了编码方便.例如有一个结构体的名字是 stu,要想定义一个结构体变量就 ...

  5. SpringCloud学习之【NACOS实现服务的注册与发现】

    根据nacos官方的介绍,Nacos 致力于帮助您发现.配置和管理微服务.Nacos 提供了一组简单易用的特性集,帮助您快速实现动态服务发现.服务配置.服务元数据及流量管理. 具有服务发现和服务健康监 ...

  6. 【C#】C#中使用GDAL3(一):Windows下超详细编译C#版GDAL3.3.0(VS2015+.NET 4+32位/64位)

    转载请注明原文地址:https://www.cnblogs.com/litou/p/15004877.html 目录 一.介绍 二.编译准备 三.编译SQLite 四.编译LibTiff 五.编译PR ...

  7. Allure测试框架 python

    关于Allure Allure是一个report框架,可以基于一些测试框架生成测试报告,比较常用的一般是Junit/Testng框架: Allure 生成的报告样式简洁美观,同时又支持中文: Allu ...

  8. 第一篇 -- 下载并安装IDEA

    此篇讲的是安装IDEA企业版,社区版是免费的,就不多说了. 参考链接:https://www.exception.site/essay/how-to-free-use-intellij-idea-20 ...

  9. C# MongoDB添加索引

    场景: 在最近的项目中,用到了Mongodb,用它来保存大量工业数据.同时是会根据用户自动建立对应的数据表.这要求同时建立索引来加快查询. 解决: 1.在Nuget包中查询"mongocsh ...

  10. 字符串匹配算法(三)-KMP算法

    今天我们来聊一下字符串匹配算法里最著名的算法-KMP算法,KMP算法的全称是 Knuth Morris Pratt 算法,是根据三位作者(D.E.Knuth,J.H.Morris 和 V.R.Prat ...