<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;" class="">Hi Barry,<div class=""><br class=""></div><div class="">I think you use it already. After configure /lib/petsc/conf/petscvariables :</div><div class=""><br class=""></div><div class=""><div class="">SL_LINKER_FUNCTION = -dynamiclib -install_name $(call SONAME_FUNCTION,$(1),$(2)) -compatibility_version $(2) -current_version $(3) -single_module -multiply_defined suppress -undefined dynamic_lookup</div><div class="">SONAME_FUNCTION = $(1).$(2).dylib</div></div><div class=""><br class=""></div><div class="">on the linking stage in the homebrew logs I see that the exact linking line contains -install_name :</div><div class=""><br class=""></div><div class="">-Wl,-multiply_defined,suppress -Wl,-multiply_defined -Wl,suppress -Wl,-commons,use_dylibs -Wl,-search_paths_first -fPIC -Wall -Wwrite-strings -Wno-strict-aliasing -Wno-unknown-pragmas -O -dynamiclib -install_name /private/tmp/petsc20151027-97392-7khduu/petsc-3.6.2/real/lib/libpetsc.3.6.dylib -compatibility_version 3.6 -current_version 3.6.2 -single_module -multiply_defined suppress -undefined dynamic_lookup</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">If I do configure manually (bare-bones PETSc) and compile it, the install_name seems to be correct (note that it’s libpetsc.3.6.dylib instead of libpetsc.3.6.2.dylib) :</div><div class="">—————</div><div class=""><div class="">$ otool -D arch-darwin-c-debug/lib/libpetsc.3.6.2.dylib</div><div class="">arch-darwin-c-debug/lib/libpetsc.3.6.2.dylib:</div><div class="">/Users/davydden/Downloads/petsc-3.6.2/arch-darwin-c-debug/lib/libpetsc.3.6.dylib</div></div><div class=""><br class=""></div><div class="">executable linked against end up using correct ABI version:</div><div class=""><div class="">$ otool -L test | grep petsc</div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>/Users/davydden/Downloads/petsc-3.6.2/arch-darwin-c-debug/lib/libpetsc.3.6.dylib (compatibility version 3.6.0, current version 3.6.2)</div></div><div class="">—————</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">however after installation to —prefix=/Users/davydden/Downloads/petsc-3.6.2/real the install name ends up being wrong:</div><div class="">—————</div><div class=""><div class="">$ otool -D real/lib/libpetsc.3.6.2.dylib</div><div class="">real/lib/libpetsc.3.6.2.dylib:</div><div class="">/Users/davydden/Downloads/petsc-3.6.2/real/lib/libpetsc.3.6.2.dylib</div></div><div class=""><br class=""></div><div class="">executable linked against end up using libpetsc.3.6.2.dylib instead of ABI version:</div><div class=""><div class="">otool -L test | grep petsc</div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>/Users/davydden/Downloads/petsc-3.6.2/real/lib/libpetsc.3.6.2.dylib (compatibility version 3.6.0, current version 3.6.2)</div></div><div class="">—————</div><div class=""><br class=""></div><div class="">My guess would be there is something wrong happening in `make install`.</div><div class="">Perhaps when using “install_name_tool” with "-id” flag to change a library’s install name.</div><div class="">As a workaround i will fix install name manually, but you may consider investigating this issue further.</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">p.s. an excerpt from <a href="http://cocoadev.com/ApplicationLinking" class="">http://cocoadev.com/ApplicationLinking</a> :</div><div class=""><br class=""></div><div class=""><span style="font-family: 'Helvetica Neue', Helvetica, Arial, Geneva, sans-serif; font-size: 13px; background-color: rgb(255, 255, 255);" class="">Unlike many OSes, OS X does not have a search path for the dynamic linker**. This means that you can't simply put a dynamic library in some "standard" location and have dyld find it, because there is no standard location. Instead, OS X embeds an "install name" inside each dynamic library. This install name is the path to where the library can be found when dyld needs to load it. When you build an application that links against a dynamic library, this install name is copied into the application binary. When the application runs, the copied install name is then used to locate the library or framework.</span></div><div class=""><span style="font-family: 'Helvetica Neue', Helvetica, Arial, Geneva, sans-serif; font-size: 13px; background-color: rgb(255, 255, 255);" class=""><br class=""></span></div><div class=""><span style="background-color: rgb(255, 255, 255);" class=""><font face="Helvetica Neue, Helvetica, Arial, Geneva, sans-serif" size="2" class="">** Technically, dyld does have a search path, defined in the DYLD_FRAMEWORK_PATH and DYLD_LIBRARY_PATH variables. However, these are empty on OS X by default, so they rarely matter.</font></span></div><div class=""><br class=""></div><div class=""><div class="">
<div class="">Kind regards,</div><div class="">Denis </div>
</div>
<br class=""><div><blockquote type="cite" class=""><div class="">On 29 Oct 2015, at 22:01, Barry Smith <<a href="mailto:bsmith@mcs.anl.gov" class="">bsmith@mcs.anl.gov</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class=""><br class=""> Denis,<br class=""><br class=""> We don't understand what purpose a soname serves on Apple or how to add it. If you need it let us know how to install PETSc so that it is set and we will do it.<br class=""><br class=""> Barry<br class=""></div></div></blockquote></div><br class=""></div></body></html>