IntelligentSoftwareSystems / Galois

Galois: C++ library for multi-core and multi-node parallelization
http://iss.ices.utexas.edu/?p=projects/galois
Other
310 stars 131 forks source link

did you forget to ‘#include <optional>’? #401

Open OneMoreProblem opened 2 years ago

OneMoreProblem commented 2 years ago

After make install i get an error:


/home/r00662636/Galois/tools/graph-convert/graph-convert.cpp:39:1: note: ‘std::optional’ is defined in header ‘<optional>’; did you forget to ‘#include <optional>’?
   38 | #include <cstdlib>
  +++ |+#include <optional>
   39 |
/home/r00662636/Galois/tools/graph-convert/graph-convert.cpp:370:23: error: expected primary-expression before ‘>’ token
  370 |   std::optional<size_t> skippedLine;
      |                       ^
/home/r00662636/Galois/tools/graph-convert/graph-convert.cpp:370:25: error: ‘skippedLine’ was not declared in this scope; did you mean ‘skipLine’?
  370 |   std::optional<size_t> skippedLine;
      |                         ^~~~~~~~~~~
      |                         skipLine
/home/r00662636/Galois/tools/graph-convert/graph-convert.cpp: In function ‘void convertEdgelist(const string&, const string&, bool)’:
/home/r00662636/Galois/tools/graph-convert/graph-convert.cpp:533:32: error: ‘optional’ is not a member of ‘std’
  533 |                           std::optional<char>());
      |                                ^~~~~~~~
/home/r00662636/Galois/tools/graph-convert/graph-convert.cpp:533:32: note: ‘std::optional’ is defined in header ‘<optional>’; did you forget to ‘#include <optional>’?
/home/r00662636/Galois/tools/graph-convert/graph-convert.cpp:533:41: error: expected primary-expression before ‘char’
  533 |                           std::optional<char>());
      |                                         ^~~~
make[2]: *** [tools/graph-convert/CMakeFiles/graph-convert.dir/build.make:76: tools/graph-convert/CMakeFiles/graph-convert.dir/graph-convert.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:3573: tools/graph-convert/CMakeFiles/graph-convert.dir/all] Error 2
make: *** [Makefile:156: all] Error 2

it can be fixed by adding #include <optional> at the beginning of file

nicelhc13 commented 2 years ago

Hi, Thank you for reporting this. I cannot reproduce this error. Could you please give us more information? (e.g. compiler version that you used)

nicelhc13 commented 2 years ago

Ok, I checked your versions from your previous issue. Thank you for reporting this. Our current release focused on gcc < 11 and I suspect a compatibility issue. We will support the newest GCC and OS soon. Thank you for reporting this and feel free to make a PR if you want.