Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emacs 25.1 build fails, 'librsvg/rsvg.h' file not found #5863

Closed
mok0 opened this issue Oct 13, 2016 · 26 comments
Closed

Emacs 25.1 build fails, 'librsvg/rsvg.h' file not found #5863

mok0 opened this issue Oct 13, 2016 · 26 comments

Comments

@mok0
Copy link

mok0 commented Oct 13, 2016

I have a strange problem building Emacs 25.1. This is the error message I get:

clang -c -Demacs -I. -I. -I../lib -I../lib -D_REENTRANT
-I@@HOMEBREW_CELLAR@@/libpng/1.6.25/include/libpng16
-I@@HOMEBREW_PREFIX@@/opt/freetype/include/freetype2
-I@@HOMEBREW_CELLAR@@/fontconfig/2.12.1_2/include
-I@@HOMEBREW_PREFIX@@/opt/freetype/include/freetype2
-I/usr/local/Cellar/pixman/0.34.0/include/pixman-1
-I/usr/local/Cellar/pcre/8.39/include
-I@@HOMEBREW_CELLAR@@/glib/2.50.1/include/glib-2.0
-I@@HOMEBREW_CELLAR@@/glib/2.50.1/lib/glib-2.0/include
-I@@HOMEBREW_PREFIX@@/opt/gettext/include
-I/usr/local/Cellar/cairo/1.14.6_1/include/cairo
-I@@HOMEBREW_CELLAR@@/gdk-pixbuf/2.36.0_2/include/gdk-pixbuf-2.0
-I@@HOMEBREW_CELLAR@@/librsvg/2.40.16_1/include/librsvg-2.0
-I/usr/include/libxml2 -MMD -MF deps/nsterm.d -MP -Wno-switch
-Wno-tautological-constant-out-of-range-compare -Wno-pointer-sign
-Wno-string-plus-int -Wno-unknown-attributes -g3 -O2 nsterm.m

image.c:8997:11: fatal error: 'librsvg/rsvg.h' file not found
# include <librsvg/rsvg.h>
          ^
1 error generated.
make[1]: *** [image.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [src] Error 2

It is very strange because librsvg is installed, and the the include

-I@@HOMEBREW_CELLAR@@/librsvg/2.40.16_1/include/librsvg-2.0

exists:

$  ls -R /usr/local/Cellar/librsvg/2.40.16_1/include/librsvg-2.0/librsvg
/usr/local/Cellar/librsvg/2.40.16_1/include/librsvg-2.0/librsvg:
librsvg-enum-types.h  librsvg-features.h  rsvg-cairo.h  rsvg.h

I've built Emacs 25.1 on my laptop without problems.

@MikeMcQuaid
Copy link
Member

brew update; brew reinstall librsvg should fix this for you.

@dunn
Copy link
Contributor

dunn commented Oct 19, 2016

@mok0 did the above work for you?

@dunn dunn added the needs response Needs a response from the issue/PR author label Oct 19, 2016
@nedcg
Copy link

nedcg commented Oct 20, 2016

Same problem, updating librsvg didn't work for me.

~❯ brew install emacs -v --with-cocoa    
==> Using the sandbox
/usr/bin/sandbox-exec -f /tmp/homebrew20161020-83890-17jzdgz.sb nice /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby -W0 -I /usr/local/Homebrew/Library/Homebrew -- /usr/local/Homebrew/Library/Homebrew/build.rb /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/emacs.rb --verbose --with-cocoa
==> Downloading https://ftpmirror.gnu.org/emacs/emacs-25.1.tar.xz
Already downloaded: /Users/edcaceres/Library/Caches/Homebrew/emacs-25.1.tar.xz
==> Verifying emacs-25.1.tar.xz checksum
tar xJf /Users/edcaceres/Library/Caches/Homebrew/emacs-25.1.tar.xz
==> ./configure --disable-dependency-tracking --disable-silent-rules --enable-locallisppath=/usr/local/share/emacs/site-lisp --infodir=/usr/local/Cellar/emacs/25.1/share/info/emacs --prefix=/usr/local/Cellar/emacs/25.1 --without-x --with-xml2 --without-dbus --without-gnutls --with-rsvg --with-ns --disable-ns-self-contained
checking for xcrun... xcrun
checking for make... yes
checking for GNU Make... make
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... build-aux/install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make supports nested variables... (cached) yes
checking build system type... x86_64-apple-darwin15.6.0
checking host system type... x86_64-apple-darwin15.6.0
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... configure: error: in `/private/tmp/emacs-20161020-83892-yibd9a/emacs-25.1':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details
==> Formula
Path: /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/emacs.rb
==> Configuration
HOMEBREW_VERSION: 1.0.8
ORIGIN: https://github.com/Homebrew/brew.git
HEAD: 0296439c832a915be9b73456c0c26bc6c79c271d
Last commit: 3 days ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 4e4f6373a629061b7bd1a5ce66af1cebcea42dcf
Core tap last commit: 22 minutes ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_REPOSITORY: /usr/local/Homebrew
HOMEBREW_CELLAR: /usr/local/Cellar
HOMEBREW_BOTTLE_DOMAIN: https://homebrew.bintray.com
CPU: octa-core 64-bit haswell
Homebrew Ruby: 2.0.0-p648
Clang: 6.0 build 600
Git: 2.10.0 => /usr/local/bin/git
Perl: /usr/bin/perl
Python: /usr/bin/python
Ruby: /Users/edcaceres/.rvm/rubies/ruby-2.1.5/bin/ruby
Java: 1.8.0_91, 1.7.0_79
macOS: 10.11.6-x86_64
Xcode: 6.1
CLT: N/A
X11: N/A
==> ENV
HOMEBREW_CC: clang
HOMEBREW_CXX: clang++
MAKEFLAGS: -j8
CMAKE_PREFIX_PATH: /usr/local/opt/gettext:/usr/local/opt/libffi:/usr/local/opt/icu4c:/usr/local
CMAKE_LIBRARY_PATH: /System/Library/Frameworks/OpenGL.framework/Versions/Current/Libraries
CMAKE_FRAMEWORK_PATH: /System/Library/Frameworks
MACOSX_DEPLOYMENT_TARGET: 10.11
PKG_CONFIG_PATH: /usr/local/opt/libpng/lib/pkgconfig:/usr/local/opt/freetype/lib/pkgconfig:/usr/local/opt/fontconfig/lib/pkgconfig:/usr/local/opt/pixman/lib/pkgconfig:/usr/local/opt/libffi/lib/pkgconfig:/usr/local/opt/pcre/lib/pkgconfig:/usr/local/opt/glib/lib/pkgconfig:/usr/local/opt/cairo/lib/pkgconfig:/usr/local/opt/libtiff/lib/pkgconfig:/usr/local/opt/gobject-introspection/lib/pkgconfig:/usr/local/opt/gdk-pixbuf/lib/pkgconfig:/usr/local/opt/libcroco/lib/pkgconfig:/usr/local/opt/icu4c/lib/pkgconfig:/usr/local/opt/harfbuzz/lib/pkgconfig:/usr/local/opt/pango/lib/pkgconfig:/usr/local/opt/librsvg/lib/pkgconfig:/usr/local/opt/shared-mime-info/share/pkgconfig
PKG_CONFIG_LIBDIR: /usr/lib/pkgconfig:/usr/local/Homebrew/Library/Homebrew/os/mac/pkgconfig/10.11
HOMEBREW_SDKROOT: 
ACLOCAL_PATH: /usr/local/opt/gettext/share/aclocal:/usr/local/share/aclocal
PATH: /usr/local/Homebrew/Library/Homebrew/shims/super:/usr/local/opt/pkg-config/bin:/usr/local/opt/libpng/bin:/usr/local/opt/freetype/bin:/usr/local/opt/fontconfig/bin:/usr/local/opt/gettext/bin:/usr/local/opt/pcre/bin:/usr/local/opt/glib/bin:/usr/local/opt/cairo/bin:/usr/local/opt/jpeg/bin:/usr/local/opt/libtiff/bin:/usr/local/opt/gobject-introspection/bin:/usr/local/opt/shared-mime-info/bin:/usr/local/opt/gdk-pixbuf/bin:/usr/local/opt/libcroco/bin:/usr/local/opt/icu4c/bin:/usr/local/opt/harfbuzz/bin:/usr/local/opt/pango/bin:/usr/local/opt/librsvg/bin:/usr/bin:/bin:/usr/sbin:/sbin

Error: emacs 25.1 did not build
Logs:
     /Users/edcaceres/Library/Logs/Homebrew/emacs/01.configure
     /Users/edcaceres/Library/Logs/Homebrew/emacs/01.configure.cc
     /Users/edcaceres/Library/Logs/Homebrew/emacs/config.log

These open issues may also help:
Emacs 25.1 build fails,  'librsvg/rsvg.h' file not found https://github.com/Homebrew/homebrew-core/issues/5863

@BrewTestBot BrewTestBot removed the needs response Needs a response from the issue/PR author label Oct 20, 2016
@mok0
Copy link
Author

mok0 commented Oct 20, 2016

@dunn I haven't tried brew reinstall (I am traveling and won't be able to test it for another week.) However, before I reported the problem I did do brew uninstall librsvg; brew install librsvg and that didn't help.

@dunn
Copy link
Contributor

dunn commented Oct 20, 2016

@edcaceres yours looks like a different problem; could you open a new issue after looking through the troubleshooting checklist: https://github.com/Homebrew/brew/blob/master/docs/Troubleshooting.md#troubleshooting Thanks!

@dunn
Copy link
Contributor

dunn commented Oct 20, 2016

@mok0 did you run brew update before reinstalling?

@mok0
Copy link
Author

mok0 commented Oct 20, 2016

@dunn, yes, I ran brew update; brew upgrade. (Nothing happened because home-brew was already up-to-date).

@dunn
Copy link
Contributor

dunn commented Oct 20, 2016

When you can, please post the output of brew config and brew doctor

@mok0
Copy link
Author

mok0 commented Oct 20, 2016

Brew doctor only warned about the fact that I have gnu coreutils in my path without "g".

@ilovezfs
Copy link
Contributor

@edcaceres Xcode 6 on El Capitan is not supported. Please upgrade Xcode.

@ilovezfs
Copy link
Contributor

@mok0 it looks like that bottle was manually extracted not installed with brew install. Is there more to the story here?

@MikeMcQuaid
Copy link
Member

@mok0 Try to brew reinstall librsvg emacs

@ksrb
Copy link

ksrb commented Oct 26, 2016

This has been a issue for me as well, more than happy to open a new issue if needed 😄 .

brew install --with-coca emacs
==> Using the sandbox
==> Downloading https://ftpmirror.gnu.org/emacs/emacs-25.1.tar.xz
Already downloaded: /Users/ksuen/Library/Caches/Homebrew/emacs-25.1.tar.xz
==> ./configure --disable-silent-rules --enable-locallisppath=/usr/local/share/e
Last 15 lines from /Users/ksuen/Library/Logs/Homebrew/emacs/01.configure:
checking for GNU Make... make
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... build-aux/install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make supports nested variables... (cached) yes
checking build system type... x86_64-apple-darwin15.6.0
checking host system type... x86_64-apple-darwin15.6.0
checking whether the C compiler works... no
configure: error: in `/private/tmp/emacs-20161025-35887-qqscof/emacs-25.1':
configure: error: C compiler cannot create executables
See `config.log' for more details

READ THIS: https://git.io/brew-troubleshooting
If reporting this issue please do so at (not Homebrew/brew):
  https://github.com/Homebrew/homebrew-core/issues

These open issues may also help:
Emacs 25.1 build fails,  'librsvg/rsvg.h' file not found https://github.com/Homebrew/homebrew-core/issues/5863

I can get the config.log if necessary.

brew config
HOMEBREW_VERSION: 1.0.8-1959-g84d1661
ORIGIN: https://github.com/Homebrew/brew
HEAD: 84d1661b9af04501473660eccf3f7941061744d3
Last commit: 13 hours ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 169c240ade102775defd9cc4e82c4a68348b6f4b
Core tap last commit: 4 hours ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_REPOSITORY: /usr/local/Homebrew
HOMEBREW_CELLAR: /usr/local/Cellar
HOMEBREW_BOTTLE_DOMAIN: https://homebrew.bintray.com
CPU: octa-core 64-bit haswell
Homebrew Ruby: 2.0.0-p648
Clang: 7.3 build 703
Git: 2.10.1 => /usr/local/bin/git
Perl: /usr/local/bin/perl => /usr/local/Cellar/perl/5.24.0_1/bin/perl
Python: /usr/local/bin/python => /usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/bin/python2.7
Ruby: /usr/local/bin/ruby => /usr/local/Cellar/ruby/2.3.1_2/bin/ruby
Java: 1.8.0_112
macOS: 10.11.6-x86_64
Xcode: 8.0
CLT: 7.3.1.0.1.1461711523
X11: N/A
brew doctor
Warning:... # I've deleted this for brevity
Unexpected header files:
  /usr/local/include/python2.7/greenlet/greenlet.h
  /usr/local/include/python3.5m/greenlet/greenlet.h

@dunn
Copy link
Contributor

dunn commented Oct 26, 2016

@ksrb Update your CLT to match your Xcode version:

Xcode: 8.0
CLT: 7.3.1.0.1.1461711523

@ilovezfs
Copy link
Contributor

There is no CLT 8 for 10.11.

sudo xcode-select -r

@ksrb
Copy link

ksrb commented Oct 26, 2016

Is this actually related to Homebrew/brew#972?

I find it hard to believe that a svg library has anything to do with xcode.

@ilovezfs
Copy link
Contributor

@ksrb

checking whether the C compiler works... no

is what indicates an Xcode issue.

The rsvg.h problem is something.

@ksrb
Copy link

ksrb commented Oct 26, 2016

@ilovezfs just fetched my mac, thanks running:

sudo xcode-select -r

Fixed my issue.

@ilovezfs
Copy link
Contributor

@ksrb cool. were you also seeing the image.c:8997:11: fatal error: 'librsvg/rsvg.h' file not found error or only thechecking whether the C compiler works... no error?

@ksrb
Copy link

ksrb commented Oct 27, 2016

After I ran the command above I did not see the librsvg/rsvg error, so by the look of it the only error that was affecting me was the C compiler not working.

I can post additional logs if you need them.

@ilovezfs
Copy link
Contributor

@mok0 are you still having the rsvg error?

@mok0
Copy link
Author

mok0 commented Oct 27, 2016

@ilovezfs I will test it in a few days, I am traveling ATM.

@mok0
Copy link
Author

mok0 commented Oct 28, 2016

I did

brew update; brew upgrade
brew reinstall librsvg emacs

Unfortunately the problem persists. Here is my brew config output:

HOMEBREW_VERSION: 1.0.8
ORIGIN: https://github.com/Homebrew/brew.git
HEAD: 0296439c832a915be9b73456c0c26bc6c79c271d
Last commit: 11 days ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 516fa7a629fd7eddbb8d9aebceb996dd10fb0a50
Core tap last commit: 3 hours ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_REPOSITORY: /usr/local/Homebrew
HOMEBREW_CELLAR: /usr/local/Cellar
HOMEBREW_BOTTLE_DOMAIN: https://homebrew.bintray.com
CPU: dual-core 64-bit penryn
Homebrew Ruby: 2.0.0-p648
Clang: 8.0 build 800
Git: 2.8.4 => /Applications/Xcode.app/Contents/Developer/usr/bin/git
Perl: /usr/bin/perl
Python: /usr/local/bin/python => /usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/bin/python2.7
Ruby: /usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
Java: 1.6.0_65-b14-468
macOS: 10.11.6-x86_64
Xcode: 8.0
CLT: 7.3.1.0.1.1461711523
X11: 2.7.9 => /opt/X11

@ilovezfs
Copy link
Contributor

The output

-I@@HOMEBREW_CELLAR@@/libpng/1.6.25/include/libpng16
-I@@HOMEBREW_PREFIX@@/opt/freetype/include/freetype2
-I@@HOMEBREW_CELLAR@@/fontconfig/2.12.1_2/include
-I@@HOMEBREW_PREFIX@@/opt/freetype/include/freetype2
-I/usr/local/Cellar/pixman/0.34.0/include/pixman-1
-I/usr/local/Cellar/pcre/8.39/include
-I@@HOMEBREW_CELLAR@@/glib/2.50.1/include/glib-2.0
-I@@HOMEBREW_CELLAR@@/glib/2.50.1/lib/glib-2.0/include
-I@@HOMEBREW_PREFIX@@/opt/gettext/include
-I/usr/local/Cellar/cairo/1.14.6_1/include/cairo
-I@@HOMEBREW_CELLAR@@/gdk-pixbuf/2.36.0_2/include/gdk-pixbuf-2.0
-I@@HOMEBREW_CELLAR@@/librsvg/2.40.16_1/include/librsvg-2.0

makes me think that these were failed bottle pours or that bottle tarballs were manually unpacked.

What's the output of

grep -r HOMEBREW_CELLAR /usr/local/include

and

grep -r HOMEBREW_PREFIX /usr/local/include

@mok0
Copy link
Author

mok0 commented Oct 29, 2016

@ilovezfs those two greps are both null, and I have never manually unpacked bottle tarballs. However, when doing brew reinstall emacsI now get another error:

Iclang -c  -Demacs  -I. -I. -I../lib -I../lib      -D_REENTRANT -I@@HOMEBREW_CELLAR@@/libpng/1.6.25/include/libpng16 -I@@HOMEBREW_PREFIX@@/opt/freetype/include/freetype2 -I@@HOMEBREW_CELLAR@@/fontconfig/2.12.1_2/include -I@@HOMEBREW_PREFIX@@/opt/freetype/include/freetype2 -I/usr/local/Cellar/pixman/0.34.0/include/pixman-1 -I/usr/local/Cellar/pcre/8.39/include -I@@HOMEBREW_CELLAR@@/glib/2.50.1/include/glib-2.0 -I@@HOMEBREW_CELLAR@@/glib/2.50.1/lib/glib-2.0/include -I@@HOMEBREW_PREFIX@@/opt/gettext/include -I/usr/local/Cellar/cairo/1.14.6_1/include/cairo -I@@HOMEBREW_CELLAR@@/gdk-pixbuf/2.36.0_2/include/gdk-pixbuf-2.0 -I/usr/local/Cellar/librsvg/2.40.16_1/include/librsvg-2.0   -I/usr/include/libxml2           -MMD -MF deps/nsterm.d -MP    -Wno-switch -Wno-tautological-constant-out-of-range-compare -Wno-pointer-sign -Wno-string-plus-int -Wno-unknown-attributes  -g3 -O2   nsterm.m
In file included from image.c:8997:
/usr/local/Cellar/librsvg/2.40.16_1/include/librsvg-2.0/librsvg/rsvg.h:31:10: fatal error: 'glib-object.h' file not found
#include <glib-object.h>
         ^
1 error generated.

Again, glib-object.h is on the system:

fafnir➜  ~  find /usr/local -name glib-object.h
/usr/local/Cellar/glib/2.50.1/include/glib-2.0/glib-object.h
fafnir➜  ~  head -1 `find /usr/local -name glib-object.h`
/* GObject - GLib Type, Object, Parameter and Signal Library

I don't have time to investigate more, I think I'll just zap homebrew and reinstall from scratch.

@mok0 mok0 closed this as completed Oct 29, 2016
@ilovezfs
Copy link
Contributor

You may also want to just try brew uninstall foo; brew install foo instead of using brew reinstall foo

@Homebrew Homebrew locked and limited conversation to collaborators May 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants