Hi Kyle,

Disclaimer: I'm not an expert in C++, but have some experience in
maintaining packages, including ones of C++ software.

First, it's a bad idea to patch *Config.cmake files, they are meant to
accurately describe the currently installed software. This is
especially important because GCC and Clang ABIs aren't compatible,
generally speaking. Bear in mind that C++ doesn't have any formal ABI
standard, only best-effort compatibility within a single compiler
vendor. I'd really advise against such experiments compared to a one-
time deal.II rebuild with clang, even if it takes a couple of hours.
You'll likely need to rebuild deal.II dependencies like MPI with clang,
again because of potential ABI incompatibilities.

Concerning warnings and other flags, you can enable additional flags
(e.g. `-fdiagnostics-color=always`) in CMakeLists.txt of your project
using `target_compile_options` function after calling
`DEAL_II_SETUP_TARGET`. However, deal.II should select supported flags
during its build with the same compiler.

Finally, a practical advice about building deal.II yourself. Obviously
it's very convenient to build in parallel (`-j <N>` option to `cmake --
build` or `make`), but to be safe you need to have at least 2 GB of
free RAM per build process.

Hope that helps.

Best regards,
Alexander

On Fri, 2024-03-15 at 08:41 -0700, Kyle Schwiebert wrote:
> I decided to switch from compiling my user codes with clang instead
> of gcc, and I can successfully get the build to use clang with either
> 
> cmake . -DDEAL_II_CXX_COMPILER=clang
> or
> cmake . -DCMAKE_CXX_COMPILER=clang
> 
> but I get a bunch of warnings with like "warning: unknown warning
> option '-Wno-placement-new' [-Wunknown-warning-option]"
> 
> I would like to get the default clang flags that deal.II would have
> set up on installation. If it is relevant, I am running deal.II on
> ubuntu 20.04 through WSL1. I installed the back port of 9.4.0 with
> "sudo apt-get ..." I know that I could just edit the file, but I'm
> worried this would mess up something unrelated and I think I would
> benefit from using the flags the deal.ii devs think wise for clang.
> 
> Thank you for any insight you can offer.
> 
> Regards,
> Kyle
> -- 
> The deal.II project is located at http://www.dealii.org/
> For mailing list/forum options, see
> https://groups.google.com/d/forum/dealii?hl=en
> --- 
> You received this message because you are subscribed to the Google
> Groups "deal.II User Group" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to dealii+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/dealii/c46c5fd3-e964-41dd-a17d-5851ee9c63c8n%40googlegroups.com
> .

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/764be4d14f4082e7083144fbf650c3d5ee586a4c.camel%40gmail.com.

Reply via email to