0

I am making the test-suite of llvm.

[test-suite-build$ make
Consolidate compiler generated dependencies of target fpcmp-target
[  0%] Built target fpcmp-target
Consolidate compiler generated dependencies of target timeit-target
[  0%] Built target timeit-target
[  0%] Built target build-litsupport
[  0%] Built target build-fpcmp
[  0%] Built target build-HashProgramOutput.sh
[  0%] Built target build-timeit
[  0%] Building CXX object Bitcode/Benchmarks/Halide/local_laplacian/CMakeFiles/halide_local_laplacian.dir/driver.cpp.o
In file included from /home/summer/llvm-16/test-suite/Bitcode/Benchmarks/Halide/local_laplacian/driver.cpp:1:
/home/summer/llvm-16/test-suite/Bitcode/Benchmarks/Halide/local_laplacian/../common/benchmark.h:4:10: fatal error: 'limits' file not found
#include <limits>
         ^~~~~~~~
1 error generated.
make[2]: *** [Bitcode/Benchmarks/Halide/local_laplacian/CMakeFiles/halide_local_laplacian.dir/build.make:76: Bitcode/Benchmarks/Halide/local_laplacian/CMakeFiles/halide_local_laplacian.dir/driver.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:14272: Bitcode/Benchmarks/Halide/local_laplacian/CMakeFiles/halide_local_laplacian.dir/all] Error 2
make: *** [Makefile:136: all] Error 2](https://stackoverflow.com)

I found limits.h in /usr/linux/

And I reinstall these libraries: gcc build-essential manpages-dev make perl zlib1g zlib1g-dev libssl-dev linux-libc-dev

But doesn't work

1
  • You are trying to build C++ code with a C compiler. Use g++ instead of gcc. Commented Oct 6, 2023 at 7:54

2 Answers 2

2

If you want to compile C++ code in a typical (Ubuntu) linux, you need the "g++" package.

Sign up to request clarification or add additional context in comments.

1 Comment

Or at least libstdc++-dev, which is likely a dependency of g++
1

"limits.h" and and C++ <limits> are not the same thing. Equivalence of <limits> and <climits>

Otherwise, you are probably missing C++ std libs. Clang doesn't see basic headers

To make sure, compile first with -v flag to see where is it looking for those headers, so you can verify yourself if they exist.

Make sure you have C++ headers installed (e.g. package name libstdc++). Additionally make sure that you compile your C++ files with necessary flags (-std=c++, -stdlib=libstdc++).

2 Comments

If you're going to install libc++-dev, -stdlib needs to be libc++, not libstdc++ (the latter is often the default).
@HolyBlackCat You are right! I just wrote the clang stdlib name, because I was thinking about clang compiler. Edited response to suggest using GCC lib as it is more commonly used on linux. Thanks for pointing it out!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.