Opened 12 years ago

Closed 12 years ago

#35526 closed defect (invalid)

glib2: error: libelf.h: No such file or directory

Reported by: wcontello Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version: 2.1.2
Keywords: Cc:
Port: glib2

Description (last modified by ryandesign (Ryan Carsten Schmidt))

This is an attempt to install "gerbv" under Mac OS X Mountain Lion. I have uninstalled all ports (sudo port -fp uninstall installed), removed directories:

sudo rm -rf \
    /opt/local \
    /Applications/DarwinPorts \
    /Applications/MacPorts \
    /Library/LaunchDaemons/org.macports.* \
    /Library/Receipts/DarwinPorts*.pkg \
    /Library/Receipts/MacPorts*.pkg \
    /Library/StartupItems/DarwinPortsStartup \
    /Library/Tcl/darwinports1.0 \
    /Library/Tcl/macports1.0 \
    ~/.macports

reinstall MacPorts from the 2.1.2 installer.
Installed the XCode CLI tools, X11

Here is the transcript:

proton:~ wayne$ sudo port install gerbv
Password:
--->  Computing dependencies for gerbv
--->  Dependencies to be installed: gtk2 atk glib2 gobject-introspection cairo fontconfig freetype bzip2 pkgconfig libpixman libpng xorg-xcb-util xorg-libxcb python27 db46 libedit python_select sqlite3 xorg-libXau xorg-xproto xorg-libXdmcp xorg-libpthread-stubs xorg-xcb-proto libxml2 xrender xorg-libX11 xorg-bigreqsproto xorg-inputproto xorg-kbproto xorg-xcmiscproto xorg-xextproto xorg-xf86bigfontproto xorg-xtrans xorg-renderproto gdk-pixbuf2 jasper jpeg tiff hicolor-icon-theme pango Xft2 shared-mime-info intltool gnome-common p5.12-getopt-long p5.12-pathtools p5.12-scalar-list-utils p5.12-xml-parser xorg-libXcomposite xorg-compositeproto xorg-libXext autoconf help2man p5.12-locale-gettext m4 automake libtool xorg-util-macros xorg-libXfixes xorg-fixesproto xorg-libXcursor xorg-libXdamage xorg-damageproto xorg-libXi xorg-libXinerama xorg-xineramaproto xorg-libXrandr xorg-randrproto
--->  Building glib2
Error: org.macports.build for port glib2 returned: command execution failed
Error: Failed to install glib2
Please see the log file for port glib2 for details:
    /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_glib2/glib2/main.log
Error: The following dependencies were not installed: gtk2 atk glib2 gobject-introspection cairo fontconfig freetype bzip2 pkgconfig libpixman libpng xorg-xcb-util xorg-libxcb python27 db46 libedit python_select sqlite3 xorg-libXau xorg-xproto xorg-libXdmcp xorg-libpthread-stubs xorg-xcb-proto libxml2 xrender xorg-libX11 xorg-bigreqsproto xorg-inputproto xorg-kbproto xorg-xcmiscproto xorg-xextproto xorg-xf86bigfontproto xorg-xtrans xorg-renderproto gdk-pixbuf2 jasper jpeg tiff hicolor-icon-theme pango Xft2 shared-mime-info intltool gnome-common p5.12-getopt-long p5.12-pathtools p5.12-scalar-list-utils p5.12-xml-parser xorg-libXcomposite xorg-compositeproto xorg-libXext autoconf help2man p5.12-locale-gettext m4 automake libtool xorg-util-macros xorg-libXfixes xorg-fixesproto xorg-libXcursor xorg-libXdamage xorg-damageproto xorg-libXi xorg-libXinerama xorg-xineramaproto xorg-libXrandr xorg-randrproto
To report a bug, follow the instructions in the guide:
    http://guide.macports.org/#project.tickets
Error: Processing of port gerbv failed
proton:~ wayne$ 

Attachments (2)

main.log (16.5 KB) - added by wcontello 12 years ago.
glib2 log file
main.2.log (668.1 KB) - added by wcontello 12 years ago.
log file after "sudo port clean glib2" and "sudo port install glib2"

Download all attachments as: .zip

Change History (7)

Changed 12 years ago by wcontello

Attachment: main.log added

glib2 log file

comment:1 Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)

Description: modified (diff)
Keywords: gerbv glib2 removed
Owner: changed from macports-tickets@… to ryandesign@…
Port: glib2 added; gerbv removed
Summary: Install of gerbv fails at glib2glib2: error: libelf.h: No such file or directory

The log says:

:info:build gresource-tool.c:34:20: error: libelf.h: No such file or directory

This sounds like #33948 which I thought I had worked around. However before we get carried away analyzing this, the log also says:

:debug:main Skipping completed org.macports.archivefetch (glib2)
:debug:main Skipping completed org.macports.fetch (glib2)
:debug:main Skipping completed org.macports.checksum (glib2)
:debug:main Skipping completed org.macports.extract (glib2)
:debug:main Skipping completed org.macports.patch (glib2)
:debug:main Skipping completed org.macports.configure (glib2)

This means this was not a clean build attempt so we should not trust it. Please run:

sudo port clean glib2

Then try again. If it fails again, then attach the new main.log.

comment:2 in reply to:  1 Changed 12 years ago by wcontello

proton:~ wayne$ sudo port clean glib2
Password:
--->  Cleaning glib2
proton:~ wayne$ sudo port install glib2
--->  Computing dependencies for glib2
--->  Fetching archive for glib2
--->  Attempting to fetch glib2-2.32.4_0.darwin_12.x86_64.tbz2 from http://packages.macports.org/glib2
--->  Fetching distfiles for glib2
--->  Verifying checksum(s) for glib2
--->  Extracting glib2
--->  Applying patches to glib2
--->  Configuring glib2
--->  Building glib2
Error: org.macports.build for port glib2 returned: command execution failed
Please see the log file for port glib2 for details:
    /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_glib2/glib2/main.log
To report a bug, follow the instructions in the guide:
    http://guide.macports.org/#project.tickets
Error: Processing of port glib2 failed
proton:~ wayne$

Changed 12 years ago by wcontello

Attachment: main.2.log added

log file after "sudo port clean glib2" and "sudo port install glib2"

comment:3 Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)

Ok, so the new log does show the same error. So now I must ask as I did in #33948: Do you have a file whose name begins with libelf in a lib directory somewhere? In /usr/local/lib perhaps or in /usr/lib? Or conceivably even in /opt/local/lib, though the fix for #33948 should have caught such a thing.

comment:4 Changed 12 years ago by wcontello

proton:lib wayne$ cd /usr/local/lib
proton:lib wayne$ ls -al libe*
-r--r--r--  1 root  wheel  158040 Nov  2  2010 libelf.a

Yup

comment:5 Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: invalid
Status: newclosed

Ok great, then you've found the reason why glib2 failed to build. Remove /usr/local/lib/libelf.a, run "sudo port clean glib2", and try again.

We don't support the use of MacPorts while software is installed in /usr/local, because of the likelihood of conflicts like this. If you really need libelf, consider installing it using "sudo port install libelf"; the glib2 port knows about that one and can alert you to the interference and what to do about it.

Note: See TracTickets for help on using tickets.