Error in Installing the Cairo R Package - macos

I am attempting to install the Cairo package in the development version of R on Mac OS X 10.7.4, but I'm running into an issue that I cannot resolve.
I have installed Cairo with homebrew (i.e., brew install cairo) and received the following message:
==> Caveats This formula is keg-only, so it was not symlinked into /usr/local.
Mac OS X already provides this program and installing another version
in parallel can cause all kinds of trouble.
The Cairo provided by Leopard is too old for newer software to link
against.
Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add its lib
& include paths to your build variables:
LDFLAGS -L/usr/local/Cellar/cairo/1.12.2/lib
CPPFLAGS -I/usr/local/Cellar/cairo/1.12.2/include
With the above message in mind, I attempted to install the Cairo package from R-Forge with the following R command:
install.packages("Cairo", repos="http://www.rforge.net/", configure.args = c("CAIRO_LIBS=/usr/local/Cellar/cairo/1.12.2/lib", "CAIRO_CFLAGS=/usr/local/Cellar/cairo/1.12.2/include/cairo"))
I receive the following error:
checking cairo.h usability... no
checking cairo.h presence... no
checking for cairo.h... no
configure: error: Cannot find cairo.h!
Please install cairo (http://www.cairographics.org/) and/or set
CAIRO_CFLAGS/LIBS correspondingly. ERROR: configuration failed for package ‘Cairo’
I repeated the same command without the repos argument (by default, I use the FHCRC mirror) with the same result.
At this point, the problem seems obvious: the file cairo.h is not present. But then I listed the files in the include/cairo directory. Here's the response:
ls /usr/local/Cellar/cairo/1.12.2/include/cairo
cairo-deprecated.h cairo-ft.h
cairo-ps.h
cairo-script-interpreter.h
cairo-svg.h
cairo-xcb.h
cairo-xlib.h
cairo-features.h
cairo-pdf.h
cairo-quartz.h
cairo-script.h
cairo-version.h
cairo-xlib-xrender.h
cairo.h
So, I'm pointing the installation of the Cairo package to the appropriate place, but the error persists. I have tried variations, such as CAIRO_CFLAGS=/usr/local/Cellar/cairo/1.12.2/include, with no luck.
Thoughts? Any help you can provide is greatly appreciated.
In case it's necessary, here is my sessionInfo:
R Under development (unstable) (2012-08-08 r60208) Platform: x86_64-apple-darwin11.4.0 (64-bit)
locale: [1]
en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages: [1] stats graphics grDevices utils
datasets methods base
other attached packages: [1] BiocInstaller_1.5.12
loaded via a namespace (and not attached): [1] tools_2.16.0

I had similar issue with cairo config error, and I already installed cairo with homebrew. Try below
brew install pkg-config
This solved mine problem.

A coworker and I just fixed the problem by ignoring all of what I typed above. Rather, we installed Cairo and all of its dependencies from source manually, thereby bypassing the usage of brew or variants like port. This worked like a charm, so I am not entirely sure what was wrong above.

After trying everything listed here, I found this blog post about installing the "full R package" using brew: https://luispuerto.net/blog/2018/05/11/installing-r-with-homebrew-with-all-the-capabilities/
What finally worked for me was building R explicitly with cairo (brew's default R tap uses --without-cairo and simply editing the tap did not solve the issue for me).
Works like a charm for me with R 4.0.2, cairo 1.16.0_3 under macOS Catalina 10.15.6.

Related

./configure doesn't find Qt5Core, QT5GUI, QT5Widgets

I've recently replaced Win10 by Linux Debian 11.2 on my PC (hence I'm a newbee in Linux). Now, not all programs are available as deb-Files.
I tried to compile source code - here a synthesizer ams-2.2.0 - from a tar.gz files (after unzipping into a separate folder) with steps (as written in the INSTALL.TXT to this source, and obviously usual)
./configure
make
make install
I get a bunch of error messages for missing files, when running ./congigure most resolved by installation of missing packages, but at last it fails with error message:
checking for QTCore Qt5Gui Qt5Widgets >= 5.0... no
configure: error: cannot find Qt5 library >= 5.0
(hope to get all written correctly, because I can't copy from the terminal ... Ctrl-Shift-C doesn't seem to work)
I checked the installation in synaptics and found that Qt-Version is 5.12. So what's wrong here?
I'm afraid to have this error message everytime I try to compile different source codes.
You need to install libqtcore and libqtwidgets with development headers, they are in qtbase5-dev package.
sudo apt install build-essential qtbase5-dev qtchooser

libgstvulkan-1.0.0.dylib missing from GStreamer plugins bad on OS X/Homebrew

On OS X 12.1, with I'm building an app that is complaining about:
dyld[12690]: Library not loaded: #rpath/lib/libgstvulkan-1.0.0.dylib
I've installed the following with Homebrew:
GStreamer 1.18.5 installed form homebrew
gst-plugins-ugly
gst-plugins-base
gst-plugins-bad
gst-plugins-good
I've been able to find all the required .dylib files so far, except for libgstvulkan-1.0.0.dylib, which should be included with gst-plugins-bad but doesn't appear to be in the Homebrew install.
Questions:
what am I missing? why don't I have libgstvulkan-1.0.0.dylib on my system and where do I get it?
I'd like to know how I can avoid Homebrew and just install the packages directly but I don't see how to get the bad plugins from that side. Do I need to build from source?
My understanding is there is no vulcan dependency in the homebrew formula, thus when building the artifact, there is no libgstvulkan-1.0.0.dylib artifact.
I tried to include molten-vk for the build and turned on vulkan flag, but it has some issue of finding the vulkan_core.h (which is already in /opt/homebrew/Cellar/molten-vk/1.1.8/libexec/include/vulkan/vulkan_core.h).
Local build error:
==> meson --prefix=/opt/homebrew/Cellar/gst-plugins-bad/1.18.5_1 --libdir=/opt/homebrew/Cellar/gst-plugins-bad/1.18.5_1/lib --buildtype=release --wrap-mode=nofallback -Dintrosp
Last 15 lines from /Users/rui/Library/Logs/Homebrew/gst-plugins-bad/01.meson:
Program g-ir-compiler found: YES (/opt/homebrew/Cellar/gobject-introspection/1.70.0_3/bin/g-ir-compiler)
Program glib-mkenums found: YES (/opt/homebrew/opt/glib/bin/glib-mkenums)
Program glib-mkenums found: YES (/opt/homebrew/opt/glib/bin/glib-mkenums)
Program glib-mkenums found: YES (/opt/homebrew/opt/glib/bin/glib-mkenums)
Program glib-mkenums found: YES (/opt/homebrew/opt/glib/bin/glib-mkenums)
Did not find CMake 'cmake'
Found CMake: NO
Run-time dependency opencv found: NO (tried pkgconfig, framework and cmake)
Run-time dependency opencv4 found: NO (tried pkgconfig, framework and cmake)
Library MoltenVK found: YES
Has header "vulkan/vulkan_core.h" : NO
../gst-libs/gst/vulkan/meson.build:146:2: ERROR: Problem encountered: vulkan plugin enabled, but vulkan.h not found
A full log can be found at /private/tmp/gst-plugins-bad-20220227-60197-31i3hx/gst-plugins-bad-1.18.5/build/meson-logs/meson-log.txt
Feel free to kick off a PR and we can get this forward.

'Error importing Gtk module: No module named repository' with graph_tool

Hello stack community!
I'm not sure if my question is graph-tool related or gtk-related, but maybe both. Moreover, sorry if what I did while trying to solve it is plain stupid, I'm not a programmer by formal education, so I know just as much as I could find by google and comprehend.
Here is the problem:
After I brew install graph-tool, launch python and try to import graph_tool.all I get the following error:
/usr/local/lib/python2.7/site-packages/graph_tool/draw/cairo_draw.py:1318: RuntimeWarning: Error importing Gtk module: No module named repository; GTK+ drawing will not work.
Previously I was sure that if import pygtk; pygtk.require('2.0'); import gtk works, that means the error is a graph-tool issue, but that don't have to be the case since graph-tool might use gtk (3??) and GObject (right?) and the upper checks for gtk2 and pygtk ( This question led me to this thought ).
I tried reinstalling gtk, GObject and all dependencies. Wipe all brew-related and brew itself and then reinstall everything (as in here). Still same error appears. I also tried to unlink everything from brew and link it again just to be sure, but this does not change anything either.
What else did I check:
I'm running MAC OS X Version 10.10.3, homebrew-installed python 2.7.10 (python --version returns Python 2.7.10 which is the one installed by brew; which python points to /usr/local/bin/python). brew info graph-tool shows that all requirements of it are there (even the optional ones). GTK 2.24.28, GTK+3 3.16.4, PyGobject 2.28.6, GObject-introspection 2.28.6, Cairo 1.14.2, Py2Cairo 1.10.0, pango 1.36.8, XQuartz 2.7.7 etc are installed, dependencies of those are fine as well. gi 1.2 is installed (via pip), gi.repository is indeed not there. I am aware of this question, but I have PyGObjects installed.
I also read this question and the reply, but none of this solves my problem as far as I can judge.
I've spend two days looking for the solution, so any help is appreciated.
It's seem to be a cairo dependency issue.
As you may see here, graph-tool package require a lot of depencies (numpy, gfortran, scipy, freetype, libpng, matplotlib, boost, cgal, graphviz, cairo, cairomm, py2cairo)
In your case you may probably solve the issue with a clean reinstall of "cairo".
Try those commands:
brew install cairo
brew install cairomm
brew install py2cairo
If "brew" ask you to run command or install other packages, do it !
(We assume here that "brew" is properly installed)
Best regards
I've faced the same issue (with a slight difference on the line number):
>>> from graph_tool.all import *
/usr/local/lib/python2.7/site-packages/graph_tool/draw/cairo_draw.py:1499: RuntimeWarning: Error importing Gtk module: No module named gi; GTK+ drawing will not work.
warnings.warn(msg, RuntimeWarning)
I know it's a relatively old question but wanted to share how I did it. You said you tried reinstalling GObject, but that is what made it work here.
I followed the installing instructions
brew install pygobject3 --with-python#2 gtk+3
which said gtk+3 and pygobject3 were already installed. Then I ran:
brew reinstall gtk+3
and
brew upgrade pygobject3
which made the import work.

Installing Cairo on Mac - Could not find libpng in the pkg-config search path

checking whether cairo's PNG functions feature could be enabled... no
I have been following the setup for configuring node canvas. Cairo is needed but i am having issues trying to set it up. https://github.com/Automattic/node-canvas/wiki/Installation---OSX
If libpng fails and you get the error "error: recommended PNG functions feature could not be enabled", try installing this binary and re-running the configure step.
I followed above by installing the binaries on Mac OS 9 and run the configuration command and still no luck. I am running the install shell script in node-canvas repository:
https://github.com/Automattic/node-canvas/blob/master/install
In my /usr/local/lib I currently have:
dtrace libjpeg.8.dylib libpng.a libpng14.a
libfreetype.6.dylib libjpeg.a libpng.dylib libpng14.dylib
libfreetype.a libjpeg.dylib libpng.la libpng14.la
libfreetype.dylib libjpeg.la libpng12.0.dylib libpng15.15.dylib
libfreetype.la libpixman-1.0.dylib libpng12.0.dylib.dSYM libpng15.15.dylib.dSYM
libgif.4.1.6.dylib libpixman-1.a libpng12.a libpng15.a
libgif.4.dylib libpixman-1.dylib libpng12.dylib libpng15.dylib
libgif.a libpixman-1.la libpng12.la libpng15.la
libgif.dylib libpng.3.dylib libpng14.14.dylib node_modules
libgif.la libpng.3.dylib.dSYM libpng14.14.dylib.dSYM pkgconfig
Libpng-1.6.10 has been replaced by libpng-1.6.12.
In your install script, change
LIBPNG="http://downloads.sourceforge.net/project/libpng/libpng16/1.6.10/libpng-1.6.10.tar.gz"
to
LIBPNG="http://downloads.sourceforge.net/project/libpng/libpng16/1.6.12/libpng-1.6.12.tar.gz"
I have a set of detailed instructions for building cairo here:
https://github.com/soegaard/racket-osx-libs
There resulting libraries are here:
https://github.com/soegaard/racket-osx-libs/tree/master/lib

GTK+ installed with brew is not found when I try to compile other applications

I installed GTK with brew install gtk+ as I need it to compile xchat from source on my Mac. When I try to install it tough, it says Cannot find GTK! Not building GTK FrontEnd.
I suspect I should've updated the environment variables once installed gtk+ but I don't know how.
iMac:xchat-2.8.8 Domenico$ brew info gtk+
gtk+: stable 2.24.20
http://gtk.org/
/usr/local/Cellar/gtk+/2.24.20 (1184 files, 52M) * // here is the path!!!
Built from source
From: https://github.com/mxcl/homebrew/commits/master/Library/Formula/gtk+.rb
==> Dependencies
Build: pkg-config, xz
Required: glib, jpeg, libtiff, gdk-pixbuf, pango, atk, cairo
Optional: jasper
==> Options
--with-jasper
Build with jasper support
The path is listed in the code above. I tried adding all kind of things related to it (e.g. /usr/local/Cellar/gtk+/2.24.20/bin or /usr/local/Cellar) to $LD_LIBRARY_PATH but it didn't work. Any ideas?
I had smiliar issues with after brew install gtk+. Specifically, I got:
Package xcb-shm was not found in the pkg-config search path.
Perhaps you should add the directory containing `xcb-shm.pc'
to the PKG_CONFIG_PATH environment variable
Package 'xcb-shm', required by 'cairo', not found
app.c:1:10: fatal error: 'gtk/gtk.h' file not found
#include <gtk/gtk.h>
^
1 error generated.
make: *** [app] Error 1
while running make for my app and this command solved my problem:
export PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig
The extended answer on this problem has been already answered here: https://stackoverflow.com/a/23988317/4694621.
This might be an issue since gtk+ depends on these libraries (source):
Glib
Pango
ATK
GDK
GdkPixbuf
Cairo

Resources