Skip to content

Latest commit

 

History

History
53 lines (35 loc) · 2.46 KB

Install.md

File metadata and controls

53 lines (35 loc) · 2.46 KB

Installation

Carp is mainly developed on macOS, but it also works fine on Linux. There is ongoing work on Windows support but it's not completely done yet.

Building the Carp executable from source

  1. Make sure you have a recent version of Stack installed.
  2. Clone this repo to your machine.
  3. Run stack build in the root of the project directory.
  4. stack install will install the Carp command line tool for easy access on your system.
  5. Make sure that the directory where stack installs executables is on your PATH, i.e: export PATH=~/.local/bin:$PATH.

Setting the CARP_DIR

To be able to run carp from anywhere on you system, the executable must know where to find its core libraries and other files. Set the environment variable CARP_DIR so that it points to the root of the Carp repo.

For example, add this to your .bashrc or similar:

export CARP_DIR=~/Carp/

You should now be able to start Carp from anywhere:

$ carp

C compiler

The carp executable will emit a single file with C code, main.c and try to compile it using an external C compiler. On macOS and Linux it defaults to clang, so make sure you have that installed (On macOS this is preferably done by installing XCode, including its developer tools).

On Windows the default C compiler used by Carp is clang-cl.exe which compiles the code using Clang but links it with the Visual Studio linker. Tip: use the package manager Scoop to install LLVM for an easy way to set this up on Windows. Also make sure you have Visual Studio with the C/C++ addon installed. Please note that you don't need WSL (Windows Subsystem for Linux) to use Carp.

If you want to use another compiler, you can configure the exact build command like so:

(Project.config "compiler" "gcc --important-flag")

SDL, GLFW, etc

The examples involving graphics/sound/interaction will require the following libraries installed on your system:

Please let us know if you have trouble getting these examples to work.