This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

CMake does not find Boost.FileSystem in docker images

0 votes

Hi,

I run some Integration Tests for my project 'Spacy' with FEniCS on travis with your (awesome!) docker-image. Since 4 days cmake-configuration fails with:
Target "FEniCS_vector" 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?

I can reproduce this locally with the current docker image, with an other version that is about 3 weeks old everything works fine.
Should I just upload the image I have on my local machine or are there better ways to solve this?

Best Regards

Lars

asked Dec 9, 2016 by nahabba FEniCS Novice (190 points)

Which docker image is this? Can you show us a minimal complete example that reproduces the problem?

It is stable:latest (docker pull quay.io/fenicsproject/stable:latest). I don't have much time today and tomorrow, but I will provide a minimal example later this week.

Here is my minimal example:

CMakeLists.txt:


project(fenics-test)

cmake_minimum_required(VERSION 3.1)

find_package(DOLFIN REQUIRED)

include_directories(${DOLFIN_INCLUDE_DIRS})
include_directories(SYSTEM ${DOLFIN_3RD_PARTY_INCLUDE_DIRS})
add_definitions(${DOLFIN_CXX_DEFINITIONS})

add_executable(run main.cpp)
target_link_libraries(run ${DOLFIN_LIBRARIES})

main.cpp:



include <dolfin.h>

int main(){}

and the script that is run in docker,
compile.sh:


!/bin/bash

mkdir -p build && cd build && cmake ..

1 Answer

0 votes
 
Best answer

From your comment above, I see that you are missing include(${DOLFIN_USE_FILE}) after find_package(DOLFIN REQUIRED). Add that and it should work.

See also the CMakeLists.txt files in the demo directory for how to build against DOLFIN.

answered Dec 16, 2016 by johannr FEniCS Expert (17,350 points)
selected Dec 16, 2016 by nahabba

Thx, for spotting my mistake. I checked and it works now.

...