[R-SIG-Mac] The Equivalent of pkg-config for Frameworks

Dominic Steinitz dominic at steinitz.org
Fri May 30 12:07:28 CEST 2014

My googling skills are failing. I want to install a package which relies on R. This currently works on windows and linux. When I try it on my macbook I get told

> Configuring H- 
> Warning: Instead of 'ghc-options: -cpp' use 'extensions: CPP' 
> cabal: The pkg-config package 'libR' version >=3.0 is required but it 
> could 
> not be found. 
> Failed to install H- 
> Updating documentation index /Users/dom/Library/Haskell/doc/index.html 
> cabal: Error: some packages failed to install: 
> H- failed during the configure step. The exception was: 
> ExitFailure 1 

But I have R installed

> $ R --version 
> R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" 
> Copyright (C) 2013 The R Foundation for Statistical Computing 
> Platform: x86_64-apple-darwin10.8.0 (64-bit) 

It seems the installer for the package uses pkg-config to check for the existence of R.

> $ pkg-config --version
> 0.28

It finds e.g. the gnu scientific library

> $ pkg-config  --libs gsl
> -L/usr/local/Cellar/gsl/1.16/lib -lgsl -lgslcblas -lm

But can’t find R

> $ pkg-config  --libs R
> Package R was not found in the pkg-config search path.
> Perhaps you should add the directory containing `R.pc'
> to the PKG_CONFIG_PATH environment variable
> No package 'R' found

On my installation, R lives in

> /Library/Frameworks/R.framework

In order to use pkg-config, it seems I need a .pc file somewhere but I can’t find one.

Can someone either tell me where the .pc file is for R or alternatively how to tell the installer where to find R?

Many thanks

Dominic Steinitz
dominic at steinitz.org

More information about the R-SIG-Mac mailing list