You are here

NPSOL Optimizer error

10 posts / 0 new
Last post
Kenji_UIUC's picture
Offline
Joined: 05/03/2019 - 11:38
NPSOL Optimizer error

I'm experiencing some issues with the twin code from the 2018 IBG workshop. It seems like the NPSOL optimizer isn't working.

Code: https://ibg.colorado.edu/cdrom2018/deleeuw/sexLimitation/oneACE5cSOLVED.R

source: https://ibg.colorado.edu/cdrom2018/deleeuw/sexLimitation/miFunctions.R

data: https://ibg.colorado.edu/cdrom2018/deleeuw/sexLimitation/sexLimACE.dat

The following happens :

what I type

source("miFunctions.R")

Message:
OpenMx version: 2.12.2 [GIT v2.12.2]
R version: R version 3.6.0 (2019-04-26)
Platform: x86_64-w64-mingw32
Default optimizer: NPSOL
NPSOL-enabled?: No
OpenMP-enabled?: No

Message:
NPSOL is not available in this build. See ?omxGetNPSOL() to download this optimizer

What I type in R:
?omxGetNPSOL()

Message: Windows users should either restart R or run
detach('package:OpenMx',unload=TRUE)
, and then run
source('http://openmx.ssri.psu.edu/getOpenMx.R')

What I type in R:

detach('package:OpenMx',unload=TRUE)
source('http://openmx.ssri.psu.edu/getOpenMx.R')

Message:

Warning in install.packages :
unable to access index for repository https://openmx.ssri.psu.edu/software/bin/windows/contrib/3.6:
cannot open URL 'https://openmx.ssri.psu.edu/software/bin/windows/contrib/3.6/PACKAGES'
Warning in install.packages :
package ‘OpenMx’ is not available (as a binary package for R version 3.6.0)

AdminRobK's picture
Offline
Joined: 01/24/2014 - 12:15
R 3.6

R version 3.6 was released less than a month ago, and more recently than the newest OpenMx release. Consequently, we haven't built any package binaries for it. It looks like you're currently running the CRAN build of OpenMx (which doesn't include NPSOL).
You could just sit tight and wait for the next OpenMx release (which will probably be by the end of this month), and in the meantime, stick with the CRAN build, and avoid running code that tries to use NPSOL.

If you need NPSOL right away for some reason, you could try downloading a binary built with R v3.5.x, and try to install it as a local zip file. I am not sure that will work, though, but you could also downgrade to R 3.5.x.

Or, instead, you could try building OpenMx from source. Note that the wiki entry I linked is probably pretty out-of-date for compilation under Windows, so unless you know what you're doing, I don't recommend trying it.

edit: "released less than a month ago"

AdminRobK's picture
Offline
Joined: 01/24/2014 - 12:15
You should be able to install

You should be able to install an NPSOL-enabled binary for R v3.6 with the getOpenMx.R script now.

Lisdin's picture
Offline
Joined: 03/08/2016 - 18:43
Hi Rob,

Hi Rob,

I installed the OpenMx version which uses the NPSOL optimizer today on my OS 10.4 (Mojave) using the following link:

source('https://openmx.ssri.psu.edu/software/getOpenMx.R')

The installation works fine, but when I require OpenMx I get the following error:

> require(OpenMx)
Loading required package: OpenMx
Error: package or namespace load failed for ‘OpenMx’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/Library/Frameworks/R.framework/Versions/3.6/Resources/library/OpenMx/libs/OpenMx.so':
dlopen(/Library/Frameworks/R.framework/Versions/3.6/Resources/library/OpenMx/libs/OpenMx.so, 6): Library not loaded: /usr/local/lib/libgomp.1.dylib
Referenced from: /Library/Frameworks/R.framework/Versions/3.6/Resources/library/OpenMx/libs/OpenMx.so
Reason: image not found

I removed the OpenMx package and installed it again, but the same error comes up. From the error code I don't quite understand what the problem is. I checked the path

/Library/Frameworks/R.framework/Versions/3.6/Resources/library/OpenMx/libs/

and the following files are in there:

OpenMx.so.dSYM
OpenMx.so
libstdc++.6.dylib
libquadmath.0.dylib
libgomp.1.dylib
libgfortran.3.dylib
libgcc_s.1.dylib

AdminRobK's picture
Offline
Joined: 01/24/2014 - 12:15
Hi, Lisa. Someone else has

Hi, Lisa. Someone else has also reported an issue similar to yours. I'm not involved with building OpenMx binaries for MacOS, but I've brought your post to the attention of developers who are.

Lisdin's picture
Offline
Joined: 03/08/2016 - 18:43
Thank you!

Thank you!

tbates's picture
Offline
Joined: 07/31/2009 - 14:25
travis is a good alternative for Mac users

Try

umx::install.OpenMx("travis")

This will get you going with the latest NPSOL version of OpenMx for Mac. (it's our most current build)

PS: The release NPSOL version (which you can access via umx::install.OpenMx("NPSOL")) will be updated shortly

Lisdin's picture
Offline
Joined: 03/08/2016 - 18:43
Hi Timothy,

Hi Timothy,

I installed the umx package in order to be able to run

umx::install.OpenMx("travis")

However, when I require umx, R cannot load it, because it cannot load the OpenMx package required for that.
So I cannot run umx::install.OpenMx("travis"). Feels like I am stuck.

Do you have any further advice?
Thank you!

AdminRobK's picture
Offline
Joined: 01/24/2014 - 12:15
getOpenMx.R

I believe using our source('https://openmx.ssri.psu.edu/software/getOpenMx.R') works again now.

Lisdin's picture
Offline
Joined: 03/08/2016 - 18:43
Thanks Rob, the problem is

Thanks Rob, the problem is solved now! :)