Discussion:
[R-SIG-Mac] compile R on Mac OS 10.9.4 with cairo support
Tobias Verbeke
2014-08-23 15:43:19 UTC
Permalink
Dear list,

I'm trying to compile R from source on Mac OS 10.9.4 using the flags from

https://svn.r-project.org/R-dev-web/trunk/QA/Simon/R-build/conf.mavericks-x86_64

I untarred the following libraries from http://r.research.att.com/libs/

gfortran-4.8.2-darwin13.tar.bz2
tcl8.6.0-darwin10-x86_64.tar.gz
tk8.6.0-darwin10-x86_64.tar.gz
freetype-2.5.3-darwin10-bin2.tar.gz
pkg-config-0.25-darwin9-bin3.tar.gz
fontconfig-2.11.1-darwin10-bin2.tar.gz
fontconfig-2.11.1-add.tar.gz
cairo-1.12.16-darwin10-bin2.tar.gz
jpeg-v8d-darwin9-bin4.tar.gz
libpng-1.5.18-darwin10-bin2.tar.gz
tiff-4.0.3-darwin10-bin2.tar.gz
pixman-0.32.4-darwin10-bin2.tar.gz
xz-5.0.5-darwin10-bin2.tar.gz

Then I applied the patch from http://r.research.att.com/libs/cairo-1.12.16-darwin13-static-pkgconfig.patch using

cd /usr/local/lib/pkgconfig
sudo curl -O http://r.research.att.com/libs/cairo-1.12.16-darwin13-static-pkgconfig.patch
sudo patch < cairo-1.12.16-darwin13-static-pkgconfig.patch

Some patches are rejected and the resulting 'fontconfig.pc.rej' looks as follows:

***************
*** 13,18 ****
Version: 2.11.0
Requires: freetype2
Requires.private: libxml-2.0
- Libs: -L${libdir} -lfontconfig
- Libs.private: -L/usr/local/lib -lfreetype -lxml2
Cflags: -I${includedir} -I/usr/local/include/freetype2 -I/usr/local/include/libpng15 -I/usr/include/libxml2
--- 13,18 ----
Version: 2.11.0
Requires: freetype2
Requires.private: libxml-2.0
+ Libs: /usr/local/lib/libfontconfig.a
+ Libs.private: /usr/local/lib/libfreetype.a -lxml2
Cflags: -I${includedir} -I/usr/local/include/freetype2 -I/usr/local/include/libpng15 -I/usr/include/libxml2

Compilation itself goes fine, but I do not succeed in getting proper cairo support.

The config.log has the following:

checking whether pkg-config knows about cairo... yes
Package libxml-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libxml-2.0.pc'
to the PKG_CONFIG_PATH environment variable
Package 'libxml-2.0', required by 'Fontconfig', not found
Package libxml-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libxml-2.0.pc'
to the PKG_CONFIG_PATH environment variable
Package 'libxml-2.0', required by 'Fontconfig', not found
Package libxml-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libxml-2.0.pc'
to the PKG_CONFIG_PATH environment variable
Package 'libxml-2.0', required by 'Fontconfig', not found
Package libxml-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libxml-2.0.pc'
to the PKG_CONFIG_PATH environment variable
Package 'libxml-2.0', required by 'Fontconfig', not found
checking whether cairo is >= 1.2 and works... no

Executing

sudo find / -name libxml-2.0.pc

does not give any results.

I must have overlooked something. Is there other information I can provide?

Many thanks in advance for any pointers.

Best,
Tobias
Prof Brian Ripley
2014-08-25 07:03:31 UTC
Permalink
Post by Tobias Verbeke
Dear list,
I'm trying to compile R from source on Mac OS 10.9.4 using the flags from
https://svn.r-project.org/R-dev-web/trunk/QA/Simon/R-build/conf.mavericks-x86_64
I untarred the following libraries from http://r.research.att.com/libs/
gfortran-4.8.2-darwin13.tar.bz2
tcl8.6.0-darwin10-x86_64.tar.gz
tk8.6.0-darwin10-x86_64.tar.gz
freetype-2.5.3-darwin10-bin2.tar.gz
pkg-config-0.25-darwin9-bin3.tar.gz
fontconfig-2.11.1-darwin10-bin2.tar.gz
fontconfig-2.11.1-add.tar.gz
cairo-1.12.16-darwin10-bin2.tar.gz
jpeg-v8d-darwin9-bin4.tar.gz
libpng-1.5.18-darwin10-bin2.tar.gz
tiff-4.0.3-darwin10-bin2.tar.gz
pixman-0.32.4-darwin10-bin2.tar.gz
xz-5.0.5-darwin10-bin2.tar.gz
Then I applied the patch from http://r.research.att.com/libs/cairo-1.12.16-darwin13-static-pkgconfig.patch using
cd /usr/local/lib/pkgconfig
sudo curl -O http://r.research.att.com/libs/cairo-1.12.16-darwin13-static-pkgconfig.patch
sudo patch < cairo-1.12.16-darwin13-static-pkgconfig.patch
***************
*** 13,18 ****
Version: 2.11.0
Requires: freetype2
Requires.private: libxml-2.0
- Libs: -L${libdir} -lfontconfig
- Libs.private: -L/usr/local/lib -lfreetype -lxml2
Cflags: -I${includedir} -I/usr/local/include/freetype2 -I/usr/local/include/libpng15 -I/usr/include/libxml2
--- 13,18 ----
Version: 2.11.0
Requires: freetype2
Requires.private: libxml-2.0
+ Libs: /usr/local/lib/libfontconfig.a
+ Libs.private: /usr/local/lib/libfreetype.a -lxml2
Cflags: -I${includedir} -I/usr/local/include/freetype2 -I/usr/local/include/libpng15 -I/usr/include/libxml2
Compilation itself goes fine, but I do not succeed in getting proper cairo support.
checking whether pkg-config knows about cairo... yes
Package libxml-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libxml-2.0.pc'
to the PKG_CONFIG_PATH environment variable
Package 'libxml-2.0', required by 'Fontconfig', not found
Package libxml-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libxml-2.0.pc'
to the PKG_CONFIG_PATH environment variable
Package 'libxml-2.0', required by 'Fontconfig', not found
Package libxml-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libxml-2.0.pc'
to the PKG_CONFIG_PATH environment variable
Package 'libxml-2.0', required by 'Fontconfig', not found
Package libxml-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libxml-2.0.pc'
to the PKG_CONFIG_PATH environment variable
Package 'libxml-2.0', required by 'Fontconfig', not found
checking whether cairo is >= 1.2 and works... no
Executing
sudo find / -name libxml-2.0.pc
does not give any results.
I must have overlooked something. Is there other information I can provide?
Apple overlooked something. The pkg-config you are using is not
provided by Apple, and Apple does not provide pkg-config files for the
software it provides[*] where installing from sources would do so.

I do have a /usr/local/lib/pkgconfig/libxml-2.0.pc, containing

prefix=/usr
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
modules=1

Name: libXML
Version: 2.9.1
Description: libXML library version2.
Requires:
Libs: -L${libdir} -lxml2
Libs.private: -lpthread -lz -liconv -lm
Cflags: -I${includedir}/libxml2

from a source installation of libxml2.

[*] Strangely, /usr/lib/pkgconfig is not quite empty on my box.
Post by Tobias Verbeke
Many thanks in advance for any pointers.
Best,
Tobias
_______________________________________________
R-SIG-Mac mailing list
R-SIG-Mac at r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-mac
--
Brian D. Ripley, ripley at stats.ox.ac.uk
Emeritus Professor of Applied Statistics, University of Oxford
1 South Parks Road, Oxford OX1 3TG, UK
Simon Urbanek
2014-08-25 14:41:42 UTC
Permalink
Post by Tobias Verbeke
Dear list,
I'm trying to compile R from source on Mac OS 10.9.4 using the flags from
https://svn.r-project.org/R-dev-web/trunk/QA/Simon/R-build/conf.mavericks-x86_64
I untarred the following libraries from http://r.research.att.com/libs/
gfortran-4.8.2-darwin13.tar.bz2
tcl8.6.0-darwin10-x86_64.tar.gz
tk8.6.0-darwin10-x86_64.tar.gz
freetype-2.5.3-darwin10-bin2.tar.gz
pkg-config-0.25-darwin9-bin3.tar.gz
fontconfig-2.11.1-darwin10-bin2.tar.gz
fontconfig-2.11.1-add.tar.gz
cairo-1.12.16-darwin10-bin2.tar.gz
jpeg-v8d-darwin9-bin4.tar.gz
libpng-1.5.18-darwin10-bin2.tar.gz
tiff-4.0.3-darwin10-bin2.tar.gz
pixman-0.32.4-darwin10-bin2.tar.gz
xz-5.0.5-darwin10-bin2.tar.gz
Then I applied the patch from http://r.research.att.com/libs/cairo-1.12.16-darwin13-static-pkgconfig.patch using
cd /usr/local/lib/pkgconfig
sudo curl -O http://r.research.att.com/libs/cairo-1.12.16-darwin13-static-pkgconfig.patch
sudo patch < cairo-1.12.16-darwin13-static-pkgconfig.patch
***************
*** 13,18 ****
Version: 2.11.0
Requires: freetype2
Requires.private: libxml-2.0
- Libs: -L${libdir} -lfontconfig
- Libs.private: -L/usr/local/lib -lfreetype -lxml2
Cflags: -I${includedir} -I/usr/local/include/freetype2 -I/usr/local/include/libpng15 -I/usr/include/libxml2
--- 13,18 ----
Version: 2.11.0
Requires: freetype2
Requires.private: libxml-2.0
+ Libs: /usr/local/lib/libfontconfig.a
+ Libs.private: /usr/local/lib/libfreetype.a -lxml2
Cflags: -I${includedir} -I/usr/local/include/freetype2 -I/usr/local/include/libpng15 -I/usr/include/libxml2
Compilation itself goes fine, but I do not succeed in getting proper cairo support.
checking whether pkg-config knows about cairo... yes
Package libxml-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libxml-2.0.pc'
to the PKG_CONFIG_PATH environment variable
Package 'libxml-2.0', required by 'Fontconfig', not found
Package libxml-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libxml-2.0.pc'
to the PKG_CONFIG_PATH environment variable
Package 'libxml-2.0', required by 'Fontconfig', not found
Package libxml-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libxml-2.0.pc'
to the PKG_CONFIG_PATH environment variable
Package 'libxml-2.0', required by 'Fontconfig', not found
Package libxml-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libxml-2.0.pc'
to the PKG_CONFIG_PATH environment variable
Package 'libxml-2.0', required by 'Fontconfig', not found
checking whether cairo is >= 1.2 and works... no
Executing
sudo find / -name libxml-2.0.pc
does not give any results.
I must have overlooked something. Is there other information I can provide?
Apple overlooked something. The pkg-config you are using is not provided by Apple, and Apple does not provide pkg-config files for the software it provides[*] where installing from sources would do so.
I do have a /usr/local/lib/pkgconfig/libxml-2.0.pc, containing
prefix=/usr
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
modules=1
Name: libXML
Version: 2.9.1
Description: libXML library version2.
Libs: -L${libdir} -lxml2
Libs.private: -lpthread -lz -liconv -lm
Cflags: -I${includedir}/libxml2
from a source installation of libxml2.
[*] Strangely, /usr/lib/pkgconfig is not quite empty on my box.
Indeed, I have

$ ls -l /usr/lib/pkgconfig/
total 32
-rw-r--r-- 1 root wheel 329 Dec 6 2013 apr-1.pc
-rw-r--r-- 1 root wheel 446 Dec 6 2013 apr-util-1.pc
-rw-r--r-- 1 root wheel 239 Dec 6 2013 libcrypto.pc
-rw-r--r-- 1 root wheel 1803 Mar 26 16:16 libcurl.pc
-rw-r--r-- 1 root wheel 327 Dec 6 2013 libedit.pc
-rw-r--r-- 1 root wheel 275 Mar 26 16:17 libexslt.pc
-rw-r--r-- 1 root wheel 3591 Dec 6 2013 libiodbc.pc
-rw-r--r-- 1 root wheel 268 Dec 6 2013 libpcre.pc
-rw-r--r-- 1 root wheel 301 Dec 6 2013 libpcreposix.pc
-rw-r--r-- 1 root wheel 254 Dec 6 2013 libssl.pc
-rw-r--r-- 1 root wheel 268 Mar 26 16:17 libxml-2.0.pc
-rw-r--r-- 1 root wheel 265 Mar 26 16:17 libxslt.pc
-rw-r--r-- 1 root wheel 264 Dec 6 2013 openssl.pc

Those are all for system libraries. But I can't really tell where they come from - some of them are from the base system:

$ pkgutil --file-info /usr/lib/pkgconfig/libpcre.pc
volume: /
path: /usr/lib/pkgconfig/libpcre.pc

pkgid: com.apple.pkg.Essentials
pkg-version: 10.9.0.1.1.1306847324
install-time: 1386365859

but the one in question doesn't have a record:

$ pkgutil --file-info /usr/lib/pkgconfig/libxml-2.0.pc
volume: /
path: /usr/lib/pkgconfig/libxml-2.0.pc

I have put the ones without provenance into

http://r.research.att.com/libs/pkgconfig-system-stubs-darwin13.tar.gz

in case they are useful

Cheers,
Simon
Post by Tobias Verbeke
Many thanks in advance for any pointers.
Best,
Tobias
_______________________________________________
R-SIG-Mac mailing list
R-SIG-Mac at r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-mac
--
Brian D. Ripley, ripley at stats.ox.ac.uk
Emeritus Professor of Applied Statistics, University of Oxford
1 South Parks Road, Oxford OX1 3TG, UK
_______________________________________________
R-SIG-Mac mailing list
R-SIG-Mac at r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-mac
Loading...