Open dirkschumacher opened 2 years ago
This problem persists on R 4.2.0 and RTOOLS 4.2 on Windows 11.
Anything I can do to help sort this out?
Is this because R 4.2 is now on ucrt?
Same issue with R 4.2.0 and RTools 4.2 on Windows 10 pro
Is there anything happening on this issue? I am happy to help debug and test...
Happy to look at a PR for it, but I don't have the capacity to look into it.
No patches needed. CBC 2.10.8 is required and fixes the problem.
As a dirty hack, I tried building the package. It downloads cbc 2.10.5. Then I replaced the files in "windows\cbc-2.10.5" with the corresponding versions of the 2.10.8 official releases from https://github.com/coin-or/Cbc/releases namely
Cbc-releases.2.10.8-i686-w64-mingw32.zip:
lib\*.a -> windows\cbc-2.10.5\lib\i386
Cbc-releases.2.10.8-x86_64-w64-mingw64.zip:
include -> windows\cbc-2.10.5\include
share -> windows\cbc-2.10.5\share
lib\*.a -windows\cbc-2.10.5\lib\x64
Then edited DESCRIPTION to call for roxygen2 7.2.0 (new version, so doc builds).
After that, Clean and Rebuild. Then Test Package - all 12+33 tests pass.
All perfectly fine.
Could you be a bit more specific @multiduplikator please? I'm not a computer science guy and I'm missing some key details here. And are you describing a fix you did or a procedure we should follow? Thanks
Before you start, you might want to update all packages first.
Download the rcbc master branch as zip and unpack.
You will get a directory namedrcbc-master
.
In that directory, open the file Rcbc.Rproj
in RStudio.
Run Build > Check Package
. Which will produce the error situation as described in #34.
Now comes the dirty fixing part.
You need to download two files from https://github.com/coin-or/Cbc/releases :
Cbc-releases.2.10.8-i686-w64-mingw32.zip
Cbc-releases.2.10.8-x86_64-w64-mingw64.zip
In the directory rcbc-master\windows\cbc-2.10.5\lib\i386
delete all files with ending .a
.
Copy all files with ending .a
from the lib directory in the downloaded zip Cbc-releases.2.10.8-i686-w64-mingw32.zip.
In shorthand pseudo code, I write:
copy Cbc-releases.2.10.8-i686-w64-mingw32.zip\lib\*.a TO rcbc-master\windows\cbc-2.10.5\lib\i386\
Now delete all files in rcbc-master\windows\cbc-2.10.5\include\coin
.
copy Cbc-releases.2.10.8-x86_64-w64-mingw64.zip\include\coin\* TO rcbc-master\windows\cbc-2.10.5\include\coin\
Next, delete everything in rcbc-master\windows\cbc-2.10.5\share\coin\Data
(two directories).
copy (directories) Cbc-releases.2.10.8-x86_64-w64-mingw64.zip\share\coin\Data\* TO rcbc-master\windows\cbc-2.10.5\share\coin\Data
Finally, delete all files in rcbc-master\windows\cbc-2.10.5\lib\x64
ending in .a
.
copy Cbc-releases.2.10.8-x86_64-w64-mingw64.zip\lib\*.a TO rcbc-master\windows\cbc-2.10.5\lib\x64
What we have done effectively is to keep the folder structure of rcbc-master as is, but replaced the libraries of cbc-2.10.5 with the ones from cbc-2.10.8. This is dirty, but it works.
Finally, you have to check which version of roxygen2
you have installed. For me it is 7.2.1
version.
Hence, I check the file rcbc-master\DESCRIPTION
to contain the line:
RoxygenNote: 7.2.1
Run Build > Build Binary Package
.
This will produce rcbc_0.1.0.9001.zip
in the directory above rcbc-master
.
That zip can be installed via "Tools > Install > Install from: Package archive file".
Hope this helps.
PS: You might want to backup the zip you created, can be installed as is when you redo your R environment.
Thank you so much @multiduplikator, works like a charm.
A pleasure :)
A bit more user friendly, I made a fork of the libraries.
So you can just download the rcbc-master, unpack, and then:
In the file rcbc-master\src\Makevars.win
change line 1 to become
VERSION = 2.10.8
In the file rcbc-master\tools\winlibs.R
change line https url in line 8 to become
https://github.com/multiduplikator/cbc/releases/download/2.10.8/cbc-2.10.8.zip
Now load rcbc-master\Rcbc.rproj
in Rstudio and build as usual.
Just in case it's helpful, I've been working on a PR for rcbc so that it will work on R version 4.2+ and older versions, and I think it's working now (#66). I've tested it on GitHub Actions and on a Windows PC and it installs and runs correctly. I'm waiting for a seperate PR to RWinLib before the PR to rcbc can be merged, but in the meantime, it can be installed with remotes::install_github("jeffreyhanson/rcbc@rwinlib")
. Please let me know if anyone runs into any issues with it.
I just did a build on Win11, R 4.2.2. Played a bit with it, executed the sample code from help. Looks good to me!
However, why did you choose 2.10.5b of cbc, when there is 2.10.8 at least since May 2022?