dealii / dealii

The development repository for the deal.II finite element library
https://www.dealii.org
Other
1.34k stars 741 forks source link

Docker image fails to build #14642

Closed peterrum closed 1 year ago

peterrum commented 1 year ago

After the latest PRs, the Docker image fails to build and produces the following error:

#7 2939.1 FAILED: source/lac/CMakeFiles/obj_lac_release.dir/la_parallel_vector.cc.o 
#7 2939.1 /usr/bin/c++  -DNDEBUG -Isource/lac -Iinclude -I../include -isystem /usr/lib/x86_64-linux-gnu/openmpi/include/openmpi -isystem /usr/lib/x86_64-linux-gnu/openmpi/include -isystem /usr/include/trilinos -isystem /usr/include/hdf5/openmpi -isystem /usr/include/scotch -isystem /usr/include/suitesparse -isystem /usr/include/petsc -isystem /usr/include/opencascade -isystem /usr/include/slepc -pedantic -fPIC -Wall -Wextra -Wmissing-braces -Woverloaded-virtual -Wpointer-arith -Wsign-compare -Wsuggest-override -Wswitch -Wsynth -Wwrite-strings -Wno-placement-new -Wno-deprecated-declarations -Wno-literal-suffix -Wno-psabi -Wno-class-memaccess -fopenmp-simd -pthread -std=c++17 -Wno-unused-local-typedefs -O2 -funroll-loops -funroll-all-loops -fstrict-aliasing -MD -MT source/lac/CMakeFiles/obj_lac_release.dir/la_parallel_vector.cc.o -MF source/lac/CMakeFiles/obj_lac_release.dir/la_parallel_vector.cc.o.d -o source/lac/CMakeFiles/obj_lac_release.dir/la_parallel_vector.cc.o -c ../source/lac/la_parallel_vector.cc
#7 2939.1 In file included from ../include/deal.II/lac/la_parallel_vector.templates.h:31,
#7 2939.1                  from ../source/lac/la_parallel_vector.cc:17:
#7 2939.1 ../include/deal.II/lac/vector_operations_internal.h: In instantiation of ‘static void dealii::internal::VectorOperations::functions<Number, Number, dealii::MemorySpace::Default>::norm_1(const std::shared_ptr<dealii::parallel::internal::TBBPartitioner>&, dealii::internal::VectorOperations::size_type, real_type&, dealii::MemorySpace::MemorySpaceData<Number, dealii::MemorySpace::Default>&) [with real_type = float; Number = float; dealii::internal::VectorOperations::size_type = unsigned int]’:
#7 2939.1 ../include/deal.II/lac/la_parallel_vector.templates.h:1847:59:   required from ‘dealii::LinearAlgebra::distributed::Vector<Number, MemorySpace>::real_type dealii::LinearAlgebra::distributed::Vector<Number, MemorySpace>::l1_norm_local() const [with Number = float; MemorySpace = dealii::MemorySpace::Default; dealii::LinearAlgebra::distributed::Vector<Number, MemorySpace>::real_type = float]’
#7 2939.1 ../source/lac/la_parallel_vector.cc:46:20:   required from here
#7 2939.1 ../include/deal.II/lac/vector_operations_internal.h:2533:20: error: no match for ‘operator+=’ (operand types are ‘float’ and ‘adouble’)
#7 2939.1  2533 |             update += abs(data.values(i));
#7 2939.1       |             ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
#7 2939.1 ../include/deal.II/lac/vector_operations_internal.h:2533:20: note: candidate: ‘operator+=(float&, double)’ <built-in>
#7 2939.1 ../include/deal.II/lac/vector_operations_internal.h:2533:20: note:   no known conversion for argument 2 from ‘adouble’ to ‘double’
#7 2939.1 ../include/deal.II/lac/vector_operations_internal.h: In instantiation of ‘static void dealii::internal::VectorOperations::functions<Number, Number, dealii::MemorySpace::Default>::norm_1(const std::shared_ptr<dealii::parallel::internal::TBBPartitioner>&, dealii::internal::VectorOperations::size_type, real_type&, dealii::MemorySpace::MemorySpaceData<Number, dealii::MemorySpace::Default>&) [with real_type = double; Number = double; dealii::internal::VectorOperations::size_type = unsigned int]’:
#7 2939.1 ../include/deal.II/lac/la_parallel_vector.templates.h:1847:59:   required from ‘dealii::LinearAlgebra::distributed::Vector<Number, MemorySpace>::real_type dealii::LinearAlgebra::distributed::Vector<Number, MemorySpace>::l1_norm_local() const [with Number = double; MemorySpace = dealii::MemorySpace::Default; dealii::LinearAlgebra::distributed::Vector<Number, MemorySpace>::real_type = double]’
#7 2939.1 ../source/lac/la_parallel_vector.cc:47:20:   required from here
#7 2939.1 ../include/deal.II/lac/vector_operations_internal.h:2533:20: error: no match for ‘operator+=’ (operand types are ‘double’ and ‘adouble’)
#7 2939.1 ../include/deal.II/lac/vector_operations_internal.h:2533:20: note: candidate: ‘operator+=(double&, double)’ <built-in>
#7 2939.1 ../include/deal.II/lac/vector_operations_internal.h:2533:20: note:   no known conversion for argument 2 from ‘adouble’ to ‘double’
#7 2939.1 In file included from /usr/include/trilinos/Kokkos_Parallel.hpp:255,
#7 2939.1                  from /usr/include/trilinos/Kokkos_Serial.hpp:55,
#7 2939.1                  from /usr/include/trilinos/Kokkos_Core.hpp:53,
#7 2939.1                  from ../include/deal.II/base/memory_space.h:23,
#7 2939.1                  from ../include/deal.II/lac/la_parallel_vector.h:22,
#7 2939.1                  from ../source/lac/la_parallel_vector.cc:16:
#7 2939.1 /usr/include/trilinos/Kokkos_Parallel_Reduce.hpp:954:6: error: ‘void Kokkos::parallel_reduce(const string&, const PolicyType&, const FunctorType&, ReturnType&, typename Kokkos::Impl::enable_if<Kokkos::is_execution_policy<ExecPolicy>::value>::type*) [with PolicyType = Kokkos::RangePolicy<Kokkos::Serial>; FunctorType = dealii::internal::VectorOperations::functions<Number, Number, dealii::MemorySpace::Default>::norm_1(const std::shared_ptr<dealii::parallel::internal::TBBPartitioner>&, dealii::internal::VectorOperations::size_type, real_type&, dealii::MemorySpace::MemorySpaceData<Number, dealii::MemorySpace::Default>&) [with real_type = float; Number = float; dealii::internal::VectorOperations::size_type = unsigned int]::<lambda(dealii::internal::VectorOperations::size_type, float&)>; ReturnType = float; std::string = std::__cxx11::basic_string<char>; typename Kokkos::Impl::enable_if<Kokkos::is_execution_policy<ExecPolicy>::value>::type = void]’, declared using local type ‘const dealii::internal::VectorOperations::functions<Number, Number, dealii::MemorySpace::Default>::norm_1(const std::shared_ptr<dealii::parallel::internal::TBBPartitioner>&, dealii::internal::VectorOperations::size_type, real_type&, dealii::MemorySpace::MemorySpaceData<Number, dealii::MemorySpace::Default>&) [with real_type = float; Number = float; dealii::internal::VectorOperations::size_type = unsigned int]::<lambda(dealii::internal::VectorOperations::size_type, float&)>’, is used but never defined [-fpermissive]
#7 2939.1   954 | void parallel_reduce(const std::string& label,
#7 2939.1       |      ^~~~~~~~~~~~~~~
#7 2939.1 /usr/include/trilinos/Kokkos_Parallel_Reduce.hpp:954:6: error: ‘void Kokkos::parallel_reduce(const string&, const PolicyType&, const FunctorType&, ReturnType&, typename Kokkos::Impl::enable_if<Kokkos::is_execution_policy<ExecPolicy>::value>::type*) [with PolicyType = Kokkos::RangePolicy<Kokkos::Serial>; FunctorType = dealii::internal::VectorOperations::functions<Number, Number, dealii::MemorySpace::Default>::norm_1(const std::shared_ptr<dealii::parallel::internal::TBBPartitioner>&, dealii::internal::VectorOperations::size_type, real_type&, dealii::MemorySpace::MemorySpaceData<Number, dealii::MemorySpace::Default>&) [with real_type = double; Number = double; dealii::internal::VectorOperations::size_type = unsigned int]::<lambda(dealii::internal::VectorOperations::size_type, double&)>; ReturnType = double; std::string = std::__cxx11::basic_string<char>; typename Kokkos::Impl::enable_if<Kokkos::is_execution_policy<ExecPolicy>::value>::type = void]’, declared using local type ‘const dealii::internal::VectorOperations::functions<Number, Number, dealii::MemorySpace::Default>::norm_1(const std::shared_ptr<dealii::parallel::internal::TBBPartitioner>&, dealii::internal::VectorOperations::size_type, real_type&, dealii::MemorySpace::MemorySpaceData<Number, dealii::MemorySpace::Default>&) [with real_type = double; Number = double; dealii::internal::VectorOperations::size_type = unsigned int]::<lambda(dealii::internal::VectorOperations::size_type, double&)>’, is used but never defined [-fpermissive]
#7 2941.7 [371/1040] Building CXX object source/lac/CMakeFiles/obj_lac_release.dir/la_vector.cc.o
#7 2941.7 ninja: build stopped: subcommand failed.
#7 ERROR: process "/bin/sh -c cd /usr/src     && git clone https://github.com/dealii/dealii     && cd dealii && mkdir build && cd build     && cmake -GNinja     -DCMAKE_PREFIX_PATH=\"/usr/lib/x86_64-linux-gnu/hdf5/openmpi;/usr/include/hdf5/openmpi\"     -DDEAL_II_ALLOW_AUTODETECTION=OFF     -DDEAL_II_COMPILE_EXAMPLES=OFF     -DDEAL_II_COMPONENT_PYTHON_BINDINGS=ON     -DCMAKE_CXX_FLAGS=\"-std=c++17\"     -DDEAL_II_WITH_64BIT_INDICES=OFF     -DDEAL_II_WITH_ADOLC=ON     -DDEAL_II_WITH_ARBORX=OFF     -DDEAL_II_WITH_ARPACK=ON     -DDEAL_II_WITH_ASSIMP=ON     -DDEAL_II_WITH_BOOST=ON     -DDEAL_II_WITH_CGAL=ON     -DDEAL_II_WITH_COMPLEX_VALUES=ON     -DDEAL_II_WITH_CUDA=OFF     -DDEAL_II_WITH_GINKGO=OFF     -DDEAL_II_WITH_GMSH=ON     -DDEAL_II_WITH_GSL=ON     -DDEAL_II_WITH_HDF5=ON     -DDEAL_II_WITH_KOKKOS=ON     -DDEAL_II_WITH_LAPACK=ON     -DDEAL_II_WITH_MPI=ON     -DDEAL_II_WITH_MUPARSER=ON     -DDEAL_II_WITH_OPENCASCADE=ON     -DDEAL_II_WITH_P4EST=ON     -DDEAL_II_WITH_PETSC=ON     -DDEAL_II_WITH_SCALAPACK=ON     -DDEAL_II_WITH_SLEPC=ON     -DDEAL_II_WITH_SUNDIALS=ON     -DDEAL_II_WITH_SYMENGINE=ON     -DDEAL_II_WITH_TASKFLOW=OFF     -DDEAL_II_WITH_TBB=ON     -DDEAL_II_WITH_TRILINOS=ON     -DDEAL_II_WITH_UMFPACK=ON     -DDEAL_II_WITH_ZLIB=ON     ..     && ninja -j 2 install     && cd ../ && rm -rf .git build" did not complete successfully: exit code: 1
------
 > [2/3] RUN cd /usr/src     && git clone https://github.com/dealii/dealii     && cd dealii && mkdir build && cd build     && cmake -GNinja     -DCMAKE_PREFIX_PATH="/usr/lib/x86_64-linux-gnu/hdf5/openmpi;/usr/include/hdf5/openmpi"     -DDEAL_II_ALLOW_AUTODETECTION=OFF     -DDEAL_II_COMPILE_EXAMPLES=OFF     -DDEAL_II_COMPONENT_PYTHON_BINDINGS=ON     -DCMAKE_CXX_FLAGS="-std=c++17"     -DDEAL_II_WITH_64BIT_INDICES=OFF     -DDEAL_II_WITH_ADOLC=ON     -DDEAL_II_WITH_ARBORX=OFF     -DDEAL_II_WITH_ARPACK=ON     -DDEAL_II_WITH_ASSIMP=ON     -DDEAL_II_WITH_BOOST=ON     -DDEAL_II_WITH_CGAL=ON     -DDEAL_II_WITH_COMPLEX_VALUES=ON     -DDEAL_II_WITH_CUDA=OFF     -DDEAL_II_WITH_GINKGO=OFF     -DDEAL_II_WITH_GMSH=ON     -DDEAL_II_WITH_GSL=ON     -DDEAL_II_WITH_HDF5=ON     -DDEAL_II_WITH_KOKKOS=ON     -DDEAL_II_WITH_LAPACK=ON     -DDEAL_II_WITH_MPI=ON     -DDEAL_II_WITH_MUPARSER=ON     -DDEAL_II_WITH_OPENCASCADE=ON     -DDEAL_II_WITH_P4EST=ON     -DDEAL_II_WITH_PETSC=ON     -DDEAL_II_WITH_SCALAPACK=ON     -DDEAL_II_WITH_SLEPC=ON     -DDEAL_II_WITH_SUNDIALS=ON     -DDEAL_II_WITH_SYMENGINE=ON     -DDEAL_II_WITH_TASKFLOW=OFF     -DDEAL_II_WITH_TBB=ON     -DDEAL_II_WITH_TRILINOS=ON     -DDEAL_II_WITH_UMFPACK=ON     -DDEAL_II_WITH_ZLIB=ON     ..     && ninja -j 2 install     && cd ../ && rm -rf .git build:
#7 2939.1                  from /usr/include/trilinos/Kokkos_Core.hpp:53,
#7 2939.1                  from ../include/deal.II/base/memory_space.h:23,
#7 2939.1                  from ../include/deal.II/lac/la_parallel_vector.h:22,
#7 2939.1                  from ../source/lac/la_parallel_vector.cc:16:
#7 2939.1 /usr/include/trilinos/Kokkos_Parallel_Reduce.hpp:954:6: error: ‘void Kokkos::parallel_reduce(const string&, const PolicyType&, const FunctorType&, ReturnType&, typename Kokkos::Impl::enable_if<Kokkos::is_execution_policy<ExecPolicy>::value>::type*) [with PolicyType = Kokkos::RangePolicy<Kokkos::Serial>; FunctorType = dealii::internal::VectorOperations::functions<Number, Number, dealii::MemorySpace::Default>::norm_1(const std::shared_ptr<dealii::parallel::internal::TBBPartitioner>&, dealii::internal::VectorOperations::size_type, real_type&, dealii::MemorySpace::MemorySpaceData<Number, dealii::MemorySpace::Default>&) [with real_type = float; Number = float; dealii::internal::VectorOperations::size_type = unsigned int]::<lambda(dealii::internal::VectorOperations::size_type, float&)>; ReturnType = float; std::string = std::__cxx11::basic_string<char>; typename Kokkos::Impl::enable_if<Kokkos::is_execution_policy<ExecPolicy>::value>::type = void]’, declared using local type ‘const dealii::internal::VectorOperations::functions<Number, Number, dealii::MemorySpace::Default>::norm_1(const std::shared_ptr<dealii::parallel::internal::TBBPartitioner>&, dealii::internal::VectorOperations::size_type, real_type&, dealii::MemorySpace::MemorySpaceData<Number, dealii::MemorySpace::Default>&) [with real_type = float; Number = float; dealii::internal::VectorOperations::size_type = unsigned int]::<lambda(dealii::internal::VectorOperations::size_type, float&)>’, is used but never defined [-fpermissive]
#7 2939.1   954 | void parallel_reduce(const std::string& label,
#7 2939.1       |      ^~~~~~~~~~~~~~~
#7 2939.1 /usr/include/trilinos/Kokkos_Parallel_Reduce.hpp:954:6: error: ‘void Kokkos::parallel_reduce(const string&, const PolicyType&, const FunctorType&, ReturnType&, typename Kokkos::Impl::enable_if<Kokkos::is_execution_policy<ExecPolicy>::value>::type*) [with PolicyType = Kokkos::RangePolicy<Kokkos::Serial>; FunctorType = dealii::internal::VectorOperations::functions<Number, Number, dealii::MemorySpace::Default>::norm_1(const std::shared_ptr<dealii::parallel::internal::TBBPartitioner>&, dealii::internal::VectorOperations::size_type, real_type&, dealii::MemorySpace::MemorySpaceData<Number, dealii::MemorySpace::Default>&) [with real_type = double; Number = double; dealii::internal::VectorOperations::size_type = unsigned int]::<lambda(dealii::internal::VectorOperations::size_type, double&)>; ReturnType = double; std::string = std::__cxx11::basic_string<char>; typename Kokkos::Impl::enable_if<Kokkos::is_execution_policy<ExecPolicy>::value>::type = void]’, declared using local type ‘const dealii::internal::VectorOperations::functions<Number, Number, dealii::MemorySpace::Default>::norm_1(const std::shared_ptr<dealii::parallel::internal::TBBPartitioner>&, dealii::internal::VectorOperations::size_type, real_type&, dealii::MemorySpace::MemorySpaceData<Number, dealii::MemorySpace::Default>&) [with real_type = double; Number = double; dealii::internal::VectorOperations::size_type = unsigned int]::<lambda(dealii::internal::VectorOperations::size_type, double&)>’, is used but never defined [-fpermissive]
#7 2941.7 [371/1040] Building CXX object source/lac/CMakeFiles/obj_lac_release.dir/la_vector.cc.o
#7 2941.7 ninja: build stopped: subcommand failed

Does anyone know what the cause might be? It is inside of LA::d::V, where there where a lot of changes in the last few weeks.

Rombur commented 1 year ago

Looks like it's a problem related to adol-c, I see a lot of adouble. Did we forget to instantiate something?

Rombur commented 1 year ago

I think I understand the problem. When we do a parallel_reduce in Kokkos, we need to create a new variable and the type is wrong. That's because the type of the result (real_type) is different than the type of the vector (Number). There might be another problem because I think that adol-c defines it's own intrinsics and we switch to the Kokkos ones. It wasn't a problem before because the code was CUDA only but now that we removed the guard, the code gets instantiated.