Fatal error in build, include <utility> not found

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Fatal error in build, include <utility> not found

APaschos
I'm trying to customize llvm by adding a header file of my own and tweaking things accordingly.
While building, things go well until a certain point where it stops seeing the includes of my file.

I'm working on Ubuntu 12.04 with llvm-3.1 on a custom target (mips-like), gcc-4.6 and clang-3.2 (i've tried 3.1 too).

From what i've understood, when it builds the first binaries of clang,it switches to this in order to continue the build, consequently using the includes found in build folder and ignoring the defaults (/usr/include, /usr/include/c++/4.6, /usr/include/c++/4.6/x86_64-linux-gnu).
Is there a way to explicitly provide include directories at this point?

Thanks,
Andrew


Last lines of build log:

Linking Release+Asserts executable c-arcmt-test (without symbols)
llvm[4]: ======= Finished Linking Release+Asserts Executable c-arcmt-test (without symbols)
make[4]: Leaving directory `/home/user/LLVM/build/tools/clang/tools/c-arcmt-test'
make[4]: Entering directory `/home/user/LLVM/build/tools/clang/tools/diagtool'
llvm[4]: Compiling DiagTool.cpp for Release+Asserts build
llvm[4]: Compiling diagtool_main.cpp for Release+Asserts build
llvm[4]: Compiling ListWarnings.cpp for Release+Asserts build
llvm[4]: Linking Release+Asserts executable diagtool (without symbols)
llvm[4]: ======= Finished Linking Release+Asserts Executable diagtool (without symbols)
make[4]: Leaving directory `/home/user/LLVM/build/tools/clang/tools/diagtool'
make[4]: Entering directory `/home/user/LLVM/build/tools/clang/tools/clang-check'
llvm[4]: Compiling ClangCheck.cpp for Release+Asserts build
llvm[4]: Linking Release+Asserts executable clang-check (without symbols)
llvm[4]: ======= Finished Linking Release+Asserts Executable clang-check (without symbols)
make[4]: Leaving directory `/home/user/LLVM/build/tools/clang/tools/clang-check'
make[3]: Leaving directory `/home/user/LLVM/build/tools/clang/tools'
make[3]: Entering directory `/home/user/LLVM/build/tools/clang/runtime'
make[4]: Entering directory `/home/user/LLVM/build/tools/clang/runtime/libcxx'
make[4]: Nothing to be done for `all'.
make[4]: Leaving directory `/home/user/LLVM/build/tools/clang/runtime/libcxx'
make[4]: Entering directory `/home/user/LLVM/build/tools/clang/runtime/compiler-rt'
make[4]: Nothing to be done for `all'.
make[4]: Leaving directory `/home/user/LLVM/build/tools/clang/runtime/compiler-rt'
make[3]: Leaving directory `/home/user/LLVM/build/tools/clang/runtime'
make[3]: Entering directory `/home/user/LLVM/build/tools/clang/docs'
make[4]: Entering directory `/home/user/LLVM/build/tools/clang/docs/tools'
make[4]: Nothing to be done for `all'.
make[4]: Leaving directory `/home/user/LLVM/build/tools/clang/docs/tools'
make[3]: Leaving directory `/home/user/LLVM/build/tools/clang/docs'
make[3]: Entering directory `/home/user/LLVM/build/tools/clang/unittests'
make[4]: Entering directory `/home/user/LLVM/build/tools/clang/unittests/Tooling'
llvm[4]: Compiling CompilationDatabaseTest.cpp for Release+Asserts build
make[4]: Entering directory `/home/user/LLVM/build/tools/clang/unittests/Basic'
make[4]: Entering directory `/home/user/LLVM/build/tools/clang/unittests/Lex'
make[4]: Entering directory `/home/user/LLVM/build/tools/clang/unittests/Frontend'
llvm[4]: Compiling LexerTest.cpp for Release+Asserts build
llvm[4]: Compiling FileManagerTest.cpp for Release+Asserts build
llvm[4]: Compiling FrontendActionTest.cpp for Release+Asserts build
llvm[4]: Compiling SourceManagerTest.cpp for Release+Asserts build
llvm[4]: Compiling PreprocessingRecordTest.cpp for Release+Asserts build
llvm[4]: Linking Release+Asserts unit test Lex (without symbols)
llvm[4]: Linking Release+Asserts unit test Basic (without symbols)
llvm[4]: ======= Finished Linking Release+Asserts Unit test Lex (without symbols)
make[4]: Leaving directory `/home/user/LLVM/build/tools/clang/unittests/Lex'
llvm[4]: Compiling ToolingTest.cpp for Release+Asserts build
llvm[4]: ======= Finished Linking Release+Asserts Unit test Basic (without symbols)
make[4]: Leaving directory `/home/user/LLVM/build/tools/clang/unittests/Basic'
llvm[4]: Linking Release+Asserts unit test Tooling (without symbols)
llvm[4]: Linking Release+Asserts unit test Frontend (without symbols)
llvm[4]: ======= Finished Linking Release+Asserts Unit test Tooling (without symbols)
make[4]: Leaving directory `/home/user/LLVM/build/tools/clang/unittests/Tooling'
llvm[4]: ======= Finished Linking Release+Asserts Unit test Frontend (without symbols)
make[4]: Leaving directory `/home/user/LLVM/build/tools/clang/unittests/Frontend'
make[3]: Leaving directory `/home/user/LLVM/build/tools/clang/unittests'
make[2]: Leaving directory `/home/user/LLVM/build/tools/clang'
make[1]: Leaving directory `/home/user/LLVM/build/tools'
make[1]: Entering directory `/home/user/LLVM/build/runtime'
make[2]: Entering directory `/home/user/LLVM/build/runtime/libprofile'
llvm[2]: Compiling BasicBlockTracing.c for Release+Asserts build (PIC)
llvm[2]: Compiling CommonProfiling.c for Release+Asserts build (PIC)
llvm[2]: Compiling EdgeProfiling.c for Release+Asserts build (PIC)
llvm[2]: Compiling GCDAProfiling.c for Release+Asserts build (PIC)
In file included from /home/user/LLVM/llvm-3.1.src/runtime/libprofile/GCDAProfiling.c:23:
In file included from /home/user/LLVM/build/include/llvm/Support/DataTypes.h:74:
/home/user/LLVM/llvm-3.1.src/include/llvm/Support/myfile.hpp:81:10: fatal error: 'utility' file not found
#include <utility>
         ^
1 error generated.
Reply | Threaded
Open this post in threaded view
|

Re: Fatal error in build, include <utility> not found

Duncan Sands
Hi Andrew, I suggest you do a verbose build (make VERBOSE=1) in order to see
exactly which command is being used to compile that file.

Ciao, Duncan.

On 03/01/13 14:50, APaschos wrote:

> I'm trying to customize llvm by adding a header file of my own and tweaking
> things accordingly.
> While building, things go well until a certain point where it stops seeing
> the includes of my file.
>
> I'm working on Ubuntu 12.04 with llvm-3.1 on a custom target (mips-like),
> gcc-4.6 and clang-3.2 (i've tried 3.1 too).
>
>  From what i've understood, when it builds the first binaries of clang,it
> switches to this in order to continue the build, consequently using the
> includes found in build folder and ignoring the defaults (/usr/include,
> /usr/include/c++/4.6, /usr/include/c++/4.6/x86_64-linux-gnu).
> Is there a way to explicitly provide include directories at this point?
>
> Thanks,
> Andrew
>
>
> Last lines of build log:
>
> Linking Release+Asserts executable c-arcmt-test (without symbols)
> llvm[4]: ======= Finished Linking Release+Asserts Executable c-arcmt-test
> (without symbols)
> make[4]: Leaving directory
> `/home/user/LLVM/build/tools/clang/tools/c-arcmt-test'
> make[4]: Entering directory
> `/home/user/LLVM/build/tools/clang/tools/diagtool'
> llvm[4]: Compiling DiagTool.cpp for Release+Asserts build
> llvm[4]: Compiling diagtool_main.cpp for Release+Asserts build
> llvm[4]: Compiling ListWarnings.cpp for Release+Asserts build
> llvm[4]: Linking Release+Asserts executable diagtool (without symbols)
> llvm[4]: ======= Finished Linking Release+Asserts Executable diagtool
> (without symbols)
> make[4]: Leaving directory
> `/home/user/LLVM/build/tools/clang/tools/diagtool'
> make[4]: Entering directory
> `/home/user/LLVM/build/tools/clang/tools/clang-check'
> llvm[4]: Compiling ClangCheck.cpp for Release+Asserts build
> llvm[4]: Linking Release+Asserts executable clang-check (without symbols)
> llvm[4]: ======= Finished Linking Release+Asserts Executable clang-check
> (without symbols)
> make[4]: Leaving directory
> `/home/user/LLVM/build/tools/clang/tools/clang-check'
> make[3]: Leaving directory `/home/user/LLVM/build/tools/clang/tools'
> make[3]: Entering directory `/home/user/LLVM/build/tools/clang/runtime'
> make[4]: Entering directory
> `/home/user/LLVM/build/tools/clang/runtime/libcxx'
> make[4]: Nothing to be done for `all'.
> make[4]: Leaving directory
> `/home/user/LLVM/build/tools/clang/runtime/libcxx'
> make[4]: Entering directory
> `/home/user/LLVM/build/tools/clang/runtime/compiler-rt'
> make[4]: Nothing to be done for `all'.
> make[4]: Leaving directory
> `/home/user/LLVM/build/tools/clang/runtime/compiler-rt'
> make[3]: Leaving directory `/home/user/LLVM/build/tools/clang/runtime'
> make[3]: Entering directory `/home/user/LLVM/build/tools/clang/docs'
> make[4]: Entering directory `/home/user/LLVM/build/tools/clang/docs/tools'
> make[4]: Nothing to be done for `all'.
> make[4]: Leaving directory `/home/user/LLVM/build/tools/clang/docs/tools'
> make[3]: Leaving directory `/home/user/LLVM/build/tools/clang/docs'
> make[3]: Entering directory `/home/user/LLVM/build/tools/clang/unittests'
> make[4]: Entering directory
> `/home/user/LLVM/build/tools/clang/unittests/Tooling'
> llvm[4]: Compiling CompilationDatabaseTest.cpp for Release+Asserts build
> make[4]: Entering directory
> `/home/user/LLVM/build/tools/clang/unittests/Basic'
> make[4]: Entering directory
> `/home/user/LLVM/build/tools/clang/unittests/Lex'
> make[4]: Entering directory
> `/home/user/LLVM/build/tools/clang/unittests/Frontend'
> llvm[4]: Compiling LexerTest.cpp for Release+Asserts build
> llvm[4]: Compiling FileManagerTest.cpp for Release+Asserts build
> llvm[4]: Compiling FrontendActionTest.cpp for Release+Asserts build
> llvm[4]: Compiling SourceManagerTest.cpp for Release+Asserts build
> llvm[4]: Compiling PreprocessingRecordTest.cpp for Release+Asserts build
> llvm[4]: Linking Release+Asserts unit test Lex (without symbols)
> llvm[4]: Linking Release+Asserts unit test Basic (without symbols)
> llvm[4]: ======= Finished Linking Release+Asserts Unit test Lex (without
> symbols)
> make[4]: Leaving directory `/home/user/LLVM/build/tools/clang/unittests/Lex'
> llvm[4]: Compiling ToolingTest.cpp for Release+Asserts build
> llvm[4]: ======= Finished Linking Release+Asserts Unit test Basic (without
> symbols)
> make[4]: Leaving directory
> `/home/user/LLVM/build/tools/clang/unittests/Basic'
> llvm[4]: Linking Release+Asserts unit test Tooling (without symbols)
> llvm[4]: Linking Release+Asserts unit test Frontend (without symbols)
> llvm[4]: ======= Finished Linking Release+Asserts Unit test Tooling (without
> symbols)
> make[4]: Leaving directory
> `/home/user/LLVM/build/tools/clang/unittests/Tooling'
> llvm[4]: ======= Finished Linking Release+Asserts Unit test Frontend
> (without symbols)
> make[4]: Leaving directory
> `/home/user/LLVM/build/tools/clang/unittests/Frontend'
> make[3]: Leaving directory `/home/user/LLVM/build/tools/clang/unittests'
> make[2]: Leaving directory `/home/user/LLVM/build/tools/clang'
> make[1]: Leaving directory `/home/user/LLVM/build/tools'
> make[1]: Entering directory `/home/user/LLVM/build/runtime'
> make[2]: Entering directory `/home/user/LLVM/build/runtime/libprofile'
> llvm[2]: Compiling BasicBlockTracing.c for Release+Asserts build (PIC)
> llvm[2]: Compiling CommonProfiling.c for Release+Asserts build (PIC)
> llvm[2]: Compiling EdgeProfiling.c for Release+Asserts build (PIC)
> llvm[2]: Compiling GCDAProfiling.c for Release+Asserts build (PIC)
> In file included from
> /home/user/LLVM/llvm-3.1.src/runtime/libprofile/GCDAProfiling.c:23:
> In file included from
> /home/user/LLVM/build/include/llvm/Support/DataTypes.h:74:
> /home/user/LLVM/llvm-3.1.src/include/llvm/Support/myfile.hpp:81:10: fatal
> error: 'utility' file not found
> #include <utility>
>           ^
> 1 error generated.
>
>
>
> --
> View this message in context: http://llvm.1065342.n5.nabble.com/Fatal-error-in-build-include-utility-not-found-tp53037.html
> Sent from the LLVM - Dev mailing list archive at Nabble.com.
> _______________________________________________
> LLVM Developers mailing list
> [hidden email]         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>

_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: Fatal error in build, include <utility> not found

APaschos
Hi Duncan,

I did. I know what the error is. It cannot see the include directories it could see before (myfile.hpp is called again on previous code).
I even tried copying the utility file in build/include. It worked but hit another include error because another directory could not be seen.
Obviously the solution is not to copy the entire directories to build/include but make clang see them.
Reply | Threaded
Open this post in threaded view
|

Re: Fatal error in build, include <utility> not found

Charles Davis
In reply to this post by APaschos

On Jan 3, 2013, at 6:50 AM, APaschos wrote:
> llvm[2]: Compiling GCDAProfiling.c for Release+Asserts build (PIC)
Well here's your problem! You're trying to include a C++ header (your custom header, "llvm/Support/myfile.hpp") from a C header (<llvm/Support/DataTypes.h>). There are a couple of ways you could solve this: either don't include your custom header from DataTypes.h, or guard it with an #ifdef __cplusplus block.

Chip

> In file included from
> /home/user/LLVM/llvm-3.1.src/runtime/libprofile/GCDAProfiling.c:23:
> In file included from
> /home/user/LLVM/build/include/llvm/Support/DataTypes.h:74:
> /home/user/LLVM/llvm-3.1.src/include/llvm/Support/myfile.hpp:81:10: fatal
> error: 'utility' file not found
> #include <utility>
>         ^
> 1 error generated.


_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: Fatal error in build, include <utility> not found

APaschos
Thank you Charles. That was the problem. It compiled just fine.
Thanks again!