Skip to content

Latest commit

 

History

History
189 lines (141 loc) · 7.22 KB

Install.md

File metadata and controls

189 lines (141 loc) · 7.22 KB

Local Setup Instructions

If you want to run the bootcamp locally, run the following instructions below for your particular situation. Note that we include a custom javascript file for Jupyter, so if you already have Jupyter installed, you still need to install the custom.js file.

Note: Make sure you are using Java 8 (NOT Java 9) and have the JDK8 installed. Coursier/jupyter-scala does not appear to be compatible with Java 9 yet as of January 2018.

If you do have multiple version of Java, make sure to select Java 8 (1.8) before running jupyter notebook:

Local Installation - Mac/Linux

This bootcamp uses Jupyter notebooks. Jupyter notebooks allow you to interactively run code in your browser. It supports multiple programming languages. For this bootcamp, we'll install jupyter first and then the Scala-specific jupyter backend (now called almond).

Jupyter

First install Jupyter.

Dependencies: openssh-client, openjdk-8-jre, openjdk-8-jdk (-headless OK for both), ca-certificates-java

First, use pip3 to install jupyter (or pip for python 2): http://jupyter.org/install.html

pip3 install --upgrade pip
pip3 install jupyter --ignore-installed

If pip3 isn't working out of the box (possibly because your Python3 version is out of date), you can try python3 -m pip in lieu of pip3.

(To reinstall jupyter later for whatever reason, you can use --no-deps to avoid re-installing all the dependencies.)

You may want to try out Jupyter lab, the newer interface developed by Project Jupyter. It is especially useful if you want to be able to run a terminal emulator in your browser. It can be installed with pip3:

pip3 install jupyterlab

Jupyter Backend for Scala

If you experience errors or issues with this section, try running rm -rf ~/.local/share/jupyter/kernels/scala/ first.

Next, download coursier and use it to install almond (see here for the source for these instructions):

curl -L -o coursier https://git.io/coursier-cli && chmod +x coursier
SCALA_VERSION=2.12.10 ALMOND_VERSION=0.9.1
./coursier bootstrap -r jitpack \
    -i user -I user:sh.almond:scala-kernel-api_$SCALA_VERSION:$ALMOND_VERSION \
    sh.almond:scala-kernel_$SCALA_VERSION:$ALMOND_VERSION \
    --sources --default=true \
    -o almond
./almond --install

You can delete coursier and almond files if you so desire.

Install bootcamp

Now clone the bootcamp repo and install the customization script. If you already have one, append this script to it.

git clone https://github.com/freechipsproject/chisel-bootcamp.git
cd chisel-bootcamp
mkdir -p ~/.jupyter/custom
cp source/custom.js ~/.jupyter/custom/custom.js

And to start the bootcamp on your local machine:

jupyter notebook

If you installed Jupyter Lab, run jupyter-lab instead.

Local Installation - Windows

These notes describe, in general, the way to install the Generator Bootcamp under Windows 10. Many different windows configurations may be encountered and some changes may be required. Please let us know of there are things out of date, or otherwise should be covered here.

There are several times where you may want to launch a Command (shell) window. I have discovered that launching the command window in Administrator Mode is helpful. To do that from the bottom left Launcher, find or search for 'CMD' when selecting it from the menu, right click and choose, "Launch in Administrator Mode". Find more details on this here and other places. It is also best to relauch command windows between steps in the process so that newly installed software will be recognized.

Be sure java is installed (ideally java 8).

If you type java into a command prompt and it says command not found, you need to install Java.

Install Jupyter

Jupyter recommends using the Anaconda distribution, here is the Windows download.

Near the end of the Jupyter installation is a question about whether to add Jupyter to the PATH. Windows does not recommend this, but I do. It will make it easier to run using the command prompt.

Install Scala components.

The simplest way seens to be to Download Coursier from here

Go to download folder, where "coursier" (file) is

java -noverify -jar coursier launch -r jitpack -i user -I user:sh.almond:scala-kernel-api_2.12.8:0.2.1 sh.almond:scala-kernel_2.12.8:0.2.1 --sources --default=true -- --install

Install the chisel-bootcamp repo.

Download the chisel-bootcamp as a zip file (or use a Windows git client) and unpack it in a directory you have access to. Ideally, you should put it in a path that has no spaces.

Install the customization script by moving chisel-bootcamp/source/custom.js to %HOMEDRIVE%%HOMEPATH%\.jupyter\custom\custom.js. If you already have a custom.js file, append this script to it.

Launch the Jupyter and the bootcamp

In the directory containing the unpacked chisel-bootcamp repo, from a new command window type:

jupyter notebook

This should start the bootcamp server and open a top page bootcamp menu in your default browser. If it does not look for the something like the following in the command window and copy and paste the link you see into a browser window.

    Copy/paste this URL into your browser when you connect for the first time,
    to login with a token:
        http://localhost:8888/?token=9c503729c379fcb3c7a17087f05462c733c1733eb8b31d07
Proxy usage

If you require a proxy, try uncommenting and changing the relevant lines at the start of source/load-ivy.sc.

Good Luck!

Cadence AWS Setup

If you don't know or don't have access to Cadence AWS, skip this section.

Navigate to your working directory, which is probably your home directory.

cd ~

Then run the following commands. The default shell is c-shell, but if you switch to bash, source jupyter_sh instead of jupyter_csh.

source /craft/tools/jupyter/jupyter_csh

The default browser, Konqueror, won't work with Jupyter. Launch Firefox in the background and set it as your default browser when it asks.

/craft/cdns_sw_inst/firefox/45.3.0esr/firefox &

Clone the repo and launch Jupyter. If it asks for a token, copy and paste the to login with a token URL seen in the terminal. Future launches will be happy for a while.

git clone /craft/tools/chisel/generator-bootcamp.git
cd generator-bootcamp
jupyter notebook

Cadence Chamber Setup

If you don't know what the Cadence Chamber is, skip this section. Navigate to your work directory, likely /projects/craft_flow/work/<username>/. Then run the following commands. Note that /proj/ is an alias to /projects/. If you are in bash, source jupyter_sh instead of jupyter_csh.

source /proj/craft_flow/tools/jupyter/jupyter_csh
git clone /proj/craft_flow/source/chisel/generator-bootcamp
cd generator-bootcamp
jupyter notebook