You may also need to update where the binaries and libraries look. See
the man pages for otool and install_name_tool for more information. Here
is a basic example:

bash-3.2# otool -L libmpi.dylib 
libmpi.dylib:
        /opt/local/lib/libmpi.1.dylib (compatibility version 3.0.0, current 
version 3.2.0)
        /opt/local/lib/libopen-rte.5.dylib (compatibility version 6.0.0, 
current version 6.2.0)
        /opt/local/lib/libopen-pal.5.dylib (compatibility version 6.0.0, 
current version 6.2.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current 
version 169.3.0)

bash-3.2# install_name_tool -change /opt/local/lib/libopen-rte.5.dylib 
@loader_path/libopen-rte.5.dylib libmpi.dylib 
bash-3.2# install_name_tool -id /some/path/lib/libmpi.1.dylib libmpi.1.dylib

bash-3.2# otool -L libmpi.dylib 
libmpi.dylib:
        /some/path/lib/libmpi.1.dylib (compatibility version 3.0.0, current 
version 3.2.0)
        @loader_path/libopen-rte.5.dylib (compatibility version 6.0.0, current 
version 6.2.0)
        /opt/local/lib/libopen-pal.5.dylib (compatibility version 6.0.0, 
current version 6.2.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current 
version 169.3.0)


@loader_path is a special token to look in directory containing the
library/binary. You can also set an rpath using install_name_tool -rpath
then use the @rpath token.

-Nathan

On Fri, Aug 16, 2013 at 03:21:56PM +0200, Reuti wrote:
> Hi,
> 
> Am 16.08.2013 um 01:33 schrieb Eric Heien:
> 
> > I'm compiling OpenMPI 1.6.5 on a set of different machines with different 
> > operating systems.  I install OpenMPI in directory A, then later move it to 
> > directory B and compile my own code with mpicc or mpic++.  Of course I need 
> > to set the OPAL_PREFIX environment variable to point to directory B.  This 
> > works fine on all my platforms (RedHat, Ubuntu, Fedora, Debian, etc) but 
> > still fails on Mac OS X 10.7 and 10.8 with the following error:
> > 
> > [xxx] ~ > env | grep OPAL
> > OPAL_PREFIX=/Users/eheien/B/
> > [xxx] ~ > mpicc
> > dyld: Library not loaded: /Users/eheien/A/lib/libopen-pal.4.dylib
> >  Referenced from: /Users/eheien/B/bin/mpicc
> 
> Besides setting the OPAL_PREFIX, also the DYLD_LIBRARY_PATH needs to be 
> adjusted to point to the new /Users/eheien/B/lib location.
> 
> -- Reuti
> 
> 
> >  Reason: image not found
> > Trace/BPT trap: 5
> > 
> > It appears the libopen-pal path is hardcoded into the opal_wrapper on OS X 
> > (I can also find it in the binary).  Does this sound like correct behavior? 
> >  If so, is there a way to get this to work correctly with OPAL_PREFIX like 
> > it does on the other operating systems?
> > 
> > Thank you for your help,
> > 
> > -Eric
> > 
> > _______________________________________________
> > users mailing list
> > us...@open-mpi.org
> > http://www.open-mpi.org/mailman/listinfo.cgi/users
> 
> _______________________________________________
> users mailing list
> us...@open-mpi.org
> http://www.open-mpi.org/mailman/listinfo.cgi/users

Reply via email to