Closed gettl008 closed 3 years ago
Hi @gettl008,
Sorry about that, I never had this issue before. I suspect the problem is with a missing std library in the file Common.hpp
which might not be a problem with some compiler versions but it is with others. Unfortunately, I am currently in holidays so I cannot try it myself before next week. If you want to give it a shot, the edit is pretty simple: Insert #include <random>
on line 3 of file src/Common.hpp
. Re-build the project entirely from scratch to try (delete your build/
folder and make a new one, then recompile).
Let me know how it goes.
Guillaume
Hi, sorry if I bother getting in here. I got the same compilation problem that @gettl008.
I tried your suggestion @GuillaumeHolley and it seemed that it work for that part (progress was made). Unfortunately, other compilation problems arose:
Scanning dependencies of target bifrost_lib
[ 5%] Completed 'bifrost_lib'
[ 44%] Built target bifrost_lib
Scanning dependencies of target Ratatosk
[ 50%] Building CXX object src/CMakeFiles/Ratatosk.dir/Alignment.cpp.o
[ 55%] Building CXX object src/CMakeFiles/Ratatosk.dir/Common.cpp.o
[ 61%] Building CXX object src/CMakeFiles/Ratatosk.dir/Correction.cpp.o
[ 66%] Building CXX object src/CMakeFiles/Ratatosk.dir/Graph.cpp.o
[ 72%] Building CXX object src/CMakeFiles/Ratatosk.dir/GraphTraversal.cpp.o
[ 77%] Building CXX object src/CMakeFiles/Ratatosk.dir/PairID.cpp.o
/home/svillanu/Programs/Ratatosk/src/PairID.cpp: In member function ‘PairID PairID::subsample(uint64_t) const’:
/home/svillanu/Programs/Ratatosk/src/PairID.cpp:1238:14: error: ‘random_device’ is not a member of ‘std’
std::random_device rd; // Seed
^~~~~~~~~~~~~
/home/svillanu/Programs/Ratatosk/src/PairID.cpp:1238:14: note: suggested alternative: ‘random_shuffle’
std::random_device rd; // Seed
^~~~~~~~~~~~~
random_shuffle
/home/svillanu/Programs/Ratatosk/src/PairID.cpp:1239:14: error: ‘default_random_engine’ is not a member of ‘std’
std::default_random_engine generator(rd()); // Random number generator
^~~~~~~~~~~~~~~~~~~~~
/home/svillanu/Programs/Ratatosk/src/PairID.cpp:1244:42: error: ‘generator’ was not declared in this scope
const int pos = distribution(generator);
^~~~~~~~~
/home/svillanu/Programs/Ratatosk/src/PairID.cpp:1244:42: note: suggested alternative: ‘operator+’
const int pos = distribution(generator);
^~~~~~~~~
operator+
make[2]: *** [src/CMakeFiles/Ratatosk.dir/PairID.cpp.o] Error 1
make[1]: *** [src/CMakeFiles/Ratatosk.dir/all] Error 2
make: *** [all] Error 2
I know nothing about C++, but it came to my mind to try your suggestion on src/PairID.hpp
as well, and it worked like a charm.
I hope it helps, Cheers
That seems to have done the trick. Thanks @GuillaumeHolley @sivico26 !
Thank you @gettl008 and @sivico26 for reporting these issues. Fixes have been made to the code. I am closing the issue, feel free to open another one if you encounter any other problem.
I have the same issue too. I have downloaded fresh repository via git and compiled it. The message is
/app/Ratatosk/src/PairID.cpp: In member function 'PairID PairID::subsample(uint64_t) const': /app/Ratatosk/src/PairID.cpp:1238:14: error: 'random_device' is not a member of 'std' 1238 | std::random_device rd; // Seed | ^~~~~~~~~~~~~ ... ... [ 50%] Building CXX object src/CMakeFiles/Ratatosk.dir/Common.cpp.o /app/Ratatosk/src/Common.cpp: In function 'PairID subsample(const SharedPairID&, size_t)': /app/Ratatosk/src/Common.cpp:347:26: error: 'random_device' is not a member of 'std' 347 | std::random_device rd; // Seed | ^~~~~~~~~~~~~
I have tried both gcc 9.4 and gcc 11.2 for Ratatosk to compile.
Hi @asantat,
It is weird that after the addition of #include <random>
in src/Common.hpp
and src/PairID.hpp
, this does not work for you, I'm not sure to understand what's going on here. Can you ensure that both files have #include <random>
at their top in your local clone? Also, can you make a fresh install by deleting the whole build
folder, making a new one and compiling from scratch again? Thanks.
I assume no news is good news and will therefore close this issue.
I've been using FMLRC but would love to give Ratatosk a go. Unfortunately, I've run into a compiling error.
[ 55%] Building CXX object src/CMakeFiles/Ratatosk.dir/Common.cpp.o /home/travisan/public/local/soft/Ratatosk/src/Common.cpp: In function 'PairID subsample(const SharedPairID&, size_t)': /home/travisan/public/local/soft/Ratatosk/src/Common.cpp:347:12: error: 'random_device' is not a member of 'std' std::random_device rd; // Seed ^
~~~~ /home/travisan/public/local/soft/Ratatosk/src/Common.cpp:347:12: note: suggested alternative: 'ratio_divide' std::random_device rd; // Seed ^~~~~ ratio_divide /home/travisan/public/local/soft/Ratatosk/src/Common.cpp:348:12: error: 'default_random_engine' is not a member of 'std' std::default_random_engine generator(rd()); // Random number generator ^~~~~/home/travisan/public/local/soft/Ratatosk/src/Common.cpp:348:12: note: suggested alternative: 'default_delete' std::default_random_engine generator(rd()); // Random number generator ^~~~~default_delete /home/travisan/public/local/soft/Ratatosk/src/Common.cpp:353:37: error: 'generator' was not declared in this scope const int pos = distribution(generator); ^~~~~ /home/travisan/public/local/soft/Ratatosk/src/Common.cpp:353:37: note: suggested alternative: 'gzerror' const int pos = distribution(generator); ^~~~~ gzerror /home/travisan/public/local/soft/Ratatosk/src/Common.cpp: In function 'PairID subsample(const PairID&, size_t)': /home/travisan/public/local/soft/Ratatosk/src/Common.cpp:376:12: error: 'random_device' is not a member of 'std' std::random_device rd; // Seed ^~~~~ /home/travisan/public/local/soft/Ratatosk/src/Common.cpp:376:12: note: suggested alternative: 'ratio_divide' std::random_device rd; // Seed ^~~~~ ratio_divide /home/travisan/public/local/soft/Ratatosk/src/Common.cpp:377:12: error: 'default_random_engine' is not a member of 'std' std::default_random_engine generator(rd()); // Random number generator ^~~~~/home/travisan/public/local/soft/Ratatosk/src/Common.cpp:377:12: note: suggested alternative: 'default_delete' std::default_random_engine generator(rd()); // Random number generator ^~~~~default_delete /home/travisan/public/local/soft/Ratatosk/src/Common.cpp:382:37: error: 'generator' was not declared in this scope const int pos = distribution(generator); ^~~~~ /home/travisan/public/local/soft/Ratatosk/src/Common.cpp:382:37: note: suggested alternative: 'gzerror' const int pos = distribution(generator); ^~~~~ gzerror make[2]: [src/CMakeFiles/Ratatosk.dir/build.make:76: src/CMakeFiles/Ratatosk.dir/Common.cpp.o] Error 1 make[2]: Leaving directory '/panfs/roc/groups/5/travisan/public/local/soft/Ratatosk/build' make[1]: [CMakeFiles/Makefile2:123: src/CMakeFiles/Ratatosk.dir/all] Error 2 make[1]: Leaving directory '/panfs/roc/groups/5/travisan/public/local/soft/Ratatosk/build' make: *** [Makefile:130: all] Error 2I am trying to build it locally on a public server (CentOS v.7). Any ideas? Thanks!