Had to blow up my Chromebook setup due to some bad lib linking in R. Here's a blow-by-blow of getting back to where I was. Useful if you what a Chromebook that can be used for coding in Python or R in Jupyter Notebooks
While the aliases aren't needed, they're useful and once you get used to them, they're hard to live without. The exports are needed later on and you might as well add them now.
alias cls='clear'
alias gh='history | grep'
alias ll='ls -laF'
alias h='history | tail -n 10'
# Below are needed for R to work correctly
export EDITOR='vim'
export TMPDIR=/usr/local/tmp
export PAGER=/usr/local/bin/less
This is recommended to help offset the vulnerability you create by running the machine in Developer mode.
$ sudo chromeos-setdevpasswd
Chromebrew is a package manager which allows you to install programs onto your Chromebook. It's similar to the Mac Homebrew package manager.
$ cd ~/Downloads # This is the only dir that is writable to you at the moment
$ curl https://raw.githubusercontent.com/skycocker/chromebrew/master/install.sh -o install.sh
$ bash ./install.sh
This will download and install a compiler toolchain which includes gcc
and other useful items that are needed to compile source code on your machine.
NOTE: The list of installed packages is contained in /usr/local/etc/crew/device.json
. It is often better to remove a package entry from here and then reinstall it, rather than 'crew remove <pkg", which can cause problems when done on low level pkgs like gcc8 and libiconv.</p>
NOTE: When installing from Chromebrew, I always use the "-s" flag to the install command. This builds the package locally from source, which I find to be much more reliable than installing from precompiled packages.
$ crew install -s hdf5
$ crew remove libxml2
$ crew install -s libxml2
$ ll ~/Downloads/netcdf*
-rw-r--r--. 1 chronos chronos 18410112 Jan 18 11:06 netcdf-c-4.7.3.tar.gz
$ cd /usr/local/share
$ cp ~/Downloads/netcdf-c-4.7.3.tar.gz ./
$ tar xzvf netcdf-c-4.7.3.tar.gz
$ cd netcdf-c-4.7.3
$ ./configure --prefix=/usr/local --libdir=/usr/local/lib64 --disable-dap
$ make check install
$ crew install -s python27 openjpeg geos proj4 curl
# After removing from devices.json
$ crew install -s libiconv
$ crew install -s gettext
$ crew install -s cairo
$ pip install numpy
$ crew install -s gdal
$ crew install -s r
NOTE: This will add a ton of other packages as part of the dependency tree.
This one is easy. And by all that is holy, do not infect your machine with Anaconda. It might work fine on a normal machine, but here it will create havoc.
$ pip install --upgrade pip
$ pip install jupyter
This you do from within R, but first we need to install the system libs for ZeroMQ, and they were incompatible with the latest version of gcc 8 that I had.
Had to download Version 4.3.2 from https://github.com/zeromq/libzmq/releases/download/v4.3.2/zeromq-4.3.2.tar.gz
$ crew install -s zeromq
$ R
> install.packages("Cairo")
> install.packages('IRkernel')
> IRkernel::installspec()
$ vi /usr/local/lib64/R/library/IRkernel/kernelspec/kernel.json
{"argv": ["R", "--slave", "-e", "options(bitmapType='cairo') ; "IRkernel::main()", "--args", "{connection_file}"],
"display_name":"R",
"language":"R"
}
$ pip install matplotlib
$ crew remove cairo
$ crew install -s cairo
$ vi /usr/local/lib/python2.7/site-packages/nbformat/sign.py
# Add to the beginning of the script
reload(sys)
sys.setdefaultencoding('utf8')