Compilation errors – dkt2d, settlingCube3d
OpenLB – Open Source Lattice Boltzmann Code › Forums › on OpenLB › General Topics › Compilation errors – dkt2d, settlingCube3d
- This topic has 4 replies, 2 voices, and was last updated 4 years, 5 months ago by sthavishtha.
-
AuthorPosts
-
April 13, 2020 at 8:47 am #4915sthavishthaParticipant
Dear all
I am using the latest version of olb-v1.3-1. Unfortunately, both the example codes – dkt2d and settlingCube3d throw the same compilation errors as shown below. I have also tried
make cleanbuild
,make clean
andmake
, which still yield the same compilation errors.Compile dkt2d.cpp g++ -DOLB_PRECOMPILED -O3 -Wall -march=native -mtune=native -std=c++14 -I/cluster/home/sbhopala/olb/src -I/cluster/home/sbhopala/olb/src/ -I/cluster/home/sbhopala/olb/src/external -I/cluster/home/sbhopala/olb/src/external/zlib -c dkt2d.cpp -o /cluster/scratch/sbhopala/run_ictslbm/dkt2d/dkt2d.o In file included from /cluster/home/sbhopala/olb/src/functors/lattice/functors2D.hh:31:0, from /cluster/home/sbhopala/olb/src/functors/functors2D.hh:30, from /cluster/home/sbhopala/olb/src/olb2D.hh:5, from dkt2d.cpp:23: /cluster/home/sbhopala/olb/src/functors/lattice/blockLatticeLocalF2D.hh: In instantiation of ‘bool olb::BlockLatticePorousMomentumLossForce2D<T, DESCRIPTOR>::operator()(T*, const int*) [with T = double; DESCRIPTOR = olb::descriptors::D2Q9<olb::descriptors::POROSITY, olb::descriptors::VELOCITY_NUMERATOR, olb::descriptors::VELOCITY_DENOMINATOR>]’: dkt2d.cpp:268:1: required from here /cluster/home/sbhopala/olb/src/functors/lattice/blockLatticeLocalF2D.hh:1050:13: error: no matching function for call to ‘olb::Cell<double, olb::descriptors::D2Q9<olb::descriptors::POROSITY, olb::descriptors::VELOCITY_NUMERATOR, olb::descriptors::VELOCITY_DENOMINATOR> >::setField(double [2])’ this->_blockLattice.get(iX, iY).template setField<descriptors::VELOCITY_NUMERATOR>(reset_to_zero); ^ In file included from /cluster/home/sbhopala/olb/src/core/blockLatticeStructure2D.h:31:0, from /cluster/home/sbhopala/olb/src/boundary/boundaryCondition2D.h:31, from /cluster/home/sbhopala/olb/src/boundary/boundary2D.h:28, from /cluster/home/sbhopala/olb/src/olb2D.h:1, from dkt2d.cpp:22: /cluster/home/sbhopala/olb/src/core/cell.h:153:3: note: candidate: template<class FIELD, class X> olb::utilities::meta::enable_if_t<(X:: size<FIELD>() > 1), void> olb::Cell<T, DESCRIPTOR>::setField(const olb::Vector<T, DESCRIPTOR:: size<FIELD>()>&) [with FIELD = FIELD; X = X; T = double; DESCRIPTOR = olb::descriptors::D2Q9<olb::descriptors::POROSITY, olb::descriptors::VELOCITY_NUMERATOR, olb::descriptors::VELOCITY_DENOMINATOR>] setField(const Vector<T,DESCRIPTOR::template size<FIELD>()>& field) ^ /cluster/home/sbhopala/olb/src/core/cell.h:153:3: note: template argument deduction/substitution failed: /cluster/home/sbhopala/olb/src/core/cell.h: In substitution of ‘template<class FIELD, class X> olb::utilities::meta::enable_if_t<(X:: size<FIELD>() > 1), void> olb::Cell<T, DESCRIPTOR>::setField(const olb::Vector<T, DESCRIPTOR:: size<FIELD>()>&) [with FIELD = olb::descriptors::VELOCITY_NUMERATOR; X = <missing>]’: /cluster/home/sbhopala/olb/src/functors/lattice/blockLatticeLocalF2D.hh:1050:13: required from ‘bool olb::BlockLatticePorousMomentumLossForce2D<T, DESCRIPTOR>::operator()(T*, const int*) [with T = double; DESCRIPTOR = olb::descriptors::D2Q9<olb::descriptors::POROSITY, olb::descriptors::VELOCITY_NUMERATOR, olb::descriptors::VELOCITY_DENOMINATOR>]’ dkt2d.cpp:268:1: required from here /cluster/home/sbhopala/olb/src/core/cell.h:153:3: error: expression ‘size<olb::descriptors::VELOCITY_NUMERATOR>’ is not a constant-expression /cluster/home/sbhopala/olb/src/core/cell.h:153:3: note: in template argument for type ‘unsigned int’ /cluster/home/sbhopala/olb/src/functors/lattice/blockLatticeLocalF2D.hh: In instantiation of ‘bool olb::BlockLatticePorousMomentumLossForce2D<T, DESCRIPTOR>::operator()(T*, const int*) [with T = double; DESCRIPTOR = olb::descriptors::D2Q9<olb::descriptors::POROSITY, olb::descriptors::VELOCITY_NUMERATOR, olb::descriptors::VELOCITY_DENOMINATOR>]’: dkt2d.cpp:268:1: required from here /cluster/home/sbhopala/olb/src/core/cell.h:164:3: note: candidate: template<class FIELD, class X> olb::utilities::meta::enable_if_t<(X:: size<FIELD>() == 1), void> olb::Cell<T, DESCRIPTOR>::setField(T) [with FIELD = FIELD; X = X; T = double; DESCRIPTOR = olb::descriptors::D2Q9<olb::descriptors::POROSITY, olb::descriptors::VELOCITY_NUMERATOR, olb::descriptors::VELOCITY_DENOMINATOR>] setField(T value) ^ /cluster/home/sbhopala/olb/src/core/cell.h:164:3: note: template argument deduction/substitution failed: In file included from /cluster/home/sbhopala/olb/src/functors/lattice/functors2D.hh:31:0, from /cluster/home/sbhopala/olb/src/functors/functors2D.hh:30, from /cluster/home/sbhopala/olb/src/olb2D.hh:5, from dkt2d.cpp:23: /cluster/home/sbhopala/olb/src/functors/lattice/blockLatticeLocalF2D.hh:1050:13: note: cannot convert ‘reset_to_zero’ (type ‘double [2]’) to type ‘double’ this->_blockLattice.get(iX, iY).template setField<descriptors::VELOCITY_NUMERATOR>(reset_to_zero); ^ make: *** [/cluster/scratch/sbhopala/run_ictslbm/dkt2d/dkt2d.o] Error 1
I made appropriate changes in the
ROOT
andSRC
ofdefinitions.mk
. However, I don’t believe this to be the source of mistake as the parallel and sequential versions ofcavity2d
work.Regards
SthavishthaApril 13, 2020 at 12:25 pm #4925mathiasKeymasterPlease compile using the generic option in confik.mk according to:
#BUILDTYPE := precompiled
BUILDTYPE := genericDont forget to “make cleanbuild”.
Best
mathiasApril 13, 2020 at 12:31 pm #4928sthavishthaParticipantDear Dr. Mathias
I forgot to mention in my earlier post. I did try with a generic BUILDTYPE as well. Yet, I get the same error.
Regards
SthavishthaApril 13, 2020 at 12:50 pm #4929mathiasKeymasterOk, then resinstall everything without any changes and report if that clean version works in generic mode. It should work. From that clean starting point, apply step by step your wanted chanches and leave a meassage again in that forum if something doesnt work. Then, also state exactly which compiler you are using.
April 13, 2020 at 2:21 pm #4930sthavishthaParticipantDear Dr. Mathias
Thanks for the comments.
The error arises due to the compiler version. I now use GCC 6.2.0 and it works. Using an old compiler version (GCC 5.2.0) earlier was enough to compile
cavity2d, cylinder2d, cylinder3d
problems. So, I was unable to identify the issue earlier with the examples available in theparticles/
folder.Regards
Sthavishtha -
AuthorPosts
- You must be logged in to reply to this topic.