Installation¶
If these instructions do not work, you can try the Docker based setup.
Install LEX¶
sudo apt-get update
sudo apt-get install flex
sudo dnf install flex
Install YACC¶
sudo apt-get update
sudo apt-get install bison
sudo dnf install bison byacc
Install XSM Machine Simulator¶
The compiler's target code needs to be run on a simulator and the installation steps are given below.
Let us install XSM
Step 1¶
Clone the XSM Simulator from the official repository to your computer
git clone https://github.com/silcnitc/xsm_expl.git
Step 2¶
Navigate into the folder xsm_expl
through the terminal.
cd xsm_expl
Do the following steps:
-
Type
make
.You may get some warnings and they can be ignored. If you get any fatal error, then install the following dependencies and try running
make
again :sudo apt-get install libreadline-dev sudo apt-get install libc6-dev
sudo dnf install readline-devel
If any other dependencies are missing (this depends on your system configuration), you have to install the missing dependencies and run
make
again.Optional
While running
./xsm
after Step 2 if you get this error:Then you need to install:/usr/bin/ld: cannot find -ll collect2: error: ld returned 1 exit status
sudo apt-get install libfl-dev
sudo dnf install flex-devel
and edit the
Makefile
ofxsm_dev
folder, to proceed find the line where-ll
is used as option and update it to-lfl
to use theflex
library we installed above. Now you can runmake
again after navigating into the folderxsm_expl
through the terminal. -
Type
cd ../xfs-interface/
and type./init
. - (Optional) Add this line
#!/usr/bin/env bash
as first line to thexsm
file inxsm_expl
folder. This step is for those who don't have bash or sh as their "default shell" and therefore may be using other customizable shells likezsh
, etc as their default shell. You can check your default shell by usingecho $SHELL
in terminal.
The usage instructions for the XSM simulator can be found here.
Please report installation errors to kmurali@nitc.ac.in