Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

question about make ./configure? #1044

Closed
b0207191 opened this issue Jan 9, 2019 · 7 comments
Closed

question about make ./configure? #1044

b0207191 opened this issue Jan 9, 2019 · 7 comments

Comments

@b0207191
Copy link

b0207191 commented Jan 9, 2019

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

@jvillard
Copy link
Contributor

jvillard commented Jan 9, 2019

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.

@b0207191
Copy link
Author

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

@b0207191
Copy link
Author

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

@jvillard
Copy link
Contributor

@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.

@b0207191
Copy link
Author

@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”

@jvillard
Copy link
Contributor

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.

https://github.com/facebook/facebook-clang-plugins/blob/81d8438a4e415c6f56ed317f86193a1acc56bfcd/clang/setup.sh#L18

@jvillard
Copy link
Contributor

jvillard commented Feb 6, 2019

Hopefully this is resolved, closing the issue optimistically. Feel free to reopen if you have more questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants