CMake Can't Find Boost.Filesystem in Docker Container

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

CMake Can't Find Boost.Filesystem in Docker Container

Osman Zakir
I'm creating a new email thread for this because the other thread's problem was already solved.  

In the Dockerfile for my project, the build process can't go any farther from the point where I'm trying to build the Jinja2Cpp library.  CMake isn't able to find Boost.Filesystem, but it's still able to build the library and write the files to "/usr/local/Jinja2Cpp/build" just fine.  But the Docker build process exits with a return code of 1 at that point due to the two CMake errors generated.  I've attached the text file I'd written documenting the CMake errors in question.

Should I delete the Docker images and containers created from previous attempts of building this Docker image, just in case there might be some problem there?  I did try deleting all Docker images and containers I had locally before trying to build the Dockerfile again, but had the same problem.    

I've asked this on the Jinja2Cpp GitHub page as well, but I thought I'd ask here as well since it also concerns CMake itself.  I hope you guys can help me out.  Thanks in advance for any replies and/or help.

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake

docker_build_error.txt (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: CMake Can't Find Boost.Filesystem in Docker Container

Mateusz Loskot
On Sun, 28 Oct 2018 at 11:26, Osman Zakir <[hidden email]> wrote:
> In the Dockerfile for my project, the build process can't go any farther from the point where I'm trying to build the Jinja2Cpp library.  CMake isn't able to find Boost.Filesystem, but it's still able to build the library and write the files to "/usr/local/Jinja2Cpp/build" just fine.

TL;TR: That sounds like Boost.Filesystem is not required, just remove
from `find_package` COMPONENTS list.

First, I'd ensure the build works locally, not in any docker image.
If it does not work, request verbose output from `FindBoost.cmake` output b

set(Boost_DEBUG ON)
find_package(Boost ...)

Read it carefully and compare what details the module determines, if
they are correct.
For example, it may detect -gcc55- tag while your environment has
libboost_filesystem...-gcc5-...lib, etc.
There are many details involved and many places where it can get wrong.
For instance, see some listed here
https://github.com/boostorg/gil/blob/develop/CONTRIBUTING.md
search for section
"TIP: If CMake is failing to find Boost libraries, you can try a few hacks:"


Your report above is very general, not sufficient at all to pin point
where may possible problem be.

Best regards,
--
Mateusz Loskot, http://mateusz.loskot.net
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake
--
Mateusz Loskot
http://mateusz.loskot.net
Reply | Threaded
Open this post in threaded view
|

Re: CMake Can't Find Boost.Filesystem in Docker Container

Mateusz Loskot
On Sun, 28 Oct 2018 at 12:44, Osman Zakir <[hidden email]> wrote:
>
> The build does work locally, and I don't get that particular error either.  I'm using Windows 10 Home on my local machine (which also means I have to use Docker Toolbox with VirtualBox, since the Home edition doesn't have Hyper-V).  I can't use Windows containers in Docker images with Docker Toolbox, so I'm having to use a Linux one.  Ubuntu 18.04 in my case.

Install Ubutun 18.04 on Virtual Box and try things out there.

FindBoost.cmake may be moody - it may fail due to many many things.
Boost deployment and FindBoost differs significantly on Windows vs Linux.
Boost can be installed using various naming conventions or layouts,
eg. versioned layout.
CMake changes also affect FindBoost.cmake at times.
Just go to https://gitlab.kitware.com/cmake/cmake/ and search for
FindBoost to see what is happening.
You will have to dig the issue deep and the digging may be difficult
and frustrating.
That is why I would work things on Linux locally (VM) first - Docker
just adds up to the overall complexity.

I see no way to solve your problem for you.

Best regards,
--
Mateusz Loskot, http://mateusz.loskot.net
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake
--
Mateusz Loskot
http://mateusz.loskot.net
Reply | Threaded
Open this post in threaded view
|

Re: CMake Can't Find Boost.Filesystem in Docker Container

Roger Leigh
In reply to this post by Osman Zakir
On 28/10/2018 10:26, Osman Zakir wrote:

> I'm creating a new email thread for this because the other thread's
> problem was already solved.
>
> In the Dockerfile for my project, the build process can't go any farther
> from the point where I'm trying to build the Jinja2Cpp library.  CMake
> isn't able to find Boost.Filesystem, but it's still able to build the
> library and write the files to "/usr/local/Jinja2Cpp/build" just fine.  
> But the Docker build process exits with a return code of 1 at that point
> due to the two CMake errors generated.  I've attached the text file I'd
> written documenting the CMake errors in question.
>
> Should I delete the Docker images and containers created from previous
> attempts of building this Docker image, just in case there might be some
> problem there?  I did try deleting all Docker images and containers I
> had locally before trying to build the Dockerfile again, but had the
> same problem.

You will need to investigate why Boost.Filesystem was not found.  If you
take a look at the various builds in this example repository:
https://gitlab.com/codelibre/ome-common-cpp/pipelines/34467308
you will see FindBoost tested on a range of compilers and platforms,
including three different Linux distributions in docker containers.
It's working in all cases.

Firstly, check that the filesystem library is installed, both runtime
and development packages.  FindBoost checks for the presence of both the
headers and the library itself; both are required for it to be
considered "found".

CMake Warning at /usr/share/cmake-3.10/Modules/FindBoost.cmake:801
(message):
   New Boost version may have incorrect or missing dependencies and imported
   targets

This warning can be a minor warning if you have a slightly newer version
of Boost which CMake isn't yet aware of explicitly.  Should be totally
fine for an older component like Boost.Filesystem.  But it might also
indicate a deeper problem.  You could also download and try the most
recent stable release of CMake, which would likely have better support
for newer Boost releases.

Are you using the Boost provided by the distribution (which distribution
version and Boost version)?  Or a newer or custom build of Boost?

As suggested, run with -DBoost_DEBUG=ON and look through the search
paths.  See why Boost isn't being picked up.  Also look at the CMake
error log.


Regards,
Roger
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake