parent
e5f6df74b0
commit
7640b01096
@ -1,122 +1,89 @@
|
|||||||
# Install Infer
|
|
||||||
|
|
||||||
## Download the Infer repository
|
We provide a source release of Infer packaged with pre-build binaries for clang and facebook-clang-plugins for Linux and MacOS. We encourage you to use this release.
|
||||||
|
Install the dependencies for your operating system and then follow the instructions
|
||||||
|
in [Infer's getting-started page](http://fbinfer.com/docs/getting-started.html).
|
||||||
|
|
||||||
```bash
|
|
||||||
git clone https://github.com/facebook/infer.git
|
|
||||||
```
|
|
||||||
|
|
||||||
To analyse C and Objective-C, Infer requires clang and the
|
|
||||||
[facebook-clang-plugins](https://github.com/facebook/facebook-clang-plugins). If
|
|
||||||
you wish to analyse only Java/Android code, then you could skip these
|
|
||||||
dependencies. Details below.
|
|
||||||
|
|
||||||
|
# Install the dependencies
|
||||||
|
|
||||||
## MacOS X
|
## MacOS X
|
||||||
|
|
||||||
|
Here are the prerequisites to be able to compile Infer. Make sure you have
|
||||||
|
the dependencies installed and opam configured properly. After that either
|
||||||
|
[use the release](http://fbinfer.com/docs/getting-started.html) (faster), or [compile everything from source](#compile-clang-and-infer-from-source).
|
||||||
|
|
||||||
### Requirements
|
### Requirements
|
||||||
|
|
||||||
- Python 2.7
|
- Python 2.7
|
||||||
- [opam](https://opam.ocaml.org/doc/Install.html#OSX)
|
- opam (instructions [here](https://opam.ocaml.org/doc/Install.html#OSX))
|
||||||
|
- Java <= 1.7 (only needed for the Java analysis)
|
||||||
#### Requirements for the Java analysis
|
- XCode <= 6.3, >= 6.1 (only needed for the C/Objective-C analysis)
|
||||||
|
- clang in XCode command line tools. You can install them with the command `xcode-select --install` (only needed for the C/Objective-C analysis)
|
||||||
- Java <= 1.7
|
|
||||||
- Android dev environment setup for analysis of Android apps.
|
|
||||||
|
|
||||||
#### Requirements for the C/Objective-C analysis
|
### Setup Opam
|
||||||
|
|
||||||
- XCode <= 6.3, >= 6.1
|
|
||||||
- clang (in XCode command line tools. You can install them with the command `xcode-select --install`)
|
|
||||||
|
|
||||||
### Installation instructions
|
|
||||||
|
|
||||||
Install the OCaml dependencies:
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
opam init --comp=4.01.0 # (answer 'y' to the question)
|
opam init -y --comp=4.01.0
|
||||||
eval `opam config env`
|
eval `opam config env`
|
||||||
opam install extlib.1.5.4 atdgen.1.6.0 javalib.2.3.1 sawja.1.5.1
|
opam install -y extlib.1.5.4 atdgen.1.6.0 javalib.2.3.1 sawja.1.5.1
|
||||||
```
|
|
||||||
|
|
||||||
If you do not require support for the C/Objective-C analysis in Infer,
|
|
||||||
and only wish to analyse Java files, continue with these
|
|
||||||
instructions. By the way, Java 1.8 is not supported.
|
|
||||||
|
|
||||||
```bash
|
|
||||||
cd infer
|
|
||||||
make -C infer java
|
|
||||||
export PATH=`pwd`/infer/bin:$PATH
|
|
||||||
```
|
|
||||||
|
|
||||||
To compile support for both Java and C/Objective-C, do this instead.
|
|
||||||
|
|
||||||
```bash
|
|
||||||
cd infer
|
|
||||||
git submodule update --init --recursive
|
|
||||||
facebook-clang-plugins/clang/setup.sh # go have a coffee :)
|
|
||||||
./compile-fcp.sh
|
|
||||||
make -C infer
|
|
||||||
export PATH=`pwd`/infer/bin:$PATH
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
## Linux
|
## Linux
|
||||||
|
Here are the prerequisites to be able to compile Infer. Make sure you have
|
||||||
|
the dependencies installed and opam configured properly. After that either
|
||||||
|
[use the release](http://fbinfer.com/docs/getting-started.html) (faster), or [compile everything from source](#compile-clang-and-infer-from-source).
|
||||||
|
|
||||||
### Requirements
|
### Requirements
|
||||||
|
|
||||||
- Python 2.7
|
- Python 2.7
|
||||||
|
- opam
|
||||||
|
- Java <= 1.7 (only needed for the Java analysis)
|
||||||
|
- gcc >= 4.7.2
|
||||||
|
|
||||||
### Installation instructions
|
### How to install the requirements on Ubuntu 12.04.4 LTS
|
||||||
|
|
||||||
These instructions were tested on Linux 64 bits on the following
|
|
||||||
distributions: Debian 7, Ubuntu 14.04 and Ubuntu 12.04.4 LTS.
|
|
||||||
|
|
||||||
Install the OCaml dependencies:
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get upgrade
|
sudo apt-get upgrade
|
||||||
sudo apt-get install git openjdk-7-jdk m4 zlib1g-dev python-software-properties build-essential libgmp-dev libmpfr-dev libmpc-dev unzip
|
sudo apt-get install git openjdk-7-jdk m4 zlib1g-dev python-software-properties build-essential libgmp-dev libmpfr-dev libmpc-dev unzip
|
||||||
wget https://github.com/ocaml/opam/releases/download/1.2.2/opam-1.2.2-x86_64-Linux -O opam
|
sudo apt-get install gcc-4.8 g++-4.8
|
||||||
chmod +x opam
|
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 60 --slave /usr/bin/g++ g++ /usr/bin/g++-4.8
|
||||||
./opam init --comp=4.01.0 #(then say 'y' to the final question)
|
|
||||||
eval `./opam config env`
|
|
||||||
./opam install extlib.1.5.4 atdgen.1.6.0 javalib.2.3.1 sawja.1.5.1 #(then say 'y' to the question)
|
|
||||||
```
|
```
|
||||||
|
|
||||||
If you do not require support for the C/Objective-C analysis in Infer,
|
### How to install the requirements on Debian 7 / Ubuntu 14.04
|
||||||
and only wish to analyse Java files, continue with these
|
|
||||||
instructions. By the way, Java 1.8 is not supported.
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd infer
|
sudo apt-get update
|
||||||
make -C infer java
|
sudo apt-get upgrade
|
||||||
export PATH=`pwd`/infer/bin:$PATH
|
sudo apt-get install git openjdk-7-jdk m4 zlib1g-dev python-software-properties build-essential libgmp-dev libmpfr-dev libmpc-dev unzip
|
||||||
```
|
```
|
||||||
|
|
||||||
To compile support for both Java and C/Objective-C, do this
|
### Setup Opam
|
||||||
instead. This assumes that gcc >= 4.7.2 is already installed on your
|
|
||||||
system. If your distribution is Ubuntu 12.04.4 LTS, you can install
|
|
||||||
gcc-4.8 and g++-4.8. Follow the following instructions to do that. You
|
|
||||||
may skip this step in other distributions with a recent enough version
|
|
||||||
of gcc, for instance Debian 7.
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sudo apt-get install python-software-properties
|
wget https://github.com/ocaml/opam/releases/download/1.2.2/opam-1.2.2-x86_64-Linux -O opam
|
||||||
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
|
chmod +x opam
|
||||||
sudo apt-get update
|
./opam init -y --comp=4.01.0
|
||||||
sudo apt-get install gcc-4.8 g++-4.8
|
eval `./opam config env`
|
||||||
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 60 --slave /usr/bin/g++ g++ /usr/bin/g++-4.8
|
./opam install -y extlib.1.5.4 atdgen.1.6.0 javalib.2.3.1 sawja.1.5.1
|
||||||
```
|
```
|
||||||
|
|
||||||
Then continue with:
|
# Compile clang and Infer from source
|
||||||
|
|
||||||
|
Infer uses a special version of clang along with a clang plugin. Follow these instructions to compile them from source. Alternatively, you can skip these instructions and use the [release](http://fbinfer.com/docs/getting-started.html).
|
||||||
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
# Checkout Infer
|
||||||
|
git clone https://github.com/facebook/infer.git
|
||||||
cd infer
|
cd infer
|
||||||
git submodule update --init --recursive
|
git submodule update --init --recursive
|
||||||
|
# Compile clang
|
||||||
facebook-clang-plugins/clang/setup.sh # go have a coffee :)
|
facebook-clang-plugins/clang/setup.sh # go have a coffee :)
|
||||||
|
# Compile the clang plugin
|
||||||
./compile-fcp.sh
|
./compile-fcp.sh
|
||||||
|
# Compile Infer
|
||||||
make -C infer
|
make -C infer
|
||||||
export PATH=`pwd`/infer/bin:$PATH
|
export PATH=`pwd`/infer/bin:$PATH
|
||||||
```
|
```
|
||||||
|
Loading…
Reference in new issue