set-learning-journey.sh 2.46 KB
Newer Older
1 2 3 4 5 6 7 8 9
#!/bin/bash

# Chisel Learning Journey
# Set-up script
# December 31st, 2017
#
# January 3rd, 2018	- adjusting verilator installation
#			- adjusting permissions automatically
#
10 11 12
# January 20th, 2018	- adapting the script to the learning-journey repo
#
# January 21st, 2018	- correcting the chown issue
13
#
14 15
# February 2nd, 2018	- added generator-bootcamp
#
16 17 18
# Oct, 2018 - Modified for non sudo users.
# Alan Marchiori
#
19 20 21 22 23 24 25 26 27 28 29 30 31
# Aleksandar Pajkanovic
# aleksandar [dot] pajkanovic [at] gmail [dot] com

# Let the user know what is going on and ask for permission:
echo "	Welcome to the Chisel Learning Journey!

	This script will set your environment in the right manner for you to
	start making first steps on the Chisel Learning	Journey.

	The script has been prepared for and tested on Mint 18, which is the
	recommended OS for the Learning Journey. For details on how to prepare
	the virtual machine, please visit:

32
	https://github.com/Intensivate/learning-journey/wiki/Chisel-Environment
33

34
	This is modified from the offical script for the Bucknell riscv machine.
35

36 37
  If you are setting this up on your own computer, use the official repo at:
  https://github.com/Intensivate/learning-journey.git
38 39 40 41 42 43 44 45 46 47 48 49 50 51

"

while true;
do
	read -p "	Do you agree?
					" response
	case $response in
		[Yy]* ) break;;
		[Nn]* ) exit;;
		* ) echo "Please answer yes or no.";;
	esac
done

apaj's avatar
apaj committed
52

53 54
#export current_user=`who | awk '{print $1}'`
export current_user=$LOGNAME
apaj's avatar
apaj committed
55

56
export LJHOME=$PWD
apaj's avatar
apaj committed
57

58
echo "export LJHOME=$PWD" >> ~/.bashrc
apaj's avatar
apaj committed
59

60 61 62 63
echo "Home of Learning Journey set in \$LJHOME"


# install verilator:
Alan Marchiori's avatar
Alan Marchiori committed
64 65 66 67 68 69 70 71 72 73 74 75 76
# git clone http://git.veripool.org/git/verilator
# cd verilator
#
# unset VERILATOR_ROOT
# git pull
# git checkout verilator_3_904
# # Version 3.904 is dated May 30th, 2017, however Chisel3 has issues with
# # more up-to-date versions. This is where the bug was reported and may be tracked:
# #	https://github.com/ucb-bar/chisel-tutorial/issues/111
# autoconf # Create ./configure script
# ./configure
# make
# make install
77 78 79

cd $LJHOME

80
# installing jupyter
81 82
#pip3 install --upgrade pip
#pip3 install jupyter
83 84 85

# installing jupyter-scala
git clone https://github.com/jupyter-scala/jupyter-scala.git
86
#cd jupyter-scala && ./jupyter-scala
apaj's avatar
apaj committed
87
cd $LJHOME
88 89 90 91 92

# setting up the Chisel Jupyter Notebook
cd generator-bootcamp
mkdir -p ~/.jupyter/custom
cp source/custom.js ~/.jupyter/custom/custom.js
apaj's avatar
apaj committed
93
cd $LJHOME
94

95
chown -R $current_user $LJHOME
96 97

# Installations finished, just give some instructions
98
echo "
99 100
	You are ready now to start walking the Chisel Learning Journey!

101
	"