You are here

I fail to install OpenMx from source on MacOs 10.12.6

5 posts / 0 new
Last post
jkarch's picture
Joined: 03/15/2011 - 15:04
I fail to install OpenMx from source on MacOs 10.12.6

The short story is that R seems to ignore my intention to use the gcc* compilers.

This is what I do (following

m0026872:R karchjd$ git clone git://
Cloning into 'OpenMx'...
remote: Counting objects: 46654, done.
remote: Compressing objects: 100% (33/33), done.
remote: Total 46654 (delta 20), reused 32 (delta 12), pack-reused 46604
Receiving objects: 100% (46654/46654), 21.72 MiB | 2.21 MiB/s, done.
Resolving deltas: 100% (36789/36789), done.
m0026872:R karchjd$ cd OpenMx/
m0026872:OpenMx karchjd$ git reset --hard origin/master
HEAD is now at 219a7870 Another set of tests succeed
m0026872:OpenMx karchjd$ make install
Checking code style
./util/prep npsol
* NPSOL build selected
* Generating src/omxSymbolTable.h
* Generating src/omxSymbolTable.cpp
* Generating R/sysdata.rda
-e travis_fold:start:roxygenizeroxygenize
R version 3.4.1 (2017-06-30) -- "Single Candle"
Copyright (C) 2017 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin15.6.0 (64-bit)
R ist freie Software und kommt OHNE JEGLICHE GARANTIE.
Sie sind eingeladen, es unter bestimmten Bedingungen weiter zu verbreiten.
Tippen Sie 'license()' or 'licence()' für Details dazu.
  Natural language support but running in an English locale
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Tippen Sie 'demo()' für einige Demos, 'help()' für on-line Hilfe, oder
'help.start()' für eine HTML Browserschnittstelle zur Hilfe.
Tippen Sie 'q()', um R zu verlassen.
> library(devtools)
Paket ‘devtools’ wurde unter R Version 3.4.2 erstellt
> devtools::document('.', roclets=c('rd'))
Updating OpenMx documentation
Loading OpenMx
Re-compiling OpenMx
'/Library/Frameworks/R.framework/Resources/bin/R' --no-site-file --no-environ  \
  --no-save --no-restore --quiet CMD INSTALL  \
  '/Users/karchjd/mystuff/projects/GPPMSoftware/R/OpenMx'  \
  --library='/var/folders/lw/kj89878x7ync198n0rbgtc6hgk_515/T//RtmpvUSzwR/devtools_install_d1702cf8d512'  \
  --no-R --no-data --no-help --no-demo --no-inst --no-docs --no-exec  \
  --no-multiarch --no-test-load --preclean
* installing *source* package ‘OpenMx’ ...
NOTE: ./configure is not an autoconf generated script.
Change default C/C++ compiler and default compile flags by editing ~/.R/Makevars
** libs
clang++ -std=gnu++11 -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG  -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/RcppEigen/include" -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/StanHeaders/include" -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/BH/include" -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/rpf/include" -I/usr/local/include  -fopenmp -Wall -Wno-unknown-pragmas -Wno-unused-parameter -Wvla -Wno-unused-local-typedefs -Wno-deprecated-declarations -Wno-unused-function -fdiagnostics-color=auto -DEXTRA_GCC_DIAG -Wno-misleading-indentation -Wno-pragmas -Wno-ignored-attributes -Wno-misleading-indentation -Wno-int-in-bool-context -mmacosx-version-min=10.7   -fPIC  -Wall -g -O2 -c Compute.cpp -o Compute.o
clang: error: unsupported option '-fopenmp'
make[1]: *** [Compute.o] Error 1
ERROR: compilation failed for package ‘OpenMx’
* removing ‘/private/var/folders/lw/kj89878x7ync198n0rbgtc6hgk_515/T/RtmpvUSzwR/devtools_install_d1702cf8d512/OpenMx’
Fehler: Command failed (1)
Ausführung angehalten
make: *** [install] Error 1

So it seems to use clang++ as C++ compile. At the same time

m0026872:OpenMx karchjd$ cat ~/.R/Makevars

and even

m0026872:etc karchjd$ cat /Library/Frameworks/R.framework/Resources/etc/Makeconf | grep 'CC = '
CC = gcc
m0026872:etc karchjd$ cat /Library/Frameworks/R.framework/Resources/etc/Makeconf | grep 'CXX ='
CXX = g++
m0026872:etc karchjd$ cat /Library/Frameworks/R.framework/Resources/etc/Makeconf | grep 'CXX1X = '
CXX1X = g++
m0026872:etc karchjd$ cat /Library/Frameworks/R.framework/Resources/etc/Makeconf | grep 'FC = '
FC = gfortran
m0026872:etc karchjd$ cat /Library/Frameworks/R.framework/Resources/etc/Makeconf | grep 'F77 = '
F77 = gfortran

What is going on?

AdminNeale's picture
Joined: 03/01/2013 - 14:09
Perhaps explicit paths are needed?


My operational Makevars looks like this:

CC = /usr/local/bin/gcc
CXX = /usr/local/bin/g++ 
CFLAGS = -g -O3 -Wall -pedantic -Wconversion -Wno-sign-conversion
CXXFLAGS = -g -O3 -Wall -pedantic -Wconversion -Wno-sign-conversion
CXX11 = /usr/local/bin/g++
CXX14 = /usr/local/bin/g++
CXX17 = /usr/local/bin/g++
CXX1X = /usr/local/bin/g++
F77 = /usr/local/bin/gfortran
FC = /usr/local/bin/gfortran
jkarch's picture
Joined: 03/15/2011 - 15:04
Progress! Thanks a lot!

Now it compiles!

I still seem to have problems with npsol. If I do make test, the result is

R  --vanilla --slave -f inst/tools/testModels.R
** WARNING: Eigen conformability checking is DISABLED **
To take full advantage of multiple cores, use:
  mxOption(NULL, 'Number of Threads', parallel::detectCores()) #now
  Sys.setenv(OMP_NUM_THREADS=parallel::detectCores()) #before library(OpenMx)
travis_fold:start:CSOLNPTEST CSOLNP
CSOLNP 1 of 211 models/passing/ACEDuplicateMatrices.R ...
Running both with 3 parameters
At line 2740 of file npsolsubs.f
Internal Error: get_unit(): Bad internal unit KIND
make: *** [test] Error 3

I left the inst/npsol/osx/ folder untouched as I am not sure how to obtain the correct version of npsol for my build (as is recommended in the HOWTO).

jpritikin's picture
Joined: 05/24/2012 - 00:35

Use 'make cran-install' to compile without NPSOL

jkarch's picture
Joined: 03/15/2011 - 15:04

That solved the issue. Thx!