SteffenMoritz/ridge

Issues installing ridge

Closed this issue · 4 comments

Hello,

I am having significant issues installing the ridge toolbox (see below error). I have used it before, so not sure what is going on. I have installed GSL. For reference, I am working on a MacOS (Catalina, 10.15.4).

Thank you,
Cristina

install.packages("ridge")
Installing package into ‘/Users/cristinaroman/Library/R/4.0/library’
(as ‘lib’ is unspecified)
Package which is only available in source form, and may need compilation of C/C++/Fortran: ‘ridge’
Do you want to attempt to install these from sources? (Yes/no/cancel) yes
installing the source package ‘ridge’

trying URL 'https://cloud.r-project.org/src/contrib/ridge_2.5.tar.gz'
Content type 'application/x-gzip' length 124719 bytes (121 KB)

downloaded 121 KB

  • installing source package ‘ridge’ ...
    ** package ‘ridge’ successfully unpacked and MD5 sums checked
    ** using staged installation
    checking for gsl-config... no
    configure: WARNING: gsl-config not found, is GSL installed?
    configure: WARNING: ridge will be installed but some functions will be unavailable
    configure: creating ./config.status
    config.status: creating R/linearRidgeGenotypes.R
    config.status: creating R/linearRidgeGenotypesPredict.R
    config.status: creating R/logisticRidgeGenotypes.R
    config.status: creating R/logisticRidgeGenotypesPredict.R
    config.status: creating src/config.h
    ** libs
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    ERROR: compilation failed for package ‘ridge’
  • removing ‘/Users/cristinaroman/Library/R/4.0/library/ridge’

The downloaded source packages are in
‘/private/var/folders/p4/1n_2sb096sg87thjdrz9whwm0000gn/T/RtmpTeLO5O/downloaded_packages’
Warning message:
In install.packages("ridge") :
installation of package ‘ridge’ had non-zero exit status

Hallo, thanks for your question.

I also have MacOS - these problems often occur after updating to a newer MacOS version. Reason is, that you have to re-install some things.

Try to install the Xcode toolkit on MacOS Terminal:
`xcode-select --install

If this does not work try to install it manually from there:
https://developer.apple.com/download/more/
`
Afterwards try again to install the ridge package as you did before.
Would be nice, if you could give me some feedback, if this solved the problem :)

Hi Steffen,

Thank you for your response. The Xcode install worked via the terminal, but unfortunately, Ridge still will not install properly. It seems like the installation got a bit farther this time?

install.packages("ridge")
Installing package into ‘/Users/cristinaroman/Library/R/4.0/library’
(as ‘lib’ is unspecified)
Package which is only available in source form, and may need compilation of C/C++/Fortran: ‘ridge’
Do you want to attempt to install these from sources? (Yes/no/cancel) Yes
installing the source package ‘ridge’

trying URL 'https://cloud.r-project.org/src/contrib/ridge_2.5.tar.gz'
Content type 'application/x-gzip' length 124719 bytes (121 KB)

downloaded 121 KB

  • installing source package ‘ridge’ ...
    ** package ‘ridge’ successfully unpacked and MD5 sums checked
    ** using staged installation
    checking for gsl-config... no
    configure: WARNING: gsl-config not found, is GSL installed?
    configure: WARNING: ridge will be installed but some functions will be unavailable
    configure: creating ./config.status
    config.status: creating R/linearRidgeGenotypes.R
    config.status: creating R/linearRidgeGenotypesPredict.R
    config.status: creating R/logisticRidgeGenotypes.R
    config.status: creating R/logisticRidgeGenotypesPredict.R
    config.status: creating src/config.h
    ** libs
    clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/usr/local/include -fPIC -Wall -g -O2 -c ReadInData.c -o ReadInData.o
    clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/usr/local/include -fPIC -Wall -g -O2 -c commonFunctions.c -o commonFunctions.o
    clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/usr/local/include -fPIC -Wall -g -O2 -c computeLinearRidge.c -o computeLinearRidge.o
    clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/usr/local/include -fPIC -Wall -g -O2 -c computePvals.c -o computePvals.o
    clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/usr/local/include -fPIC -Wall -g -O2 -c coordinateDescent.c -o coordinateDescent.o
    clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/usr/local/include -fPIC -Wall -g -O2 -c linear.c -o linear.o
    clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/usr/local/include -fPIC -Wall -g -O2 -c linearFunctions.c -o linearFunctions.o
    clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/usr/local/include -fPIC -Wall -g -O2 -c logistic.c -o logistic.o
    clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/usr/local/include -fPIC -Wall -g -O2 -c logisticFunctions.c -o logisticFunctions.o
    clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/usr/local/include -fPIC -Wall -g -O2 -c registration.c -o registration.o
    clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/usr/local/include -fPIC -Wall -g -O2 -c regression_wrapper_function.c -o regression_wrapper_function.o
    clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/usr/local/include -fPIC -Wall -g -O2 -c ridgeRegressionFunctions.c -o ridgeRegressionFunctions.o
    clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/usr/local/include -fPIC -Wall -g -O2 -c thin.c -o thin.o
    clang -mmacosx-version-min=10.13 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/lib -L/usr/local/lib -o ridge.so ReadInData.o commonFunctions.o computeLinearRidge.o computePvals.o coordinateDescent.o linear.o linearFunctions.o logistic.o logisticFunctions.o registration.o regression_wrapper_function.o ridgeRegressionFunctions.o thin.o -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
    installing to /Users/cristinaroman/Library/R/4.0/library/00LOCK-ridge/00new/ridge/libs
    ** R
    ** data
    ** inst
    ** byte-compile and prepare package for lazy loading
    ** help
    *** installing help indices
    ** building package indices
    ** testing if installed package can be loaded from temporary location
    Error: package or namespace load failed for ‘ridge’ in dyn.load(file, DLLpath = DLLpath, ...):
    unable to load shared object '/Users/cristinaroman/Library/R/4.0/library/00LOCK-ridge/00new/ridge/libs/ridge.so':
    dlopen(/Users/cristinaroman/Library/R/4.0/library/00LOCK-ridge/00new/ridge/libs/ridge.so, 6): Symbol not found: _regression_wrapper_function
    Referenced from: /Users/cristinaroman/Library/R/4.0/library/00LOCK-ridge/00new/ridge/libs/ridge.so
    Expected in: flat namespace
    in /Users/cristinaroman/Library/R/4.0/library/00LOCK-ridge/00new/ridge/libs/ridge.so
    Error: loading failed
    Execution halted
    ERROR: loading failed
  • removing ‘/Users/cristinaroman/Library/R/4.0/library/ridge’

The downloaded source packages are in
‘/private/var/folders/p4/1n_2sb096sg87thjdrz9whwm0000gn/T/RtmpdLuvjm/downloaded_packages’
Warning message:
In install.packages("ridge") :
installation of package ‘ridge’ had non-zero exit status

Ok, we fixed one problem - now we have to fix the rest.
From the message it seems lib gsl is also missing.

So on the terminal install:
brew install gsl

(if you do not have homebrew installed yet: https://brew.sh/ )

Hope this is solved 👍