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

2018-10-28 Thread Roger Leigh

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


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

2018-10-28 Thread Mateusz Loskot
On Sun, 28 Oct 2018 at 12:44, Osman Zakir  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


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

2018-10-28 Thread Mateusz Loskot
On Sun, 28 Oct 2018 at 11:26, Osman Zakir  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


[CMake] CMake Can't Find Boost.Filesystem in Docker Container

2018-10-28 Thread 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.
Step 6/15 : RUN git clone https://github.com/flexferrum/jinja2cpp && cd 
jinja2cpp && git submodule -q update --init && mkdir build && cd 
build && cmake .. -DCMAKE_INSTALL_PREFIX=../install && cmake --build . 
--target all && cmake --build . --target install
 ---> Running in 02178abe6ef0
Cloning into 'jinja2cpp'...
-- The C compiler identification is GNU 7.3.0
-- The CXX compiler identification is GNU 7.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- expected-lite not found, using submodule
-- Found Git: /usr/bin/git (found version "2.17.1")
-- variant-lite or optional-lite not found, using submodule
-- value-ptr-lite not found, using submodule
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
Call Stack (most recent call first):
  /usr/share/cmake-3.10/Modules/FindBoost.cmake:907 
(_Boost_COMPONENT_DEPENDENCIES)
  /usr/share/cmake-3.10/Modules/FindBoost.cmake:1558 
(_Boost_MISSING_DEPENDENCIES)
  thirdparty/CMakeLists.txt:108 (find_package)


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
Call Stack (most recent call first):
  /usr/share/cmake-3.10/Modules/FindBoost.cmake:907 
(_Boost_COMPONENT_DEPENDENCIES)
  /usr/share/cmake-3.10/Modules/FindBoost.cmake:1558 
(_Boost_MISSING_DEPENDENCIES)
  thirdparty/CMakeLists.txt:108 (find_package)


-- expected-lite not found, using submodule
-- Could NOT find PythonInterp (missing: PYTHON_EXECUTABLE)
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - yes
-- Found Threads: TRUE
-- Configuring done
CMake Error at CMakeLists.txt:81 (add_executable):
  Target "jinja2cpp_tests" links to target "Boost::filesystem" but the target
  was not found.  Perhaps a find_package() call is missing for an IMPORTED
  target, or an ALIAS target is missing?


CMake Error at CMakeLists.txt:49 (add_library):
  Target "jinja2cpp" links to target "Boost::filesystem" but the target was
  not found.  Perhaps a find_package() call is missing for an IMPORTED
  target, or an ALIAS target is missing?


-- Generating done
-- Build files have been written to: /app/jinja2cpp/build
The command '/bin/sh -c git clone https://github.com/flexferrum/jinja2cpp 
&& cd jinja2cpp && git submodule -q update --init && mkdir build && 
cd build && cmake .. -DCMAKE_INSTALL_PREFIX=../install && cmake --build 
. --target all && cmake --build . --target install' returned a non-zero 
code: 1-- 

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