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

Unable to manually compile Infer in a Linux laptop #649

Closed
ghost opened this issue Apr 29, 2017 · 3 comments
Closed

Unable to manually compile Infer in a Linux laptop #649

ghost opened this issue Apr 29, 2017 · 3 comments

Comments

@ghost
Copy link

ghost commented Apr 29, 2017

Hello,

I try to manually compile Infer in my 3-year Linux laptop, which running Linux Mint 18.1, CPU Core i5-4210U (4 cores) and 12 GB of RAM, 40GB of the spare hard drive. The compilation always fails at building the facebook-clang-plugin. It happens to me 4, 5 times and below is the error message of the latest attempt. When it fails, I checked that there are still 14GB of the spare hard drive.

Could you please advise what is wrong? It often takes about 2 hours to compile facebook-clang-plugin before it fails like described. The commands I used are ./autogen.sh; ./configure; make

However, this problem doesn't occur when I compile Infer in a Virtualbox machine, in the other PC

Thank you!

[100%] Linking CXX shared library ../../../../lib/libclang.so
make[3]: Leaving directory '/tmp/clang-setup.SBjcpY/build'
[100%] Built target opt
make[3]: Entering directory '/tmp/clang-setup.SBjcpY/build'
Scanning dependencies of target arcmt-test
make[3]: Leaving directory '/tmp/clang-setup.SBjcpY/build'
make[3]: Entering directory '/tmp/clang-setup.SBjcpY/build'
[100%] Building CXX object tools/clang/tools/arcmt-test/CMakeFiles/arcmt-test.dir/arcmt-test.cpp.o
[100%] Linking CXX executable ../../../../bin/arcmt-test
make[3]: Leaving directory '/tmp/clang-setup.SBjcpY/build'
[100%] Built target arcmt-test
make[3]: Entering directory '/tmp/clang-setup.SBjcpY/build'
Scanning dependencies of target clang-check
make[3]: Leaving directory '/tmp/clang-setup.SBjcpY/build'
make[3]: Entering directory '/tmp/clang-setup.SBjcpY/build'
[100%] Building CXX object tools/clang/tools/clang-check/CMakeFiles/clang-check.dir/ClangCheck.cpp.o
[100%] Linking CXX executable ../../../../bin/clang-check
make[3]: Leaving directory '/tmp/clang-setup.SBjcpY/build'
[100%] Built target llvm-dwp
collect2: fatal error: ld terminated with signal 9 [Killed]
compilation terminated.
tools/clang/tools/driver/CMakeFiles/clang.dir/build.make:311: recipe for target 'bin/clang-4.0' failed
make[3]: *** [bin/clang-4.0] Error 1
make[3]: *** Deleting file 'bin/clang-4.0'
make[3]: Leaving directory '/tmp/clang-setup.SBjcpY/build'
CMakeFiles/Makefile2:27048: recipe for target 'tools/clang/tools/driver/CMakeFiles/clang.dir/all' failed
make[2]: *** [tools/clang/tools/driver/CMakeFiles/clang.dir/all] Error 2
make[2]: *** Waiting for unfinished jobs....
make[3]: Leaving directory '/tmp/clang-setup.SBjcpY/build'
[100%] Built target libclang
make[3]: Leaving directory '/tmp/clang-setup.SBjcpY/build'
[100%] Built target clang-check
make[2]: Leaving directory '/tmp/clang-setup.SBjcpY/build'
Makefile:149: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/tmp/clang-setup.SBjcpY/build'
Makefile:150: recipe for target 'clang_setup' failed
make: *** [clang_setup] Error 2

@jvillard
Copy link
Contributor

jvillard commented May 9, 2017

Looks like ld get OOM-killed:

collect2: fatal error: ld terminated with signal 9 [Killed]

That's a bit odd given your 12GB of RAM, but not impossible. Try using fewer cores. One way is to edit facebook-clang-plugins/clang/setup.sh and change line 132 to JOBS=1 (instead of JOBS="$(getconf ...)") (sorry, GitHub is acting up and I cannot link directly to the line at the moment).

A faster way if you still have the temp dir lying around is to attempt to finish the installation by hand:

cd /tmp/clang-setup.SBjcpY/build
make -j 1 install
cd /path/to/infer/facebook-clang-plugins/clang
# strip binaries to save space
find install/{bin,lib} -type f -exec strip -x \{\} \+
# record that the installation was successful
./setup.sh --only-record-install

Let me know if this helps.

@ghost
Copy link
Author

ghost commented May 19, 2017

Thank you so much for your suggestion. I am able to build both facebook-clang-plugins and infer from the scratch by changing the number of JOBS to 1 as you suggested.

The compilation took really a long time though, more or less 3 hours.

@jvillard
Copy link
Contributor

jvillard commented Nov 9, 2017

Please reopen if there's still an issue here.

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

1 participant