diff --git a/6-InRealEnvironment/3-Compilers.ipynb b/6-InRealEnvironment/3-Compilers.ipynb index 9cdf838971ae8e8ab3c60bc08abbf648f82f33bb..4b5be5c25a7b5926f31cdec1932a2d85967df293 100644 --- a/6-InRealEnvironment/3-Compilers.ipynb +++ b/6-InRealEnvironment/3-Compilers.ipynb @@ -25,7 +25,7 @@ "\n", "I will present here briefly some characteristics of both gcc and clang compilers.\n", "\n", - "I recommend using them both (and more if you can!): each compiler gets its own spin on the standard, and sometimes a perfectly valid code will be refused by one... whereas (more often) invalid code will unduly get a free pass with one of the compiler.\n", + "I recommend using them both (and more if you can!): each compiler gets its own spin on the standard, and sometimes a perfectly valid code will be refused by one... whereas (more often) invalid code will unduly get a free pass with one of the compilers.\n", "\n", "So the more compiler with which you may test your code, the merrier!\n", "\n", @@ -36,7 +36,7 @@ "\n", "[GCC](http://gcc.gnu.org/) is a free-to-use compiler which has now been around for decades; it is mostly for Unix systems but may be used with Windows with some additional set-up (I don't master this but see for instance this [StackOverflow question](https://stackoverflow.com/questions/771756/what-is-the-difference-between-cygwin-and-mingw)).\n", "\n", - "As many others softwares, GCC changed its version system: gcc 3 and 4 were there for decades, and now the versions change more swiftly, with gcc 11 the current stable version (published on the 27th of April 2021).\n", + "As many others softwares, GCC changed its version system: gcc 3 and 4 were there for decades, and now the versions change more swiftly, with gcc 12.2 the current stable version (as of September 2022; it was published on the 19th of August 2022).\n", "\n", "`gcc` was long known for its terse user interface: until recently color were not provided in outputs, and error messages were a bit cryptic for the beotians. It changed though when `clang` appeared.\n", "\n", @@ -65,7 +65,7 @@ "* `-DNDEBUG` means the macro `NDEBUG` is defined; this deactivates all asserts in the code.\n", "* `-O3` means as many optimizations as possible should be applied.\n", "\n", - "You may sometimes find on the Web advocates of `-O2` flag, which performs slightly less optimization than `-O3`, on the ground that `-O3` breaks some code. It was true many years ago... but now if your code breaks under `-O3` it probably means it's buggy, not that optimization is! You may read [this thread](https://stackoverflow.com/questions/11546075/is-optimisation-level-o3-dangerous-in-g) for more about the question; I raised this point because you might be surprised by the number of libraries which use up O2 in their release mode.\n", + "You may sometimes find on the Web advocates of `-O2` flag, which performs slightly less optimization than `-O3`, on the ground that `-O3` breaks some code. It was true many years ago... but now if your code breaks under `-O3` it probably means it's buggy, not that optimization is! You may read [this thread](https://stackoverflow.com/questions/11546075/is-optimisation-level-o3-dangerous-in-g) for more about the question; I raised this point because you might be surprised by the number of libraries which still use up O2 in their release mode.\n", "\n", "\n", "### Warnings\n", @@ -130,7 +130,7 @@ "-Wno-global-constructors // same\n", "-Wno-documentation // Some Doxygen were incorrectly indicated as inadequate\n", "-Wno-documentation-unknown-command // A valid Doxygen command I used was not recognized\n", - "-Wno-undefined-func-template // Required weird code in header file; didn't understand this one to be honest\n", + "-Wno-undefined-func-template // Requires weird code in header file; didn't understand this one to be honest\n", "-Wno-c++1z-extensions // I assume my code uses up C++ 17\n", "-Wno-unused-template // A very recent one that tells if a template is never used \n", "````\n", @@ -151,7 +151,9 @@ "\n", "### Fortran support\n", "\n", - "There is no Fortran compiler with LLVM or clang; you should therefore use gfortran if a third-party library you use require it. Usually take the most recent you may find.\n", + "For a long time, there was no Fortran compiler with LLVM or clang; you therefore had to use something as gfortran if a third-party library you use require it - usually the most recent you may find.\n", + "\n", + "As of 2022, there is something called Flang that exists, but my attempt to use it didn't go far as they chose contrary to clang did years ago to use their own options without pseudo backward compatibility with gfortran's ones. As a result, compilation of third party libraries is tricky as they often assume interface provided by gfortran (Openblas and PETSc for instance won't compile with Flang). So for the time being the best is probably to stick with gfortran if as myself you aren't a Fortran developer but may need it for your third party dependencies.\n", "\n", "### Apple Clang\n", "\n", @@ -229,5 +231,5 @@ } }, "nbformat": 4, - "nbformat_minor": 2 + "nbformat_minor": 4 }