chaos-polymtl / lethe

Repository for the open-source lethe CFD/DEM/CFD-DEM project
https://chaos-polymtl.github.io/lethe/index.html
GNU Lesser General Public License v2.1
270 stars 59 forks source link

Error during building #654

Closed Wendi-L closed 1 year ago

Wendi-L commented 1 year ago

Hi there,

Many thanks for developing this solver. I can see great potential for Lethe on CFD simulations.

I followed the Lethe documentation to install Lethe on Ubuntu 22.04.1 LTS. The candi is used for the installation of all dependencies and deal.ii. It should be noted that there is no "STABLE_BUILD" keyword in "candi.cfg" in candi dealii-9.4 branch. I installed the deal.ii v9.4.0.

After installation of deal.ii and its dependencies, I use

cmake ../lethe -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=/home/username/path/to/installation

make -j4

to install Lethe, but hit the following error during make:

[ 25%] Building CXX object source/dem/CMakeFiles/lethe-dem.dir/dem_solver_parameters.cc.o
/*/Lethe/packs/lethe/source/dem/dem_container_manager.cc: In instantiation of ‘void DEMContainerManager<dim>::execute_particle_wall_broad_search(const dealii::Particles::ParticleHandler<dim>&, BoundaryCellsInformation<dim>&, const Parameters::Lagrangian::FloatingWalls<dim>&, double, bool) [with int dim = 2]’:
/*/Lethe/packs/lethe/source/dem/dem_container_manager.cc:410:16:   required from here
/*/Lethe/packs/lethe/source/dem/dem_container_manager.cc:272:51: error: cannot convert ‘std::unordered_map<unsigned int, std::set<dealii::TriaActiveIterator<dealii::CellAccessor<2, 2> >, std::less<dealii::TriaActiveIterator<dealii::CellAccessor<2, 2> > >, std::allocator<dealii::TriaActiveIterator<dealii::CellAccessor<2, 2> > > >, std::hash<unsigned int>, std::equal_to<unsigned int>, std::allocator<std::pair<const unsigned int, std::set<dealii::TriaActiveIterator<dealii::CellAccessor<2, 2> >, std::less<dealii::TriaActiveIterator<dealii::CellAccessor<2, 2> > >, std::allocator<dealii::TriaActiveIterator<dealii::CellAccessor<2, 2> > > > > > >’ to ‘const std::unordered_map<long unsigned int, std::set<dealii::TriaActiveIterator<dealii::CellAccessor<2, 2> >, std::less<dealii::TriaActiveIterator<dealii::CellAccessor<2, 2> > >, std::allocator<dealii::TriaActiveIterator<dealii::CellAccessor<2, 2> > > >, std::hash<long unsigned int>, std::equal_to<long unsigned int>, std::allocator<std::pair<const long unsigned int, std::set<dealii::TriaActiveIterator<dealii::CellAccessor<2, 2> >, std::less<dealii::TriaActiveIterator<dealii::CellAccessor<2, 2> > >, std::allocator<dealii::TriaActiveIterator<dealii::CellAccessor<2, 2> > > > > > >&’
  271 |       particle_wall_broad_search_object
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~            
  272 |         .find_particle_floating_wall_contact_pairs(
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
  273 |           boundary_cell_object.get_boundary_cells_with_floating_walls(),
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  274 |           particle_handler,
      |           ~~~~~~~~~~~~~~~~~                        
  275 |           floating_walls,
      |           ~~~~~~~~~~~~~~~                          
  276 |           simulation_time,
      |           ~~~~~~~~~~~~~~~~                         
  277 |           particle_floating_wall_candidates);
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~       
In file included from /*/Lethe/packs/lethe/source/core/../../include/dem/dem_container_manager.h:29,
                 from /*/Lethe/packs/lethe/source/dem/dem_container_manager.cc:19:
/*/Lethe/packs/lethe/source/core/../../include/dem/particle_wall_broad_search.h:103:44: note:   initializing argument 1 of ‘void ParticleWallBroadSearch<dim>::find_particle_floating_wall_contact_pairs(const std::unordered_map<long unsigned int, std::set<typename dealii::Triangulation<dim>::active_cell_iterator> >&, const dealii::Particles::ParticleHandler<dim>&, const Parameters::Lagrangian::FloatingWalls<dim>&, double, typename DEM::dem_data_structures<dim>::particle_floating_wall_candidates&) [with int dim = 2; typename dealii::Triangulation<dim>::active_cell_iterator = dealii::TriaActiveIterator<dealii::CellAccessor<2, 2> >; typename DEM::dem_data_structures<dim>::particle_floating_wall_candidates = std::unordered_map<long unsigned int, std::unordered_map<unsigned int, dealii::Particles::ParticleIterator<2, 2>, std::hash<unsigned int>, std::equal_to<unsigned int>, std::allocator<std::pair<const unsigned int, dealii::Particles::ParticleIterator<2, 2> > > >, std::hash<long unsigned int>, std::equal_to<long unsigned int>, std::allocator<std::pair<const long unsigned int, std::unordered_map<unsigned int, dealii::Particles::ParticleIterator<2, 2>, std::hash<unsigned int>, std::equal_to<unsigned int>, std::allocator<std::pair<const unsigned int, dealii::Particles::ParticleIterator<2, 2> > > > > > >]’
  100 |     const std::unordered_map<
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~               
  101 |       types::particle_index,
      |       ~~~~~~~~~~~~~~~~~~~~~~                
  102 |       std::set<typename Triangulation<dim>::active_cell_iterator>>
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  103 |       &                                    boundary_cells_for_floating_walls,
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/*/Lethe/packs/lethe/source/dem/dem_container_manager.cc: In instantiation of ‘void DEMContainerManager<dim>::execute_particle_wall_broad_search(const dealii::Particles::ParticleHandler<dim>&, BoundaryCellsInformation<dim>&, const Parameters::Lagrangian::FloatingWalls<dim>&, double, bool) [with int dim = 3]’:
/*/Lethe/packs/lethe/source/dem/dem_container_manager.cc:411:16:   required from here
/*/Lethe/packs/lethe/source/dem/dem_container_manager.cc:272:51: error: cannot convert ‘std::unordered_map<unsigned int, std::set<dealii::TriaActiveIterator<dealii::CellAccessor<3, 3> >, std::less<dealii::TriaActiveIterator<dealii::CellAccessor<3, 3> > >, std::allocator<dealii::TriaActiveIterator<dealii::CellAccessor<3, 3> > > >, std::hash<unsigned int>, std::equal_to<unsigned int>, std::allocator<std::pair<const unsigned int, std::set<dealii::TriaActiveIterator<dealii::CellAccessor<3, 3> >, std::less<dealii::TriaActiveIterator<dealii::CellAccessor<3, 3> > >, std::allocator<dealii::TriaActiveIterator<dealii::CellAccessor<3, 3> > > > > > >’ to ‘const std::unordered_map<long unsigned int, std::set<dealii::TriaActiveIterator<dealii::CellAccessor<3, 3> >, std::less<dealii::TriaActiveIterator<dealii::CellAccessor<3, 3> > >, std::allocator<dealii::TriaActiveIterator<dealii::CellAccessor<3, 3> > > >, std::hash<long unsigned int>, std::equal_to<long unsigned int>, std::allocator<std::pair<const long unsigned int, std::set<dealii::TriaActiveIterator<dealii::CellAccessor<3, 3> >, std::less<dealii::TriaActiveIterator<dealii::CellAccessor<3, 3> > >, std::allocator<dealii::TriaActiveIterator<dealii::CellAccessor<3, 3> > > > > > >&’
  271 |       particle_wall_broad_search_object
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~            
  272 |         .find_particle_floating_wall_contact_pairs(
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
  273 |           boundary_cell_object.get_boundary_cells_with_floating_walls(),
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  274 |           particle_handler,
      |           ~~~~~~~~~~~~~~~~~                        
  275 |           floating_walls,
      |           ~~~~~~~~~~~~~~~                          
  276 |           simulation_time,
      |           ~~~~~~~~~~~~~~~~                         
  277 |           particle_floating_wall_candidates);
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~       
In file included from /*/Lethe/packs/lethe/source/core/../../include/dem/dem_container_manager.h:29,
                 from /*/Lethe/packs/lethe/source/dem/dem_container_manager.cc:19:
/*/Lethe/packs/lethe/source/core/../../include/dem/particle_wall_broad_search.h:103:44: note:   initializing argument 1 of ‘void ParticleWallBroadSearch<dim>::find_particle_floating_wall_contact_pairs(const std::unordered_map<long unsigned int, std::set<typename dealii::Triangulation<dim>::active_cell_iterator> >&, const dealii::Particles::ParticleHandler<dim>&, const Parameters::Lagrangian::FloatingWalls<dim>&, double, typename DEM::dem_data_structures<dim>::particle_floating_wall_candidates&) [with int dim = 3; typename dealii::Triangulation<dim>::active_cell_iterator = dealii::TriaActiveIterator<dealii::CellAccessor<3, 3> >; typename DEM::dem_data_structures<dim>::particle_floating_wall_candidates = std::unordered_map<long unsigned int, std::unordered_map<unsigned int, dealii::Particles::ParticleIterator<3, 3>, std::hash<unsigned int>, std::equal_to<unsigned int>, std::allocator<std::pair<const unsigned int, dealii::Particles::ParticleIterator<3, 3> > > >, std::hash<long unsigned int>, std::equal_to<long unsigned int>, std::allocator<std::pair<const long unsigned int, std::unordered_map<unsigned int, dealii::Particles::ParticleIterator<3, 3>, std::hash<unsigned int>, std::equal_to<unsigned int>, std::allocator<std::pair<const unsigned int, dealii::Particles::ParticleIterator<3, 3> > > > > > >]’
  100 |     const std::unordered_map<
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~               
  101 |       types::particle_index,
      |       ~~~~~~~~~~~~~~~~~~~~~~                
  102 |       std::set<typename Triangulation<dim>::active_cell_iterator>>
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  103 |       &                                    boundary_cells_for_floating_walls,
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make[2]: *** [source/dem/CMakeFiles/lethe-dem.dir/build.make:104: source/dem/CMakeFiles/lethe-dem.dir/dem_container_manager.cc.o] Error 1
make[2]: *** Waiting for unfinished jobs....
[ 25%] Building CXX object source/solvers/CMakeFiles/lethe-solvers.dir/gls_navier_stokes.cc.o
make[1]: *** [CMakeFiles/Makefile2:1333: source/dem/CMakeFiles/lethe-dem.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 25%] Building CXX object source/solvers/CMakeFiles/lethe-solvers.dir/gls_nitsche_navier_stokes.cc.o
[ 25%] Linking CXX static library liblethe-rpt.a
[ 25%] Built target lethe-rpt
[ 25%] Building CXX object source/solvers/CMakeFiles/lethe-solvers.dir/heat_transfer.cc.o
[ 25%] Building CXX object source/solvers/CMakeFiles/lethe-solvers.dir/heat_transfer_assemblers.cc.o
[ 25%] Building CXX object source/solvers/CMakeFiles/lethe-solvers.dir/heat_transfer_scratch_data.cc.o
[ 25%] Building CXX object source/solvers/CMakeFiles/lethe-solvers.dir/initial_conditions.cc.o
[ 31%] Building CXX object source/solvers/CMakeFiles/lethe-solvers.dir/multiphysics_interface.cc.o
[ 31%] Building CXX object source/solvers/CMakeFiles/lethe-solvers.dir/navier_stokes_assemblers.cc.o
[ 31%] Building CXX object source/solvers/CMakeFiles/lethe-solvers.dir/navier_stokes_base.cc.o
[ 31%] Building CXX object source/solvers/CMakeFiles/lethe-solvers.dir/navier_stokes_scratch_data.cc.o
[ 31%] Building CXX object source/solvers/CMakeFiles/lethe-solvers.dir/navier_stokes_vof_assemblers.cc.o
[ 31%] Building CXX object source/solvers/CMakeFiles/lethe-solvers.dir/physical_properties_manager.cc.o
[ 31%] Building CXX object source/solvers/CMakeFiles/lethe-solvers.dir/post_processors_smoothing.cc.o
[ 31%] Building CXX object source/solvers/CMakeFiles/lethe-solvers.dir/postprocessing_cfd.cc.o
[ 31%] Building CXX object source/solvers/CMakeFiles/lethe-solvers.dir/postprocessing_velocities.cc.o
[ 37%] Building CXX object source/solvers/CMakeFiles/lethe-solvers.dir/simulation_parameters.cc.o
[ 37%] Building CXX object source/solvers/CMakeFiles/lethe-solvers.dir/source_terms.cc.o
[ 37%] Building CXX object source/solvers/CMakeFiles/lethe-solvers.dir/tracer.cc.o
[ 37%] Building CXX object source/solvers/CMakeFiles/lethe-solvers.dir/tracer_assemblers.cc.o
[ 37%] Building CXX object source/solvers/CMakeFiles/lethe-solvers.dir/tracer_scratch_data.cc.o
[ 37%] Building CXX object source/solvers/CMakeFiles/lethe-solvers.dir/vof.cc.o
[ 37%] Building CXX object source/solvers/CMakeFiles/lethe-solvers.dir/vof_assemblers.cc.o
[ 37%] Building CXX object source/solvers/CMakeFiles/lethe-solvers.dir/vof_scratch_data.cc.o
[ 37%] Linking CXX static library liblethe-solvers.a
[ 37%] Built target lethe-solvers
make: *** [Makefile:146: all] Error 2

May I know if I missed anything? Many thanks.

Best Regards

Wendi

DanW97 commented 1 year ago

Could you share your candi.cfg file? And did the deal.ii tests pass?

It should be noted that there is no "STABLE_BUILD" keyword in "candi.cfg"

A quick look at the commit history suggests that DEAL_II_VERSION has superseded this parameter (setting master is probably the same as setting STABLE_BUILD to false), mine seems to be set to 9.4.1.

I recently moved to Ubuntu 22.04, and I haven't had any issues building the most recent version of Lethe as per the instructions. Are you also using the most recent version of candi?

For reference, this is what candi installed for me:

Cheers,

Dan

blaisb commented 1 year ago

Dear @Wendi-L , sorry for the delay in my answer. I am afraid I have never encountered this issue. Can you try pulling the latest version of candi and of lethe and compile again? We compile routinely on the continuous integration using Ubuntu 22.01 so I am surprised you are facing these issues. Did the candi installation fully complete? Best Bruno

Wendi-L commented 1 year ago

Many thanks, @DanW97 and @blaisb, for your comments. Let me try again sometime this week by using the latest candi and setting the deal.ii version as 9.4.1. I'll let you know if it works in due course.

Wendi-L commented 1 year ago

Dear @blaisb and @DanW97, I created a pull request on this issue pull#670. Please let me know if it makes sense.

This pull request only covered the main code. I think there are some build tests that need similar changes. Let me see if I can find some free time in the coming week to have a look at the build testing codes.

Happy for further discussions about it.

Best Regards

Wendi

blaisb commented 1 year ago

Great find! Your PR has been merged. Thanks for making it, we greatly appreciate.