[LLVMdev] A bunch of errors while installing VMKit and compiling LLVM

Nicolas Geoffray nicolas.geoffray at gmail.com
Tue Oct 25 10:45:22 PDT 2011


Hi Sergii,

On Tue, Oct 25, 2011 at 1:15 PM, Vozniuk, Sergii <sergii.vozniuk at epfl.ch>wrote:

> Hi everyone
>
> I wasn't successful in running VMKit on my machine and I'm still struggling
> with doing it.
> Maybe someone had at least one of my problems and knows how to solve it
> (because it seems to me that I ran into every problem that could occur :) ).
>
>
> Thanks in advance,
> Sergii.
>
> So here is the story:
> I have a fresh installation of Ubuntu 11.04 64bit with all important
> updates.
> I'll tell in advance that I was careful in trying to compile LLVM and VMKit
> (i.e. I had only one version of llvm-gcc and/or clang installed at a
> time, I always ran "make clean" before "make" etc.)
>
> To build VMKit we have first to checkout and build LLVM. The VMKit "Getting
> started"
> guide states: Make sure you have llvm-gcc or clang available when you
> configure LLVM.
> Alternatively, you can also checkout clang in llvm-scr/tools.
>
> The following steps are not done in sequence, they are alternatives
>
>     1. Install llvm-gcc from Ubuntu repository. In this case the LLVM
> configuration
>        script doesn't see the gcc compiler although it's installed
>         ~/llvm/llvm-build$ sudo apt-get install llvm-gcc-4.5
>         ~/llvm/llvm-build$ ../llvm-src/configure --enable-optimized
>             checking for clang... no
>             checking for llvm-gcc... llvm-gcc
>             checking for C compiler default output file name... configure:
>
>             error: C compiler cannot create executables
>
>     2. Install older version of llvm-gcc from Ubuntu repository. This
> installation
>        doesn't create llvm-gcc executable but instead creates llvm-gcc-4.2
> so I
>        created a symlink to llvm-gcc-4.2. named llvm-gcc. The LLVM
> configuration goes fine
>        but building LLVM produces an error
>
>         ~/llvm/llvm-build$ sudo apt-get install llvm-gcc-4.2
>         ~/llvm/llvm-build$ sudo ln -s /usr/bin/llvm-gcc-4.2
> /usr/bin/llvm-gcc
>         ~/llvm/llvm-build$ ../llvm-src/configure --enable-optimized
>         ~/llvm/llvm-build$ make
>
>             llvm[1]: Compiling Host.cpp for Release+Asserts build
>             In file included from /usr/include/c++/4.5/cerrno:43:0,
>                      from
> /home/svozniuk/llvm/llvm-src/lib/Support/Unix/Unix.h:27,
>                      from
> /home/svozniuk/llvm/llvm-src/lib/Support/Unix/Host.inc:21,
>                      from
> /home/svozniuk/llvm/llvm-src/lib/Support/Host.cpp:20:
>             /usr/include/errno.h:69:13: error: multiple types in one
> declaration
>             /usr/include/errno.h:69:13: error: declaration does not declare
> anything
>             /bin/rm: cannot remove
> `/home/svozniuk/llvm/llvm-build/lib/Support/Release+Asserts/Host.d.tmp': No
> such file or directory
>             make[1]: ***
> [/home/svozniuk/llvm/llvm-build/lib/Support/Release+Asserts/Host.o] Error 1
>             make[1]: Leaving directory
> `/home/svozniuk/llvm/llvm-build/lib/Support'
>             make: *** [all] Error 1
>
>     3. Download llvm-gcc4.2-2.9-x86_64-linux archive from llvm.org,
> extract
>        it and manually add to the PATH. The configuration script finishes
> successfully
>        but building LLVM produces an error
>
>         ~/llvm/llvm-build$ export
> PATH=$PATH:/home/svozniuk/llvm/llvm-gcc4.2-2.9-x86_64-linux/bin/
>         ~/llvm/llvm-build$ ../llvm-src/configure --enable-optimized
>         ~/llvm/llvm-build$ make
>             llvm[1]: Compiling CommandLine.cpp for Release+Asserts build
>             In file included from
> /home/svozniuk/llvm/llvm-src/lib/Support/CommandLine.cpp:25:
>
> /home/svozniuk/llvm/llvm-src/include/llvm/Support/system_error.h:499: error:
> ‘EAFNOSUPPORT’ was not declared in this scope
>
> /home/svozniuk/llvm/llvm-src/include/llvm/Support/system_error.h:500: error:
> ‘EADDRINUSE’ was not declared in this scope
>             .........And another 50 errors of the same type follow.........
>
>
>     4. Install clang from Ubuntu repository (All ways (which I know of) to
> build LLVM with
>        llvm-gcc available have failed so now I switch to building LLVM with
> clang available).
>        The configuration finishes successfully but again I get an error
> trying to build LLVM
>
>         ~/llvm/llvm-build$ sudo apt-get install clang
>         ~/llvm/llvm-build$ ../llvm-src/configure --enable-optimized
>         ~/llvm/llvm-build$ make
>
>             llvm[1]: Compiling APFloat.cpp for Release+Asserts build
>             In file included from
> /home/svozniuk/llvm/llvm-src/lib/Support/APFloat.cpp:15:
>             In file included from
> /home/svozniuk/llvm/llvm-src/include/llvm/ADT/APFloat.h:104:
>             In file included from
> /home/svozniuk/llvm/llvm-src/include/llvm/ADT/APInt.h:18:
>             In file included from
> /home/svozniuk/llvm/llvm-src/include/llvm/ADT/ArrayRef.h:13:
>             In file included from
> /home/svozniuk/llvm/llvm-src/include/llvm/ADT/SmallVector.h:17:
>
> /home/svozniuk/llvm/llvm-src/include/llvm/Support/type_traits.h:20:10: fatal
> error: 'utility' file not found
>             #include <utility>
>                  ^
>             1 error generated.
>             make[1]: ***
> [/home/svozniuk/llvm/llvm-build/lib/Support/Release+Asserts/APFloat.o] Error
> 1
>
>
>
>     5. Checkout clang to llvm-src-clang/tools and build LLVM this way. LLVM
> Configuration script finishes
>        with no errors. LLVM builds successfully. VMKit configuration script
> finishes with no errors.
>

I believe option 5 is the only solution that works right now :( You're not
the first one that had problems with pre-installed llvm-gcc or clang. I'll
update the web page to say that one *must* checkout clang in tools/clang


>        Building VMKit produces an error (segmentation fault)
>         ~/llvm/llvm-build-clang$ ../llvm-src-clang/configure
> --enable-optimized
>         ~/llvm/llvm-build-clang$ make
>         ~/llvm/vmkit$ ./configure
> --with-llvmsrc="/home/svozniuk/llvm/llvm-src-clang"
> --with-llvmobj="/home/svozniuk/llvm/llvm-build-clang"
> --with-gnu-classpath-glibj="/home/svozniuk/llvm/classpath-0.97.2"
> --with-gnu-classpath-libs="/home/svozniuk/llvm/classpath-0.97.2/lib"
> --with-mmtk-plan=org.mmtk.plan.copyms.CopyMS
>         ~/llvm/vmkit$ make
>
>
>             llvm[2]: Building Release+Asserts Bytecode Module MMTKAlloc.bc
>             make[2]: Leaving directory
> `/home/svozniuk/llvm/vmkit/mmtk/mmtk-alloc'
>             make[2]: Entering directory
> `/home/svozniuk/llvm/vmkit/mmtk/java'
>             make[2]: buildfile: Command not found
>             make[2]: [all] Error 127 (ignored)
>             llvm[2]: Building Release+Asserts mmtk-vmkit.jar all
>             Can't find zip file.
>             0  opt             0x000000000093449f
>             1  opt             0x0000000000934fda
>             2  libpthread.so.0 0x00002b867fa26c60
>             3  MMTKMagic.so    0x00002b8680977769
>             4  opt             0x00000000008d0177
> llvm::MPPassManager::runOnModule(llvm::Module&) + 535
>             5  opt             0x00000000008d02db
> llvm::PassManagerImpl::run(llvm::Module&) + 187
>             6  opt             0x00000000004c4c9f main + 5791
>             7  libc.so.6       0x00002b86805faeff __libc_start_main + 255
>             8  opt             0x00000000004b4569
>             Stack dump:
>             0.    Program arguments:
> /home/svozniuk/llvm/llvm-build-clang/Release+Asserts/bin/opt
> -load=/home/svozniuk/llvm/vmkit/Release+Asserts/lib/MMTKMagic.so
> -std-compile-opts -LowerJavaRT -f mmtk-vmkit.bc -o mmtk-vmkit-optimized.bc
>             1.    Running pass 'Remove references to RT' on module
> 'mmtk-vmkit.bc'.
>             make[2]: *** [all] Segmentation fault
>             make[2]: Leaving directory
> `/home/svozniuk/llvm/vmkit/mmtk/java'
>             make[1]: *** [all] Error 1
>             make[1]: Leaving directory `/home/svozniuk/llvm/vmkit/mmtk'
>             make: *** [all] Error 1
>

Do you have 'ant'? I think we forget to check if ant is installed on your
machine :( If not, please install it. If yes, could you also attach the
output of make ENABLE_OPTIMIZED=1 VERBOSE=1?

Thanks!
Nicolas



>
>
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20111025/5d54116c/attachment.html>


More information about the llvm-dev mailing list