hermit-os / kernel

A Rust-based, lightweight unikernel.
http://hermit-os.org
Apache License 2.0
1.16k stars 85 forks source link

Error in installation #3

Closed carlosb1 closed 6 years ago

carlosb1 commented 6 years ago

I am following the README steps to install the library but I couldn't. I installed the dependencies that are necessary. Also I added these packages:

sudo apt-get install binutils-hermit newlib-hermit pte-hermit-rs gcc-hermit libhermit-rs apt-get install qemu-system-x86

And finally, I checked that I have installed the library that It gives error: libmpfr-dev - multiple precision floating-point computation developers tools libmpfr4 - multiple precision floating-point computation libgmpv4-dev - Multiprecision arithmetic library developers tools (GCC 4.x compatible) libmpfrc++-dev - multi-precision floating point number class for C++

Anyway, I receive this error:

carlosb@carlosb-UX530UX ~/Desktop/tools/libhermit-rs/build $ cmake ..
-- The ASM_NASM compiler identification is NASM
-- Found assembler: /usr/bin/nasm
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
-- The Fortran compiler identification is unknown
/opt/hermit/libexec/gcc/x86_64-hermit/6.3.0/cc1: error while loading shared libraries: libmpfr.so.6: cannot open shared object file: No such file or directory
-- Check for working C compiler: /opt/hermit/bin/x86_64-hermit-gcc
-- Check for working C compiler: /opt/hermit/bin/x86_64-hermit-gcc -- broken
CMake Error at /home/carlosb/Desktop/tools/cmake-3.11.3-Linux-x86_64/share/cmake-3.11/Modules/CMakeTestCCompiler.cmake:52 (message):
  The C compiler

    "/opt/hermit/bin/x86_64-hermit-gcc"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /home/carlosb/Desktop/tools/libhermit-rs/build/CMakeFiles/CMakeTmp

    Run Build Command:"/usr/bin/make" "cmTC_9ee17/fast"
    /usr/bin/make -f CMakeFiles/cmTC_9ee17.dir/build.make CMakeFiles/cmTC_9ee17.dir/build
    make[1]: Entering directory '/home/carlosb/Desktop/tools/libhermit-rs/build/CMakeFiles/CMakeTmp'
    Building C object CMakeFiles/cmTC_9ee17.dir/testCCompiler.c.obj
    /opt/hermit/bin/x86_64-hermit-gcc -Wl,--gc-sections    -o CMakeFiles/cmTC_9ee17.dir/testCCompiler.c.obj   -c /home/carlosb/Desktop/tools/libhermit-rs/build/CMakeFiles/CMakeTmp/testCCompiler.c
    /opt/hermit/libexec/gcc/x86_64-hermit/6.3.0/cc1: error while loading shared libraries: libmpfr.so.6: cannot open shared object file: No such file or directory
    CMakeFiles/cmTC_9ee17.dir/build.make:65: recipe for target 'CMakeFiles/cmTC_9ee17.dir/testCCompiler.c.obj' failed
    make[1]: *** [CMakeFiles/cmTC_9ee17.dir/testCCompiler.c.obj] Error 1
    make[1]: Leaving directory '/home/carlosb/Desktop/tools/libhermit-rs/build/CMakeFiles/CMakeTmp'
    Makefile:126: recipe for target 'cmTC_9ee17/fast' failed
    make: *** [cmTC_9ee17/fast] Error 2

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  cmake/HermitCore.cmake:96 (enable_language)
  CMakeLists.txt:4 (include)

-- Configuring incomplete, errors occurred!
See also "/home/carlosb/Desktop/tools/libhermit-rs/build/CMakeFiles/CMakeOutput.log".
See also "/home/carlosb/Desktop/tools/libhermit-rs/build/CMakeFiles/CMakeError.log".
carlosb1 commented 6 years ago

Finally, I tried the docker to apply a clean installation, but in the middle of the installation process I receive this:

   Compiling raw-cpuid v3.1.0
   Compiling hermit-rs v0.3.0 (file:///home/projects/libhermit-rs/librs)
error[E0432]: unresolved import `alloc::heap`
  --> src/mm/allocator.rs:36:12
   |
36 | use alloc::heap::Layout;
   |            ^^^^ Could not find `heap` in `alloc`

error[E0432]: unresolved import `core::alloc::Opaque`
  --> src/mm/allocator.rs:37:32
   |
37 | use core::alloc::{GlobalAlloc, Opaque};
   |                                ^^^^^^ no `Opaque` in `alloc`

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0432`.
error: Could not compile `hermit-rs`.
stlankes commented 6 years ago

Which operating systems do you use? I tested the packages only on Ubuntu 18.04.

Do you use the latest Rust version (nightly build)?

carlosb1 commented 6 years ago

I see (currently Ubuntu 18.04 only) <- I use the dockerfile from the repository. But it seems that the downloaded rust version didn't work:

# Install Rust toolchain
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain nightly
RUN /root/.cargo/bin/cargo install xargo
RUN /root/.cargo/bin/rustup component add rust-src
stlankes commented 6 years ago

Excuse for my late response. I din't find to answer your question.

Do you get an error message from https://sh.rustup.rs?

stlankes commented 6 years ago

@carlosb1 I revised my scripts (https://github.com/hermitcore/hermit-toolchain) to build the complete toolchain for the Rust-based version of HermitCore. Following steps should work on all Linux-based systems:

$ git clone -b path2rs git@github.com:hermitcore/hermit-toolchain.git
$ ./toolchain.sh x86_64-hermit /home/user/tmp

Afterwards you will find the toolchain in the directory /home/user/tmp.

carlosb1 commented 6 years ago

I am going to check it. Also, I am in the slack channel

stlankes commented 6 years ago

I just updated the master branch. I have forgotten to update the Rust compiler on my system. For our kernel we have to use the compiler from the nightly channel. My code wasn't working with latest version. Now, it should work.

carlosb1 commented 6 years ago

It seems that I ran in the docker image... I will play a little with the project to test it. Does it exist any project roadmap?

stlankes commented 6 years ago

Yes, this is missing. I have to cleanup our internal documents. Maybe it is a good starting point for a clear roadmap.