root icon indicating copy to clipboard operation
root copied to clipboard

Compilation fails with VecGeom, ROOT6.26/04

Open stephanlachnit opened this issue 3 years ago • 5 comments

  • [x] Checked for duplicates

Describe the bug

When compiling with VecGeom enabled, I get this compile error:

In file included from <builddir>/include/TObject.h:18,
                 from <builddir>/include/TNamed.h:25,
                 from <builddir>/include/TDictionary.h:44,
                 from <builddir>/include/TClass.h:23,
                 from <builddir>/geom/vecgeom/G__ConverterVG.cxx:14:
<builddir>/include/TStorage.h: In static member function ‘static void TStorage::UpdateIsOnHeap(const volatile UInt_t&, volatile UInt_t&)’:
<builddir>/include/TStorage.h:133:12: warning: compound assignment with ‘volatile’-qualified left operand is deprecated [-Wvolatile]
  133 |       bits |= kIsOnHeap;
      |       ~~~~~^~~~~~~~~~~~
<builddir>/include/TStorage.h:135:12: warning: compound assignment with ‘volatile’-qualified left operand is deprecated [-Wvolatile]
  135 |       bits &= ~kIsOnHeap;
      |       ~~~~~^~~~~~~~~~~~~
In file included from /usr/include/c++/11/memory:76,
                 from <builddir>/include/ROOT/TypeTraits.hxx:15,
                 from <builddir>/include/TString.h:30,
                 from <builddir>/include/TNamed.h:26,
                 from <builddir>/include/TDictionary.h:44,
                 from <builddir>/include/TClass.h:23,
                 from <builddir>/geom/vecgeom/G__ConverterVG.cxx:14:
/usr/include/c++/11/bits/unique_ptr.h: In instantiation of ‘constexpr std::unique_ptr<_Tp, _Dp>::unique_ptr(std::nullptr_t) [with _Del = std::default_delete<TInterpreterValue>; <template-parameter-2-2> = void; _Tp = TInterpreterValue; _Dp = std::default_delete<TInterpreterValue>; std::nullptr_t = std::nullptr_t]’:
<builddir>/include/TInterpreter.h:280:85:   required from here
/usr/include/c++/11/bits/unique_ptr.h:321:11: error: no matching function for call to ‘std::__uniq_ptr_data<TInterpreterValue, std::default_delete<TInterpreterValue>, true, true>::__uniq_ptr_data()’
  321 |         : _M_t()
      |           ^~~~~~
/usr/include/c++/11/bits/unique_ptr.h:210:40: note: candidate: ‘template<class _Del> std::__uniq_ptr_data<TInterpreterValue, std::default_delete<TInterpreterValue>, true, true>::__uniq_ptr_data(std::__uniq_ptr_impl<TInterpreterValue, std::default_delete<TInterpreterValue> >::pointer, _Del&&) [inherited from std::__uniq_ptr_impl<TInterpreterValue, std::default_delete<TInterpreterValue> >]’
  210 |       using __uniq_ptr_impl<_Tp, _Dp>::__uniq_ptr_impl;
      |                                        ^~~~~~~~~~~~~~~
/usr/include/c++/11/bits/unique_ptr.h:210:40: note:   template argument deduction/substitution failed:
/usr/include/c++/11/bits/unique_ptr.h:321:11: note:   candidate expects 2 arguments, 0 provided
  321 |         : _M_t()
      |           ^~~~~~
/usr/include/c++/11/bits/unique_ptr.h:210:40: note: candidate: ‘std::__uniq_ptr_data<TInterpreterValue, std::default_delete<TInterpreterValue>, true, true>::__uniq_ptr_data(std::__uniq_ptr_impl<TInterpreterValue, std::default_delete<TInterpreterValue> >::pointer) [inherited from std::__uniq_ptr_impl<TInterpreterValue, std::default_delete<TInterpreterValue> >]’
  210 |       using __uniq_ptr_impl<_Tp, _Dp>::__uniq_ptr_impl;
      |                                        ^~~~~~~~~~~~~~~
/usr/include/c++/11/bits/unique_ptr.h:210:40: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/11/bits/unique_ptr.h:211:7: note: candidate: ‘std::__uniq_ptr_data<_Tp, _Dp, <anonymous>, <anonymous> >::__uniq_ptr_data(std::__uniq_ptr_data<_Tp, _Dp, <anonymous>, <anonymous> >&&) [with _Tp = TInterpreterValue; _Dp = std::default_delete<TInterpreterValue>; bool <anonymous> = true; bool <anonymous> = true]’
  211 |       __uniq_ptr_data(__uniq_ptr_data&&) = default;
      |       ^~~~~~~~~~~~~~~
/usr/include/c++/11/bits/unique_ptr.h:211:7: note:   candidate expects 1 argument, 0 provided
make[3]: *** [geom/vecgeom/CMakeFiles/G__ConverterVG.dir/build.make:96: geom/vecgeom/CMakeFiles/G__ConverterVG.dir/G__ConverterVG.cxx.o] Error 1
make[3]: Leaving directory '<builddir>'
make[2]: *** [CMakeFiles/Makefile2:33593: geom/vecgeom/CMakeFiles/G__ConverterVG.dir/all] Error 2
make[2]: Leaving directory '<builddir>'
make[1]: *** [Makefile:159: all] Error 2
make[1]: Leaving directory '<builddir>'

Expected behavior

The compilation does not fail.

To Reproduce

Compile with vecgeom option.

Setup

Compiling ROOT v6.26.04 on Debian Unstable (amd64), with GCC 11.3.0 and VecGeom 1.2.0, with this configuration:

-- ROOT Configuration 

System          Linux-5.18.0-2-amd64
Processor       4 core Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz (x86_64)
Build type      None
Install path    /usr
Compiler        GNU 11.3.0
Compiler flags:
C               -g -O2 -ffile-prefix-map=<srcdir>=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -Wno-implicit-fallthrough -pipe -Wall -W -pthread 
C++             -g -O2 -ffile-prefix-map=<srcdir>=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -std=c++17 -Wno-implicit-fallthrough -Wno-noexcept-type -pipe  -Wshadow -Wall -W -Woverloaded-virtual -fsigned-char -pthread 
Linker flags:
Executable      -Wl,-z,relro -Wl,-z,now -rdynamic
Module          -Wl,-z,relro -Wl,-z,now
Shared          -Wl,-z,relro -Wl,-z,now -Wl,--no-undefined -Wl,--hash-style="both"

-- Enabled support for:  asimage builtin_clang builtin_cling builtin_llvm builtin_unuran builtin_vdt ccache dataframe davix dcache exceptions fftw3 fitsio fortran gdml gfal gnuinstall gsl_shared gviz http fcgi imt mathmore mlp minuit2 mpi mysql odbc opengl pgsql pyroot qt5web qt6web r roofit root7 rpath shadowpw shared soversion sqlite ssl tmva tmva-cpu tmva-sofie tmva-pymva tmva-rmva spectrum unuran uring vc vdt veccore x11 xml xrootd

Additional context

I have build VecGeom as a shared library, but this shouldn't make a difference. I think the VecGeom part of ROOT is just out of date (last change made 2 years ago).

stephanlachnit avatar Jul 18 '22 15:07 stephanlachnit

For future reference, I was unable to reproduce locally using ArchLinux x86_64, g++ (GCC) 12.1.0, and VecGeom master branch.

jalopezg-git avatar Jul 19 '22 10:07 jalopezg-git

Still fails for me with GCC 12, but I realized VecGeom is build with C++20 for VecCore's std::experimental::simd backend - this might cause the issue. I will try with C++17...

stephanlachnit avatar Jul 21 '22 11:07 stephanlachnit

As mentioned verbally last week, I cannot reproduce this problem even if compiling VecGeom with C++20. However, because it's not possible to build ROOT with recent versions of VecGeom anyway (now tracked in https://github.com/root-project/root/issues/11271), I would recommend not trying to do so.

hahnjo avatar Aug 29 '22 15:08 hahnjo

@stephanlachnit trying to understand the background a bit: is / was this in the context of your project with our simulation friends, or what's the use case here?

Axel-Naumann avatar Aug 30 '22 12:08 Axel-Naumann

@stephanlachnit trying to understand the background a bit: is / was this in the context of your project with our simulation friends, or what's the use case here?

I was just looking through ROOT's build options for Debian packaging - VecGeom is already in Debian for Geant4 anyway, so I tried building ROOT with VecGeom enabled. There is no explicit use case on my side.

stephanlachnit avatar Aug 30 '22 14:08 stephanlachnit

Still fails with master after #11790 (dbc2fb856c133ed9ecdfde8be3f5e57b9f7935ff):

[5250/5252] Building CXX object geom/vecgeom/CMakeFiles/G__ConverterVG.dir/G__ConverterVG.cxx.o
FAILED: geom/vecgeom/CMakeFiles/G__ConverterVG.dir/G__ConverterVG.cxx.o 
/usr/bin/ccache /usr/bin/c++ -DVECCORE_ENABLE_VC -I/home/stephan/Projects/ROOT/geom/vecgeom/inc -I/home/stephan/Projects/ROOT/builddir/include -I/home/stephan/Projects/ROOT/core/unix/../clib/res -I/home/stephan/Projects/ROOT/core/unix/inc -I/home/stephan/Projects/ROOT/core/zstd/inc -I/home/stephan/Projects/ROOT/core/lz4/inc -I/home/stephan/Projects/ROOT/core/lzma/inc -I/home/stephan/Projects/ROOT/core/zip/inc -I/home/stephan/Projects/ROOT/core/thread/inc -I/home/stephan/Projects/ROOT/core/textinput/src -I/home/stephan/Projects/ROOT/core/textinput/inc -I/home/stephan/Projects/ROOT/core/rint/inc -I/home/stephan/Projects/ROOT/core/meta/inc -I/home/stephan/Projects/ROOT/core/gui/inc -I/home/stephan/Projects/ROOT/core/foundation/res -I/home/stephan/Projects/ROOT/core/foundation/v7/inc -I/home/stephan/Projects/ROOT/core/foundation/inc -I/home/stephan/Projects/ROOT/core/cont/inc -I/home/stephan/Projects/ROOT/core/clingutils/res -I/home/stephan/Projects/ROOT/core/clingutils/inc -I/home/stephan/Projects/ROOT/core/clib/inc -I/home/stephan/Projects/ROOT/core/base/v7/inc -I/home/stephan/Projects/ROOT/core/base/inc -I/home/stephan/Projects/ROOT/builddir/ginclude -I/home/stephan/Projects/ROOT/geom/geom/inc -I/home/stephan/Projects/ROOT/io/io/v7/inc -I/home/stephan/Projects/ROOT/io/io/inc -I/home/stephan/Projects/ROOT/core/clib/res -I/home/stephan/Projects/ROOT/math/mathcore/v7/inc -I/home/stephan/Projects/ROOT/math/mathcore/inc -I/home/stephan/Projects/ROOT/core/imt/inc -I/home/stephan/Projects/ROOT/hist/hist/inc -I/home/stephan/Projects/ROOT/math/matrix/inc -I/home/stephan/Projects/ROOT/core/multiproc/inc -I/home/stephan/Projects/ROOT/net/net/inc -fdiagnostics-color=always -std=c++17 -Wno-implicit-fallthrough -Wno-noexcept-type -pipe  -Wshadow -Wall -W -Woverloaded-virtual -fsigned-char -pthread -fabi-version=6 -O3 -DNDEBUG -fPIC -faligned-new -msse4.2 -std=c++17 -MD -MT geom/vecgeom/CMakeFiles/G__ConverterVG.dir/G__ConverterVG.cxx.o -MF geom/vecgeom/CMakeFiles/G__ConverterVG.dir/G__ConverterVG.cxx.o.d -o geom/vecgeom/CMakeFiles/G__ConverterVG.dir/G__ConverterVG.cxx.o -c /home/stephan/Projects/ROOT/builddir/geom/vecgeom/G__ConverterVG.cxx
In file included from /usr/include/c++/12/memory:76,
                 from /home/stephan/Projects/ROOT/builddir/include/ROOT/TypeTraits.hxx:15,
                 from /home/stephan/Projects/ROOT/builddir/include/TString.h:30,
                 from /home/stephan/Projects/ROOT/builddir/include/TNamed.h:26,
                 from /home/stephan/Projects/ROOT/builddir/include/TDictionary.h:44,
                 from /home/stephan/Projects/ROOT/builddir/include/TClass.h:23,
                 from /home/stephan/Projects/ROOT/builddir/geom/vecgeom/G__ConverterVG.cxx:14:
/usr/include/c++/12/bits/unique_ptr.h: In instantiation of ‘constexpr std::unique_ptr<_Tp, _Dp>::unique_ptr(std::nullptr_t) [with _Del = std::default_delete<TInterpreterValue>; <template-parameter-2-2> = void; _Tp = TInterpreterValue; _Dp = std::default_delete<TInterpreterValue>; std::nullptr_t = std::nullptr_t]’:
/home/stephan/Projects/ROOT/builddir/include/TInterpreter.h:282:85:   required from here
/usr/include/c++/12/bits/unique_ptr.h:352:11: error: no matching function for call to ‘std::__uniq_ptr_data<TInterpreterValue, std::default_delete<TInterpreterValue>, true, true>::__uniq_ptr_data()’
  352 |         : _M_t()
      |           ^~~~~~
/usr/include/c++/12/bits/unique_ptr.h:233:40: note: candidate: ‘template<class _Del> std::__uniq_ptr_data<TInterpreterValue, std::default_delete<TInterpreterValue>, true, true>::__uniq_ptr_data(std::__uniq_ptr_impl<TInterpreterValue, std::default_delete<TInterpreterValue> >::pointer, _Del&&) [inherited from std::__uniq_ptr_impl<TInterpreterValue, std::default_delete<TInterpreterValue> >]’
  233 |       using __uniq_ptr_impl<_Tp, _Dp>::__uniq_ptr_impl;
      |                                        ^~~~~~~~~~~~~~~
/usr/include/c++/12/bits/unique_ptr.h:233:40: note:   template argument deduction/substitution failed:
/usr/include/c++/12/bits/unique_ptr.h:352:11: note:   candidate expects 2 arguments, 0 provided
  352 |         : _M_t()
      |           ^~~~~~
/usr/include/c++/12/bits/unique_ptr.h:233:40: note: candidate: ‘std::__uniq_ptr_data<TInterpreterValue, std::default_delete<TInterpreterValue>, true, true>::__uniq_ptr_data(std::__uniq_ptr_impl<TInterpreterValue, std::default_delete<TInterpreterValue> >::pointer) [inherited from std::__uniq_ptr_impl<TInterpreterValue, std::default_delete<TInterpreterValue> >]’
  233 |       using __uniq_ptr_impl<_Tp, _Dp>::__uniq_ptr_impl;
      |                                        ^~~~~~~~~~~~~~~
/usr/include/c++/12/bits/unique_ptr.h:233:40: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/12/bits/unique_ptr.h:234:7: note: candidate: ‘std::__uniq_ptr_data<_Tp, _Dp, <anonymous>, <anonymous> >::__uniq_ptr_data(std::__uniq_ptr_data<_Tp, _Dp, <anonymous>, <anonymous> >&&) [with _Tp = TInterpreterValue; _Dp = std::default_delete<TInterpreterValue>; bool <anonymous> = true; bool <anonymous> = true]’
  234 |       __uniq_ptr_data(__uniq_ptr_data&&) = default;
      |       ^~~~~~~~~~~~~~~
/usr/include/c++/12/bits/unique_ptr.h:234:7: note:   candidate expects 1 argument, 0 provided

PS: I think #11271 can be closed now (or this, but it's a bit of a duplicate)

stephanlachnit avatar Feb 06 '23 08:02 stephanlachnit

Hello, thanks for reporting this! I was able to reproduce and fix the problem:

  • https://github.com/root-project/root/pull/13751

guitargeek avatar Sep 28 '23 17:09 guitargeek

Just for completeness, here is a simple reproducer of the problem:

// compile with g++ -fabi-version=6 -o test test.cpp using GCC 13.2
#include <memory>

std::unique_ptr<int> foo() { return nullptr; }

int main() {}

Here is again the error:

In file included from /usr/include/c++/13.2.1/memory:78,
                 from test.C:1:
/usr/include/c++/13.2.1/bits/unique_ptr.h: In instantiation of ‘constexpr std::unique_ptr<_Tp, _Dp>::unique_ptr(std::nullptr_t) [with _Del = std::default_delete<int>; <template-parameter-2-2> = void; _Tp = int; _Dp = std::default_delete<int>; std::nullptr_t = std::nullptr_t]’:
test.C:3:37:   required from here
/usr/include/c++/13.2.1/bits/unique_ptr.h:360:11: error: no matching function for call to ‘std::__uniq_ptr_data<int, std::default_delete<int>, true, true>::__uniq_ptr_data()’
  360 |         : _M_t()
      |           ^~~~~~
/usr/include/c++/13.2.1/bits/unique_ptr.h:241:40: note: candidate: ‘template<class _Del> std::__uniq_ptr_data<int, std::default_delete<int>, true, true>::__uniq_ptr_data(std::__uniq_ptr_impl<int, std::default_delete<int> >::pointer, _Del&&) [inherited from std::__uniq_ptr_impl<int, std::default_delete<int> >]’
  241 |       using __uniq_ptr_impl<_Tp, _Dp>::__uniq_ptr_impl;
      |                                        ^~~~~~~~~~~~~~~
/usr/include/c++/13.2.1/bits/unique_ptr.h:241:40: note:   template argument deduction/substitution failed:
/usr/include/c++/13.2.1/bits/unique_ptr.h:360:11: note:   candidate expects 2 arguments, 0 provided
  360 |         : _M_t()
      |           ^~~~~~
/usr/include/c++/13.2.1/bits/unique_ptr.h:241:40: note: candidate: ‘std::__uniq_ptr_data<int, std::default_delete<int>, true, true>::__uniq_ptr_data(std::__uniq_ptr_impl<int, std::default_delete<int> >::pointer) [inherited from std::__uniq_ptr_impl<int, std::default_delete<int> >]’
  241 |       using __uniq_ptr_impl<_Tp, _Dp>::__uniq_ptr_impl;
      |                                        ^~~~~~~~~~~~~~~
/usr/include/c++/13.2.1/bits/unique_ptr.h:241:40: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/13.2.1/bits/unique_ptr.h:242:7: note: candidate: ‘std::__uniq_ptr_data<_Tp, _Dp, <anonymous>, <anonymous> >::__uniq_ptr_data(std::__uniq_ptr_data<_Tp, _Dp, <anonymous>, <anonymous> >&&) [with _Tp = int; _Dp = std::default_delete<int>; bool <anonymous> = true; bool <anonymous> = true]’
  242 |       __uniq_ptr_data(__uniq_ptr_data&&) = default;
      |       ^~~~~~~~~~~~~~~
/usr/include/c++/13.2.1/bits/unique_ptr.h:242:7: note:   candidate expects 1 argument, 0 provided

guitargeek avatar Sep 28 '23 18:09 guitargeek

Closed by #13751.

  • #10984

guitargeek avatar Sep 29 '23 09:09 guitargeek