cmake flag to skip a specific example?

53 views
Skip to first unread message

David Montiel

unread,
Feb 6, 2025, 10:40:38 AM2/6/25
to deal.II User Group
I am trying to install deal.II in a cluster and somehow the compiler is not recognizing std::filesystem which is used in step-83. However step-83 isn't marked as having unmet dependencies. 

As a results the "make" I use for building deal.II fails when building step-83

I can probably modify the CMakeLists.txt file within step-83 but I was hoping to instead introduce a flag during CMake to force skip step-83 instead. 

Can I do that without disabling the rest of the examples, as in DEAL_II_COMPONENT_EXAMPLES=OFF?

Any other better options?

Thank you!

David


Wolfgang Bangerth

unread,
Feb 6, 2025, 10:57:28 AM2/6/25
to dea...@googlegroups.com
If you don't actually care about step-83, then just comment out the offending
lines in step-83 before compiling deal.II. The program won't work correctly,
of course, but at least you can proceed with the installation.

Out of curiosity: What is the compiler you are using, and how does the error
message you get look like?

Best
W.

--
------------------------------------------------------------------------
Wolfgang Bangerth email: bang...@colostate.edu
www: http://www.math.colostate.edu/~bangerth/


Matthias Maier

unread,
Feb 6, 2025, 11:27:11 AM2/6/25
to dea...@googlegroups.com

On Thu, Feb 6, 2025, at 09:40 CST, David Montiel <dmon...@umich.edu> wrote:

> Can I do that without disabling the rest of the examples, as in
> DEAL_II_COMPONENT_EXAMPLES=OFF?

You can simply set -DDEAL_II_COMPILE_EXAMPLES=OFF and it will install
the examples in source form only.

We have removed compilation of example steps from the build system
entirely in the current development version.

Best,
Matthias

David Montiel

unread,
Feb 6, 2025, 12:11:27 PM2/6/25
to deal.II User Group
Thank you both for your suggestions!

Wolfgang, I am using ICC 2021.5.0 which as far as I know fully supports the C++17 standard, including the std::filesystem library. So who knows what is going on. 

I tried including the flag -DDEAL_II_CXX_FLAGS="-lstdc++fs" but that still didn't work. 

The error message I am getting is 

CMakeFiles/example_step_83_release.dir/step-83/step-83.cc.o:step-83.cc:function Step83::CathodeRaySimulator<2>::checkpoint(): error: undefined reference to 'std::filesystem::__cxx11::path::_M_split_cmpts()'

CMakeFiles/example_step_83_release.dir/step-83/step-83.cc.o:step-83.cc:function Step83::CathodeRaySimulator<2>::checkpoint(): error: undefined reference to 'std::filesystem::__cxx11::directory_iterator::directory_iterator(std::filesystem::__cxx11::path const&, std::filesystem::directory_options, std::error_code*)'

CMakeFiles/example_step_83_release.dir/step-83/step-83.cc.o:step-83.cc:function Step83::CathodeRaySimulator<2>::checkpoint(): error: undefined reference to 'std::filesystem::__cxx11::directory_iterator::operator*() const'

CMakeFiles/example_step_83_release.dir/step-83/step-83.cc.o:step-83.cc:function Step83::CathodeRaySimulator<2>::checkpoint(): error: undefined reference to 'std::filesystem::__cxx11::directory_iterator::operator++()'

CMakeFiles/example_step_83_release.dir/step-83/step-83.cc.o:step-83.cc:function Step83::CathodeRaySimulator<2>::checkpoint(): error: undefined reference to 'std::filesystem::__cxx11::path::_M_split_cmpts()'

CMakeFiles/example_step_83_release.dir/step-83/step-83.cc.o:step-83.cc:function Step83::CathodeRaySimulator<2>::checkpoint(): error: undefined reference to 'std::filesystem::__cxx11::path::_M_split_cmpts()'

CMakeFiles/example_step_83_release.dir/step-83/step-83.cc.o:step-83.cc:function Step83::CathodeRaySimulator<2>::checkpoint(): error: undefined reference to 'std::filesystem::rename(std::filesystem::__cxx11::path const&, std::filesystem::__cxx11::path const&)'

CMakeFiles/example_step_83_release.dir/step-83/step-83.cc.o:step-83.cc:function Step83::CathodeRaySimulator<2>::checkpoint(): error: undefined reference to 'std::filesystem::status(std::filesystem::__cxx11::path const&)'

make[2]: *** [examples/CMakeFiles/example_step_83_release.dir/build.make:106: bin/step-83.release] Error 1

make[1]: *** [CMakeFiles/Makefile2:8634: examples/CMakeFiles/example_step_83_release.dir/all] Error 2

make[1]: *** Waiting for unfinished jobs....

I will try going with -DDEAL_II_COMPILE_EXAMPLES=OFF. That should also make the build go faster.

David

Wolfgang Bangerth

unread,
Feb 6, 2025, 12:26:18 PM2/6/25
to dea...@googlegroups.com
On 2/6/25 10:11, David Montiel wrote:
>
> I tried including the flag -DDEAL_II_CXX_FLAGS="-lstdc++fs" but that still
> didn't work.

It is possible that if you do
export LD_FLAGS="-lstdc++fs"
before calling cmake, it works. But I think your solution is fine for your
purposes too.
Reply all
Reply to author
Forward
0 new messages