mersenneforum.org  

Go Back   mersenneforum.org > Extra Stuff > Programming

Reply
 
Thread Tools
Old 2012-03-11, 20:22   #1
ewmayer
2ω=0
 
ewmayer's Avatar
 
Sep 2002
República de California

11,633 Posts
Default MacPorts for OS X software-update

I find myself stuck in a never-ending lib-update loop as I try to build an open-source graphing package I downloaded last night, called Inkscape. That project recommends Mac users install MacPorts to ease the update/build cycle ... did that, MacPorts installed fine. The first several times I got a "you need a newer version of libXYZ", following that with "sudo port install libXYZ" worked OK, in the sense that the ensuing retry of ./configure in the Inkscape build-dir got past the previous lib-version error. But then I hit the following "libpng" error, and as you can see, even after updating the lib, the configure script is still finding the older version of libpng:

configure: error: libpng >= 1.2 is needed to compile inkscape

OK, so let's get the latest version:

ernst-w-mayers-macbook:inkscape-0.48.2 ewmayer$ sudo port install libpng
Password:
---> Computing dependencies for libpng
---> Fetching archive for libpng
---> Attempting to fetch libpng-1.4.9_0.darwin_9.i386.tbz2 from http://packages.macports.org/libpng
---> Fetching libpng
---> Attempting to fetch libpng-1.4.9.tar.bz2 from http://cdnetworks-us-1.dl.sourceforg...libpng14/1.4.9
---> Verifying checksum(s) for libpng
---> Extracting libpng
---> Configuring libpng
---> Building libpng
---> Staging libpng into destroot
---> Installing libpng @1.4.9_0
---> Activating libpng @1.4.9_0
---> Cleaning libpng

OK, that looks good, let's retry the configure:

ernst-w-mayers-macbook:inkscape-0.48.2 ewmayer$ ./configure
checking build system type... i386-apple-darwin9.6.1
checking host system type... i386-apple-darwin9.6.1
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking how to create a pax tar archive... gnutar
checking for style of include used by make... GNU
checking for g++... g++
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... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
...
checking for locale.h... yes
checking for LC_MESSAGES... yes
checking libintl.h usability... no
checking libintl.h presence... no
checking for libintl.h... no
checking for pkg-config... /opt/local/bin/pkg-config
checking for msgfmt... (cached) /opt/local/bin/msgfmt
checking for gmsgfmt... (cached) /opt/local/bin/msgfmt
checking for OpenMP flag of C++ compiler... unknown
checking for png_read_info in -lpng... no

configure: error: libpng >= 1.2 is needed to compile inkscape

Go directly to jail ... do not pass Go ...

Is it possible this could be a lib-search-order issue?
ewmayer is offline   Reply With Quote
Old 2012-03-11, 22:06   #2
ldesnogu
 
ldesnogu's Avatar
 
Jan 2008
France

547 Posts
Default

Do you have libpng-dev?

Try to look in config.log where the error occurs, it usually has the full gcc error message which might help.
ldesnogu is offline   Reply With Quote
Old 2012-03-12, 09:56   #3
ccorn
 
ccorn's Avatar
 
Apr 2010

2×3×52 Posts
Default

Quote:
Originally Posted by ewmayer View Post
ernst-w-mayers-macbook:inkscape-0.48.2 ewmayer$ ./configure
[...]
checking for png_read_info in -lpng... no
configure: error: libpng >= 1.2 is needed to compile inkscape
[...]
Is it possible this could be a lib-search-order issue?
Inspecting config.log should clarify this.

If so, then the MacPorts port of inkscape should pass this stage.
(MacPorts sets CPPFLAGS and LDFLAGS or C_INCLUDE_PATH and LIBRARY_PATH with appropriate -I${prefix}/include and -L${prefix}/lib.)

In any case, Portfiles are easy to read ("port cat inkscape") and modify. After all, it's Tcl syntax, and "man portfile" helps a lot.
ccorn is offline   Reply With Quote
Old 2012-03-12, 19:29   #4
ewmayer
2ω=0
 
ewmayer's Avatar
 
Sep 2002
República de California

11,633 Posts
Default

Quote:
Originally Posted by ldesnogu View Post
Do you have libpng-dev?

Try to look in config.log where the error occurs, it usually has the full gcc error message which might help.
I have attached the log. In the meantime I am going to try the prebuilt Mac OS binary - the reason I didn't grab that to begin with it that it says it needs OS X v10.6 whereas my system is 10.5.8. I have an upgrade disc (burned by an Apple buddy) for 10.6, but have so far avoided it because I've heard a few too many cautionary tales about people having major issues with the upgrade, and I simply cannot afford that kind of major time-wastage (or worse, system-offline-ness) right now.
Attached Files
File Type: gz config.log.gz (8.7 KB, 102 views)
ewmayer is offline   Reply With Quote
Old 2012-03-13, 10:40   #5
ldesnogu
 
ldesnogu's Avatar
 
Jan 2008
France

547 Posts
Default

The offending lines are:

Code:
configure:8217: checking for png_read_info in -lpng
configure:8242: g++ -o conftest -g -O2 -Wno-strict-aliasing -Wall -Wformat -Wformat-security -W -D_FORTIFY_SOURCE=2   conftest.cpp -lpng -lz -lm  >&5
ld: library not found for -lpng
collect2: ld returned 1 exit status
Try to locate libpng, I guess configure fails to provide the path to the library. Usually configure has options such as --with-png-path; look at configure --help.

EDIT: quickly looked at configure.ac and it looks like no such option exists... So I see two possibilites:
1. edit configure (around line 8217, see above)
2. create a link in the default library path to libpng

Last fiddled with by ldesnogu on 2012-03-13 at 10:45
ldesnogu is offline   Reply With Quote
Old 2012-03-13, 13:49   #6
ccorn
 
ccorn's Avatar
 
Apr 2010

2×3×52 Posts
Default

There are no -L flags in the link line. Add CPPFLAGS=-I/opt/local/include LDFLAGS=-L/opt/local/lib to your ./configure command. (Replace /opt/local with your MacPorts prefix.) Another option: Use "sudo port install inkscape", but make sure that the numerous dependencies get installed with the variants (e.g. +quartz) you want. Try "port -y install inkscape" for a dry run. Edit: Corrected the *FLAGS settings.

Last fiddled with by ccorn on 2012-03-13 at 13:58
ccorn is offline   Reply With Quote
Old 2012-03-14, 01:08   #7
ewmayer
2ω=0
 
ewmayer's Avatar
 
Sep 2002
República de California

101101011100012 Posts
Default

Quote:
Originally Posted by ldesnogu View Post
The offending lines are:

Code:
configure:8217: checking for png_read_info in -lpng
configure:8242: g++ -o conftest -g -O2 -Wno-strict-aliasing -Wall -Wformat -Wformat-security -W -D_FORTIFY_SOURCE=2   conftest.cpp -lpng -lz -lm  >&5
ld: library not found for -lpng
collect2: ld returned 1 exit status
Try to locate libpng, I guess configure fails to provide the path to the library.
ccorn's guess below was right ... on my system libpng is in /opt/local/lib; I verified that the MacPorts-uodated vrsion of that I got a couple days ago is in there, as well.

Quote:
Originally Posted by ccorn View Post
There are no -L flags in the link line. Add CPPFLAGS=-I/opt/local/include LDFLAGS=-L/opt/local/lib to your ./configure command. (Replace /opt/local with your MacPorts prefix.) Another option: Use "sudo port install inkscape", but make sure that the numerous dependencies get installed with the variants (e.g. +quartz) you want. Try "port -y install inkscape" for a dry run. Edit: Corrected the *FLAGS settings.
Should I add the paths by modifying the configure file (and if so where, since there are CPPFLAGS refereces all over the place and I don't see and "master definitions" of that variable), or as command-line arguments appended to ./configure?
ewmayer is offline   Reply With Quote
Old 2012-03-19, 19:01   #8
ccorn
 
ccorn's Avatar
 
Apr 2010

2×3×52 Posts
Default

Quote:
Originally Posted by ewmayer View Post
Should I add the paths by modifying the configure file (and if so where, since there are CPPFLAGS refereces all over the place and I don't see and "master definitions" of that variable), or as command-line arguments appended to ./configure?
The usage recommended by newer autoconf versions is to pass those settings as command-line arguments like this:
Code:
./configure CPPFLAGS=-I/opt/local/include LDFLAGS=-L/opt/local/lib
The classic usage employs the environment of the configure run like this:
Code:
CPPFLAGS=-I/opt/local/include LDFLAGS=-L/opt/local/lib ./configure
You may also want to add more configure options. For an overview, try
Code:
./configure --help | less
(If this makes you grin, you are not alone.)
ccorn is offline   Reply With Quote
Old 2012-03-25, 01:23   #9
ewmayer
2ω=0
 
ewmayer's Avatar
 
Sep 2002
República de California

11,633 Posts
Default

Quote:
Originally Posted by ccorn View Post
The usage recommended by newer autoconf versions is to pass those settings as command-line arguments like this:
Code:
./configure CPPFLAGS=-I/opt/local/include LDFLAGS=-L/opt/local/lib
I ended up doing just that - It successfully got past the previous sticking point, only to hang shortly thereafter due to another dependency, in this case the package needed itself required multiple other packages (this endless-seeming proliferation of branching seems to be nearly ubiquitous with MacPorts-usage), one of which is apparently not MacPorts-enabled. Sure, I *could* manually download and make, just as I *could* spend every waking hour for the next month trying to get some package to build which at this point I merely want to evaluate for suitability-for-my-needs, but enough. At that point I said f*** it, let me just install good old gnuplot ... that can also be easily done (or better, easily attempted) using MacPorts, but much like Inkscape, fails on one of the dependencies. First, check out how many other pkgs MacPorts-gnuplot tries to install:

sudo port install gnuplot
Password:
---> Computing dependencies for gnuplot
---> Dependencies to be installed: gd2 autoconf m4 automake jpeg libtool xpm xorg-libXext xorg-libX11 xorg-bigreqsproto xorg-inputproto xorg-kbproto xorg-libXau xorg-xproto xorg-libXdmcp xorg-libxcb python27 db46 libedit openssl python_select sqlite3 python27 xorg-libpthread-stubs xorg-xcb-proto libxml2 xorg-util-macros xorg-xcmiscproto xorg-xextproto xorg-xf86bigfontproto xorg-xtrans xorg-libXt xorg-libsm xorg-libice lua readline pango Xft2 xrender xorg-renderproto cairo libpixman xorg-xcb-util pdflib

Each one of those may or may not itself need yet-other packages ... anyway it gets the first 2 installed, but now barfs on 'm4':

---> Configuring m4
Error: Target org.macports.configure returned: configure failure: shell command failed (see log for details)
Error: Failed to install m4
Log for m4 is at: /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_m4/m4/main.log
Error: The following dependencies were not installed: gd2 autoconf m4 automake jpeg libtool xpm xorg-libXext xorg-libX11 xorg-bigreqsproto xorg-inputproto xorg-kbproto xorg-libXau xorg-xproto xorg-libXdmcp xorg-libxcb python27 db46 libedit openssl python_select sqlite3 python27 xorg-libpthread-stubs xorg-xcb-proto libxml2 xorg-util-macros xorg-xcmiscproto xorg-xextproto xorg-xf86bigfontproto xorg-xtrans xorg-libXt xorg-libsm xorg-libice lua readline pango Xft2 xrender xorg-renderproto cairo libpixman xorg-xcb-util pdflib
Error: Status 1 encountered during processing.
To report a bug, see <http://guide.macports.org/#project.tickets>

From the above main.log, it seems to be claiming simple C-compilation fails:

:notice:configure ---> Configuring m4
:debug:configure Using compiler 'Mac OS X gcc 4.0'
:debug:configure Executing org.macports.configure (m4)
:debug:configure Environment: CPATH='/opt/local/include' CFLAGS='-pipe -O2 -arch i386' CPPFLAGS='-I/opt/local/include' CXXFLAGS='-pipe -O2 -arch i386' LIBRARY_PATH='/opt/local/lib' MACOSX_DEPLOYMENT_TARGET='10.5' CXX='/usr/bin/g++-4.0' CC_PRINT_OPTIONS_FILE='/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_m4/m4/work/.CC_PRINT_OPTIONS' F90FLAGS='-pipe -O2 -m32' LDFLAGS='-L/opt/local/lib -arch i386' OBJC='/usr/bin/gcc-4.0' FCFLAGS='-pipe -O2 -m32' GI_SCANNER_DISABLE_CACHE='1' INSTALL='/usr/bin/install -c' OBJCFLAGS='-pipe -O2 -arch i386' FFLAGS='-pipe -O2 -m32' CC_PRINT_OPTIONS='YES' CC='/usr/bin/gcc-4.0'
:debug:configure Assembled command: 'cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_m4/m4/work/m4-1.4.16" && ./configure --prefix=/opt/local --program-prefix=g ac_cv_libsigsegv=no'
:debug:configure Executing command line: cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_m4/m4/work/m4-1.4.16" && ./configure --prefix=/opt/local --program-prefix=g ac_cv_libsigsegv=no
:info:configure checking for a BSD-compatible install... /usr/bin/install -c
:info:configure checking whether build environment is sane... yes
:info:configure checking for a thread-safe mkdir -p... build-aux/install-sh -c -d
:info:configure checking for gawk... no
:info:configure checking for mawk... no
:info:configure checking for nawk... no
:info:configure checking for awk... awk
:info:configure checking whether make sets $(MAKE)... yes
:info:configure checking for gcc... /usr/bin/gcc-4.0
:info:configure checking whether the C compiler works... no
:info:configure configure: error: in `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_m4/m4/work/m4-1.4.16':
:info:configure configure: error: C compiler cannot create executables
:info:configure See `config.log' for more details

In /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_m4/m4/work/m4-1.4.16/config.log, the offender appears to be in this section:

## ----------- ##
## Core tests. ##
## ----------- ##

configure:3397: checking for a BSD-compatible install
configure:3465: result: /usr/bin/install -c
configure:3476: checking whether build environment is sane
configure:3526: result: yes
configure:3667: checking for a thread-safe mkdir -p
configure:3706: result: build-aux/install-sh -c -d
configure:3720: checking for gawk
configure:3750: result: no
configure:3720: checking for mawk
configure:3750: result: no
configure:3720: checking for nawk
configure:3750: result: no
configure:3720: checking for awk
configure:3736: found /usr/bin/awk
configure:3747: result: awk
configure:3758: checking whether make sets $(MAKE)
configure:3780: result: yes
configure:3927: checking for gcc
configure:3954: result: /usr/bin/gcc-4.0
configure:4183: checking for C compiler version
configure:4192: /usr/bin/gcc-4.0 --version >&5
i686-apple-darwin9-gcc-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5490)
Copyright (C) 2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:4203: $? = 0
configure:4192: /usr/bin/gcc-4.0 -v >&5
Using built-in specs.
Target: i686-apple-darwin9
Configured with: /var/tmp/gcc/gcc-5490~1/src/configure --disable-checking -enable-werror --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*$/s/$/-4.0/ --with-gxx-include-dir=/include/c++/4.0.0 --with-slibdir=/usr/lib --build=i686-apple-darwin9 --with-arch=apple --with-tune=generic --host=i686-apple-darwin9 --target=i686-apple-darwin9
Thread model: posix
gcc version 4.0.1 (Apple Inc. build 5490)
configure:4203: $? = 0
configure:4192: /usr/bin/gcc-4.0 -V >&5
gcc-4.0: argument to `-V' is missing
configure:4203: $? = 1
configure:4192: /usr/bin/gcc-4.0 -qversion >&5
i686-apple-darwin9-gcc-4.0.1: no input files
configure:4203: $? = 1
configure:4223: checking whether the C compiler works
configure:4245: /usr/bin/gcc-4.0 -pipe -O2 -arch i386 -I/opt/local/include -L/opt/local/lib -arch i386 conftest.c >&5
can not open CC_PRINT_OPTIONS_FILE /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_m4/m4/work/.CC_PRINT_OPTIONS
configure:4249: $? = 1
configure:4287: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "GNU M4"
| #define PACKAGE_TARNAME "m4"
| #define PACKAGE_VERSION "1.4.16"
| #define PACKAGE_STRING "GNU M4 1.4.16"
| #define PACKAGE_BUGREPORT "bug-m4@gnu.org"
| #define PACKAGE_URL "http://www.gnu.org/software/m4/"
| #define PACKAGE "m4"
| #define VERSION "1.4.16"
| /* end confdefs.h. */
|
| int
| main ()
| {
|
| ;
| return 0;
| }
configure:4292: error: in `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_m4/m4/work/m4-1.4.16':
configure:4294: error: C compiler cannot create executables
See `config.log' for more details

Again, any ideas? This is starting to get annoying.
ewmayer is offline   Reply With Quote
Old 2012-03-25, 01:38   #10
Mathew
 
Mathew's Avatar
 
Nov 2009

2·52·7 Posts
Default

ewmayer,

I used this for M4 hopefully it will be less annoying for you.
Mathew is offline   Reply With Quote
Old 2012-03-25, 02:19   #11
ewmayer
2ω=0
 
ewmayer's Avatar
 
Sep 2002
República de California

11,633 Posts
Default

Quote:
Originally Posted by Mathew View Post
ewmayer,

I used this for M4 hopefully it will be less annoying for you.
Thanks ... I downloaded the .pkg file for Snow Leopard, and ran the installer, successfully. But ... MacPorts apparently is still trying to install the same particular freeware version as before, because again trying the install-gnuplot again tries to build m4 fails precisely as before:

---> Computing dependencies for gnuplot
---> Dependencies to be installed: gd2 autoconf m4 automake jpeg libtool xpm xorg-libXext xorg-libX11 xorg-bigreqsproto xorg-inputproto xorg-kbproto xorg-libXau xorg-xproto xorg-libXdmcp xorg-libxcb python27 db46 libedit openssl python_select sqlite3 python27 xorg-libpthread-stubs xorg-xcb-proto libxml2 xorg-util-macros xorg-xcmiscproto xorg-xextproto xorg-xf86bigfontproto xorg-xtrans xorg-libXt xorg-libsm xorg-libice lua readline pango Xft2 xrender xorg-renderproto cairo libpixman xorg-xcb-util pdflib
---> Configuring m4
Error: Target org.macports.configure returned: configure failure: shell command failed (see log for details)
Error: Failed to install m4
Log for m4 is at: /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_m4/m4/main.log
Error: The following dependencies were not installed: gd2 autoconf m4 automake jpeg libtool xpm xorg-libXext xorg-libX11 xorg-bigreqsproto xorg-inputproto xorg-kbproto xorg-libXau xorg-xproto xorg-libXdmcp xorg-libxcb python27 db46 libedit openssl python_select sqlite3 python27 xorg-libpthread-stubs xorg-xcb-proto libxml2 xorg-util-macros xorg-xcmiscproto xorg-xextproto xorg-xf86bigfontproto xorg-xtrans xorg-libXt xorg-libsm xorg-libice lua readline pango Xft2 xrender xorg-renderproto cairo libpixman xorg-xcb-util pdflib
Error: Status 1 encountered during processing.

Do I need to un-install the above compile-error-afflicted version of m4, or somehow tell MacPorts to instead use the m4 package I got from the above link?
ewmayer is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
No update possible Max Information & Answers 5 2009-01-20 18:12
How update prime95 software Sam_X Software 4 2005-07-09 12:44
Update... Magish LMH > 100M 3 2005-06-16 02:41
Update wblipp ElevenSmooth 5 2004-12-28 18:25
49-50 and 62-64 update tha Lone Mersenne Hunters 0 2004-03-14 13:14

All times are UTC. The time now is 22:49.

Mon May 17 22:49:43 UTC 2021 up 39 days, 17:30, 0 users, load averages: 2.68, 2.50, 2.58

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.