Hi There,
Student had problem running a script today having updated to R version 2.12.0 (2010-10-15) in order to run OpenMx 1.0.2
Model (previously running fine) came back with error:
CP_fit1 = mxRun(CP_Model1)
Running fullCommon
Error in mxVersion() : subscript out of bounds
trying mxVersion itself, I now get
mxVersion()
Error in mxVersion() : subscript out of bounds
After quitting R, and restarting... error persists
> library(OpenMx)
Attaching package: 'OpenMx'
> mxVersion()
Error in mxVersion() : subscript out of bounds
Did you try mxVersion() from a new R session? Your R session will do some funny things if you already have the library loaded and you try to install the new version.
yes, quit r, reloaded it, then started again. hence the comment "After quitting R, and restarting... error persists"
> library(OpenMx)
Attaching package: 'OpenMx'
> mxVersion()
Error in mxVersion() : subscript out of bounds
will try again tomorrow on the student's computer when she's in.
t
The whole of mxVersion consists of two lines of code, copied-and-pasted here:
Thanks. When I look at it, there's no reason that mxVersion() should fail hard. I forgot we include it at the end of mxRun(). I'll change it to return a NA if the library is not found.
Ooh, that's a better long-term solution. That doesn't answer the deeper question, though, which is "why isn't OpenMx in the list of installed packages?"
Hi Ryne... like the 2.11 optimism!
This seems to be a mac build * R version 2.12.0 interaction.
I just upgraded my home laptop to 2.12, installed the OpenMx ready-to-wear version and got
> mxVersion()
Error in mxVersion() : subscript out of bounds
Built my own version from svn...
mxVersion()
[1] "999.0.0-1448"
OK. Solved. Installed packages is for some reason detecting the wrong architecture. Turning that off works.
The off the rack version is installing for "i386", but my (and students) .Platform$r_arch = "x86_64"
I guess too that there are a range of optimisations to be had above i386 with the gcc compilers?
Perhaps it will be worth spending some time to build a compile pool to generate more versions without poor Mike S having to guide it all manually...? Not sure.
libMatrix <- installed.packages(subarch=NULL)
> libMatrix["OpenMx",]
Package LibPath Version
"OpenMx" "/Users/tim/Library/R/2.12/library" "1.0.2-1497"
Priority Depends Imports
NA "methods" NA
LinkingTo Suggests Enhances
NA "snowfall" NA
OS_type License Archs
NA "Apache License 2.0" "i386"
Built
"2.12.0"
>
Ah, is this a windows machine? We have libnpsol successfully compiled for 32-bit windows but not 64-bit windows.
All Macintoshes:Mini, MacBookPro, and iMac 26 all running OS X 10.64
This is why we can't have nice things. Because R decides to add a new field to the package DESCRIPTION file and not put it in the documentation. OK, I just manually inserted the line into the package file. Can you have your student try installing OpenMx again using the web installer? Everything should just work.
Thanks for spotting this, sorry for doubting you earlier. That's the problem when I test on the same system I build.
jeez that f*in cat is scary! :-)
All working well now as far as i can see:
repos <- c('http://openmx.psyc.virginia.edu/packages/')
install.packages(pkgs=c('OpenMx'), repos=repos)
mxVersion()
[1] "1.0.2-1497 & smooth runnin's dr mike!"