Giter Club home page Giter Club logo

civicc-skeleton's Introduction

CiviC Skeleton

This gives a base for your own civicc compiler.

Getting started

First make sure you have all dependencies installed. The full dependencies of CoCoNut are listed on the main GitHub repository. On Ubuntu these can be installed using:

sudo apt update && sudo apt install build-essential cmake bison flex graphviz

For macOS, see macOS dependencies.

Now clone this repo:

git clone [email protected]:CoCoNut-UvA/civicc-skeleton.git civicc
cd civicc
./configure.sh

If everything went correctly, a build-debug directory is created. Run

make -C build-debug

to build your compiler.

IMPORTANT: After cloning, you should change the remote to point to a private repo you control. You can not achieve this via forking, because GitHub does not allow changing the visibility of a forked repo.

VS Code support

For syntax highlighting of the CoCoNut DSL files (e.g. the main.ccn file), you can install the nutcracker extension from the Visual Studio Marketplace here.

We provide a Linux configuration file in .vscode/c_cpp_properties.json that helps IntelliSense to find the header files generated by cocogen. VS code should pick this up automatically; if you open a C file you should see CoCoNut-Linux in the bottom-right corner.

Creating an archive

You can quickly create an archive for submitting to canvas as follows

make dist

this gets everything in your git repo and combines it with the used coconut version in one archive. This should contain everything needed to hand in your assignments. NOTE: Always check the resulting archive if it contains everything and builds correctly.

Disabling the Address Sanitizer

If you just want ASAN to not report memory leaks (although we do recommend that you actually fix the leaks), you can add the following to src/main.c:

/* Do not detect memory leaks when using AddressSanitizer. */
const char *__asan_default_options() {
    return "detect_leaks=0";
}

If you want to disable it entirely, edit the debug configuration in the Makefile. You may need to remove the build-debug folder and rerun ./configure.sh.

macOS dependencies

The following build dependencies are required on macOS:

brew install cmake coreutils binutils bison graphviz gnu-tar

You might also need to run the following for cmake to find Bison:

echo "export PATH=\"$(brew --prefix)/opt/bison/bin:\$PATH\"" >> ~/.zshrc

Note: Make sure to fully restart your terminal after adding this line to .zshrc, and also delete the folder coconut/build if it exists. Otherwise cmake will keep using the old unsupported Bison version that macOS ships with.

civicc-skeleton's People

Contributors

tristanlaan avatar leegbestand avatar spolstra avatar miljoen avatar

Stargazers

 avatar Wouter avatar  avatar

Watchers

James Cloos avatar  avatar

civicc-skeleton's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.