Building fails under Ubuntu 18.04 with GCC 7
huangshincheng opened this issue · 3 comments
Hi thanks for the repo. I am compiling visqol in Ubuntu 18.04 with GCC 7.5.0
bazel build :visqol -c opt
I get the filesystem include error.
Then I found similar issue in here https://stackoverflow.com/questions/73974753/undefined-reference-to-stdfilesystem-using-bazel-build
Now I am trying to use gcc 8 to compile visqol based on the link above.
Just a quick question. Is there a gcc version that you recommend to use ? gcc 8 or above?
Sorry for the delay. I hope that worked for you, let me know if not.
To answer your question, we don't have a specific gcc version we recommend (some people build with clang). The main requirement is that it supports C++17 (the filesystem module became available in that standard).
@huangshincheng Did you manage to fix it? I am having the same error and the installation of gcc-8 did not really help, since gcc --version
still returned 7.5.0, and I even removed gcc-7.5, but it didn't help either, so I am completely stucked now, would really appreciate your help.
To anyone who also struggles with this, do the following
apt-get install gcc-8 g++-8
to install gcc-8
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 8
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-8 8
to make gcc-8 the default one, then run bazel clean --expunge
and bazel build :visqol -c opt