<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?action=history&amp;feed=atom&amp;title=XIOS_on_an_Apple_Silicon_Mac</id>
		<title>XIOS on an Apple Silicon Mac - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?action=history&amp;feed=atom&amp;title=XIOS_on_an_Apple_Silicon_Mac"/>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=XIOS_on_an_Apple_Silicon_Mac&amp;action=history"/>
		<updated>2026-10-20T19:48:28Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.27.7</generator>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=XIOS_on_an_Apple_Silicon_Mac&amp;diff=3341&amp;oldid=prev</id>
		<title>Mwolff: /* Compiling XIOS on macOS (Apple Silicon) with openmpi and clang */</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=XIOS_on_an_Apple_Silicon_Mac&amp;diff=3341&amp;oldid=prev"/>
				<updated>2026-10-16T10:37:41Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Compiling XIOS on macOS (Apple Silicon) with openmpi and clang&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;' lang='en'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 10:37, 16 October 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot; &gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= Compiling XIOS on macOS (Apple Silicon) with openmpi and clang =&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= Compiling XIOS on macOS (Apple Silicon) with openmpi and clang =&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This page &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;provides &lt;/del&gt;the three XIOS arch files needed to build XIOS on macOS &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;with &lt;/del&gt;Homebrew gfortran and Homebrew Open MPI. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;In this setup &lt;/del&gt;the Open MPI C++ wrapper &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;calls &lt;/del&gt;Apple '''clang''', not GCC. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Because of that&lt;/del&gt;, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;two settings differ from the stock &amp;lt;code&amp;gt;arch-gfortran&amp;lt;/code&amp;gt; files. They are explained in &lt;/del&gt;[[#Background: Open MPI uses Clang, not GCC|the background section]] &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;below&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This page &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;makes the assumption that you have built and installed the parallel version of NetCDF similarly to that described on the page [[NetCDF-Parallel on an Apple Silicon Mac]].&amp;#160; Below, one finds &lt;/ins&gt;the three XIOS arch files needed to build XIOS on macOS &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;(using &lt;/ins&gt;Homebrew gfortran and Homebrew Open MPI&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;)&lt;/ins&gt;. &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt; The customizations here with respect to the stock &amp;lt;code&amp;gt;arch-gfortran&amp;lt;/code&amp;gt; files are driven by &lt;/ins&gt;the Open MPI C++ wrapper &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;calling &lt;/ins&gt;Apple '''clang''', not GCC &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;(e.g&lt;/ins&gt;., [[#Background: Open MPI uses Clang, not GCC|the background section]]&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;)&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Tested environment ==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Tested environment ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key PlanetsWiki:diff:version:1.11a:oldid:3340:newid:3341 --&gt;
&lt;/table&gt;</summary>
		<author><name>Mwolff</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=XIOS_on_an_Apple_Silicon_Mac&amp;diff=3340&amp;oldid=prev</id>
		<title>Mwolff: /* Compiling XIOS on macOS (Apple Silicon) with Open MPI and Clang */</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=XIOS_on_an_Apple_Silicon_Mac&amp;diff=3340&amp;oldid=prev"/>
				<updated>2026-10-16T10:29:01Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Compiling XIOS on macOS (Apple Silicon) with Open MPI and Clang&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;' lang='en'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 10:29, 16 October 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot; &gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= Compiling XIOS on macOS (Apple Silicon) with &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Open MPI &lt;/del&gt;and &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Clang &lt;/del&gt;=&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= Compiling XIOS on macOS (Apple Silicon) with &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;openmpi &lt;/ins&gt;and &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;clang &lt;/ins&gt;=&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This page provides the three XIOS arch files needed to build XIOS on macOS with Homebrew gfortran and Homebrew Open MPI. In this setup the Open MPI C++ wrapper calls Apple '''clang''', not GCC. Because of that, two settings differ from the stock &amp;lt;code&amp;gt;arch-gfortran&amp;lt;/code&amp;gt; files. They are explained in [[#Background: Open MPI uses Clang, not GCC|the background section]] below.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This page provides the three XIOS arch files needed to build XIOS on macOS with Homebrew gfortran and Homebrew Open MPI. In this setup the Open MPI C++ wrapper calls Apple '''clang''', not GCC. Because of that, two settings differ from the stock &amp;lt;code&amp;gt;arch-gfortran&amp;lt;/code&amp;gt; files. They are explained in [[#Background: Open MPI uses Clang, not GCC|the background section]] below.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key PlanetsWiki:diff:version:1.11a:oldid:3339:newid:3340 --&gt;
&lt;/table&gt;</summary>
		<author><name>Mwolff</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=XIOS_on_an_Apple_Silicon_Mac&amp;diff=3339&amp;oldid=prev</id>
		<title>Mwolff: /* Compiling XIOS on macOS (Apple Silicon) with Open MPI and Clang */</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=XIOS_on_an_Apple_Silicon_Mac&amp;diff=3339&amp;oldid=prev"/>
				<updated>2026-10-16T10:27:08Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Compiling XIOS on macOS (Apple Silicon) with Open MPI and Clang&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;' lang='en'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 10:27, 16 October 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l9&quot; &gt;Line 9:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 9:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Apple clang 21, which provides &amp;lt;code&amp;gt;/usr/bin/cpp&amp;lt;/code&amp;gt; and is called by &amp;lt;code&amp;gt;mpiCC&amp;lt;/code&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Apple clang 21, which provides &amp;lt;code&amp;gt;/usr/bin/cpp&amp;lt;/code&amp;gt; and is called by &amp;lt;code&amp;gt;mpiCC&amp;lt;/code&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Open MPI 5.0.11 (Homebrew)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Open MPI 5.0.11 (Homebrew)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* netCDF-C 4.10.1 and netCDF-Fortran 4.6.4, compiled from source against Open MPI and installed in &amp;lt;code&amp;gt;/opt/parallel-netcdf&amp;lt;/code&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* netCDF-C 4.10.1 and netCDF-Fortran 4.6.4, compiled from source against Open MPI&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;(which is where the CLANG dependence originates) &lt;/ins&gt;and installed in &amp;lt;code&amp;gt;/opt/parallel-netcdf&amp;lt;/code&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Arch files ==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Arch files ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l20&quot; &gt;Line 20:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 20:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Environment to compile XIOS on Mac OS X with NETCDF compiled with CLANG&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Environment to compile XIOS on Mac OS X with NETCDF compiled with CLANG &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;(through openmpi)&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Tested successfully with :&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Tested successfully with :&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key PlanetsWiki:diff:version:1.11a:oldid:3338:newid:3339 --&gt;
&lt;/table&gt;</summary>
		<author><name>Mwolff</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=XIOS_on_an_Apple_Silicon_Mac&amp;diff=3338&amp;oldid=prev</id>
		<title>Mwolff: /* Building */</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=XIOS_on_an_Apple_Silicon_Mac&amp;diff=3338&amp;oldid=prev"/>
				<updated>2026-10-16T10:25:33Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Building&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;' lang='en'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 10:25, 16 October 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l91&quot; &gt;Line 91:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 91:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Use &amp;lt;code&amp;gt;--full&amp;lt;/code&amp;gt; to rebuild from scratch&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;. &amp;lt;code&amp;gt;make_xios&amp;lt;/code&amp;gt; has no &amp;lt;code&amp;gt;--clean&amp;lt;/code&amp;gt; option, and it ignores unknown options without any warning. So &amp;lt;code&amp;gt;./make_xios --clean&amp;lt;/code&amp;gt; cleans nothing. FCM then keeps reusing old preprocessed files in &amp;lt;code&amp;gt;ppsrc/&amp;lt;/code&amp;gt;, and a fix to the preprocessor settings does not take effect&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Use &amp;lt;code&amp;gt;--full&amp;lt;/code&amp;gt; to rebuild from scratch. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;A successful build produces:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;A successful build produces:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &amp;lt;code&amp;gt;lib/libxios.a&amp;lt;/code&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &amp;lt;code&amp;gt;lib/libxios.a&amp;lt;/code&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* &amp;lt;code&amp;gt;bin/xios_server.exe&amp;lt;/code&amp;gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* &amp;lt;code&amp;gt;bin/generic_testcase.exe&amp;lt;/code&amp;gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Background: Open MPI uses Clang, not GCC ==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Background: Open MPI uses Clang, not GCC ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key PlanetsWiki:diff:version:1.11a:oldid:3337:newid:3338 --&gt;
&lt;/table&gt;</summary>
		<author><name>Mwolff</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=XIOS_on_an_Apple_Silicon_Mac&amp;diff=3337&amp;oldid=prev</id>
		<title>Mwolff: Created page with &quot;= Compiling XIOS on macOS (Apple Silicon) with Open MPI and Clang =  This page provides the three XIOS arch files needed to build XIOS on macOS with Homebrew gfortran and Home...&quot;</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=XIOS_on_an_Apple_Silicon_Mac&amp;diff=3337&amp;oldid=prev"/>
				<updated>2026-10-16T10:14:32Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;= Compiling XIOS on macOS (Apple Silicon) with Open MPI and Clang =  This page provides the three XIOS arch files needed to build XIOS on macOS with Homebrew gfortran and Home...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= Compiling XIOS on macOS (Apple Silicon) with Open MPI and Clang =&lt;br /&gt;
&lt;br /&gt;
This page provides the three XIOS arch files needed to build XIOS on macOS with Homebrew gfortran and Homebrew Open MPI. In this setup the Open MPI C++ wrapper calls Apple '''clang''', not GCC. Because of that, two settings differ from the stock &amp;lt;code&amp;gt;arch-gfortran&amp;lt;/code&amp;gt; files. They are explained in [[#Background: Open MPI uses Clang, not GCC|the background section]] below.&lt;br /&gt;
&lt;br /&gt;
== Tested environment ==&lt;br /&gt;
&lt;br /&gt;
* macOS 26 (Darwin 25.6.0), Apple Silicon (arm64)&lt;br /&gt;
* GNU Fortran 16.2.0 (Homebrew), installed as &amp;lt;code&amp;gt;gfortran&amp;lt;/code&amp;gt;&lt;br /&gt;
* Apple clang 21, which provides &amp;lt;code&amp;gt;/usr/bin/cpp&amp;lt;/code&amp;gt; and is called by &amp;lt;code&amp;gt;mpiCC&amp;lt;/code&amp;gt;&lt;br /&gt;
* Open MPI 5.0.11 (Homebrew)&lt;br /&gt;
* netCDF-C 4.10.1 and netCDF-Fortran 4.6.4, compiled from source against Open MPI and installed in &amp;lt;code&amp;gt;/opt/parallel-netcdf&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Arch files ==&lt;br /&gt;
&lt;br /&gt;
Create these three files in the &amp;lt;code&amp;gt;arch/&amp;lt;/code&amp;gt; directory of your XIOS source tree.&lt;br /&gt;
&lt;br /&gt;
=== arch/arch-CLANG_MACOSX.env ===&lt;br /&gt;
&lt;br /&gt;
Change &amp;lt;code&amp;gt;NETCDF_DIR&amp;lt;/code&amp;gt; to match your netCDF installation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Environment to compile XIOS on Mac OS X with NETCDF compiled with CLANG&lt;br /&gt;
#&lt;br /&gt;
# Tested successfully with :&lt;br /&gt;
#   Mac OS X 25.6.0&lt;br /&gt;
#   Prerequisite softwares installed with Homebrew&lt;br /&gt;
#     gfortran       : 16.2.0&lt;br /&gt;
#     openmpi        : 5.0.11&lt;br /&gt;
#&lt;br /&gt;
#   Compiled from source with open-mpi&lt;br /&gt;
#     netcdf         : netCDF 4.10.1 netCDF-Fortran 4.6.4&lt;br /&gt;
#&lt;br /&gt;
#&lt;br /&gt;
export NETCDF_DIR=/opt/parallel-netcdf&lt;br /&gt;
export NETCDF_INC_DIR=${NETCDF_DIR}/include&lt;br /&gt;
export NETCDF_LIB_DIR=${NETCDF_DIR}/lib&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== arch/arch-CLANG_MACOSX.fcm ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
################################################################################&lt;br /&gt;
###################                Projet XIOS               ###################&lt;br /&gt;
################################################################################&lt;br /&gt;
#Build environment (2026-10-13):&lt;br /&gt;
#&lt;br /&gt;
#- macOS 26 (Darwin 25.6.0), arm64&lt;br /&gt;
#- GNU Fortran 16.2.0 (Homebrew), installed as `gfortran`&lt;br /&gt;
#- Apple clang 21, which provides `/usr/bin/cpp` and is wrapped by `mpiCC`&lt;br /&gt;
#- Open MPI 5.0.11 (Homebrew)&lt;br /&gt;
## Summary&lt;br /&gt;
&lt;br /&gt;
%CCOMPILER      mpiCC&lt;br /&gt;
%FCOMPILER      mpif90&lt;br /&gt;
%LINKER         mpif90&lt;br /&gt;
&lt;br /&gt;
%BASE_CFLAGS    -w -std=gnu++11&lt;br /&gt;
%PROD_CFLAGS    -O3 -D BOOST_DISABLE_ASSERTS&lt;br /&gt;
%DEV_CFLAGS     -g&lt;br /&gt;
%DEBUG_CFLAGS   -g -O2&lt;br /&gt;
&lt;br /&gt;
%BASE_FFLAGS    -D__NONE__ -ffree-line-length-none&lt;br /&gt;
%PROD_FFLAGS    -O3&lt;br /&gt;
%DEV_FFLAGS     -g -O2&lt;br /&gt;
%DEBUG_FFLAGS   -g&lt;br /&gt;
&lt;br /&gt;
%BASE_INC       -D__NONE__&lt;br /&gt;
%BASE_LD        -lc++&lt;br /&gt;
&lt;br /&gt;
%CPP             cpp -P -undef&lt;br /&gt;
%FPP             cpp-16 -P&lt;br /&gt;
%MAKE           make&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== arch/arch-CLANG_MACOSX.path ===&lt;br /&gt;
&lt;br /&gt;
This file gets the netCDF flags from &amp;lt;code&amp;gt;nc-config&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;nf-config&amp;lt;/code&amp;gt;, so both must be on your &amp;lt;code&amp;gt;PATH&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NETCDF_INCDIR=&amp;quot;$(nc-config --cflags) $(nf-config --fflags)&amp;quot;&lt;br /&gt;
NETCDF_LIBDIR=&amp;quot;$(nc-config --libs) $(nf-config --flibs)&amp;quot;&lt;br /&gt;
NETCDF_LIB=&amp;quot;&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Building ==&lt;br /&gt;
&lt;br /&gt;
From the top of the XIOS source tree:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./make_xios --arch CLANG_MACOSX --job 8 --full &amp;gt; make_xios.out 2&amp;gt;&amp;amp;1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;code&amp;gt;--full&amp;lt;/code&amp;gt; to rebuild from scratch. &amp;lt;code&amp;gt;make_xios&amp;lt;/code&amp;gt; has no &amp;lt;code&amp;gt;--clean&amp;lt;/code&amp;gt; option, and it ignores unknown options without any warning. So &amp;lt;code&amp;gt;./make_xios --clean&amp;lt;/code&amp;gt; cleans nothing. FCM then keeps reusing old preprocessed files in &amp;lt;code&amp;gt;ppsrc/&amp;lt;/code&amp;gt;, and a fix to the preprocessor settings does not take effect.&lt;br /&gt;
&lt;br /&gt;
A successful build produces:&lt;br /&gt;
* &amp;lt;code&amp;gt;lib/libxios.a&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;bin/xios_server.exe&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;bin/generic_testcase.exe&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Background: Open MPI uses Clang, not GCC ==&lt;br /&gt;
&lt;br /&gt;
On Linux, &amp;lt;code&amp;gt;mpif90&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;mpicc&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;mpicxx&amp;lt;/code&amp;gt; usually all call the GNU compilers. With Homebrew on macOS, Open MPI is built with Apple's toolchain. Only the Fortran wrapper calls GCC:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Component !! Wrapper !! Underlying compiler !! C++ standard library&lt;br /&gt;
|-&lt;br /&gt;
| XIOS (C++ core) || &amp;lt;code&amp;gt;mpiCC&amp;lt;/code&amp;gt; || Apple '''clang''' || '''libc++''' (LLVM), linked with &amp;lt;code&amp;gt;-lc++&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| XIOS Fortran interface, and the model (e.g. LMDZ / PCM) || &amp;lt;code&amp;gt;mpif90&amp;lt;/code&amp;gt; || Homebrew '''gfortran''' || none (GCC Fortran runtime)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This mix causes two problems: one with the preprocessor and one at link time.&lt;br /&gt;
&lt;br /&gt;
=== Why mpiCC is really clang ===&lt;br /&gt;
&lt;br /&gt;
macOS filesystems are case-insensitive by default, so the files &amp;lt;code&amp;gt;mpiCC&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;mpicc&amp;lt;/code&amp;gt; cannot both exist. Homebrew's Open MPI makes &amp;lt;code&amp;gt;/opt/homebrew/bin/mpiCC&amp;lt;/code&amp;gt; a symlink to the C wrapper &amp;lt;code&amp;gt;mpicc&amp;lt;/code&amp;gt;, which calls Apple &amp;lt;code&amp;gt;clang&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ mpiCC --showme&lt;br /&gt;
clang -I/opt/homebrew/Cellar/open-mpi/5.0.11/include -L/opt/homebrew/Cellar/open-mpi/5.0.11/lib -lmpi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
clang still compiles the XIOS &amp;lt;code&amp;gt;.cpp&amp;lt;/code&amp;gt; files as C++, because it picks the language from the file extension. But it compiles them against '''libc++''', LLVM's C++ standard library, not GCC's '''libstdc++'''.&lt;br /&gt;
&lt;br /&gt;
A side effect: &amp;lt;code&amp;gt;OMPI_CXX&amp;lt;/code&amp;gt; has no effect on &amp;lt;code&amp;gt;mpiCC&amp;lt;/code&amp;gt;, because &amp;lt;code&amp;gt;mpiCC&amp;lt;/code&amp;gt; is really &amp;lt;code&amp;gt;mpicc&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;mpicc&amp;lt;/code&amp;gt; reads &amp;lt;code&amp;gt;OMPI_CC&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== 1. Link library: &amp;lt;code&amp;gt;-lc++&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;-lstdc++&amp;lt;/code&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
The stock &amp;lt;code&amp;gt;arch-gfortran.fcm&amp;lt;/code&amp;gt; sets &amp;lt;code&amp;gt;%BASE_LD -lstdc++&amp;lt;/code&amp;gt;. With clang-compiled C++ objects, the link of &amp;lt;code&amp;gt;xios_server.exe&amp;lt;/code&amp;gt; fails with errors like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Undefined symbols for architecture arm64:&lt;br /&gt;
  &amp;quot;std::__1::basic_string&amp;lt;...&amp;gt;::copy(...) const&amp;quot;, referenced from: ...&lt;br /&gt;
  &amp;quot;std::__1::regex_error::regex_error(...)&amp;quot;, referenced from: ...&lt;br /&gt;
ld: symbol(s) not found for architecture arm64&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;std::__1::&amp;lt;/code&amp;gt; prefix is libc++'s inline namespace. libstdc++ uses different names, such as &amp;lt;code&amp;gt;std::__cxx11::&amp;lt;/code&amp;gt;. The two libraries are '''not interchangeable''' at link time: an object compiled against libc++ can only be linked with libc++.&lt;br /&gt;
&lt;br /&gt;
The final link is done by &amp;lt;code&amp;gt;mpif90&amp;lt;/code&amp;gt; (gfortran), and gfortran does not add any C++ library on its own. The arch file must name the right one, so &amp;lt;code&amp;gt;%BASE_LD&amp;lt;/code&amp;gt; is set to &amp;lt;code&amp;gt;-lc++&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''This also applies to every program that links against this &amp;lt;code&amp;gt;libxios.a&amp;lt;/code&amp;gt;.''' For example, the LMDZ / PCM arch &amp;lt;code&amp;gt;.path&amp;lt;/code&amp;gt; file must use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
XIOS_LIB=&amp;quot;-lxios -lc++&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and not &amp;lt;code&amp;gt;-lstdc++&amp;lt;/code&amp;gt;. Otherwise the model build compiles all its sources and then fails at the final link with hundreds of undefined &amp;lt;code&amp;gt;std::__1::&amp;lt;/code&amp;gt; symbols coming from &amp;lt;code&amp;gt;libxios.a&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
To check which C++ library an existing &amp;lt;code&amp;gt;libxios.a&amp;lt;/code&amp;gt; needs:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nm -C lib/libxios.a | grep -m1 'std::__1::'      # match -&amp;gt; libc++    (-lc++)&lt;br /&gt;
nm -C lib/libxios.a | grep -m1 'std::__cxx11::'  # match -&amp;gt; libstdc++ (-lstdc++)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The rule: '''the C++ library named at link time must be the same one that compiled XIOS.''' If you rebuild XIOS with GCC's &amp;lt;code&amp;gt;g++&amp;lt;/code&amp;gt; instead (for example &amp;lt;code&amp;gt;%CCOMPILER mpicxx&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;export OMPI_CXX=g++-16&amp;lt;/code&amp;gt;), switch back to &amp;lt;code&amp;gt;-lstdc++&amp;lt;/code&amp;gt; in both the XIOS and the model arch files.&lt;br /&gt;
&lt;br /&gt;
=== 2. Fortran preprocessor: &amp;lt;code&amp;gt;cpp-16&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;cpp&amp;lt;/code&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
The XIOS Fortran interface builds its names with a token-pasting macro, defined in &amp;lt;code&amp;gt;src/interface/fortran/xios_fortran_prefix.hpp&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#define xios(arg)  xios_##arg&lt;br /&gt;
#define txios(arg) xios_##arg&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On macOS, &amp;lt;code&amp;gt;/usr/bin/cpp&amp;lt;/code&amp;gt; is Apple clang. It does not expand &amp;lt;code&amp;gt;##&amp;lt;/code&amp;gt; in these files, so &amp;lt;code&amp;gt;txios(duration)&amp;lt;/code&amp;gt; comes out as &amp;lt;code&amp;gt;xios_##duration&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;xios_duration&amp;lt;/code&amp;gt;. Compilation then fails, for example in &amp;lt;code&amp;gt;duration_interface.f90&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IMPORT :: xios_##duration&lt;br /&gt;
Error: Syntax error in IMPORT statement at (1)&lt;br /&gt;
TYPE(xios_##duration), VALUE :: dur&lt;br /&gt;
Error: Malformed type-spec at (1)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The fix is to use the GNU C preprocessor that comes with Homebrew GCC for Fortran files: &amp;lt;code&amp;gt;%FPP cpp-16 -P&amp;lt;/code&amp;gt;. The &amp;lt;code&amp;gt;-16&amp;lt;/code&amp;gt; suffix follows the major version of Homebrew GCC. If GCC is upgraded, update this line to match. Check the installed version with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ls /opt/homebrew/bin/cpp-*&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;gfortran -E -P -cpp&amp;lt;/code&amp;gt; may also work as the Fortran preprocessor, but it has not been tested.&lt;br /&gt;
&lt;br /&gt;
=== Harmless warning ===&lt;br /&gt;
&lt;br /&gt;
The XIOS build and the model builds may print:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ld: warning: ignoring duplicate libraries: '-lnetcdf'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It appears because &amp;lt;code&amp;gt;nc-config --libs&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;nf-config --flibs&amp;lt;/code&amp;gt; both list &amp;lt;code&amp;gt;-lnetcdf&amp;lt;/code&amp;gt;. You can ignore it.&lt;br /&gt;
&lt;br /&gt;
[[Category:XIOS]]&lt;br /&gt;
[[Category:macOS]]&lt;/div&gt;</summary>
		<author><name>Mwolff</name></author>	</entry>

	</feed>