run the step-1 tutorial in Visual Studio 2019

38 views
Skip to first unread message

wei zhang

unread,
Sep 28, 2024, 10:57:46 AM9/28/24
to deal.II User Group
Dear Dealii_group,

I am currently learning Dealii and have successfully compiled dealii-9.6.0 using Visual Studio 2019 with the default settings, without encountering any issues.
 However, after creating a blank C++ project in Visual Studio 2019 and copying the code from the step-1 tutorial into the project, I encountered the following errors during debugging:


Error C2995: “T desul::Impl::atomic_oper_fetch(const Oper &,T *const ,dont_deduce_this_parameter<const T>::type,MemoryOrder,MemoryScope)”: function template already defined step1 C:\dealii-9.6.0\deal.II\bundled\kokkos-3.7.00\tpls\desul\include\desul\atomics\Generic.hpp 326

Error C2995: “T desul::Impl::atomic_fetch_oper(const Oper &,T *const ,dont_deduce_this_parameter<const T>::type,MemoryOrder,MemoryScope)”: function template already defined step1 C:\dealii-9.6.0\deal.II\bundled\kokkos-3.7.00\tpls\desul\include\desul\atomics\Generic.hpp 247

Error C2572: “desul::Impl::atomic_oper_fetch”: redefinition of default argument: parameter 5 step1 C:\dealii-9.6.0\deal.II\bundled\kokkos-3.7.00\tpls\desul\include\desul\atomics\Generic.hpp 319

Error C2572: “desul::Impl::atomic_fetch_oper”: redefinition of default argument: parameter 5 step1 C:\dealii-9.6.0\deal.II\bundled\kokkos-3.7.00\tpls\desul\include\desul\atomics\Generic.hpp 240
Despite multiple attempts, I have not been able to resolve the issue. Could you please advise me on how to fix this?

Thank you in advance.

Wolfgang Bangerth

unread,
Oct 4, 2024, 12:12:02 AM10/4/24
to dea...@googlegroups.com
On 9/28/24 02:08, wei zhang wrote:
> *** Caution: EXTERNAL Sender ***
Wei:
I'm not particularly familiar with Visual Studio, but have a couple of
suggestions:

* As a general rule, setting up deal.II projects "a blank C++ project in
Visual Studio 2019 and copying the code from the step-1 tutorial into the
project" is likely not going to work. You need to also copy the CMakeLists.txt
into it, and let cmake do its magic to properly set up compiler flags and all
sorts of other things. Is that what you did? If you really started with a
blank project, can you compile step-1 in its original directory, using cmake
to set up the project?

* Do you happen to have access to a newer version of Visual Studio? 2019 is a
good while ago, newer compilers might have this fixed.

* You say that you "encountered the following errors during debugging". Do you
mean during "compiling"? Or which part of the build process is producing this
error? Perhaps during linking?

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


Reply all
Reply to author
Forward
0 new messages