Cole Erickson, advised by Professor Dan Barowy
Run flarec.sh
with your Flare program as the sole argument. The Flare program is compiled and written to a binary named flaresheetmatch
. To use this binary, pass it a single argument: the path to the spreadsheet. The output is stored in a.csv
.
An example:
$ ./flarec.sh "</..*/>rr</.*0/>"
$ ./flaresheetmatch test.csv
This Flare program captures every pair of cells such that the first cell is nonempty, the second cell is two spaces to the right of the first, and the contents of the second cell end with 0.
For example, the input file test.csv
has the following contents.
city,country,pop
Boston,United States,4628910
Concord,United States,42695
The output (in a.csv
) is:
Boston,4628910
Run ./utop.sh
.
Run make test
.
I've sketched out the steps I used in reproducing my build environment. They are brief, but I believe they are complete. Don't hesitate to let me know if these instructions are unclear or incorrect.
- Create a virtual machine using the minimal version of Lubuntu 18.04 64-bit in VMWare Player
- Update apt
sudo apt update
- Install git, curl, clang, make, aspcud, m4, cmake, pkg-config
sudo apt install git curl clang make aspcud m4 cmake pkg-config
-
Install rust with rustup, using default choices when prompted by the install script
-
Install OPAM
wget https://raw.github.com/ocaml/opam/master/shell/opam_installer.sh -O - | sh -s /usr/local/bin
-
Downgrade OCaml to 4.04.0 because some packages are not compatible with 4.06.0
opam switch 4.04.0
- Configure OPAM. I give manual instructions here because
opam init
put the following environment variables configuration code in ~/.profile, where it is not by default used in new bash sessions in LUbuntu. I moved it to ~/.bashrc
echo ". /home/flarec/.opam/opam-init/init.sh > dev/null 2> /dev/null || true" >> ~/.bashrc
- Create
~/.ocamlinit
with contents:
let () =
try Topdirs.dir_directory (Sys.getenv "OCAML_TOPLEVEL_PATH")
with Not_found -> ()
;;
-
Open a new terminal
-
Install dependencies from OPAM
opam install jbuilder core llvm utop ounit
- Also install Menhir from OPAM if you can, but I had to use apt
sudo apt install menhir
- Clone the repository
git clone https://github.com/coleerickson/flarec.git
- Enter the repository
cd flarec
- Build, for example, the
flaresheetmatch
target
make flaresheetmatch
- 👍