Alexander,

Thank you. That makes a lot of sense. I've been thinking it's about time to 
update to some version of 9.5 anyway and I'm thinking unlike when I first 
got deal.ii, I might be able to handle building from source like you 
suggest. I'll give it a go.  If it were possible to apt-get install the 
newest version of deal.II 9.5.1 but force it to use clang I would probably 
just do that, but despite looking all day, I have been unable to learn much 
about how that might be done.

Any other approach will not work as you pointed out. As you suggested, 
there are issues with the ABI and even if I compile my project with clang 
it's a big issue trying to link with deal.II which was compiled with gcc.

Regards,
Kyle

On Friday, March 15, 2024 at 3:46:05 PM UTC-4 Alexander Kiselyov wrote:

> 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+un...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/dealii/c46c5fd3-e964-41dd-a17d-5851ee9c63c8n%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/dealii/c46c5fd3-e964-41dd-a17d-5851ee9c63c8n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
>
>

-- 
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/1af91de7-f7cc-4202-9bd5-d2f0ee044632n%40googlegroups.com.

Reply via email to