Compiling Software
Start by cloning the enso repository, if you haven't already:
git clone https://github.com/crossroadsfpga/enso
Prepare the compilation using meson
and compile it with ninja
.
Setup build directory:
meson setup build
Now compile:
cd build
ninja
Compilation options
There are a few compile-time options that you may set. You can see all the available options with:
meson configure
If you run the above in the build directory, it also shows the current value for each option.
To change one of the options run:
meson configure -D<option_name>=<value>
For instance, to disable latency optimization:
meson configure -Dlatency_opt=false
Build an application with Ensō
If you want to build an application that uses Ensō, you should install the Ensō library in your system. You can use ninja
for that:
cd build
ninja
sudo ninja install
Tip
If sudo ninja install
fails, you may try using the following command instead:
sudo $(which ninja) install
This will use the user ninja
instead of the system ninja
.
Then, you should link the application with the Ensō library. The way you do it depends on how you are compiling your code. Here are some examples using gcc
, meson
and cmake
.
g++ -o my_app my_app.cpp -lenso
You may also use pkg-config
to retrieve the flags:
g++ -o my_app my_app.cpp $(pkg-config --cflags --libs enso)
Add the following to your meson.build
file:
enso_dep = dependency('enso')
Then, you can link your application with the Ensō library:
executable('my_app', 'my_app.cpp', dependencies: [enso_dep])
Add the following to your CMakeLists.txt
file:
link_libraries(enso)
Build the documentation optional
You can access Ensō's documentation at https://enso.cs.cmu.edu/. But if you would like to contribute to the documentation, you may choose to also build it locally.
Install the requirements:
sudo apt update
sudo apt install doxygen python3-pip npm
python3 -m pip install -r docs/requirements.txt
sudo npm install -g teroshdl
To build the documentation, run (from the build directory):
meson compile docs
While writing documentation, you can use the following command to automatically rebuild the documentation when you make changes:
cd <root of enso repository>
mkdocs serve
Note that this does not automatically rebuild the hardware and software API reference. You need to rerun meson compile docs
to do that.