{"id":8438,"date":"2023-10-16T07:37:09","date_gmt":"2023-10-16T07:37:09","guid":{"rendered":"https:\/\/www.modernescpp.com\/?p=8438"},"modified":"2023-10-28T08:48:41","modified_gmt":"2023-10-28T08:48:41","slug":"c20-module-support-of-the-big-three-compilers","status":"publish","type":"post","link":"https:\/\/www.modernescpp.com\/index.php\/c20-module-support-of-the-big-three-compilers\/","title":{"rendered":"C++20: Module Support of the Big Three"},"content":{"rendered":"\n<p>I have written almost 100 posts about <a href=\"https:\/\/www.modernescpp.com\/index.php\/category\/blog\/c-20\/\" data-type=\"link\" data-id=\"https:\/\/www.modernescpp.com\/index.php\/category\/blog\/c-20\/\">C++20<\/a> in the last four years, but I&#8217;m not done. This post continues my story about C++20.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1030\" height=\"390\" src=\"https:\/\/www.modernescpp.com\/wp-content\/uploads\/2023\/10\/TimelineCpp20-1-1030x390.png\" alt=\"\" class=\"wp-image-8442\" srcset=\"https:\/\/www.modernescpp.com\/wp-content\/uploads\/2023\/10\/TimelineCpp20-1-1030x390.png 1030w, https:\/\/www.modernescpp.com\/wp-content\/uploads\/2023\/10\/TimelineCpp20-1-300x114.png 300w, https:\/\/www.modernescpp.com\/wp-content\/uploads\/2023\/10\/TimelineCpp20-1-768x291.png 768w, https:\/\/www.modernescpp.com\/wp-content\/uploads\/2023\/10\/TimelineCpp20-1-705x267.png 705w, https:\/\/www.modernescpp.com\/wp-content\/uploads\/2023\/10\/TimelineCpp20-1-845x321.png 845w, https:\/\/www.modernescpp.com\/wp-content\/uploads\/2023\/10\/TimelineCpp20-1.png 1077w\" sizes=\"auto, (max-width: 1030px) 100vw, 1030px\" \/><\/figure>\n\n\n\n<p>Modules are one of the Big Four in C++20. In my C++20 classes, they are one of the main topics. Sadly, the implementation in GCC and Clang was way behind the Microsoft Compiler. Consequentially, I usually used the Microsoft Compiler in my classes, my talks, and books to present modules. I&#8217;m happy to say that the module support of GCC and Clang significantly improved. I will, therefore, present the current module implementation state (10\/2023) of the Big Three GCC, Clang, and MSVC in this post.<\/p>\n\n\n\n<p>If you are not familiar with modules in C++20, here is a simple example:<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">A Simple Module<\/h2>\n\n\n\n<p>This is the module <code>math<\/code>. <\/p>\n\n\n\n<!-- HTML generated using hilite.me --><div style=\"background: #f0f3f3; overflow:auto;width:auto;gray;border-width:.1em .1em .1em .8em\"><pre style=\"margin: 0; line-height: 125%\"><span style=\"color: #0099FF; font-style: italic\">\/\/ math1.ixx<\/span>\n\nmodule;                  <span style=\"color: #0099FF; font-style: italic\">\/\/ (1)          <\/span>\n\n<span style=\"color: #009999\">#include &lt;numeric&gt;<\/span>\n<span style=\"color: #009999\">#include &lt;vector&gt;<\/span>\n\n<span style=\"color: #006699; font-weight: bold\">export<\/span> module math;      <span style=\"color: #0099FF; font-style: italic\">\/\/ (2) <\/span>\n\n<span style=\"color: #006699; font-weight: bold\">export<\/span> <span style=\"color: #007788; font-weight: bold\">int<\/span> <span style=\"color: #CC00FF\">add<\/span>(<span style=\"color: #007788; font-weight: bold\">int<\/span> fir, <span style=\"color: #007788; font-weight: bold\">int<\/span> sec){\n    <span style=\"color: #006699; font-weight: bold\">return<\/span> fir <span style=\"color: #555555\">+<\/span> sec;\n}\n\n<span style=\"color: #006699; font-weight: bold\">export<\/span> <span style=\"color: #007788; font-weight: bold\">int<\/span> <span style=\"color: #CC00FF\">getProduct<\/span>(<span style=\"color: #006699; font-weight: bold\">const<\/span> std<span style=\"color: #555555\">::<\/span>vector<span style=\"color: #555555\">&lt;<\/span><span style=\"color: #007788; font-weight: bold\">int<\/span><span style=\"color: #555555\">&gt;&amp;<\/span> vec) {\n    <span style=\"color: #006699; font-weight: bold\">return<\/span> std<span style=\"color: #555555\">::<\/span>accumulate(vec.begin(), vec.end(), <span style=\"color: #FF6600\">1<\/span>, std<span style=\"color: #555555\">::<\/span>multiplies<span style=\"color: #555555\">&lt;<\/span><span style=\"color: #007788; font-weight: bold\">int<\/span><span style=\"color: #555555\">&gt;<\/span>());\n}\n<\/pre><\/div>\n\n\n\n<p>The global module fragment starts with the keyword <code>module <\/code>(line 1) and ends with the exporting module declaration (line 3). The global module fragment is the place to use preprocessor directives such as <code>#include<\/code> so that the module can compile. Preprocessor entities used inside the global module fragment are only visible inside the module. The module <code>math <\/code>exports the two functions <code>add <\/code>and <code>getProduct<\/code>.<\/p>\n\n\n\n<p>&nbsp;The client imports the module <code>math <\/code>(line 1) and uses its functionality:<\/p>\n\n\n\n<!-- HTML generated using hilite.me --><div style=\"background: #f0f3f3; overflow:auto;width:auto;gray;border-width:.1em .1em .1em .8em\"><pre style=\"margin: 0; line-height: 125%\"><span style=\"color: #0099FF; font-style: italic\">\/\/ client1.cpp<\/span>\n\n<span style=\"color: #009999\">#include &lt;iostream&gt;<\/span>\n<span style=\"color: #009999\">#include &lt;vector&gt;<\/span>\n\nimport math;                        <span style=\"color: #0099FF; font-style: italic\">\/\/ (1)<\/span>\n\n<span style=\"color: #007788; font-weight: bold\">int<\/span> <span style=\"color: #CC00FF\">main<\/span>() {\n    \n    std<span style=\"color: #555555\">::<\/span>cout <span style=\"color: #555555\">&lt;&lt;<\/span> <span style=\"color: #CC3300\">&#39;\\n&#39;<\/span>;   \n   \n    std<span style=\"color: #555555\">::<\/span>cout <span style=\"color: #555555\">&lt;&lt;<\/span> <span style=\"color: #CC3300\">&quot;add(2000, 20): &quot;<\/span> <span style=\"color: #555555\">&lt;&lt;<\/span> add(<span style=\"color: #FF6600\">2000<\/span>, <span style=\"color: #FF6600\">20<\/span>) <span style=\"color: #555555\">&lt;&lt;<\/span> <span style=\"color: #CC3300\">&#39;\\n&#39;<\/span>;\n    \n    std<span style=\"color: #555555\">::<\/span>vector<span style=\"color: #555555\">&lt;<\/span><span style=\"color: #007788; font-weight: bold\">int<\/span><span style=\"color: #555555\">&gt;<\/span> myVec{<span style=\"color: #FF6600\">1<\/span>, <span style=\"color: #FF6600\">2<\/span>, <span style=\"color: #FF6600\">3<\/span>, <span style=\"color: #FF6600\">4<\/span>, <span style=\"color: #FF6600\">5<\/span>, <span style=\"color: #FF6600\">6<\/span>, <span style=\"color: #FF6600\">7<\/span>, <span style=\"color: #FF6600\">8<\/span>, <span style=\"color: #FF6600\">9<\/span>, <span style=\"color: #FF6600\">10<\/span>};\n    \n    std<span style=\"color: #555555\">::<\/span>cout <span style=\"color: #555555\">&lt;&lt;<\/span> <span style=\"color: #CC3300\">&quot;getProduct(myVec): &quot;<\/span> <span style=\"color: #555555\">&lt;&lt;<\/span> getProduct(myVec) <span style=\"color: #555555\">&lt;&lt;<\/span> <span style=\"color: #CC3300\">&#39;\\n&#39;<\/span>;\n    \n    std<span style=\"color: #555555\">::<\/span>cout <span style=\"color: #555555\">&lt;&lt;<\/span> <span style=\"color: #CC3300\">&#39;\\n&#39;<\/span>;\n   \n}\n<\/pre><\/div>\n\n\n\n<p>Finally, this is the output of the program:<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-medium\"><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"165\" src=\"https:\/\/www.modernescpp.com\/wp-content\/uploads\/2023\/10\/client1-300x165.png\" alt=\"\" class=\"wp-image-8449\" srcset=\"https:\/\/www.modernescpp.com\/wp-content\/uploads\/2023\/10\/client1-300x165.png 300w, https:\/\/www.modernescpp.com\/wp-content\/uploads\/2023\/10\/client1-768x421.png 768w, https:\/\/www.modernescpp.com\/wp-content\/uploads\/2023\/10\/client1-705x387.png 705w, https:\/\/www.modernescpp.com\/wp-content\/uploads\/2023\/10\/client1.png 1026w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/figure>\n\n\n\n<p>Of course, there is a lot more to modules you should know. I suggest that you read the following posts:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><a href=\"https:\/\/bit.ly\/cpp20-module\">The Advantages of Modules<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/bit.ly\/SimpleMathModul\">A Simple math Modul<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/bit.ly\/ModuleInterfaceUnitModuleImplementationUnit\">Module Interface Unit and Module Implementation Unit<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/bit.ly\/DivideModules\">Structure Modules<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/bit.ly\/ModulesOpenQuestions\">Open Questions to Modules<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.modernescpp.com\/index.php\/c-20-modules-private-module-fragment-and-header-units\">Private Module Fragment and Header Units<\/a><\/li>\n<\/ol>\n\n\n\n<p>I started with a simple module, and I will make it even more simple when I discuss the module implementation state of GCC, Clang, and MSVC.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Implementation State<\/h2>\n\n\n\n<p><code>math.ixx<\/code> defines the module <code>math<\/code>, I will use it in the following comparison.<\/p>\n\n\n\n<!-- HTML generated using hilite.me --><div style=\"background: #f0f3f3; overflow:auto;width:auto;gray;border-width:.1em .1em .1em .8em\"><pre style=\"margin: 0; line-height: 125%\"><span style=\"color: #0099FF; font-style: italic\">\/\/ math.ixx<\/span>\n\n<span style=\"color: #006699; font-weight: bold\">export<\/span> module math;     <span style=\"color: #0099FF; font-style: italic\">\/\/ (1)<\/span>\n\n<span style=\"color: #006699; font-weight: bold\">export<\/span> <span style=\"color: #007788; font-weight: bold\">int<\/span> <span style=\"color: #CC00FF\">add<\/span>(<span style=\"color: #007788; font-weight: bold\">int<\/span> fir, <span style=\"color: #007788; font-weight: bold\">int<\/span> sec){\n    <span style=\"color: #006699; font-weight: bold\">return<\/span> fir <span style=\"color: #555555\">+<\/span> sec;\n}\n<\/pre><\/div>\n\n\n\n<p>Additionally, here is the client program <code>client.cpp <\/code>importing the module <code>math<\/code>.<\/p>\n\n\n\n<!-- HTML generated using hilite.me --><div style=\"background: #f0f3f3; overflow:auto;width:auto;gray;border-width:.1em .1em .1em .8em\"><pre style=\"margin: 0; line-height: 125%\"><span style=\"color: #0099FF; font-style: italic\">\/\/ client.cpp<\/span>\n\nimport math;       <span style=\"color: #0099FF; font-style: italic\">\/\/ (2)<\/span>\n\n<span style=\"color: #007788; font-weight: bold\">int<\/span> <span style=\"color: #CC00FF\">main<\/span>() {\n   \n   add(<span style=\"color: #FF6600\">2000<\/span>, <span style=\"color: #FF6600\">20<\/span>);\n   \n}\n<\/pre><\/div>\n\n\n\n<p>Line (1) is the exporting module declaration, and line (2) imports the module. For obvious reasons, I will not show you the program&#8217;s output. <\/p>\n\n\n\n<p>First, you may wonder why I called the module declaration file <code>math.ixx<\/code>. Here is the first irritating point.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Module Declaration File<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The Microsoft compiler uses the extension <code>ixx<\/code>. The suffix <code>ixx <\/code>stands for a module interface source.<\/li>\n\n\n\n<li>The Clang compiler uses the extension <code>cppm<\/code>. The m in the suffix probably stands for module.<\/li>\n\n\n\n<li>The GCC compiler uses no special extension.<\/li>\n<\/ul>\n\n\n\n<p>These are only the defaults that you can change. Now, let me compile and use the module <code>math<\/code>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Compile and Use the Module<\/h3>\n\n\n\n<p>First, I start with  Microsofts cl.exe 19.29.30133 for x64 compiler.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Microsoft Compiler<\/h4>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"642\" height=\"201\" src=\"https:\/\/www.modernescpp.com\/wp-content\/uploads\/2023\/10\/MicrosoftCompiler.png\" alt=\"\" class=\"wp-image-8457\" srcset=\"https:\/\/www.modernescpp.com\/wp-content\/uploads\/2023\/10\/MicrosoftCompiler.png 642w, https:\/\/www.modernescpp.com\/wp-content\/uploads\/2023\/10\/MicrosoftCompiler-300x94.png 300w\" sizes=\"auto, (max-width: 642px) 100vw, 642px\" \/><\/figure>\n\n\n\n<p>These are the steps to compile and use the module with the Microsoft compiler. I only show the minimal command line. As promised, more will follow in the next post. Additionally, with an older Microsoft compiler, you must use the flag <code>\/std:c++latest<\/code> instead of the flag <code>\/std:c++20<\/code>.<\/p>\n\n\n\n<!-- HTML generated using hilite.me --><div style=\"background: #f0f3f3; overflow:auto;width:auto;gray;border-width:.1em .1em .1em .8em\"><pre style=\"margin: 0; line-height: 125%\">cl.exe <span style=\"color: #555555\">\/<\/span>std<span style=\"color: #555555\">:<\/span>c<span style=\"color: #555555\">++<\/span><span style=\"color: #FF6600\">20<\/span> <span style=\"color: #555555\">\/<\/span>c math.ixx           \ncl.exe <span style=\"color: #555555\">\/<\/span>std<span style=\"color: #555555\">:<\/span>c<span style=\"color: #555555\">++<\/span><span style=\"color: #FF6600\">20<\/span> client.cpp math.obj\n<\/pre><\/div>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Line 1 creates an obj file <code>math.obj<\/code> and an IFC file <code>math.ifc<\/code>. The IFC is the module and contains the metadata description of the module interface. The binary format of the IFC is modeled after the <a href=\"https:\/\/www.stroustrup.com\/gdr-bs-macis09.pdf\" data-type=\"link\" data-id=\"https:\/\/www.stroustrup.com\/gdr-bs-macis09.pdf\">Internal Program Representation<\/a> by Gabriel Dos Reis and Bjarne Stroustrup.<\/li>\n\n\n\n<li>Line 2 creates the executable <code>client.exe<\/code>. The compiler implicitly finds the compiled <code>math.ifc<\/code> from the first step.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"735\" height=\"478\" src=\"https:\/\/www.modernescpp.com\/wp-content\/uploads\/2023\/10\/implicitIFC.png\" alt=\"\" class=\"wp-image-8461\" srcset=\"https:\/\/www.modernescpp.com\/wp-content\/uploads\/2023\/10\/implicitIFC.png 735w, https:\/\/www.modernescpp.com\/wp-content\/uploads\/2023\/10\/implicitIFC-300x195.png 300w, https:\/\/www.modernescpp.com\/wp-content\/uploads\/2023\/10\/implicitIFC-705x458.png 705w\" sizes=\"auto, (max-width: 735px) 100vw, 735px\" \/><\/figure>\n\n\n\n<p>Now, let&#8217;s continue with the Clang compiler<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Clang Compiler<\/h4>\n\n\n\n<p>I use the Clang 16.0.5 compiler.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"898\" height=\"210\" src=\"https:\/\/www.modernescpp.com\/wp-content\/uploads\/2023\/10\/clangCompiler.png\" alt=\"\" class=\"wp-image-8465\" srcset=\"https:\/\/www.modernescpp.com\/wp-content\/uploads\/2023\/10\/clangCompiler.png 898w, https:\/\/www.modernescpp.com\/wp-content\/uploads\/2023\/10\/clangCompiler-300x70.png 300w, https:\/\/www.modernescpp.com\/wp-content\/uploads\/2023\/10\/clangCompiler-768x180.png 768w, https:\/\/www.modernescpp.com\/wp-content\/uploads\/2023\/10\/clangCompiler-705x165.png 705w\" sizes=\"auto, (max-width: 898px) 100vw, 898px\" \/><\/figure>\n\n\n\n<p>The Clang compiler expects a module with the extension cppm. Consequently, I must rename the <code>math.ixx<\/code> file to <code>math.cppm<\/code>. On the contrary, the file <code>client.cpp<\/code> is unchanged. Finally, here are the corresponding build and use steps:<\/p>\n\n\n\n<!-- HTML generated using hilite.me --><div style=\"background: #f0f3f3; overflow:auto;width:auto;gray;border-width:.1em .1em .1em .8em\"><pre style=\"margin: 0; line-height: 125%\">clang<span style=\"color: #555555\">++<\/span> <span style=\"color: #555555\">-<\/span>std<span style=\"color: #555555\">=<\/span>c<span style=\"color: #555555\">++<\/span><span style=\"color: #FF6600\">20<\/span> <span style=\"color: #555555\">-<\/span>c math.cppm <span style=\"color: #555555\">--<\/span>precompile <span style=\"color: #555555\">-<\/span>o math.pcm\nclang<span style=\"color: #555555\">++<\/span> <span style=\"color: #555555\">-<\/span>std<span style=\"color: #555555\">=<\/span>c<span style=\"color: #555555\">++<\/span><span style=\"color: #FF6600\">20<\/span> client.cpp <span style=\"color: #555555\">-<\/span>fprebuilt<span style=\"color: #555555\">-<\/span>module<span style=\"color: #555555\">-<\/span>path<span style=\"color: #555555\">=<\/span>. math.pcm <span style=\"color: #555555\">-<\/span>o client.exe\n<\/pre><\/div>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Line 1 creates the module <code>math.pcm<\/code>. The suffix <code>pcm <\/code>stands for precompiled module and is equivalent to the <code>ifc <\/code>file extension of the &nbsp;Microsoft Visual Compiler. Additionally, the produced module already includes the module definition. Consequentially, the Clang compiler does not produce an object file <code>math.o<\/code>. The option <code>--precompile<\/code> is necessary for creating the precompiled module.<\/li>\n\n\n\n<li>Line 2 creates the executable<code> client.exe<\/code>, which uses the module <code>math.pcm<\/code>. The Clang compiler requires that you specify the path to the module with the <code>-fprebuilt-module-path<\/code> flag. If not, the link process fails:<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"788\" height=\"195\" src=\"https:\/\/www.modernescpp.com\/wp-content\/uploads\/2023\/10\/clangCompilerFailed.png\" alt=\"\" class=\"wp-image-8468\" style=\"width:600px;height:undefinedpx\" srcset=\"https:\/\/www.modernescpp.com\/wp-content\/uploads\/2023\/10\/clangCompilerFailed.png 788w, https:\/\/www.modernescpp.com\/wp-content\/uploads\/2023\/10\/clangCompilerFailed-300x74.png 300w, https:\/\/www.modernescpp.com\/wp-content\/uploads\/2023\/10\/clangCompilerFailed-768x190.png 768w, https:\/\/www.modernescpp.com\/wp-content\/uploads\/2023\/10\/clangCompilerFailed-705x174.png 705w\" sizes=\"auto, (max-width: 788px) 100vw, 788px\" \/><\/figure>\n\n\n\n<p>Finally, let me do it with the GCC compiler.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">GCC Compiler<\/h4>\n\n\n\n<p>I use the GCC 11.1.0 compiler.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"788\" height=\"321\" src=\"https:\/\/www.modernescpp.com\/wp-content\/uploads\/2023\/10\/gcc.png\" alt=\"\" class=\"wp-image-8473\" style=\"width:650px;height:undefinedpx\" srcset=\"https:\/\/www.modernescpp.com\/wp-content\/uploads\/2023\/10\/gcc.png 788w, https:\/\/www.modernescpp.com\/wp-content\/uploads\/2023\/10\/gcc-300x122.png 300w, https:\/\/www.modernescpp.com\/wp-content\/uploads\/2023\/10\/gcc-768x313.png 768w, https:\/\/www.modernescpp.com\/wp-content\/uploads\/2023\/10\/gcc-705x287.png 705w\" sizes=\"auto, (max-width: 788px) 100vw, 788px\" \/><\/figure>\n\n\n\n<p>The GCC Compiler neither expected Window&#8217;s <code>ixx<\/code> nor Clang&#8217;s <code>cppm<\/code> suffix. Consequently, I rename the <code>math.ixx<\/code> file into a cpp file:<code> math.cxx<\/code>. The<code> client.cpp<\/code> is identical to the one I used with the Microsoft and the Clang compiler.<\/p>\n\n\n\n<!-- HTML generated using hilite.me --><div style=\"background: #f0f3f3; overflow:auto;width:auto;gray;border-width:.1em .1em .1em .8em\"><pre style=\"margin: 0; line-height: 125%\">g<span style=\"color: #555555\">++<\/span> <span style=\"color: #555555\">-<\/span>c <span style=\"color: #555555\">-<\/span>std<span style=\"color: #555555\">=<\/span>c<span style=\"color: #555555\">++<\/span><span style=\"color: #FF6600\">20<\/span> <span style=\"color: #555555\">-<\/span>fmodules<span style=\"color: #555555\">-<\/span>ts math.cxx\ng<span style=\"color: #555555\">++<\/span> <span style=\"color: #555555\">-<\/span>std<span style=\"color: #555555\">=<\/span>c<span style=\"color: #555555\">++<\/span><span style=\"color: #FF6600\">20<\/span> <span style=\"color: #555555\">-<\/span>fmodules<span style=\"color: #555555\">-<\/span>ts client.cpp math.o <span style=\"color: #555555\">-<\/span>o client\n<\/pre><\/div>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Line 1 creates the module <code>math.gcm<\/code> and the object file <code>math.o<\/code>. I have to specify <code>-fmodules-ts<\/code>. The extension &#8211;<code>fmodules-ts<\/code> irritates me because <code>ts <\/code>usually stands for technical specification.  The module <code>math.gcm<\/code> is in the subdirectory <code>gcm.cache<\/code>.<code> math.gcm<\/code> is the compiled module interface. Presumably, <code>gcm<\/code> stands for GCC compiled module.<\/li>\n\n\n\n<li>Line 2 creates the executable <code>client<\/code>. It uses the module <code>math.gcm<\/code> implicitly.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">What&#8217;s Next? <\/h2>\n\n\n\n<p>This post gave you the first steps of how to build a module with the Big Three. In my next post, I will drill deeper.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have written almost 100 posts about C++20 in the last four years, but I&#8217;m not done. This post continues my story about C++20. Modules are one of the Big Four in C++20. In my C++20 classes, they are one of the main topics. Sadly, the implementation in GCC and Clang was way behind the [&hellip;]<\/p>\n","protected":false},"author":21,"featured_media":8441,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[375],"tags":[443],"class_list":["post-8438","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-c-20","tag-modules"],"_links":{"self":[{"href":"https:\/\/www.modernescpp.com\/index.php\/wp-json\/wp\/v2\/posts\/8438","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.modernescpp.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.modernescpp.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.modernescpp.com\/index.php\/wp-json\/wp\/v2\/users\/21"}],"replies":[{"embeddable":true,"href":"https:\/\/www.modernescpp.com\/index.php\/wp-json\/wp\/v2\/comments?post=8438"}],"version-history":[{"count":42,"href":"https:\/\/www.modernescpp.com\/index.php\/wp-json\/wp\/v2\/posts\/8438\/revisions"}],"predecessor-version":[{"id":8495,"href":"https:\/\/www.modernescpp.com\/index.php\/wp-json\/wp\/v2\/posts\/8438\/revisions\/8495"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.modernescpp.com\/index.php\/wp-json\/wp\/v2\/media\/8441"}],"wp:attachment":[{"href":"https:\/\/www.modernescpp.com\/index.php\/wp-json\/wp\/v2\/media?parent=8438"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.modernescpp.com\/index.php\/wp-json\/wp\/v2\/categories?post=8438"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.modernescpp.com\/index.php\/wp-json\/wp\/v2\/tags?post=8438"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}