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

Docker Container - YAML issue #35

Closed
vsoch opened this issue Feb 24, 2019 · 6 comments
Closed

Docker Container - YAML issue #35

vsoch opened this issue Feb 24, 2019 · 6 comments

Comments

@vsoch
Copy link

vsoch commented Feb 24, 2019

I'm trying to build a Dockerfile, so far I have:

FROM ubuntu:18.04

ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get install -y g++ gcc \
                                         cmake clang-3.9 \
                                         wget \
                                         libfreetype6 \
                                         libyaml-cpp-dev \
                                         libsdl2-dev \
                                         software-properties-common \
                                         freetype2-demos \
                                         libfreetype6-dev

# above installs cmake 3.10.2, gcc 7.3.0

# Boost
RUN wget https://dl.bintray.com/boostorg/release/1.66.0/source/boost_1_66_0.tar.gz && \
    tar -xzvf boost_1_66_0.tar.gz && \
    cd cd boost_1_66_0 && \
    ./bootstrap.sh && \
    ./b2 install

# boost header files in /usr/local/include/boost
# compiled libraries in /usr/local/lib

RUN mkdir -p /code

ADD . /code
WORKDIR /code

RUN cd src && \
    cmake -DCMAKE_INCLUDE_PATH=/usr/local/lib -DHALLEY_PATH=../halley -DBUILD_HALLEY_TOOLS=1 -DBUILD_HALLEY_TESTS=0 -DCMAKE_LIBRARY_PATH=/usr/local/lib -DBOOST_ROOT=/usr/local/include/boost .. && \
    make

Make gets somewhat far, but I error out on

[ 83%] Built target halley-asio
[ 83%] Building CXX object src/tools/tools/CMakeFiles/halley-tools.dir/src/assets/importers/config_importer.cpp.o
/code/src/tools/tools/src/assets/importers/config_importer.cpp: In static member function 'static Halley::ConfigNode Halley::ConfigImporter::parseYAMLNode(const YAML::Node&)':
/code/src/tools/tools/src/assets/importers/config_importer.cpp:50:34: error: 'const class YAML::Node' has no member named 'Mark'
  result.setOriginalPosition(node.Mark().line, node.Mark().column);
                                  ^~~~
/code/src/tools/tools/src/assets/importers/config_importer.cpp:50:52: error: 'const class YAML::Node' has no member named 'Mark'
  result.setOriginalPosition(node.Mark().line, node.Mark().column);
                                                    ^~~~
src/tools/tools/CMakeFiles/halley-tools.dir/build.make:350: recipe for target 'src/tools/tools/CMakeFiles/halley-tools.dir/src/assets/importers/config_importer.cpp.o' failed
make[2]: *** [src/tools/tools/CMakeFiles/halley-tools.dir/src/assets/importers/config_importer.cpp.o] Error 1
CMakeFiles/Makefile2:769: recipe for target 'src/tools/tools/CMakeFiles/halley-tools.dir/all' failed
make[1]: *** [src/tools/tools/CMakeFiles/halley-tools.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
root@5b23cdcb9144:/code/src# 

I tried different installations of yaml and decided it would be easiest to ask for your help! Have you seen this before?

@ghost
Copy link

ghost commented Feb 24, 2019

Ubuntu ships with with old versions of yaml-cpp... you'll have to go and get a version that's >= 0.5.3.

@vsoch
Copy link
Author

vsoch commented Feb 24, 2019

Ah that must be it! I'll give it a try.

@vsoch
Copy link
Author

vsoch commented Feb 24, 2019

Latest (0.6.2) got a bit farther, but not much:

[ 96%] Building CXX object src/tools/cmd/CMakeFiles/halley-cmd.dir/src/main.cpp.o
[ 96%] Linking CXX executable ../../../../bin/halley-cmd
../../../../lib/libhalley-tools.a(animation_importer.cpp.o): In function `YAML::detail::node& YAML::detail::node_data::get<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, boost::shared_ptr<YAML::detail::memory_holder>)':
animation_importer.cpp:(.text._ZN4YAML6detail9node_data3getINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEERNS0_4nodeERKT_N5boost10shared_ptrINS0_13memory_holderEEE[_ZN4YAML6detail9node_data3getINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEERNS0_4nodeERKT_N5boost10shared_ptrINS0_13memory_holderEEE]+0xd4): undefined reference to `YAML::detail::node_data::convert_to_map(boost::shared_ptr<YAML::detail::memory_holder>)'
collect2: error: ld returned 1 exit status
src/tools/cmd/CMakeFiles/halley-cmd.dir/build.make:106: recipe for target '../bin/halley-cmd' failed
make[2]: *** [../bin/halley-cmd] Error 1
CMakeFiles/Makefile2:829: recipe for target 'src/tools/cmd/CMakeFiles/halley-cmd.dir/all' failed
make[1]: *** [src/tools/cmd/CMakeFiles/halley-cmd.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
root@5b23cdcb9144:/code/src# cd /

I'm trying 0.5.3 exact version now.

@vsoch
Copy link
Author

vsoch commented Feb 24, 2019

Success!

I'm going to build the container from scratch now, and figure out how to get access to the video devices. I think worst case scenario I can run a Singularity container (more seamless connection to host) and (fingers crossed) get some of the tests working. If I put together a recipe that works I'll write up some instructions and add the finished Dockerfile / Singularity recipe to the repo - minimally others can pull the container and have a quick way to get started!

@vsoch
Copy link
Author

vsoch commented Feb 24, 2019

Thanks for your help! If others run into this in the future, your advice was spot on - and even the (most recent) versions will bug out too, so finding the exact version is the way to go. E.g.,:

# yaml-cpp
RUN wget https://github.com/jbeder/yaml-cpp/archive/yaml-cpp-0.5.3.tar.gz && \
    tar -xzvf yaml-cpp-0.5.3.tar.gz && \
    cd yaml-cpp-yaml-cpp-0.5.3 && \
    mkdir build && \ 
    cd build && \
    cmake -DBUILD_SHARED_LIBS=ON .. && \
    make && \
    make install

@vsoch vsoch closed this as completed Feb 24, 2019
@ghost
Copy link

ghost commented Feb 24, 2019

Nice one :)

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