Mac Pro Server Installation Problem

Posted on
Picture of user. pdeboeck Joined: 08/04/2009

Am I missing a step? Did source('http://...'), library(OpenMx) and problems came up.

> source('REDACTED')
trying URL 'http://cran.wustl.edu/bin/macosx/universal/contrib/2.9/snowfall_1.70.tgz'
Content type 'application/x-tar' length 221764 bytes (216 Kb)
opened URL
==================================================
downloaded 216 Kb

The downloaded packages are in
/var/folders/4P/4PjGpUneHz4ihgwMhvzYPE+++TI/-Tmp-//RtmpN2blBk/downloaded_packages
trying URL 'REDACTED'
Content type 'application/x-gzip' length 2356993 bytes (2.2 Mb)
opened URL
==================================================
downloaded 2.2 Mb

The downloaded packages are in
/var/folders/4P/4PjGpUneHz4ihgwMhvzYPE+++TI/-Tmp-//RtmpN2blBk/downloaded_packages

> library(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
Error in library(OpenMx) : .First.lib failed for 'OpenMx'
> R.Version()
$platform
[1] "i386-apple-darwin8.11.1"

$arch
[1] "i386"

$os
[1] "darwin8.11.1"

$system
[1] "i386, darwin8.11.1"

$status
[1] ""

$major
[1] "2"

$minor
[1] "9.1"

$year
[1] "2009"

$month
[1] "06"

$day
[1] "26"

$`svn rev`
[1] "48839"

$language
[1] "R"

$version.string
[1] "R version 2.9.1 (2009-06-26)"

Replied on Thu, 08/20/2009 - 18:31
Picture of user. pdeboeck Joined: Aug 04, 2009

OpenMx does show up under installed.packages(), but I'm not doing something right because:

> mxMatrix()
Error: could not find function "mxMatrix"

Replied on Thu, 08/20/2009 - 19:08
Picture of user. Steve Joined: Jul 30, 2009

In reply to by pdeboeck

I wonder if this is a permissions problem since you're using OS X Server

Are you logged in as an account that has permissions to write to
/Library/Frameworks/R.framework/Resources/library/

You might need to do the install as an administrator, depending on how your OS X Server is set up.

Replied on Fri, 08/21/2009 - 10:02
Picture of user. pdeboeck Joined: Aug 04, 2009

In reply to by Steve

Turns out --- Not just a server issue. Similar issues on my laptop (Mac Pro)

> source('http:...')
trying URL 'http://cran.mtu.edu/bin/macosx/universal/contrib/2.9/snowfall_1.70.tgz'
Content type 'application/x-gzip' length 221764 bytes (216 Kb)
opened URL
==================================================
downloaded 216 Kb

The downloaded packages are in
/var/folders/96/96lirKLcEKeAKV3pKF6Y2E+++TI/-Tmp-//RtmpkKyMfC/downloaded_packages
trying URL 'http:...'
Content type 'application/x-gzip' length 2356993 bytes (2.2 Mb)
opened URL
==================================================
downloaded 2.2 Mb

The downloaded packages are in
/var/folders/96/96lirKLcEKeAKV3pKF6Y2E+++TI/-Tmp-//RtmpkKyMfC/downloaded_packages

> library(OpenMx)
Loading required package: snowfall
Loading required package: snow
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
Error in library(OpenMx) : .First.lib failed for 'OpenMx'

> R.Version()
$platform
[1] "i386-apple-darwin8.11.1"

$arch
[1] "i386"

$os
[1] "darwin8.11.1"

$system
[1] "i386, darwin8.11.1"

$status
[1] ""

$major
[1] "2"

$minor
[1] "9.1"

$year
[1] "2009"

$month
[1] "06"

$day
[1] "26"

$`svn rev`
[1] "48839"

$language
[1] "R"

$version.string
[1] "R version 2.9.1 (2009-06-26)"

Replied on Thu, 08/20/2009 - 19:44
Picture of user. Jeff Joined: Jul 31, 2009

Hi, Pascal,

Let's start out in terminal:

> ls /usr/local/lib/libgfortran.2.dylib

Is it there? If it is, it's a permission issue to that file. If it's not, then you probably need to do a clean install of R for all users. But let's do a quick search first:

> locate libgfortran.2.dylib

If it doesn't find it, then, if you have time:

> /usr/libexec/locate.updatedb
> locate libgfortran.2.dylib

The first will update your "locate" databases.

If it did find it, then you can do an "ln -s" to the file in /usr/local/lib or just cp it there.

As Steve pointed out, the fact that it's server may be causing some problems.

Replied on Fri, 08/21/2009 - 10:04
Picture of user. pdeboeck Joined: Aug 04, 2009

In reply to by Jeff

Both computers --- here's the problem.

ComputerName:~ pascal$ ls /usr/local/lib/libgfortran.2.dylib
ls: /usr/local/lib/libgfortran.2.dylib: No such file or directory

ComputerName:~ pascal$ locate libgfortran.2.dylib
/Library/Frameworks/R.framework/Versions/2.7/Resources/lib/libgfortran.2.dylib

What's the best way to fix this?

Replied on Fri, 08/21/2009 - 10:33
Picture of user. pdeboeck Joined: Aug 04, 2009

In reply to by Jeff

Terminal:

ComputerName:~ localadmin$ sudo ln -s /Library/Frameworks/R.framework/Versions/2.7/Resources/lib/libgfortran.2.dylib /usr/local/lib/libgfortran.2.dylib
Password:
ComputerName:~ localadmin$

R:

> library(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
Error in library(OpenMx) : .First.lib failed for 'OpenMx'

Replied on Fri, 08/21/2009 - 12:32
Picture of user. pdeboeck Joined: Aug 04, 2009

In reply to by AdminJeff

Tried it --- still having problems.

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
Error in library(OpenMx) : .First.lib failed for 'OpenMx'

In the terminal, I tried locating the file and got:

ComputerName:~ pascal$ ls /usr/local/lib/libgfortran.2.dylib
/usr/local/lib/libgfortran.2.dylib
ComputerName:~ pascal$

permissions are: lrwxr-xr-x

Replied on Fri, 08/21/2009 - 13:26
Picture of user. pdeboeck Joined: Aug 04, 2009

In reply to by Jeff

What do you think of this?

ComputerName:~ localadmin$ ls -la /usr/local/lib/libgfortran.2.dylib

lrwxr-xr-x 1 root wheel 78 Aug 21 09:30 /usr/local/lib/libgfortran.2.dylib -> /Library/Frameworks/R.framework/Versions/2.7/Resources/lib/libgfortran.2.dylib

ComputerName:~ localadmin$ ls -la /Library/Frameworks/R.framework/Versions/2.7/Resources/lib/libgfortran.2.dylib

ls: /Library/Frameworks/R.framework/Versions/2.7/Resources/lib/libgfortran.2.dylib: No such file or directory

ComputerName:~ localadmin$ locate libgfortran.2.dylib

/Library/Frameworks/R.framework/Versions/2.7/Resources/lib/libgfortran.2.dylib

Replied on Fri, 08/21/2009 - 12:34
Picture of user. Jeff Joined: Jul 31, 2009

In reply to by tbates

If they have the latest version, then we should see if we can fix first, as these issues could pop up when we have to support earlier versions of R as well, that is, when R 2.9.2 comes out.

Replied on Fri, 08/21/2009 - 16:48
Picture of user. pdeboeck Joined: Aug 04, 2009

Poor Solution:

I made a copy of R.framework/Versions/2.9 and relabeled it 2.7. Now when it goes to

/usr/local/lib/libgfortran.2.dylib

it finds

/Library/Frameworks/R.framework/Versions/2.7/Resources/lib/libgfortran.2.dylib

However, when I try to

sudo ln -s /Library/Frameworks/R.framework/Versions/2.9/Resources/lib/libgfortran.2.dylib /usr/local/lib/libgfortran.2.dylib

It complains the file exists. When I try to remove /usr/local/lib/libgfortran.2.dylib, it complains that no such file exists. So ugly solution, and some bad voodoo, but it is working. Question is what is the underlying problem? These are two very different machines --- one OS X 10.5.8 server, the other just OS X 10.5.8. I can see if the problem will replicate with one of my machines downstairs, but I suspect the result will be the same.

On a tangent, I get the complaint from R:

> library(OpenMx)
Created directory: /var/localadmin/.sfCluster/restore
snowfall 1.70 initialized: sequential execution, one CPU.

Warning message:
In searchCommandline(parallel, cpus = cpus, type = type, socketHosts = socketHosts, :
Unknown option on commandline: --gui

Replied on Sun, 08/23/2009 - 19:52
Picture of user. Steve Joined: Jul 30, 2009

In reply to by pdeboeck

This looks to me like a permissions problem.

Someplace on the directory tree you likely don't have permission to read anything further up the tree (for trees that grow up from their roots).

That's the only thing I know of that can create the symptoms you are describing: a file exists some times (especially when sudo'ing) and doesn't appear to exist at other times.

If your user is named "pdeboeck", you might try

cd /Library/Frameworks
chown -R pdeboeck R.framework

That will make "all your base belong to you".