dirkschumacher / rcbc

COIN-OR branch and cut (CBC) bindings for R
https://dirkschumacher.github.io/rcbc/
Other
20 stars 5 forks source link

Failed installation on MacOS due to missing CBC #65

Open igoreulaers opened 2 years ago

igoreulaers commented 2 years ago

I have the same issue as has been described before in what seems to be a closed (ad perhaps solved?) issue: https://bit.ly/3BXa9Wj

When I try to install the package the link to CBC fails, although this has been installed successfully installed using Homebrew.

The specific console output of the failure is exactly the same as in the earlier closed issue: https://bit.ly/3BXa9Wj

Was there a solution to this issue?

Many thanks !

jeffreyhanson commented 1 year ago

Hi @igoreulaers,

I've been playing around with installing rcbc on macOS using GitHub Actions, and the following instructions seem to work (see below). When you get a chance, could you please see if they work for you too?

Run these commands in the terminal to install CBC and dependencies:

brew tap coin-or-tools/coinor
brew install coin-or-tools/coinor/cbc
brew link cbc --force
brew link coinutils --force
brew link osi --force
brew link clp --force
brew link cgl --force

Run this command in R to install rcbc R package:

remotes::install_github("dirkschumacher/rcbc")
SnBuenafe commented 1 year ago

Hi @jeffreyhanson. It's still not working for me. I get the following error:

> Using PKG_CFLAGS=-I/usr/include/coin
> Using PKG_LIBS=-lCbc -lCbcSolver
> ------------------------- [ANTICONF ERROR] ----------------------------------
> Configuration failed because cbc was not found. Try installing:
>  * deb: coinor-libcbc-dev, coinor-libclp-dev (Debian, Ubuntu, etc)
>  * rpm: coin-or-Cbc-devel, coin-or-Clp-devel (Fedora, CentOS, RHEL)
>  * brew: coin-or-tools/coinor/cbc (Mac OSX)
> If cbc is already installed, check that 'pkg-config' is in your
> PATH and PKG_CONFIG_PATH contains a cbc.pc file. If pkg-config
> is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
> R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
> ------------------------- [BEGIN ERROR MESSAGE] -----------------------------
> cat: configure.log: No such file or directory
> ------------------------- [END ERROR MESSAGE] -------------------------------
> ERROR: configuration failed for package ‘rcbc’
> 

I'm on a macOS Ventura 13.3.1 Apple M2 Chip Pro R version 4.3.0 (2023-04-21).

I have successfully installed cbc in my machine using Homebrew.

SnBuenafe commented 1 year ago

I solved it by installing pkg-config separately using homebrew on my terminal

brew install pkg-config

And then running

remotes::install_github("dirkschumacher/rcbc")

jeffreyhanson commented 1 year ago

Ah - thank you very much for posting the solution @tinbuenafe!