Compile error JointedCohesiveFrictionalPM

Asked by William Chevremont

Hi,

I've just updated the source code of yade using git pull and I get this compile error, comming from code added 2 days ago:

/media/datas/Yade2/trunk/pkg/dem/JointedCohesiveFrictionalPM.cpp: In member function ‘void Ip2_JCFpmMat_JCFpmMat_JCFpmPhys::distributeCrossSectionsWeibull(boost::shared_ptr<JCFpmPhys>, Real, Real)’:
/media/datas/Yade2/trunk/pkg/dem/JointedCohesiveFrictionalPM.cpp:600:7: error: ‘random_device’ is not a member of ‘std’
  std::random_device rd;
       ^~~~~~~~~~~~~
/media/datas/Yade2/trunk/pkg/dem/JointedCohesiveFrictionalPM.cpp:600:7: note: suggested alternative: ‘random_shuffle’
  std::random_device rd;
       ^~~~~~~~~~~~~
       random_shuffle
/media/datas/Yade2/trunk/pkg/dem/JointedCohesiveFrictionalPM.cpp:601:7: error: ‘mt19937’ is not a member of ‘std’
  std::mt19937 e2(rd());
       ^~~~~~~
/media/datas/Yade2/trunk/pkg/dem/JointedCohesiveFrictionalPM.cpp:602:7: error: ‘weibull_distribution’ is not a member of ‘std’
  std::weibull_distribution<Real> weibullDistribution(xSectionWeibullShapeParameter, xSectionWeibullScaleParameter);
       ^~~~~~~~~~~~~~~~~~~~
/media/datas/Yade2/trunk/pkg/dem/JointedCohesiveFrictionalPM.cpp:602:7: note: suggested alternative: ‘uniform_int_distribution’
  std::weibull_distribution<Real> weibullDistribution(xSectionWeibullShapeParameter, xSectionWeibullScaleParameter);
       ^~~~~~~~~~~~~~~~~~~~
       uniform_int_distribution
/media/datas/Yade2/trunk/pkg/dem/JointedCohesiveFrictionalPM.cpp:602:32: error: expected primary-expression before ‘>’ token
  std::weibull_distribution<Real> weibullDistribution(xSectionWeibullShapeParameter, xSectionWeibullScaleParameter);
                                ^
/media/datas/Yade2/trunk/pkg/dem/JointedCohesiveFrictionalPM.cpp:602:34: error: ‘weibullDistribution’ was not declared in this scope
  std::weibull_distribution<Real> weibullDistribution(xSectionWeibullShapeParameter, xSectionWeibullScaleParameter);
                                  ^~~~~~~~~~~~~~~~~~~
/media/datas/Yade2/trunk/pkg/dem/JointedCohesiveFrictionalPM.cpp:602:34: note: suggested alternative: ‘weibullCutOffMin’
  std::weibull_distribution<Real> weibullDistribution(xSectionWeibullShapeParameter, xSectionWeibullScaleParameter);
                                  ^~~~~~~~~~~~~~~~~~~
                                  weibullCutOffMin
/media/datas/Yade2/trunk/pkg/dem/JointedCohesiveFrictionalPM.cpp:603:40: error: ‘e2’ was not declared in this scope
  Real correction = weibullDistribution(e2);
                                        ^~
/media/datas/Yade2/trunk/pkg/dem/JointedCohesiveFrictionalPM.cpp:603:40: note: suggested alternative: ‘R2’
  Real correction = weibullDistribution(e2);
                                        ^~
                                        R2

Question information

Language:
English Edit question
Status:
Answered
For:
Yade Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Robert Caulk (rcaulk) said :
#1

Hello William,

Which linux distribution are you running? Which compiler are you using (gcc --version)?

As Bruno mentions on yade-dev, your most recent build passes the buildbot [1] - so it may be a local problem. (I think Bruno's message [2] was not posted here as intended. He suggests you join yade-dev list serv [3] and send compiler questions there).

Although it seems unlikely - is it possible this has something to do with this unusual merge of master with itself [4]? Is that a merge into your local repository? Perhaps you are you working off a read-only clone? Do you have duplicated commits on your local machine? I can't quite figure out what is going on there, the "merge" seems to simply add commits that are already committed to the repository.

Cheers,

Robert

[1]https://yade-dem.org/buildbot/builders/yade-full/builds/4507
[2]https://lists.launchpad.net/yade-dev/msg13755.html
[3]https://launchpad.net/~yade-dev
[4]https://github.com/yade/trunk/commit/921bb17079fea51385fe620526f9bc48c055918e

Revision history for this message
Thomas Chauve (chauvet) said :
#2

Hello

I have similar probleme with the latest mater branch (from 12/03/2018). I compile it on Debian 9 with GCC 6.3.0.
I had no trouble before (last version tested is the one dated of 21/02/2018).

I see that JointedCohesiveFrictionalPM.cpp JointedCohesiveFrictionalPM.cpp have been modified 6 day ago.
I try someting : I compile the new master (from 12/03/2018) with the old JointedCohesiveFrictionalPM.cpp JointedCohesiveFrictionalPM.cpp (from 21/02/2018 branch) and it works.

I hope it can helps.

Cheers
Thomas

Revision history for this message
William Chevremont (william.chevremont) said :
#3

Solved by adding #include <random> into JointedCohesiveFrictionalpm.hpp, Thanks Robert.

Can you help with this problem?

Provide an answer of your own, or ask William Chevremont for more information if necessary.

To post a message you must log in.