Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with installation #5

Open
JimmyTree opened this issue Aug 20, 2017 · 11 comments
Open

Problems with installation #5

JimmyTree opened this issue Aug 20, 2017 · 11 comments

Comments

@JimmyTree
Copy link

Hi,
I am trying to install the package but encounter the following error message:
Error : package 'gurobi' is not installed for 'arch = i386'
Error: loading failed
Execution halted
*** arch - x64
ERROR: loading failed for 'i386'

  • removing 'C:/Users/jimmyt/Documents/R/R-3.4.1/library/bestsubset'
    Installation failed: Command failed (1)

Also, which version of Gurobi does this package work with? Would the package works with the latest version of gurobi as well?
I am using gurobi 7.0.1 and R 3.4.1 and wondering if this would work?
Thank you very much.

@zhan-gao
Copy link

Hi @JimmyTree , I met the same problem, and solved the problem by

library(devtools)
options(devtools.install.args = "--no-multiarch")   
install_github(repo="ryantibs/best-subset", subdir="bestsubset")

The installation will not invoke i386 arch with the additional option.

@JosHageman
Copy link

Thanks for sharing! it works!

@BartLoonstra
Copy link

Hmm.. It still doesn't work for me. I copy-pasted:

install.packages('devtools')
library(devtools)
options(devtools.install.args = "--no-multiarch")
install_github(repo="ryantibs/best-subset", subdir="bestsubset")

But my error was the same as before:

ERROR: dependency 'gurobi' is not available for package 'bestsubset'

  • removing 'D:/R/R-3.4.1/library/bestsubset'
    Installation failed: Command failed (1)

@BartLoonstra
Copy link

What I found I had to do:

  • Install gurobi optimizer and get the appropriate licence:
    http://www.gurobi.com/downloads/download-center
  • Install the package that was somehwere found in the gurobi folder after installation:
    install.packages('C:/gurobi751/win64/R/gurobi_7.5-1.zip', repos=NULL)
  • Install devtools:
    install.packages('devtools')
    library(devtools)
  • Install a package for gurobi called 'slam' (library not needed; as it is called automatically by gurobi):
    install.packages('slam')
  • Run the code to install the 'bestsubset' package from github:
    options(devtools.install.args = "--no-multiarch")
    install_github(repo="ryantibs/best-subset", subdir="bestsubset")

Result:
* DONE (bestsubset)

@KiraDynnes
Copy link

KiraDynnes commented Apr 27, 2018

Hi all

I followed @BartLoonstra recipe above and it worked perfect - until I updated R to the new 3.5.0.
Installation of gurobi works fine install.packages
> install.packages('C:/gurobi800/win64/R/gurobi_8.0-0.zip', repos=NULL)
Installing package into ‘C:/Users/kdsv/Documents/R/win-library/3.5’ (as ‘lib’ is unspecified) package ‘gurobi’ successfully unpacked and MD5 sums checked
but I cannot seem to load the library:
> library(gurobi)
Error: package or namespace load failed for ‘gurobi’: package ‘gurobi’ was installed by an R version with different internals; it needs to be reinstalled for use with this R version
I uninstalled gurobi and installed i again - nu luck, then I downloaded the 8.0 version and tried again - still no luck. Any suggestions will be very much appreciated!

@javierfajnolla
Copy link

I think that this is a problem with gurobi's R package, which does not seem to install or work in R 3.5. The one provided with gurobi 8.0 does work with previous versions.

I was in the same situation as you. I have written to gurobi, but it is been a week and I did not get any reply from them. The only solution I can think about until they update the binaries is to go back to the previous R version. If you had it installed, maybe you have not uninstalled it yet and can point RStudio (or whatever you are using) to this old instalation...

@KiraDynnes
Copy link

Im back with 3.4.4 - and it all works like a charm! I guess that is what you get for being a little too fresh on your updates ;-)

@javierfajnolla
Copy link

Awesome :)

For the record, if someone else ends up here, I was able to install gurobi's R package from source to work with R 3.5 by doing this: (I did this on a mac, but it should be very similar on windows or linux, as the files for those OS are also there)

  • Download source code from: http://files.gurobi.com/gurobi800/gurobiR.tar.gz (I got this address from gurobi's assistance mail)

  • Unzip the file somewhere.

  • Go inside unzipped folder from a terminal (or CMD in windows) and type:
    make -f Makefile.mac (or Makefile.win for windows; or Makefile.linux)

  • This creates the zipped package that can be installed within R: gurobi_8.0-0.tgz.

  • So, in R or RStudio, just install the this file, either from RStudio option or with the command:
    install.packages("/Library/gurobi800/mac64/R/from_source/gurobiR/gurobi_8.0-0.tgz", repos = NULL)
    (where "/Library/gurobi800/mac64/R/from_source/gurobiR/gurobi_8.0-0.tgz" is the address to the zipped file that we have just created)

Hope it helps!

@vtshen
Copy link

vtshen commented Aug 6, 2018

I am able to install the packages bestsubset and gurobi following this online guide https://cran.r-project.org/web/packages/prioritizr/vignettes/gurobi_installation.html , but only in R in Linux terminal.

In R studio, when I am running library(bestsubset), the error message is

"unable to load shared object '/home/shen/R/x86_64-pc-linux-gnu-library/3.4/gurobi/libs/gurobi.so': libgurobi80.so: cannot open shared object file: No such file or directory"

The official document (http://www.gurobi.com/documentation/8.0/quickstart_linux.pdf) mentions that

If you are using R from RStudio Server, and you get an error indicating that R is unable to load
the Gurobi DLL or shared object, you may need to set the rsession-ld-library-path entry in the server config file. Please consult the RStudio documentation for more information.

I tried to add

rsession-ld-library-path=/opt/gurobi/linux64/lib

in each of the two created files rserver.conf and rsession.conf in the folder /etc/rstudio, but not working. Any suggestions?

@faengl
Copy link

faengl commented Sep 4, 2018

I had the same problem on Ubuntu 16.04.4. with the desktop version of RStudio (not RStudio Server). My problem was solved by adding these lines to ~/.profile as suggested in this post.
Notice that for the variable GUROBI_HOME you have to substitute the correct path on your system.

export GUROBI_HOME="/path/to/installation/dir/gurobi801/linux64"
export PATH="${PATH}:${GUROBI_HOME}/bin"
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${GUROBI_HOME}/lib"

@Pancreatologist
Copy link

Hi everyone, i find the way to solve this problem in my computer. Just install the gurobi current version and get the free license for non-commerical use only. and in the R studio.
install.packages('c:/gurobi1000/win64/R/gurobi_10.0-0.zip', repos=NULL)
I hope it might help you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants