-
Notifications
You must be signed in to change notification settings - Fork 5
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
Installation fails (Windows 10, R v4.0, RTools v4.0.0) #34
Comments
I ran into same problem. What fixed it for me:
Then run installation in R again as prescribed: Works for me. |
Thanks for the tip. Sadly, this did not fix the issue for me. |
I installed rtools4.0 in "the new way" as given here https://cran.r-project.org/bin/windows/Rtools/ Did you do it the same way? |
On Windows the coin librarys are downloaded from r-winlib: Lines 5 to 11 in 1c78b0b
Maybe that is the problem as you get some error messages that the coin libs are not found. Can you use the Will try to look into it this week or weekend. |
Rhub installs without issue. I eventually succeeded installing rcbc after downloading the coin libraries from the address in winlibs/R and then flailing around a bit to discover their appropriate homes in ~/lib and ~/include under ~/rtools40/mingw32 and ~/rtools40/mingw64. The install script seemed to have populated the coin libraries in ~/mingw64 but then was looking for them in ~/mingw32, where they were absent. Perhaps this is a source of my initial problems? Thanks for the attention. |
I am having the same issue after updating to R 4.0 |
LIkewise here. @f3-matt ... can you be a little more specific about what you had to do to get it to work? Thank you. |
Sure. I downloaded the coin libraries from https://github.com/rwinlib/cbc/archive/v2.9.8.zip, referenced on line 7 of rcbc/tools/winlibs.R. From that archive, I took the /cbc-2.8.9/include/coin directory and copied it to C:/rtools40/mingw32/include/ and C:/rtools40/mingw64/include/ (your rtools directory may vary). After that, installing rcbc worked as expected. (It may not be necessary to put it in both places, but that's where I stopped experimenting.) |
Thanks, @f3-matt. I tried this but get the same result. I also tried the approach that @multiduplikator suggested but still can't get rcbc to install from github. |
Just to make sure. Sys.which("make") in R console gives you the expected results as described in the rtools installation documentation? I could produce a more detailed documentation on how I did it...if you want. |
Yep. See below:
I would like the additional guidance, if you are willing. Thank you. |
We can get the mingw cbc package installed and then you could use ROI with the cbc plug-in - as an alternative to rcbc. Would that be an option? Potentially with ompr and ompr.roi. That is my preferred setup... At any rate, I will do a small write-up tomorrow for you. |
Yes, please! I am using ompr and ompr.roi, so that is what I am trying to do. Just not happy with performance of glpk and symphony, so checking out some other options. Also looking for a good version of roi.plugin.gurobi if you know where to find one. They all appear 2+ years old and won't install. Thank you! |
In the meatime, you dont need the rcbc package for the cbc plugin to work. So installation of mingw-cbc should get you started. As for glpk performance, depending on the problem you are trying to solve you might get good improvements with: It does a lot less cutting as compared to cbc, but might be sufficient for you (it was not for me though). Off to write a bit for you. |
With msys2 shell.
Now you should be able to see the package available:
In the above, you can see that I installed my own build (multi-thread enabled), but the 2.9.9 is good as well. The multi threading kicks in with mini branch-and-bound part in a solve only, so you might not benefit so much from it. Now its time to install: That should get you started to use the cbc plugin with ROI. Also, at this stage I was able to build rcbc. If no dice, then I am afraid there is something wrong with your rtools40 install or something else, who knows. You could then move on and build your custom cbc package based on the rtools-packages. But that is a longer story. It goes something like this: Install
And then That will give you (after 8h or so, just because fork() and msys2 dont like each other so much) a package (with multi-threading enabled) that you can install with:
And then use with ROI and ompr like this (using the tictoc package for measuring time it takes):
If all the above fails, why not using neos and the cbc there? For that you install the ROI.plugin.neos first and then just submit your solve to neos (no account needed on neos):
Another side note, if you wish to experiment and tryout different solvers, you might want to convert the ompr model into an ROI OP model:
and then use ROI_solve() instead of solve_model(), effectively saving conversion each time you run a solve. That would be it for now. Let me know how it goes. I am happy to share my build with you. Not sure if it is allowed to post it here, so I wont for now. |
As for gurobi, I am afraid I dont have gurobi here (using it via neos every now and then). But it looks like there is a native integration with examples available with the gurobi installation: https://cran.r-project.org/web/packages/prioritizr/vignettes/gurobi_installation.html Once that is installed properly, the ROI.plugin.gurobi should work, but I cant test it. Sorry. Looks like there are at least 3 different ROI plugins for gurobi, and the most recent one is 2yrs old...but we are in the rcbc package here, so probably we should head over to discuss there ;) |
@multiduplikator Thanks so much for all of this. I really do appreciate it. I'm going to try your suggestions out this evening, when I have some more time available for this project. Sorry for adding in a Gurobi question here; just exploring multiple alternatives. |
Crossing fingers! Lets see how it goes. I am on CET timezone ... happy to help after the nap. |
I'm getting this when I try what you suggested for glpk.
Warning in ROI::ROI_solve(op, solver, ...) :
the control argument "UseCuts" is not available in solver 'glpk'
But I see it in the GLPK documentation here:
http://www.maximalsoftware.com/solvopt/optglpk.html
Is it possibly because I am passing through from ompr to ROI?
…On Fri, Jun 26, 2020 at 3:33 PM multiduplikator ***@***.***> wrote:
In the meatime, you dont need the rcbc package for the cbc plugin to work.
So installation of mingw-cbc should get you started.
As for glpk performance, depending on the problem you are trying to solve
you might get good improvements with:
ROI_solve(op_model, solver = "glpk", control = list("verbose" = TRUE,
"presolve" = TRUE, "UseCuts" = 256))
It does a lot less cutting as compared to cbc, but might be sufficient for
you (it was not for me though).
Off to write a bit for you.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#34 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABTQW3RLTOPY3H42WQJG5F3RYTZZRANCNFSM4NLMJRRQ>
.
--
Scott Nestler
Academic Director, MSBA Program
IT, Analytics, & Operations
University of Notre Dame
574-631-8117 (Office)
[email protected]
mendoza.nd.edu/mendoza-directory/profile/?slug=scott-nestler
[image: Mendoza College of Business]
338 Mendoza College of Business
Notre Dame, IN 46556
|
I was able to go through what you provided to install cbc from within msys2 shell. However, I still can't get rcbc or ROI.plugin.cbc to work (since the latter apparently depends on the former). Getting same error as before. I uninstalled and reinstalled Rtools 4.0 and still have the same issue. I have used NEOS a little bit and will give it a try again. But seem to recall there being some problem size limitations that were an issue at the time. Might not be an issue here. Thanks again for all of the suggestions. Hoping to get something to work faster than what I currently have. |
Unfortunately, the size limitation is still there in neos. And since you were able to build the cbc yourself, I would rule out rtools40 being the issue. Just sent you an email... |
Looking at this thread again, it seems like you guys are using an installation of R that is having 32bit and 64bit enabled. I know its a lot to ask, but could you reinstall with 64bit only - if not already the case? |
Could you post output of Also the following two:
And maybe give this a shot: |
Another approach to understand better - using RStudio to build the package. For that, get the rcbc-master and open the Rcbc.Rproj in RStudio. Then in Rstudio > Build menu, you can do "Install and Restart". If that fails, you can do "Check Package" and that will give you ample information to go on... Again, it would highly recommend to use an R installation that is in one arch only - e.g. 64.bit. |
Still failed, after a complete uninstall / reinstall of R and Rtools 4.0 (and adding packages needed for current project). Posting requested output.
Matrix products: default locale: attached base packages: loaded via a namespace (and not attached):
Tried as suggested: Still failed with error:
|
Problems resolved after reinstalling cbc via msys2 shell, AFTER R & Rtools uninstall/reinstall. Not really sure what the issue was, but it is working now. Thanks for all help. |
I am wondering if that is something that needs to be fixed in the package or if it is a R 4.0 issue. If it is the latter, would someone of you be interested to put the installation instructions into the wiki? I don't have a Windows PC. |
rtools40 and R4.0 have some quite substantial changes - and some issues with path handling, e.g. In theory, we should not need to do anything in the msys2. It should just install like any other package. We could document the cbc multi-threaded build (for usage with ROI) already. For the rest, I would wait out a few minor releases of R and monitor the path handling related fixes. |
I'm having a similar issue (i.e., unable to install the rcpc package) after I updated R from 4.0 to 4.2.1 and Rtools42 from Rtools40 (I could install and use the rcpc package before these updates). I'm running Windows 11 (also the A difference from the issue above is that I have a "undefined reference to `__imp___iob_func'" message. I tried I tried to copy-paste the coin library from rwindlib/cbc in ~/rtools42/mingw32 and ~/rtools42/mingw64 (as suggested by @f3-matt). Not sure if I should explore all the above mentioned suggestions considering that my problem seems a bit different (i.e., more recent version of R and Rtools, the "undefined reference to `__imp___iob_func'" message). Here is the log with the error message:
Downloading GitHub repo dirkschumacher/rcbc@HEAD Installing package into ‘C:/Users/bruno/AppData/Local/R/win-library/4.2’
Here are some info about my session:
─ Session info ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ─ Packages ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── Here is some info related to Rtools PATH:
"C:\rtools42/usr/bin" Here is a proof that the Rcpp package works:
2 Thanks in advance for any sort of help. |
Check #57 I have described a procedure there on how to build on R4.2.1/RT4.2. |
Thanks @multiduplikator. I commented in #57 because I need a bit more details on how to fix the issue. |
I'm unable to get installation to work properly under the 4.0 versions of R and RTools. After executing > install_github('dirkschumacher/rcbc'), I eventually get:
"C:/rtools40/mingw32/bin/"gcc -I"C:/PROGRA
1/R/R-401.0/include" -DNDEBUG -I../windows/cbc-2.9.8/include/coin -I'C:/Users/{user}/Documents/R/win-library/4.0/Rcpp/include' -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c rcbc-init.c -o rcbc-init.oC:/rtools40/mingw32/bin/g++ -std=gnu++11 -shared -s -static-libgcc -o rcbc.dll tmp.def RcppExports.o cpp_cbc_solve.o rcbc-init.o -L../windows/cbc-2.9.8/lib-8.3.0/i386 -lCbcSolver -lClpSolver -lOsiCbc -lCbc -lCgl -lOsiClp -lClp -lOsi -lCoinUtils -lz -lm -LC:/PROGRA
1/R/R-401.0/bin/i386 -lRC:/rtools40/mingw32/bin/../lib/gcc/i686-w64-mingw32/8.3.0/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lCbcSolver
C:/rtools40/mingw32/bin/../lib/gcc/i686-w64-mingw32/8.3.0/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lClpSolver
C:/rtools40/mingw32/bin/../lib/gcc/i686-w64-mingw32/8.3.0/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lOsiCbc
C:/rtools40/mingw32/bin/../lib/gcc/i686-w64-mingw32/8.3.0/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lCbc
C:/rtools40/mingw32/bin/../lib/gcc/i686-w64-mingw32/8.3.0/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lCgl
C:/rtools40/mingw32/bin/../lib/gcc/i686-w64-mingw32/8.3.0/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lOsiClp
C:/rtools40/mingw32/bin/../lib/gcc/i686-w64-mingw32/8.3.0/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lClp
C:/rtools40/mingw32/bin/../lib/gcc/i686-w64-mingw32/8.3.0/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lOsi
C:/rtools40/mingw32/bin/../lib/gcc/i686-w64-mingw32/8.3.0/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lCoinUtils
collect2.exe: error: ld returned 1 exit status
no DLL was created
ERROR: compilation failed for package 'rcbc'
(Apologies for the automatic Markdown formatting)
Any suggestions? I've tested with R v3.63 and RTools v3.5 and it installed without problem.
The text was updated successfully, but these errors were encountered: