请选择 进入手机版 | 继续访问电脑版

risc-v中文社区

 找回密码
 立即注册
查看: 2696|回复: 0

[原创] 手把手教你开始搭建Risc-v Rocket环境(1)

[复制链接]

347

主题

564

帖子

2237

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
2237
发表于 2021-7-28 13:46:47 | 显示全部楼层 |阅读模式
为了搭建Rocke环境,我买了一个2T的移动硬盘,安装的ubuntu-16.04 LTS版。没有java8,gcc是5.4.0

joe@joe-Inspiron-7460:~$ java -version
程序 'java' 已包含在下列软件包中:
* default-jre
* gcj-5-jre-headless
* openjdk-8-jre-headless
* gcj-4.8-jre-headless
* gcj-4.9-jre-headless
* openjdk-9-jre-headless
请尝试:sudo apt install <选定的软件包>
joe@joe-Inspiron-7460:~$ echo $JAVA_HOME

joe@joe-Inspiron-7460:~$ gcc --version
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1:下载jdk-8u171-linux-x64.tar.gz  然后再执行 如下命令:

joe@joe-Inspiron-7460:~/Downloads$ sudo mkdir /usr/lib/jdk8u171

joe@joe-Inspiron-7460:~/Downloads$ tar -zxvf jdk-8u171-linux-x64.tar.gz

joe@joe-Inspiron-7460:~/Downloads$ sudo mv jdk1.8.0_171 /usr/lib/jdk8u171/

joe@joe-Inspiron-7460:~$ gedit .bashrc
在.bashrc文件中增加如下内容:
export JAVA_HOME=/usr/lib/jdk8u171/jdk1.8.0_171
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.{JAVA_HOME}/lib{JRE_HOME}/lib
export PATH=.{JAVA_HOME}/binPATH

joe@joe-Inspiron-7460:~$ source ~/.bashrc

此时再测试java -version则成功:
joe@joe-Inspiron-7460:~$ java -version
java version "1.8.0_171"
Java(TM) SE Runtime Environment (build 1.8.0_171-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.171-b11, mixed mode)
2:参考

https://github.com/freechipsproject/rocket-chip

https://github.com/freechipsproject/rocket-chip#quick

https://github.com/riscv/riscv-tools/blob/master/README.md

sudo apt-get install autoconf automake autotools-dev curl libmpc-dev libmpfr-dev libgmp-dev libusb-1.0-0-dev gawk build-essential bison flex texinfo gperf libtool patchutils bc zlib1g-dev device-tree-compiler pkg-config libexpat-dev
3:因为是新系统没有git ,所以先安装git 命令 sudo apt-get install git 然后在主目录下建立rocketchip目录并进入目录:

joe@joe-Inspiron-7460:~/rocketchip$ git clone https://github.com/ucb-bar/rocket-chip.git
joe@joe-Inspiron-7460:~/rocketchip$ cd rocket-chip
joe@joe-Inspiron-7460:~/rocketchip/rocket-chip$ git submodule update --init
子模组 'chisel3' (https://github.com/ucb-bar/chisel3.git) 未对路径 'chisel3' 注册
子模组 'firrtl' (https://github.com/ucb-bar/firrtl.git) 未对路径 'firrtl' 注册
子模组 'hardfloat' (https://github.com/ucb-bar/berkeley-hardfloat.git) 未对路径 'hardfloat' 注册
子模组 'riscv-tools' (https://github.com/riscv/riscv-tools.git) 未对路径 'riscv-tools' 注册
子模组 'torture' (https://github.com/ucb-bar/riscv-torture.git) 未对路径 'torture' 注册
正克隆到 'chisel3'...
remote: Counting objects: 16295, done.
remote: Compressing objects: 100% (155/155), done.
remote: Total 16295 (delta 81), reused 186 (delta 51), pack-reused 16042
接收对象中: 100% (16295/16295), 2.77 MiB | 17.00 KiB/s, 完成.
处理 delta 中: 100% (7605/7605), 完成.
检查连接... 完成。
子模组路径 'chisel3':检出 'e03e3f730250673ffa48c000caa369ed582467a2'
正克隆到 'firrtl'...
remote: Counting objects: 19723, done.
remote: Compressing objects: 100% (104/104), done.
error: RPC failed; curl 18 transfer closed with outstanding read data remaining
fatal: The remote end hung up unexpectedly
fatal: 过早的文件结束符(EOF)
fatal: index-pack failed
fatal: 无法克隆 'https://github.com/ucb-bar/firrtl.git' 到子模组路径 'firrtl'

查看文件夹~/rocketchip/ 发现其中的rocket-chip,torture,hardfloat目录中都是空的,并且firrtl目录也不存在。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则



Archiver|手机版|小黑屋|risc-v中文社区

GMT+8, 2024-3-28 16:27 , Processed in 0.015914 second(s), 17 queries .

risc-v中文社区论坛 官方网站

Copyright © 2018-2021, risc-v open source

快速回复 返回顶部 返回列表