<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<br class="">
<blockquote type="cite" class="">On Sep 22, 2015, at 3:50 PM, Satish Balay <<a href="mailto:balay@mcs.anl.gov" class="">balay@mcs.anl.gov</a>> wrote:<br class="">
<br class="">
I'm not sure what to suggest.<br class="">
<br class="">
Blaise gets a successful build with:<br class="">
<br class="">
--with-cxx=0 --with-clib-autodetect=0 --with-fortranlib-autodetect=0 LIBS="/opt/intel-16.0/compilers_and_libraries_2016.0.083/mac/compiler/lib/libifcore.a"<br class="">
<br class="">
The next thing Blaise could try is:<br class="">
<br class="">
--with-cxx=0 --with-clib-autodetect=0 --with-fortranlib-autodetect=0 LIBS=-lifcore<br class="">
</blockquote>
<div class=""><br class="">
</div>
This works.
<div class=""><br class="">
</div>
<div class="">bourdin@galerkin:tutorials (master)$  otool -l ex5f90 |grep ifor<br class="">
         name /opt/HPC/mpich-3.1.4-intel16.0/lib/libmpifort.12.dylib (offset 24)<br class="">
<br class="">
</div>
<div class="">In contrast, with the build command suggested with richard, I get a non-functioning build:</div>
<div class=""><br class="">
</div>
<div class="">bourdin@galerkin:petsc-dev (master)$ ./configure --with-debugging=1 COPTFLAGS="-g -O0" FOPTFLAGS="-g -O0” </div>
<div class="">CXXOPTFLAGS="-g -O0" --with-blas-lapack-dir=/opt/intel-16.0/compilers_and_libraries_2016/mac/mkl --with-mpi-dir=$MPI_HOME<br class="">
<br class="">
</div>
<div class="">bourdin@galerkin:tutorials (master)$  otool -l ex5f90 |grep ifor<br class="">
         name /opt/HPC/mpich-3.1.4-intel16.0/lib/libmpifort.12.dylib (offset 24)<br class="">
<br class="">
</div>
<div class="">
<blockquote type="cite" class=""><br class="">
[and if this fails - see which ifcore the binary is using - via 'otool -l petscbinary |grep ifore']<br class="">
<br class="">
If not - what I would do - is try compiling an example with a petsc makefile.<br class="">
[with the broken build]<br class="">
<br class="">
And then copy/paste the link line - removing stuff - until the binary<br class="">
created by that link line works. [and identify the linker option is<br class="">
making the difference]. Again - this would be for Blaise to try.<br class="">
</blockquote>
<div class=""><br class="">
</div>
With the later configuration, it looks like what matters is the order in which  -lmpifort and -lifcore are listed:</div>
<div class="">This one works:</div>
<div class="">
<div style="margin: 0px; font-family: 'Source Code Pro';" class="">mpif90 -Wl,-multiply_defined,suppress -Wl,-multiply_defined -Wl,suppress -Wl,-commons,use_dylibs -Wl,-search_paths_first   -g -O0  -I/opt/HPC/petsc-dev/include/petsc/finclude -o ex5f90 ex5f90.o
 -Wl,-rpath,/opt/HPC/petsc-dev/Darwin-intel16.0-g/lib -L/opt/HPC/petsc-dev/Darwin-intel16.0-g/lib  -lpetsc -Wl,-rpath,/opt/intel-16.0/compilers_and_libraries_2016.0.083/mac/compiler/lib -L/opt/intel-16.0/compilers_and_libraries_2016.0.083/mac/compiler/lib -Wl,-rpath,/opt/intel-16.0/compilers_and_libraries_2016.0.083/mac/mkl/lib
 -lifcore -lmpifort </div>
</div>
<div class=""><br class="">
</div>
<div class="">This one does not:</div>
<div class="">
<div style="margin: 0px; font-family: 'Source Code Pro';" class="">mpif90 -Wl,-multiply_defined,suppress -Wl,-multiply_defined -Wl,suppress -Wl,-commons,use_dylibs -Wl,-search_paths_first   -g -O0  -I/opt/HPC/petsc-dev/include/petsc/finclude -o ex5f90 ex5f90.o
 -Wl,-rpath,/opt/HPC/petsc-dev/Darwin-intel16.0-g/lib -L/opt/HPC/petsc-dev/Darwin-intel16.0-g/lib  -lpetsc -Wl,-rpath,/opt/intel-16.0/compilers_and_libraries_2016.0.083/mac/compiler/lib -L/opt/intel-16.0/compilers_and_libraries_2016.0.083/mac/compiler/lib -Wl,-rpath,/opt/intel-16.0/compilers_and_libraries_2016.0.083/mac/mkl/lib
 -lmpifort -lifcore </div>
<div style="margin: 0px; font-family: 'Source Code Pro';" class=""><br class="">
</div>
<div style="margin: 0px; font-family: 'Source Code Pro';" class="">Same goes with the lengthy link line from the petsc makefile:</div>
<div style="margin: 0px;" class=""><font face="Source Code Pro" class="">mpif90 -Wl,-multiply_defined,suppress -Wl,-multiply_defined -Wl,suppress -Wl,-commons,use_dylibs -Wl,-search_paths_first   -g -O0  -I/opt/HPC/petsc-dev/include/petsc/finclude -o ex5f90
 ex5f90.o -Wl,-rpath,/opt/HPC/petsc-dev/Darwin-intel16.0-g/lib -L/opt/HPC/petsc-dev/Darwin-intel16.0-g/lib  -lpetsc -Wl,-rpath,/opt/intel-16.0/compilers_and_libraries_2016/mac/mkl -L/opt/intel-16.0/compilers_and_libraries_2016/mac/mkl -lmkl_intel -lmkl_sequential
 -lmkl_core -lpthread -lm -Wl,-rpath,/opt/X11/lib -L/opt/X11/lib -lX11 -lssl -lcrypto -Wl,-rpath,/opt/HPC/mpich-3.1.4-intel16.0/lib -L/opt/HPC/mpich-3.1.4-intel16.0/lib -Wl,-rpath,/opt/intel-16.0/compilers_and_libraries_2016.0.083/mac/compiler/lib -L/opt/intel-16.0/compilers_and_libraries_2016.0.083/mac/compiler/lib
 -Wl,-rpath,/opt/intel-16.0/compilers_and_libraries_2016.0.083/mac/mkl/lib -L/opt/intel-16.0/compilers_and_libraries_2016.0.083/mac/mkl/lib -Wl,-rpath,/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/6.1.0/lib/darwin
 -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/6.1.0/lib/darwin -lifcore -lmpifort -lifport  -limf -lsvml -lipgo -lirc -lpthread -Wl,-rpath,/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.1.0/lib/darwin
 -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.1.0/lib/darwin -lclang_rt.osx -limf -lsvml -lirng -lipgo -ldecimal -lirc -lclang_rt.osx -lmpicxx -limf -lsvml -lirng -lipgo -ldecimal -lirc -lclang_rt.osx
 -ldl -Wl,-rpath,/opt/HPC/mpich-3.1.4-intel16.0/lib -L/opt/HPC/mpich-3.1.4-intel16.0/lib -lmpi -lpmpi -Wl,-rpath,/opt/HPC/mpich-3.1.4-intel16.0/lib -L/opt/HPC/mpich-3.1.4-intel16.0/lib -Wl,-rpath,/opt/intel-16.0/compilers_and_libraries_2016.0.083/mac/compiler/lib
 -L/opt/intel-16.0/compilers_and_libraries_2016.0.083/mac/compiler/lib -Wl,-rpath,/opt/intel-16.0/compilers_and_libraries_2016.0.083/mac/mkl/lib -L/opt/intel-16.0/compilers_and_libraries_2016.0.083/mac/mkl/lib -Wl,-rpath,/opt/intel-16.0/compilers_and_libraries_2016.0.083/mac/compiler/lib
 -L/opt/intel-16.0/compilers_and_libraries_2016.0.083/mac/compiler/lib -Wl,-rpath,/opt/intel-16.0/compilers_and_libraries_2016.0.083/mac/compiler/lib -L/opt/intel-16.0/compilers_and_libraries_2016.0.083/mac/compiler/lib -limf -Wl,-rpath,/opt/intel-16.0/compilers_and_libraries_2016.0.083/mac/compiler/lib
 -L/opt/intel-16.0/compilers_and_libraries_2016.0.083/mac/compiler/lib -lsvml -Wl,-rpath,/opt/intel-16.0/compilers_and_libraries_2016.0.083/mac/compiler/lib -L/opt/intel-16.0/compilers_and_libraries_2016.0.083/mac/compiler/lib -lirng -Wl,-rpath,/opt/intel-16.0/compilers_and_libraries_2016.0.083/mac/compiler/lib
 -L/opt/intel-16.0/compilers_and_libraries_2016.0.083/mac/compiler/lib -lipgo -Wl,-rpath,/opt/intel-16.0/compilers_and_libraries_2016.0.083/mac/compiler/lib -L/opt/intel-16.0/compilers_and_libraries_2016.0.083/mac/compiler/lib -ldecimal -lc++ -lSystem -Wl,-rpath,/opt/intel-16.0/compilers_and_libraries_2016.0.083/mac/compiler/lib
 -L/opt/intel-16.0/compilers_and_libraries_2016.0.083/mac/compiler/lib -lirc -Wl,-rpath,/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.1.0/lib/darwin -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.1.0/lib/darwin
 -lclang_rt.osx -Wl,-rpath,/opt/HPC/mpich-3.1.4-intel16.0/lib -L/opt/HPC/mpich-3.1.4-intel16.0/lib -Wl,-rpath,/opt/intel-16.0/compilers_and_libraries_2016.0.083/mac/compiler/lib -L/opt/intel-16.0/compilers_and_libraries_2016.0.083/mac/compiler/lib -Wl,-rpath,/opt/intel-16.0/compilers_and_libraries_2016.0.083/mac/mkl/lib
 -L/opt/intel-16.0/compilers_and_libraries_2016.0.083/mac/mkl/lib -Wl,-rpath,/opt/intel-16.0/compilers_and_libraries_2016.0.083/mac/compiler/lib -L/opt/intel-16.0/compilers_and_libraries_2016.0.083/mac/compiler/lib -ldl </font></div>
<div style="margin: 0px;" class=""><font face="Source Code Pro" class=""><br class="">
</font></div>
<div style="margin: 0px;" class=""><font face="Source Code Pro" class="">this works, but switch the order of libmpifort and libifcore, and it does not anymore. (don’t ask me how I noticed!)</font></div>
<div style="margin: 0px;" class=""><font face="Source Code Pro" class=""><br class="">
</font></div>
<div style="margin: 0px;" class=""><font face="Source Code Pro" class="">Blaise</font></div>
<div style="margin: 0px; font-family: 'Source Code Pro';" class=""><br class="">
</div>
<blockquote type="cite" class=""><br class="">
<br class="">
Intel compilers (esp on Mac) had workarrounds to system issues encoded<br class="">
in the link command. [I remember the first generation of intel<br class="">
compilers on Mac had such issues]. And the way PETSc configure, and<br class="">
checkFortranLibraries() process/use this 'ifort -v' info can break<br class="">
these encoded workarrounds.. [Its a hacky piece of code - and not easy<br class="">
to get right]<br class="">
<br class="">
Ideally compilers should provide equivalent of 'mpicc -show' - so that<br class="">
configure tools can grab and use this info for language interoperable<br class="">
linking.<br class="">
<br class="">
[Jed suggested we should 'always use FC as linker' and not do any such<br class="">
detection.  But then we still have to worry about C++. Previously we<br class="">
had machines where we had to use C++ linker - but perhaps such<br class="">
machines don't exist anymore]<br class="">
<br class="">
Satish<br class="">
<br class="">
<br class="">
On Tue, 22 Sep 2015, Richard Mills wrote:<br class="">
<br class="">
<blockquote type="cite" class="">Blaise and Satish,<br class="">
<br class="">
I'm a bit slow to pick up on this thread as I was busy traveling, but since<br class="">
I use a Mac and work for Intel, I thought I should see if I could reproduce<br class="">
the problems that Blaise is seeing.  I installed the 16.0 compilers and<br class="">
built a simple configuration ('--with-debugging=1 COPTFLAGS="-g -O0"<br class="">
FOPTFLAGS="-g -O0" CXXOPTFLAGS="-g -O0"<br class="">
--with-blas-lapack-dir=/opt/intel/compilers_and_libraries_2016/mac/mkl<br class="">
--with-mpi-dir=/Users/rtmills/packages/mpich-3.1.4-intel') using a very<br class="">
recent revision of 'master' (09b4d96fa5749f82a0af9a914729f77a4ef2b2fd, Sun<br class="">
Sep 20 22:51:31 2015 -0500).  When I try running SNES ex5f and passing<br class="">
various command-line options, everything appears to work fine.  Any<br class="">
suggestions for digging deeping into this to try to determine the<br class="">
difference between what Blaise and I are seeing?<br class="">
<br class="">
Best regards,<br class="">
Richard<br class="">
<br class="">
On Mon, Sep 21, 2015 at 10:21 AM, Blaise A Bourdin <<a href="mailto:bourdin@lsu.edu" class="">bourdin@lsu.edu</a>> wrote:<br class="">
<br class="">
<blockquote type="cite" class=""><br class="">
<blockquote type="cite" class="">On Sep 20, 2015, at 9:04 AM, Satish Balay <<a href="mailto:balay@mcs.anl.gov" class="">balay@mcs.anl.gov</a>> wrote:<br class="">
<br class="">
Hm - I would suggest doing a minimal build build with:<br class="">
<br class="">
--with-cxx=0<br class="">
--with-clib-autodetect=0 --with-fortranlib-autodetect=0<br class="">
</blockquote>
LIBS="/opt/intel-16.0/compilers_and_libraries_2016.0.083/mac/compiler/lib/libifcore.a"<br class="">
<blockquote type="cite" class=""><br class="">
And see if that makes a difference.<br class="">
</blockquote>
Satish,<br class="">
<br class="">
It does help.<br class="">
Turning off auto detect leads to a functional build, turning it back on<br class="">
leads to a non-functioning one.<br class="">
<br class="">
The configure.log without auto detect is here:<br class="">
<br class="">
<a href="https://filestogeaux.lsu.edu/public/download.php?FILE=bourdin/61967j4XaVp" class="">https://filestogeaux.lsu.edu/public/download.php?FILE=bourdin/61967j4XaVp</a><br class="">
The one with auto detect there:<br class="">
  https://filestogeaux.lsu.edu/public/download.php?FILE=bourdin/691pPOSRU<br class="">
<br class="">
The petscconf.h are attached<br class="">
<br class="">
<br class="">
</blockquote>
<br class="">
</blockquote>
<br class="">
</blockquote>
<br class="">
<div class="">-- <br class="">
Department of Mathematics and Center for Computation & Technology<br class="">
Louisiana State University, Baton Rouge, LA 70803, USA<br class="">
Tel. +1 (225) 578 1612, Fax  +1 (225) 578 4276 <a href="http://www.math.lsu.edu/~bourdin" class="">
http://www.math.lsu.edu/~bourdin</a><br class="">
<br class="">
<br class="">
<br class="">
<br class="">
<br class="">
<br class="">
</div>
<br class="">
</div>
</body>
</html>