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
makeagain :sudo apt-get install libreadline-dev sudo apt-get install libc6-devsudo dnf install readline-develIf any other dependencies are missing (this depends on your system configuration), you have to install the missing dependencies and run
makeagain.Optional
While running
./xsmafter Step 2 if you get this error:Then you need to install:/usr/bin/ld: cannot find -ll collect2: error: ld returned 1 exit statussudo apt-get install libfl-devsudo dnf install flex-develand edit the
Makefileofxsm_devfolder, to proceed find the line where-llis used as option and update it to-lflto use theflexlibrary we installed above. Now you can runmakeagain after navigating into the folderxsm_explthrough the terminal. -
Type
cd ../xfs-interface/and type./init. - (Optional) Add this line
#!/usr/bin/env bashas first line to thexsmfile inxsm_explfolder. 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 $SHELLin terminal.
The usage instructions for the XSM simulator can be found here.
Please report installation errors to kmurali@nitc.ac.in