Closed b0207191 closed 5 years ago
The simplest way to build infer is with ./build-infer.sh
. It will install the opam dependencies for you, such as ocamlbuild. After that you can rebuild infer as you like with ./configure && make
.
thanks to jvllard, and i want to parse C code, but i met a question as following: ...... configure: creating ./config.status config.status: creating Makefile.autoconf ./build-infer.sh: 行 165: facebook-clang-plugins/clang/setup.sh: no such file or dir
Warning: you are not using a release of Infer. The C and Objective-C analyses require a custom clang to be compiled now. This step takes ~30-60 minutes, possibly more.
To speed this along, you are encouraged to use a release of Infer instead:
http://fbinfer.com/docs/getting-started.html
If you are only interested in analyzing Java programs, simply run this script with only the "java" argument:
./build-infer.sh java
Are you sure you want to compile clang? (y/N) y bash: 行 3: /toolsrc/infer-master/facebook-clang-plugins/clang/setup.sh: no such file or dir bash: 行 4: /toolsrc/infer-master/facebook-clang-plugins/clang/setup.sh: no such file or dir Makefile:307: recipe for target 'clang_setup' failed make: *** [clang_setup] Error 127
compilation failure; you can try running
make clean './build-infer.sh' clang
and i have installed clang on this env
infer-master# clang --version clang version 7.0.0 (tags/RELEASE_700/final) Target: x86_64-unknown-linux-gnu Thread model: posix InstalledDir: /usr/bin
@b0207191 How did you get the sources of infer? You should get them by cloning the github repo.
GitHub generates .zip and .tar.gz or the sources but they are unusable because they do not contain the submodule in facebook-clang-plugins.
@jvllard, thanks, i add clang-plugin so that can continue to complie, but then it happens , i wonder how many memory it need?
[ 94%] Building CXX object tools/llvm-isel-fuzzer/CMakeFiles/llvm-isel-fuzzer.dir/DummyISelFuzzer.cpp.o [ 94%] Building CXX object tools/llvm-isel-fuzzer/CMakeFiles/llvm-isel-fuzzer.dir/llvm-isel-fuzzer.cpp.o [ 94%] Linking CXX executable ../../bin/llvm-isel-fuzzer clang-7: error: unable to execute command: Killed clang-7: error: linker command failed due to signal (use -v to see invocation) tools/llvm-isel-fuzzer/CMakeFiles/llvm-isel-fuzzer.dir/build.make:271: recipe for target 'bin/llvm-isel-fuzzer' failed make[3]: *** [bin/llvm-isel-fuzzer] Error 254 make[3]: leave directory “/tmp/clang-setup.L8anPk/build”
Compiling clang is very memory-hungry. We limit the number of parallel jobs to try and avoid running out of memory, but you can also override it yourself by running JOBS=1 ./facebook-clang-plugins/clang/setup.sh
.
Hopefully this is resolved, closing the issue optimistically. Feel free to reopen if you have more questions.
when i run ./configure, it occurs as following
checking for ocamlmklib... /usr/local/bin/ocamlmklib checking for ocamldoc... /usr/local/bin/ocamldoc checking for ocamlbuild... no checking if OCaml version is >= 4.06.1... yes checking for ocamlbuild... no configure: error: ocamlbuild not found.
root@OptiPlex-390:/toolsrc/infer-master# ocaml --version The OCaml toplevel, version 4.06.1
i think i have installed ocaml with version 4.06.1