<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
{font-family:"Times New Roman \(Body CS\)";
panose-1:2 2 6 3 5 4 5 2 3 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:12.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:Consolas;
color:windowtext;
font-weight:normal;
font-style:normal;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:12.0pt;
font-family:"Calibri",sans-serif;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style>
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-family:Consolas">All,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas">As the subject says, I'm having issues building MPICH as a shared library with NAG Fortran and Clang on my MacBook.
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas">I configured mpich as:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas">../configure FCFLAGS="-mismatch_all -fpp" FFLAGS="-mismatch_all -fpp" --prefix=$HOME/installed/Compiler/nag-7.0_7066/mpich/4.0rc3 |& tee configure.nag-7.0_7066.log<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas">where CC=clang, CXX=clang++, and FC=nagfor (set in environment). When I do this, the configure step is fine, but upon build:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas">make[2]: Entering directory '/Users/mathomp4/src/MPI/mpich-4.0rc3/build-nag-7.0_7066'<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"> GEN lib/libmpifort.la<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas">NAG Fortran Compiler Release 7.0(Yurakucho) Build 7066<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas">Option error: Unrecognised option -dynamiclib<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas">make[2]: *** [Makefile:7606: lib/libmpifort.la] Error 2<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas">make[2]: Leaving directory '/Users/mathomp4/src/MPI/mpich-4.0rc3/build-nag-7.0_7066'<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas">make[1]: *** [Makefile:30237: all-recursive] Error 1<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas">make[1]: Leaving directory '/Users/mathomp4/src/MPI/mpich-4.0rc3/build-nag-7.0_7066'<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas">make: *** [Makefile:7300: all] Error 2<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas">The issue seems to be that MPICH (or libtool?) assumes that flags that clang accepts will be accepted by the Fortran compiler as well. But NAG doesn't accept '-dynamiclib' as an option. (I am asking NAG
about this as well.)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas">I can kind of see places where this is happening. For example in config.status:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas">749:archive_cmds_FC='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring $single_module'<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas">Now, the interesting thing is this *<b>exact same</b>* issue happened to me with Open MPI:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"><a href="https://www.mail-archive.com/users@lists.open-mpi.org/msg34635.html">https://www.mail-archive.com/users@lists.open-mpi.org//msg34635.html</a><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas">On that thread, I eventually figured out how to build Open MPI as static, but now I ran into this:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas">https://discourse.cmake.org/t/cmake-and-mpi-fortran-cmake-doesnt-see-it/4869<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas">My fear is that if I try and build MPICH as a static library, the same thing will happen.
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas">Does anyone at MPICH have any thoughts on this?
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas">Thanks,<br>
Matt<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas">-- <o:p></o:p></span></p>
<div>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:Consolas">Matt Thompson, SSAI, Ld Scientific Programmer/Analyst<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:Consolas">NASA GSFC, Global Modeling and Assimilation Office<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:Consolas">Code 610.1, 8800 Greenbelt Rd, Greenbelt, MD 20771<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:Consolas">Phone: 301-614-6712 Fax: 301-614-6246<o:p></o:p></span></p>
</div>
<p class="MsoNormal"><u><span style="font-family:Consolas;color:#0000E9">http://science.gsfc.nasa.gov/sed/bio/matthew.thompson</span></u><o:p></o:p></p>
</div>
</body>
</html>