Another Mac installation problem

I am also having a problem installing and using OpenMx on a Max running snow leopard. This is true both with my desktop Mac and a new Macbook running R 2.10.1 (brand new download). It seems to download the package ok, but when I try to require Open Mx, I get:
> require(OpenMx)
Loading required package: OpenMx
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared library '/Library/Frameworks/R.framework/Resources/library/OpenMx/libs/i386/OpenMx.so':
dlopen(/Library/Frameworks/R.framework/Resources/library/OpenMx/libs/i386/OpenMx.so, 6): Library not loaded: /usr/local/lib/libgfortran.2.dylib
Referenced from: /Library/Frameworks/R.framework/Resources/library/OpenMx/libs/i386/OpenMx.so
Reason: image not found
In addition: Warning message:
package 'OpenMx' was built under R version 2.9.2 and help may not work correctly
This seems similar but not identical to the problems that some other people have been having. Is it to do with the version of R I have dowloaded (I went for R-2.10.1.dmg, which includes Fortran libraries).
Many thanks if anyone can help
Daniel
There are quite a few
comfortable with computer language. Basically, it's exactly the same as everyone else has written but I've added a line of code. As a note, I am running snow leopard (10.6.2) and have R version 2.10.1
In my terminal window, I entered the following:
> cd /usr/local/lib
# This changes your directory; your next line should look something like this:
#my-computer:lib username$
> sudo ln -s
/Library/Frameworks/R.framework/Versions/2.10/Resources/lib/libgfortran.2.dylib
/usr/local/lib/libgfortran.2.dylib
#all of the above also should be entered on one line
> file /usr/local/lib/libgfortran.2.dylib
#another double-check
#output: /usr/local/lib: directory
my-computer:lib username$ file /usr/local/lib/libgfortran.2.dylib
/usr/local/lib/libgfortran.2.dylib: Mach-O universal binary with 4 architectures
/usr/local/lib/libgfortran.2.dylib (for architecture i386): Mach-O
dynamically linked shared library i386
/usr/local/lib/libgfortran.2.dylib (for architecture ppc): Mach-O dynamically
linked shared library ppc
/usr/local/lib/libgfortran.2.dylib (for architecture x86_64): Mach-O 64-bit
dynamically linked shared library x86_64
/usr/local/lib/libgfortran.2.dylib (for architecture ppc64): Mach-O 64-bit
dynamically linked shared library ppc64
#In other words, it worked!
#Open R and require(OpenMx) then you're good to go.
Log in or register to post comments
In reply to There are quite a few by horn
Just to provide confirmation
Thanks for posting the details of how to appropriately get the dynamic libraries linked.
Ken
Log in or register to post comments
In reply to There are quite a few by horn
It's worth noting that when
Log in or register to post comments
In reply to There are quite a few by horn
Hi I had similar problems
I followed the directions from horn, modified for version 11 in obvious way. Here's a blow-by-blow:
1) Installed R11.0 for mac
> version
_
platform i386-apple-darwin9.8.0
arch i386
os darwin9.8.0
system i386, darwin9.8.0
status
major 2
minor 11.0
year 2010
month 04
day 22
svn rev 51801
language R
version.string R version 2.11.0 (2010-04-22)
2) quit newly installed R
3) Set the link for libgfortran and checked results
> cd /usr/local/lib
> sudo ln -fs /Library/Frameworks/R.framework/Versions/2.11/Resources/lib/libgfortran.2.dylib /usr/local/lib/libgfortran.2.dylib
# used -fs instead of -s and changed to ...Versions/2.11
> ls -l /usr/local/lib/libgfortran.2.dylib
lrwxr-xr-x 1 root wheel 79 May 11 13:26 /usr/local/lib/libgfortran.2.dylib -> /Library/Frameworks/R.framework/Versions/2.11/Resources/lib/libgfortran.2.dylib
>file /usr/local/lib/libgfortran.2.dylib
/usr/local/lib/libgfortran.2.dylib: Mach-O universal binary with 4 architectures
/usr/local/lib/libgfortran.2.dylib (for architecture i386): Mach-O dynamically linked shared library i386
/usr/local/lib/libgfortran.2.dylib (for architecture ppc): Mach-O dynamically linked shared library ppc
/usr/local/lib/libgfortran.2.dylib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64
/usr/local/lib/libgfortran.2.dylib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64
4) Downloaded OpenMx as per instructions
5) Started the newly installed R
Tried to start OpemMx. Got error reported above.
> require(OpenMx)
Loading required package: OpenMx
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared library '/Users/tnearey/Library/R/2.11/library/OpenMx/libs/i386/OpenMx.so':
dlopen(/Users/tnearey/Library/R/2.11/library/OpenMx/libs/i386/OpenMx.so, 6): Library not loaded: /Library/Frameworks/R.framework/Versions/2.10/Resources/lib/libRblas.dylib
Referenced from: /Users/tnearey/Library/R/2.11/library/OpenMx/libs/i386/OpenMx.so
Reason: image not found
Advice requested.
Followup questions:
a) Is the following excerpt relevant?
b) If so could the Mx team add above code to their install instructions or script for Mac OS? ( I've never had these kinds of problems with other R packages.)
Start excerpt--------
(From http://cran.r-project.org/bin/macosx/RMacOSX-FAQ.html 5.6 Building universal packages)
If you want to share a binary with multiple users and don't want to require them to install Xcode, you can use the same approach as CRAN but only if you use the same tools as we do on CRAN. It means to change the path of the FORTRAN dynamic library (libgfortran) to point inside the R version that you are compiling for. For example, if you have installed a universal package FOO for R 2.11.x, you can change the paths as follows:
# change into the library where you installed FOO
cd /Library/Frameworks/R.framework/Resources/library
# fix the Fortran paths in FOO to point to R 2.11 instead
for lib in `ls FOO/libs/*/*.so`; do
install_name_tool -change /usr/local/lib/libgfortran.2.dylib \
/Library/Frameworks/R.framework/Versions/2.11/Resources/lib/libgfortran.2.dylib \
$lib
done
End excerpt ---------
Cheers,
-T Nearey
Log in or register to post comments
In reply to Hi I had similar problems by tnearey
The installation is looking
Yes, the answer in the FAQ is relevant. We have been meaning to change the build process to the new system. However, it is a non-trivial operation and if we get it wrong then the installer works for nobody. We'll try to bump its priority.
Log in or register to post comments
In reply to The installation is looking by mspiegel
Thanks for your quick
Sorry ...I now see I didn't read my output carefully enough in my first posting. I'll try one of your suggestions.
I got the same error when I tried to implement the FAQ procedure (just before I rechecked this thread)
.
I can see why the change to the FAQ method would be tricky.
Maybe adding a web link to this thread on the Mac install instructions would be warranted in the meantime.
-tnearey
Log in or register to post comments
In reply to Thanks for your quick by tnearey
No problem. Also, I might
Let me work on implementing the FAQ tonight. One change on our server: currently the 2.11.x binaries are symbolic links to the 2.10.x binaries. We'll have to change that.
Log in or register to post comments
In reply to No problem. Also, I might by mspiegel
I think it's working now! The
Log in or register to post comments
In reply to I think it's working now! The by mspiegel
Thanks! Confirming it works
Confirming it works no problem on R2.11 on Mac OS 10.5.8.
Glad I checked this thread this morning.
Great service!
Cheers,
TNearey
Log in or register to post comments