fppimenta/rheoTool

Error running Allwmake in RheoTool version 4 with OpenFOAM v6

thebhatman opened this issue · 6 comments

Hi. I am getting an error while compiling rheotool with OpenFOAM6, on running Allwmake. Pasting the error message here, I tried googling, but to no avail. Can somebody help me with this problem? Thanks.

In file included from /home/thebhatman99/OpenFOAM/OpenFOAM-6/src/OpenFOAM/lnInclude/List.H:309:0,
                 from /home/thebhatman99/OpenFOAM/OpenFOAM-6/src/OpenFOAM/lnInclude/HashTable.C:30,
                 from /home/thebhatman99/OpenFOAM/OpenFOAM-6/src/OpenFOAM/lnInclude/HashTable.H:566,
                 from /home/thebhatman99/OpenFOAM/OpenFOAM-6/src/OpenFOAM/lnInclude/NamedEnum.H:38,
                 from /home/thebhatman99/OpenFOAM/OpenFOAM-6/src/OpenFOAM/lnInclude/IOobject.H:79,
                 from /home/thebhatman99/OpenFOAM/OpenFOAM-6/src/OpenFOAM/lnInclude/regIOobject.H:41,
                 from /home/thebhatman99/OpenFOAM/OpenFOAM-6/src/OpenFOAM/lnInclude/GeometricField.H:42,
                 from /home/thebhatman99/OpenFOAM/OpenFOAM-6/src/OpenFOAM/lnInclude/GeometricScalarField.H:38,
                 from /home/thebhatman99/OpenFOAM/OpenFOAM-6/src/OpenFOAM/lnInclude/GeometricFields.H:34,
                 from /home/thebhatman99/OpenFOAM/OpenFOAM-6/src/finiteVolume/lnInclude/volFields.H:37,
                 from operators/div.H:39,
                 from operators/blockOperators.H:39,
                 from operators/blockOperators.C:26:
/home/thebhatman99/OpenFOAM/OpenFOAM-6/src/OpenFOAM/lnInclude/List.C: In instantiation of ‘Foam::List<T>::List(InputIterator, InputIterator) [with InputIterator = int; T = long int]’:
operators/div.C:147:20:   required from here
/home/thebhatman99/OpenFOAM/OpenFOAM-6/src/OpenFOAM/lnInclude/List.C:211:39: error: no matching function for call to ‘distance(int&, int&)’
     List<T>(first, last, std::distance(first, last))
                          ~~~~~~~~~~~~~^~~~~~~~~~~~~
In file included from /usr/include/c++/7/bits/stl_algobase.h:66:0,
                 from /usr/include/c++/7/bits/char_traits.h:39,
                 from /usr/include/c++/7/string:40,
                 from /home/thebhatman99/OpenFOAM/OpenFOAM-6/src/OpenFOAM/lnInclude/string.H:51,
                 from /home/thebhatman99/OpenFOAM/OpenFOAM-6/src/OpenFOAM/lnInclude/word.H:42,
                 from /home/thebhatman99/OpenFOAM/OpenFOAM-6/src/OpenFOAM/lnInclude/fileName.H:48,
                 from /home/thebhatman99/OpenFOAM/OpenFOAM-6/src/OpenFOAM/lnInclude/IOobject.H:75,
                 from /home/thebhatman99/OpenFOAM/OpenFOAM-6/src/OpenFOAM/lnInclude/regIOobject.H:41,
                 from /home/thebhatman99/OpenFOAM/OpenFOAM-6/src/OpenFOAM/lnInclude/GeometricField.H:42,
                 from /home/thebhatman99/OpenFOAM/OpenFOAM-6/src/OpenFOAM/lnInclude/GeometricScalarField.H:38,
                 from /home/thebhatman99/OpenFOAM/OpenFOAM-6/src/OpenFOAM/lnInclude/GeometricFields.H:34,
                 from /home/thebhatman99/OpenFOAM/OpenFOAM-6/src/finiteVolume/lnInclude/volFields.H:37,
                 from operators/div.H:39,
                 from operators/blockOperators.H:39,
                 from operators/blockOperators.C:26:
/usr/include/c++/7/bits/stl_iterator_base_funcs.h:138:5: note: candidate: template<class _InputIterator> typename std::iterator_traits<_Iterator>::difference_type std::distance(_InputIterator, _InputIterator)
     distance(_InputIterator __first, _InputIterator __last)
     ^~~~~~~~
/usr/include/c++/7/bits/stl_iterator_base_funcs.h:138:5: note:   template argument deduction/substitution failed:
/usr/include/c++/7/bits/stl_iterator_base_funcs.h: In substitution of ‘template<class _InputIterator> typename std::iterator_traits<_Iterator>::difference_type std::distance(_InputIterator, _InputIterator) [with _InputIterator = int]’:
/home/thebhatman99/OpenFOAM/OpenFOAM-6/src/OpenFOAM/lnInclude/List.C:211:39:   required from ‘Foam::List<T>::List(InputIterator, InputIterator) [with InputIterator = int; T = long int]’
operators/div.C:147:20:   required from here
/usr/include/c++/7/bits/stl_iterator_base_funcs.h:138:5: error: no type named ‘difference_type’ in ‘struct std::iterator_traits<int>’
/home/thebhatman99/OpenFOAM/OpenFOAM-6/wmake/rules/General/transform:25: recipe for target 'Make/linux64GccDPInt64Opt/operators/blockOperators.o' failed
make: *** [Make/linux64GccDPInt64Opt/operators/blockOperators.o] Error 1

I never faced that issue, but it seems like a versioning problem, perhaps related with some specific patch (intermediate release) of OF6.0. Why are you not trying with the latest version of rheoTool (5.0)?

I tried with the latest master branch of rheotool as well, and yet the same error..

Some questions for debugging:

  • what is the OS?
  • what is the build stamp of openfoam? If you don't know how to get it with git, simply run 'icoFoam -h' and it will appear at the end of the error retrieved.

I am on Ubuntu 18.04.

Build Stamp:
Using: OpenFOAM-6 (see www.OpenFOAM.org)
Build: 6-47517f2ebb1b

I cannot reproduce your error. I tried with openfoam patches newer (the latest one for OF6.0) and older than yours and all is ok. It would be very unlikely to get an error with that intermediate patch. Therefore, you might just be doing some basic error and there are several possible ones. I would perhaps suggest you to make a fresh install of openfoam 6.0 (perhaps just sudo apt-get install --only-upgrade openfoam6 if you want the binaries) or 7.0 and also of rhetool and try again.

Re-open if needed.