Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions LLVM_Instruction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
You can obtain the Sources or the Pre-Built Binaries of LLVM and Clang from [here](http://llvm.org/releases/download.html).

Installing LLVM and Clang from Pre-Built Binaries saves your time and trouble of directly compiling the Sources by yourself. You can follow the instruction [here](http://stackoverflow.com/questions/17045954/how-to-install-clang-using-precompiled-binaries) and [here](http://askubuntu.com/questions/89615/how-do-i-install-llvm-clang-3-0) to learn more about how to install the binaries.

You can also install LLVM and Clang from the Sources, please check [here](http://llvm.org/docs/GettingStarted.html#requirements) for the requirements of building LLVM by yourself. If you are using Ubuntu or Debian, it is probably a good idea to install the `build-essential` package before you start, since it contains the required `gcc` and `make` utilities. After all the requirements are met, click [here](http://llvm.org/docs/GettingStarted.html#getting-started-with-llvm) for a very detailed instruction and some options you can configure when installing LLVM.
Please do note the following when you follow the instructions above:
1. The linking process of LLVM is very memory heavy, make sure your machine has enough memory and swap space before you compile LLVM Source Code. Otherwise you risk the chances of getting errors like `ld terminated with signal 9`, `Memory exhausted` or `ld returned exist status 1` which halts and fails the compilation process. Some helpful links on how to increase swap space can be found [here](https://www.maketecheasier.com/swap-partitions-on-linux/), [here](https://blog.inventic.eu/2012/07/linux-c-linker-ld-terminated-with-signal-9/) and [here](http://stackoverflow.com/questions/5682854/why-is-the-linker-terminating-on-me-when-i-build-clang).
2. You can also choose to build LLVM in Release mode instead of Debug mode to reduce the amount of memory required during compilation. See [here](http://llvm.org/docs/GettingStarted.html#local-llvm-configuration) and [here](http://llvm.org/docs/CMake.html#introduction) about how to change local LLVM configuration.
3. Instructions on installing LLVM and Clang without Root Privileges can be found [here](http://stackoverflow.com/questions/8681385/install-clang-as-user-no-root-privileges) and [here](http://llvm.org/docs/GettingStarted.html#local-llvm-configuration).
19 changes: 11 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,28 +24,31 @@ This project is partially supported by the Air Force Office of Scientific Resear

# FlipIt Installation

1.) Follow Steps from http://clang.llvm.org/get_started.html to install LLVM and Clang
1.) Obtain a copy of LLVM and clang [here](http://llvm.org/releases/download.html). We have tested with LLVM 3.5.2 source and precompiled binaries. If you choose to build LLVM and clang from source, follow these [directions](http://clang.llvm.org/get_started.html).

2.) Get FlipIt:

```
git clone git@github.com:aperson40/FlipIt.git
```

3.) Modify your bashrc file to add directory to path and set some environment variables. If you have a *Release+Asserts* build of LLVM, replace *Debug+Asserts* with it in the following:

3.) Modify your bashrc file to add directory to path and set some environment variables that are used throughout FlipIt
```
PATH=$PATH:/path/to/build/Debug+Asserts/bin
export PATH
export LLVM_BUILD_PATH=/path/to/build/
export LLVM_REPO_PATH=/path/to/repo/llvm/
export LLVM_BUILD_PATH=/path/to/llvm/
export FLIPIT_PATH=/path/to/flipit

#only required if you want to use FlipIt as a library with other code
export LD_LIBRARY_PATH=/path/to/flipit/lib:$LD_LIBRARY_PATH

#not required, but can make your fingers happy in you do not use the compiler wrapper
PATH=$PATH:/path/to/llvm/bin
export PATH
```

4.) Run script to setup FlipIt with LLVM (Note: If you're not using LLVM version 3.4, the LLVM #include files in [faults.h](src/pass/faults.cpp) might not be correct. This is due to changes in the directory structure in LLVM between releases.):

```
cd $FLIPIT_PATH/
cd $FLIPIT_PATH
./setup
```
5.) Test that everything works:
Expand Down
Loading