CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > REEF3D

Problems compiling DIVEMesh

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By zweihuehner

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 21, 2021, 21:22
Default Problems compiling DIVEMesh
  #1
New Member
 
Faro Schäfer
Join Date: Nov 2021
Posts: 10
Rep Power: 6
zweihuehner is on a distinguished road
When trying to compile DIVEMesh with "make j 8" there seems to be a namespace issue in driver.h with 'data'. Thus the compilation can not be completed.
I followed the steps from the installation videos:


Quote:
(
sudo apt-get install build-essential gfortran unzip make wget openmpi-bin libopenmpi-dev
mkdir libraries
cd libraries
git clone https://github.com/hypre-space/hypre.git
cd hypre/src
./configure --prefix=/usr/local/hypre
make all
sudo make install
sudo printf '\n#export Path for hypre (part of reef3D) \nPATH=/usr/local/hypre/lib:usr/local/hypre/include:$PATH' >> ~/.bashrc
source ~/.bashrc

)

cd
git clone https://github.com/REEF3D/DIVEMesh.git
cd DIVEMesh
make -j 8

What am I doing wrong?


**System information:**
- REEF3D 21.10
- DIVEMesh 21.10
- OpenMPI 4.1.o
- Hypre 2.23.0
- OS Ubuntu


Here is the output from the compilation:


Quote:
In file included from src/driver.cpp:23:
src/driver.h:59:9: error: reference to ‘data’ is ambiguous
59 | data *pdata;
| ^~~~
In file included from /usr/include/c++/11/string:54,
from /usr/include/c++/11/bits/locale_classes.h:40,
from /usr/include/c++/11/bits/ios_base.h:41,
from /usr/include/c++/11/ios:42,
from /usr/include/c++/11/ostream:38,
from /usr/include/c++/11/iostream:39,
from src/driver.h:23,
from src/driver.cpp:23:
/usr/include/c++/11/bits/range_access.h:319:5: note: candidates are: ‘template<class _Tp> constexpr const _Tp* std::data(std::initializer_list<_Tp>)’
319 | data(initializer_list<_Tp> __il) noexcept
| ^~~~
/usr/include/c++/11/bits/range_access.h:310:5: note: ‘template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])’
310 | data(_Tp (&__array)[_Nm]) noexcept
| ^~~~
/usr/include/c++/11/bits/range_access.h:300:5: note: ‘template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)’
300 | data(const _Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
/usr/include/c++/11/bits/range_access.h:290:5: note: ‘template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)’
290 | data(_Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
In file included from src/driver.h:25,
from src/driver.cpp:23:
src/driver_declarations.h:36:7: note: ‘class data’
36 | class objects_geometry;
| ^~~~
In file included from src/driver_analytics.cpp:23:
src/driver.h:59:9: error: reference to ‘data’ is ambiguous
59 | data *pdata;
| ^~~~
In file included from /usr/include/c++/11/string:54,
from /usr/include/c++/11/bits/locale_classes.h:40,
from /usr/include/c++/11/bits/ios_base.h:41,
from /usr/include/c++/11/ios:42,
from /usr/include/c++/11/ostream:38,
from /usr/include/c++/11/iostream:39,
from src/driver.h:23,
from src/driver_analytics.cpp:23:
/usr/include/c++/11/bits/range_access.h:319:5: note: candidates are: ‘template<class _Tp> constexpr const _Tp* std::data(std::initializer_list<_Tp>)’
319 | data(initializer_list<_Tp> __il) noexcept
| ^~~~
/usr/include/c++/11/bits/range_access.h:310:5: note: ‘template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])’
310 | data(_Tp (&__array)[_Nm]) noexcept
| ^~~~
/usr/include/c++/11/bits/range_access.h:300:5: note: ‘template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)’
300 | data(const _Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
/usr/include/c++/11/bits/range_access.h:290:5: note: ‘template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)’
290 | data(_Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
In file included from src/driver.h:25,
from src/driver_analytics.cpp:23:
src/driver_declarations.h:36:7: note: ‘class data’
36 | class objects_geometry;
| ^~~~
src/driver.cpp: In member function ‘void driver::mainloop()’:
src/driver.cpp:75:5: error: ‘pdata’ was not declared in this scope; did you mean ‘data’?
75 | pdata->start(p,a);
| ^~~~~
| data
make: [Makefile:19: build/src/driver.o] Error 1 (ignored)
make: [Makefile:19: build/src/driver_analytics.o] Error 1 (ignored)
In file included from src/main.h:25,
from src/main.cpp:23:
src/driver.h:59:9: error: reference to ‘data’ is ambiguous
59 | data *pdata;
| ^~~~
In file included from /usr/include/c++/11/string:54,
from /usr/include/c++/11/bits/locale_classes.h:40,
from /usr/include/c++/11/bits/ios_base.h:41,
from /usr/include/c++/11/ios:42,
from /usr/include/c++/11/ostream:38,
from /usr/include/c++/11/iostream:39,
from src/main.h:24,
from src/main.cpp:23:
/usr/include/c++/11/bits/range_access.h:319:5: note: candidates are: ‘template<class _Tp> constexpr const _Tp* std::data(std::initializer_list<_Tp>)’
319 | data(initializer_list<_Tp> __il) noexcept
| ^~~~
/usr/include/c++/11/bits/range_access.h:310:5: note: ‘template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])’
310 | data(_Tp (&__array)[_Nm]) noexcept
| ^~~~
/usr/include/c++/11/bits/range_access.h:300:5: note: ‘template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)’
300 | data(const _Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
/usr/include/c++/11/bits/range_access.h:290:5: note: ‘template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)’
290 | data(_Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
In file included from src/driver.h:25,
from src/main.h:25,
from src/main.cpp:23:
src/driver_declarations.h:36:7: note: ‘class data’
36 | class objects_geometry;
| ^~~~
make: [Makefile:19: build/src/main.o] Error 1 (ignored)
In file included from src/logic.cpp:23:
src/driver.h:59:9: error: reference to ‘data’ is ambiguous
59 | data *pdata;
| ^~~~
In file included from /usr/include/c++/11/string:54,
from /usr/include/c++/11/bits/locale_classes.h:40,
from /usr/include/c++/11/bits/ios_base.h:41,
from /usr/include/c++/11/ios:42,
from /usr/include/c++/11/ostream:38,
from /usr/include/c++/11/iostream:39,
from src/driver.h:23,
from src/logic.cpp:23:
/usr/include/c++/11/bits/range_access.h:319:5: note: candidates are: ‘template<class _Tp> constexpr const _Tp* std::data(std::initializer_list<_Tp>)’
319 | data(initializer_list<_Tp> __il) noexcept
| ^~~~
/usr/include/c++/11/bits/range_access.h:310:5: note: ‘template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])’
310 | data(_Tp (&__array)[_Nm]) noexcept
| ^~~~
/usr/include/c++/11/bits/range_access.h:300:5: note: ‘template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)’
300 | data(const _Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
/usr/include/c++/11/bits/range_access.h:290:5: note: ‘template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)’
290 | data(_Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
In file included from src/driver.h:25,
from src/logic.cpp:23:
src/driver_declarations.h:36:7: note: ‘class data’
36 | class objects_geometry;
| ^~~~
src/logic.cpp: In member function ‘void driver::logic(lexer*)’:
src/logic.cpp:59:5: error: ‘pdata’ was not declared in this scope; did you mean ‘data’?
59 |
| ^
| data
src/logic.cpp:59:17: error: expected type-specifier before ‘data’
59 |
| ^
make: [Makefile:19: build/src/logic.o] Error 1 (ignored)
/usr/bin/ld: cannot find build/src/driver_analytics.o: No such file or directory
/usr/bin/ld: cannot find build/src/driver.o: No such file or directory
/usr/bin/ld: cannot find build/src/logic.o: No such file or directory
/usr/bin/ld: cannot find build/src/main.o: No such file or directory
collect2: error: ld returned 1 exit status
make: [Makefile:24: bin/DiveMESH] Error 1 (ignored)
(base) fafs@Fafs-XPS:~/Dev/Reef3D/DIVEMesh$ ll
total 5932
drwxrwxr-x 7 fafs fafs 4096 Nov 21 22:24 ./
drwxrwxr-x 5 fafs fafs 4096 Nov 21 22:01 ../
drwxrwxr-x 2 fafs fafs 4096 Nov 21 22:24 bin/
drwxrwxr-x 3 fafs fafs 4096 Nov 21 22:24 build/
-rw-rw-r-- 1 fafs fafs 5965464 Nov 21 22:01 DIVEMesh-UserGuide.pdf
drwxrwxr-x 8 fafs fafs 4096 Nov 21 22:01 .git/
-rw-rw-r-- 1 fafs fafs 66 Nov 21 22:01 .gitattributes
drwxrwxr-x 3 fafs fafs 4096 Nov 21 22:01 .github/
-rw-rw-r-- 1 fafs fafs 235 Nov 21 22:01 .gitignore
-rw-rw-r-- 1 fafs fafs 35126 Nov 21 22:01 LICENSE
-rw-rw-r-- 1 fafs fafs 14369 Nov 21 22:24 log
-rw-rw-r-- 1 fafs fafs 909 Nov 21 22:01 Makefile
-rwxrwxr-x 1 fafs fafs 2590 Nov 21 22:01 release-notes.txt*
drwxrwxr-x 2 fafs fafs 12288 Nov 21 22:01 src/
(base) fafs@Fafs-XPS:~/Dev/Reef3D/DIVEMesh$ cat log
g++ -w -O3 -march=native -c src/baselayer.cpp -o build/src/baselayer.o
g++ -w -O3 -march=native -c src/bc.cpp -o build/src/bc.o
g++ -w -O3 -march=native -c src/bedlevel.cpp -o build/src/bedlevel.o
g++ -w -O3 -march=native -c src/box_bl.cpp -o build/src/box_bl.o

...



Quote:

g++ -w -O3 -march=native -o ./bin/DiveMESH build/src/baselayer.o build/src/bc.o build/src/bedlevel.o build/src/box_bl.o build/src/data.o build/src/data_inversedist.o build/src/decomp_analyse.o build/src/decomp_correction.o build/src/decomp_costfunc.o build/src/decomp_count.o build/src/decomp.o build/src/decomp_paraslice.o build/src/decomp_partition.o build/src/decomp_partition_manual.o build/src/decomp_partition_planes.o build/src/decomp_periodic.o build/src/decomp_periodic_surfco.o build/src/decomp_periodic_surf.o build/src/decomp_print.o build/src/decomp_surface.o build/src/decomp_surfco.o build/src/decomp_vtp.o build/src/dive.o build/src/driver_analytics.o build/src/driver.o build/src/field1d.o build/src/field2d.o build/src/field.o build/src/geodat.o build/src/geodat_holecheck.o build/src/geodat_multigrid_ccipol.o build/src/geodat_multigrid.o build/src/geodat_pointcheck.o build/src/geodat_print-sampled.o build/src/geodat_print-vtp.o build/src/geodat_remove_bounds.o build/src/geodat_setup_ijk.o build/src/geometry_arch.o build/src/geometry_box_array.o build/src/geometry_box.o build/src/geometry_cone_x.o build/src/geometry_cone_y.o build/src/geometry_cone_z.o build/src/geometry.o build/src/geometry_cylinder_y.o build/src/geometry_cylinder_z.o build/src/geometry_ellipsoid.o build/src/geometry_ellipsoid_semi.o build/src/geometry_ellipsoid_semi_rot.o build/src/geometry_fluvial_box_fill_segments.o build/src/geometry_fluvial_box_util.o build/src/geometry_fluvial_box_v1.o build/src/geometry_fluvial_box_v2.o build/src/geometry_hexahedron.o build/src/geometry_jacketmember_norm.o build/src/geometry_ogee-weir.o build/src/geometry_plate_x.o build/src/geometry_pyramid.o build/src/geometry_ray_cast.o build/src/geometry_ray_cast_io_x.o build/src/geometry_ray_cast_io_ycorr.o build/src/geometry_ray_cast_io_zcorr.o build/src/geometry_ray_cast_x.o build/src/geometry_ray_cast_x_gcb.o build/src/geometry_ray_cast_y.o build/src/geometry_ray_cast_z.o build/src/geometry_rotation.o build/src/geometry_semicyl_y.o build/src/geometry_sphere.o build/src/geometry_stl.o build/src/geometry_tetrahedon.o build/src/geometry_wedge.o build/src/geometry_wedge_x.o build/src/geometry_wedge_y.o build/src/geometry_wedge_z.o build/src/hdc_allocate.o build/src/hdc.o build/src/hdc_decomp.o build/src/hdc_filename_in.o build/src/hdc_filename_out.o build/src/hdc_read.o build/src/hdc_read_header.o build/src/hdc_read_mainheader.o build/src/hdc_write.o build/src/hdc_write_header.o build/src/increment.o build/src/ini.o build/src/initialize.o build/src/intfield1d.o build/src/intfield1dy.o build/src/intfield2d.o build/src/intfield.o build/src/inverse_dist.o build/src/inverse_dist_local.o build/src/inverse_dist_local_setup.o build/src/kriging.o build/src/kriging_ini.o build/src/kriging_rearrange.o build/src/kriging_semivariogram.o build/src/kriging_solve.o build/src/lexer.o build/src/lexer_createspace.o build/src/lexer_gridspacing_cellBased.o build/src/lexer_gridspacing.o build/src/lexer_gridspacing_fsf.o build/src/lexer_gridspacing_print.o build/src/lexer_pos.o build/src/logic.o build/src/main.o build/src/module_void.o build/src/print_binary.o build/src/print_bottom.o build/src/print_debug.o build/src/print_solid.o build/src/print_vtu.o build/src/read_control.o build/src/read_data.o build/src/read_geodat.o build/src/read_solid.o build/src/read_stl.o build/src/read_topo.o build/src/resize.o build/src/resize_delete.o build/src/resize_resize.o build/src/slice.o build/src/solid.o build/src/solid_fluvial_box.o build/src/surface.o build/src/surface_dir.o build/src/surface_plate.o build/src/surface_solid.o build/src/topo.o



Last edited by zweihuehner; November 21, 2021 at 21:39. Reason: question wasn't finished
zweihuehner is offline   Reply With Quote

Old   November 22, 2021, 09:00
Default
  #2
Senior Member
 
Arun Kamath
Join Date: Nov 2014
Location: Trondheim, Norway
Posts: 265
Rep Power: 14
kamath is on a distinguished road
Seems like a compiler issue on your local machine.
DiveMESH uses only g++ and has no dependencies. So problems compiling this are quite rare (and therefore I haven't seen a lot a problems) and generally compiler related.
Could you please post the output you get for:

which gcc

which g++

What I also find strange is that while you get an error during the compilation (from the first console output pasted above), the output that denotes the making of the executable is printed out in full (the last output).
__________________
Arun
X years with REEF3D
kamath is offline   Reply With Quote

Old   November 22, 2021, 09:19
Default
  #3
New Member
 
Faro Schäfer
Join Date: Nov 2021
Posts: 10
Rep Power: 6
zweihuehner is on a distinguished road
Thank you for the quick reply.

Quote:
which gcc
usr/bin/gcc
gcc -dumpfullversion
11.2.0



which g++
usr/bin/g++
g++ -dumpfullversion
11.2.0

Is the executable output actually correct ? Shouldn't it end with


Quote:
-o DiveMESH
?
zweihuehner is offline   Reply With Quote

Old   November 22, 2021, 09:37
Default
  #4
Senior Member
 
Arun Kamath
Join Date: Nov 2014
Location: Trondheim, Norway
Posts: 265
Rep Power: 14
kamath is on a distinguished road
The last quote in your original post is correct.
Starts with
g++ -w -O3 -march=native -o ./bin/DiveMESH ...
ends with build/src/topo.o

as expected.
Could you please confirm that the DIVEMesh/bin folder is actually empty?

Meanwhile I will check if there are any issues with gcc-11
__________________
Arun
X years with REEF3D
kamath is offline   Reply With Quote

Old   November 22, 2021, 09:54
Default
  #5
New Member
 
Faro Schäfer
Join Date: Nov 2021
Posts: 10
Rep Power: 6
zweihuehner is on a distinguished road
DIVEMesh/bin is empty.


And I am very sorry there is also output at the very end:


Quote:
... o build/src/surface_solid.o build/src/topo.o
/usr/bin/ld: cannot find build/src/driver_analytics.o: No such file or directory
/usr/bin/ld: cannot find build/src/driver.o: No such file or directory
/usr/bin/ld: cannot find build/src/logic.o: No such file or directory
/usr/bin/ld: cannot find build/src/main.o: No such file or directory
collect2: error: ld returned 1 exit status
make: [Makefile:24: bin/DiveMESH] Error 1 (ignored)
I checked and those files don't exist.

I forgot to quote it as the maximum number of letters was exceeded.
zweihuehner is offline   Reply With Quote

Old   November 22, 2021, 09:57
Default
  #6
Senior Member
 
Arun Kamath
Join Date: Nov 2014
Location: Trondheim, Norway
Posts: 265
Rep Power: 14
kamath is on a distinguished road
No problem

But I can at this stage confirm that compiling fails with gcc-11.

We are looking into it and a fix might come soon.

In the meantime, as a temp fix:
sudo update-alternatives --remove-all gcc
sudo update-alternatives --remove-all g++
sudo apt-get install gcc-9.3.0 g++-9.3.0

should help?

(This is the highest version I have confirmation currently for a successful compilation on a Linux machine)
__________________
Arun
X years with REEF3D

Last edited by kamath; November 22, 2021 at 09:58. Reason: command to remove gcc before installing new versions added
kamath is offline   Reply With Quote

Old   November 22, 2021, 10:34
Default
  #7
New Member
 
Faro Schäfer
Join Date: Nov 2021
Posts: 10
Rep Power: 6
zweihuehner is on a distinguished road
Compiles beautifully now!

Your recommended commands didn't work for me, however I did the following instead:

Quote:
sudo add-apt-repository ppa:ubuntu-toolchain-r/test

sudo apt update
sudo apt install g++-9 gcc-9

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 60 --slave /usr/bin/g++ g++ /usr/bin/g++-9
sudo update-alternatives --config gcc

Versions are now both 9.4.0.
kamath likes this.
zweihuehner is offline   Reply With Quote

Old   November 23, 2021, 08:19
Default
  #8
Super Moderator
 
Hans Bihs
Join Date: Jun 2009
Location: Trondheim, Norway
Posts: 403
Rep Power: 19
valgrinda is on a distinguished road
Should be fixed in the newest DIVMesh release candidate, should be now compatible with gcc v11.
__________________
Hans Bihs
Team REEF3D
www.reef3d.com
valgrinda is offline   Reply With Quote

Old   November 23, 2021, 10:28
Default
  #9
New Member
 
Faro Schäfer
Join Date: Nov 2021
Posts: 10
Rep Power: 6
zweihuehner is on a distinguished road
Thanks a lot !
zweihuehner is offline   Reply With Quote

Reply

Tags
divemesh


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Various problems compiling interFoam with CFDSupport's v1706 port of OpenFOAM ndtrong OpenFOAM Programming & Development 9 April 10, 2020 12:56
[OpenFOAM.org] Problems with Compiling OpenFOAM-2.1.1 in Ubuntu 16.04 charles4allme OpenFOAM Installation 17 May 31, 2018 10:01
[waves2Foam] Problems compiling with Ubuntu 14.04 and OpenFOAM 3.0.1 kenrichaiz OpenFOAM Community Contributions 4 December 1, 2016 04:05
Problems while compiling OpenFOAM15 with OpenSuse 103 coompressor OpenFOAM Installation 3 November 7, 2008 01:57
Problems with compiling CFD code! ravi Main CFD Forum 1 July 12, 2004 12:28


All times are GMT -4. The time now is 12:58.