title: error: failed to read compiled module: No such file or directory
body: <p>I've just purchased the book Beginning C++20 (the eBook version) and I'm trying to compile the first example using the new C++20 method.</p>
  <p>The content of the source file is</p>
  <pre><code>// Ex1_01.cpp
  // A Complete C++ program
  import &lt;iostream&gt;;
  
  int main()
  {
      int answer{42};     // Defines answer with 42
      std::cout &lt;&lt; &quot;The answer to life, the universe, and everything is &quot;
          &lt;&lt; answer
          &lt;&lt; std::endl;
      return 0;
  }
  </code></pre>
  <p>If I understand correctly this is not yet supported by GCC version 10 or 11 (some sites claim that GCC 11 support it, but when I use the -fmodules-ts flag as some suggest there is an error message that it's not implemented/experimental and quits.</p>
  <p>After some searching I've found some posts refering to <a href="https://gcc.gnu.org/wiki/cxx-modules" rel="noreferrer">https://gcc.gnu.org/wiki/cxx-modules</a> where there are instructions to install a version of GCC 10 with support for modules (using the -fmodules-ts flag) but when I use that on my example code I get the following error:</p>
  <pre><code>In module imported at Ex1_01.cpp:3:1:
  /usr/local/include/c++/10.0.0/iostream: error: failed to read compiled module: No such file or directory
  /usr/local/include/c++/10.0.0/iostream: note: compiled module file is ‘gcm.cache/./usr/local/include/c++/10.0.0/iostream.gcm’
  /usr/local/include/c++/10.0.0/iostream: fatal error: jumping off the crazy train to crashville
  compilation terminated.
  </code></pre>
  <p>The version of gcc is:
  g++ (GCC) 10.0.0 20200110 (experimental) [svn-280157:20201220-1704]
  I found a post here on Stack Overflow where someone points to this version (<a href="https://stackoverflow.com/questions/58712244/how-to-compile-c-code-using-modules-ts-and-gcc-experimental">How to compile C++ code using modules-ts and gcc (experimental)?</a>)</p>
  <p>I also tried the examples from the wiki (hello.cc and main.cc) but those also give an error message:</p>
  <pre><code>In module imported at main.cpp:1:1:
  hello: error: failed to read compiled module: No such file or directory
  hello: note: compiled module file is ‘gcm.cache/hello.gcm’
  hello: fatal error: jumping off the crazy train to crashville
  compilation terminated.
  </code></pre>
  <p>Is there a way to make this work, or should I just start with the &quot;old&quot; #include method until there is a stable release of GCC 11 with support for modules? As I understand if I build the latest snapshot of GCC 11 most other C++20 specific code should work? (or just stick with the default (g++ (Debian 10.2.1-1) 10.2.1 20201207) version supplied by my distribution?)</p>