Skip to content

Commit

Permalink
Add README.md with installing instructions.
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillem Marpons committed May 8, 2012
1 parent ef50081 commit a71563b
Show file tree
Hide file tree
Showing 4 changed files with 114 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ autom4te.cache/
/GRTAGS
/GSYMS
/GTAGS
/README.html
2 changes: 1 addition & 1 deletion Makefile.llvm.rules
Original file line number Diff line number Diff line change
Expand Up @@ -1919,7 +1919,7 @@ TopDistDir := $(PROJ_OBJ_ROOT)/$(DistName)
DistTarGZip := $(PROJ_OBJ_ROOT)/$(DistName).tar.gz
DistZip := $(PROJ_OBJ_ROOT)/$(DistName).zip
DistTarBZ2 := $(PROJ_OBJ_ROOT)/$(DistName).tar.bz2
DistAlways := CREDITS.TXT LICENSE.TXT README.txt README AUTHORS COPYING \
DistAlways := CREDITS.TXT LICENSE.TXT README.md README.txt README AUTHORS COPYING \
ChangeLog INSTALL NEWS Makefile Makefile.common Makefile.rules \
Makefile.config.in configure autoconf
DistOther := $(notdir $(wildcard \
Expand Down
Empty file removed README
Empty file.
112 changes: 112 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
Crisp
=====

A coding rule validation add-on for **LLVM/clang**, GPL v3
licensed.

**Coding Rules** constrain admissible constructs of a language to help
produce better code. Crisp can be used to define and enforce rules for
C and C++, like those in
[High Integrity C++](http://www.codingstandard.com/), and
[CERT's Secure Coding Standards](http://www.cert.org/secure-coding/).

Crisp rules are written in Prolog. A high-level declarative DSL to
easily write new rules is under development. It will be called CRISP,
an acronym for *Coding Rules in Sugared Prolog*.


Installation
============

Although Crisp should be quite portable, it has been tested on
GNU/Linux only so far.

Prerequisites
-------------

1. Install and build **LLVM/clang sources**. You can follow
instructions in [http://clang.llvm.org/get_started.html](). There
are also Git repositories available for both LLVM and clang:
- [http://llvm.org/git/llvm.git]()
- [http://llvm.org/git/clang.git]()

For faster Crisp compilation it is recommended to (also) build
LLVM/clang in *Release* mode, setting environment variables
`ENABLE_OPTIMIZED=1` and `DISABLE_ASSERTIONS=1` when running `make`
in step 5 of the "Getting Started" documentation.

2. Install **SWI-Prolog**. It is most likely provided as a
pre-compiled package for your GNU/Linux distribution. On
Debian/Ubuntu (and derivatives) you simply need to type `sudo
apt-get install swi-prolog`.

3. Install **Boost C++ Libraries**. General installation instructions
for Unix/Linux can be found here:
[http://www.boost.org/doc/libs/1_49_0/more/getting_started/unix-variants.html]().
Crisp relies on header-only libraries. On Debian/Ubuntu (and
derivatives) you only need to type `sudo apt-get install
libboost-dev`.

Download Crisp source code
--------------------------

Source code is available at GitHub:

git clone git://github.com/gmarpons/Crisp.git

Build Crisp
-----------

Let `LOCAL_LLVM_SRC_ROOT` (resp. `LOCAL_LLVM_OBJ_ROOT`) the root of
your LLVM/clang source (resp. build) tree, and `LOCAL_CRISP_SRC_ROOT`
the root of your Crisp source tree. Then do the following:

mkdir LOCAL_CRISP_SRC_ROOT/projects/crisp
cd LOCAL_CRISP_SRC_ROOT/projects/crisp
LOCAL_CRISP_SRC_ROOT/configure \
--with-llvmsrc=LOCAL_LLVM_SRC_ROOT \
--with-llvmobj=LOCAL_LLVM_OBJ_ROOT
You will probably need also to set the header directory for
SWI-Prolog, with the `configure`'s extra argument
`--with-swipl-includes`. E.g., in Debian/Ubuntu (and derivatives) you
need to use
`--with-swipl-includes=/usr/lib/swi-prolog/include/`. Documentation
for other `configure` command line options (such as `--prefix`) can be
obtained typing

LOCAL_CRISP_SRC_ROOT/configure --help

In order to build and install Crisp, type:

make
make install

Compilation is possible with a recent version of LLVM/clang (it does
not work with GCC). As usual, you can specify a particular building
compiler with environment variables `CC` and `CXX`. E.g., write

make CC=LOCAL_LLVM_OBJ_ROOT/BUILD_MODE/bin/clang \
CXX=LOCAL_LLVM_OBJ_ROOT/BUILD_MODE/bin/clang++

to compile Crisp using the same compiler you are building an add-on
for, where `BUILD_MODE` can be `Release`, `Debug+Asserts`, or another
combination describing the debugging/optimizing/profiling options you
have used to build LLVM/clang (default is `Debug+Asserts`).

If you want to test Crisp without installing it, instead of running
`make install` you can simply add variable `ENABLE_DATA_OBJ_ROOT=1` to
your make command. This will allow Crisp access to necessary
initialization data directly from the build tree.


Basic Usage
===========

*TODO*


Known Issues
============

- Building Crisp in *Release* mode does not currently work.

0 comments on commit a71563b

Please sign in to comment.