DEAL_II_HAVE_USABLE_FLAGS_DEBUG - Failed

86 views
Skip to first unread message

yushut

unread,
Dec 3, 2024, 10:53:27 AM12/3/24
to deal.II User Group
Hello!
I am installing dealii an a new machine with Ubuntu 24 .  I succeed wIthout MPI, but when I run
cmake -DDEAL_II_WITH_MPI=ON ../CMakeLists.txt
I get the following error:
CMake Error at cmake/setup_sanity_checks.cmake:99 (message):
     Configuration error: Cannot compile a test program with the final set of
   compiler and linker flags:
     CXX flags (DEBUG): -fopenmp-simd -O0 -ggdb -Wa,--compress-debug-sections
     LD flags  (DEBUG): -rdynamic  -ggdb -Wl,--compress-debug-sections=zlib
     LIBRARIES (DEBUG): dl;rt;
From where this inconsistency of flags can be coming? Any help is appreciated! I'm attaching the full log.

log.txt

Wolfgang Bangerth

unread,
Dec 4, 2024, 1:37:42 PM12/4/24
to dea...@googlegroups.com
Vladimir:
I can't tell from your log what exactly the compiler error is that leads
cmake to declare that it can't compile a simple test program. In
essence, what we do is collect the flags that we want to pass to the
compiler (to switch on warnings, enable optimizations, link with
external libraries) and then we see whether we can compile a small
program with it. That steps seems to be failing for you, which means
that either the compiler did not understand one of the flags or perhaps
could not find one of the external libraries. I don't know what the
specific reason is why it fails, but if you search through the files
that are probably in a directory called CMakeFiles then I think you
should be able to identify the specific error the compiler gives you and
that would be helpful to know what it is that is going wrong.

So, can you see whether you can find out something more in this direction?

Best
W.

yushut

unread,
Dec 5, 2024, 8:42:12 AM12/5/24
to deal.II User Group
Thanks for the clues!
There are several errors which appear from the search: "__AVX__ flag not set, no support for AVX", "insufficient support for C++20", and even "‘concept’ does not name a type; did you mean ‘const’?", but I think the key error is the following:

3.28.3/CompilerIdC/CMakeCCompilerId.c:# error "A C++ compiler has been selected for C."
3.28.3/CompilerIdCXX/CMakeCXXCompilerId.cpp:# error "A C compiler has been selected for C++."

I've tried
cmake -DDEAL_II_WITH_MPI=ON   -DCMAKE_CXX_COMPILER:FILEPATH=/usr/bin/c++ -DCMAKE_CXX_FLAGS=-std=c++17 ../CMakeLists.txt
with same errors. It looks like I need to reinstall all libraries specifying the compiler explicitly, right?

Best,
Vladimir

среда, 4 декабря 2024 г. в 13:37:42 UTC-5, Wolfgang Bangerth:

Matthias Maier

unread,
Dec 5, 2024, 3:07:55 PM12/5/24
to dea...@googlegroups.com
Delete your build directory and try again.

Did you set a compiler via
CMAKE_C_COMPILER, or CMAKE_CXX_COMPILER,

or did you specify a compiler via the CC or CXX environment variables
(and accidentally swapped them)?

$ echo $CC
$ echo $CXX

will tell you.

MM
Reply all
Reply to author
Forward
0 new messages