bugDenemo - Bugs: bug #40878, ld: library not found for...

 
 

bug #40878: ld: library not found for -lporttime

Submitter:  Ryan Carsten Schmidt <ryandesign>
Submitted:  Wed 11 Dec 2013 09:31:49 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Duplicate
Privacy:  Public Assigned to:  None
Originator Name:  Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 12 Feb 2014 09:31:00 AM UTC, comment #5: 

I applied commit e73202134bfccbf78a958938d5c14147424cd32f to the 1.1.0 source code and ran autoconf to rebuild configure, then configure ran with this output:


checking for portmidi.h... yes
checking for Pm_Initialize in -lportmidi... yes
checking for Pt_Start in -lporttime... no


And the build succeeded. Thanks!

Ryan Carsten Schmidt <ryandesign>
Mon 16 Dec 2013 09:08:08 PM UTC, comment #4: 

I pushed in master. Now autotools should detect libporttime and libportmidi and link against which ones are present. Can you please test ?

Éloi Rivard <eloi>
Group Member
Fri 13 Dec 2013 05:59:35 PM UTC, comment #3: 
Richard Shann <rshann>
Group administrator
Thu 12 Dec 2013 10:51:02 PM UTC, comment #2: 

I assumed that some prior version of portmidi had used two separate libraries but that the current version no longer did. I checked the portmidi changelog, but unfortunately what I found says:


 * 17Jan07 Roger Dannenberg
...
 * - Went back to single library in OS X for both portmidi and porttime


This implies that on OS X there's only a single portmidi library but on other systems there might still be both. If this is true, this is unfortunate because it means that developers using OS X are likely to write software that doesn't build on other systems, and vice versa.

portmidi doesn't seem to provide a pkg-config .pc file or portmidi-config script either.

Perhaps the portmidi developers can recommend a snippet you can use in your configure script to get the correct library flags to use.

I am not well versed in writing configure scripts but I believe autotools has the capability to determine if a symbol is in a library, or at least to test if a program compiles and runs. So you should be able to write a small program that uses a symbol that would be in porttime in Linux, and try to link it with only -lportmidi. If it succeeds, use -lportmidi only. You could run a second test like the one you already run using both -lportmidi and -lporttime; if that works, use both. If neither version works, complain that portmidi is missing.

Ryan Carsten Schmidt <ryandesign>
Thu 12 Dec 2013 08:22:11 AM UTC, comment #1: 

My understanding is that some distros split libportmidi into two libraries called libportmidi and libporttime. So those distros that use only one but install a link for the other are coping with that situation.
Your patch would break the build for the other sort of distro - I wonder if there is a way we could make Denemo build in either case?

Richard Shann <rshann>
Group administrator
Wed 11 Dec 2013 09:31:49 PM UTC, original submission:  

Hello, I'm a developer with the MacPorts project, trying to update our denemo port to the latest version.

Denemo 1.1.0 is failing to build on OS X 10.9 Mavericks as follows:


libtool: link: /usr/bin/clang -pipe -Os -arch x86_64 -D_THREAD_SAFE -I/opt/local/include -I/opt/local/include/libxml2 -D_REENTRANT -I/opt/local/include/librsvg-2.0 -I/opt/local/include/gdk-pixbuf-2.0 -I/opt/local/include/libpng16 -I/opt/local/include/cairo -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include -I/opt/local/include/pixman-1 -I/opt/local/include -I/opt/local/include/freetype2 -I/opt/local/include -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -I/opt/local/include -I/opt/local/include -I/opt/local/include/freetype2 -I/opt/local/include -I/opt/local/include/freetype2 -D_HAVE_JACK_ -I/opt/local/include -D_REENTRANT -I/opt/local/include/gtk-3.0 -I/opt/local/include/at-spi2-atk/2.0 -I/opt/local/include/gtk-3.0 -I/opt/local/include/gio-unix-2.0/ -I/opt/local/include -I/opt/local/include/cairo -I/opt/local/include/pango-1.0 -I/opt/local/include/harfbuzz -I/opt/local/include/pango-1.0 -I/opt/local/include/atk-1.0 -I/opt/local/include/cairo -I/opt/local/include/pixman-1 -I/opt/local/include -I/opt/local/include/freetype2 -I/opt/local/include -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -I/opt/local/include -I/opt/local/include/gdk-pixbuf-2.0 -I/opt/local/include/libpng16 -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include -D_REENTRANT -I/opt/local/include/gtksourceview-3.0 -I/opt/local/include/libxml2 -I/opt/local/include/gtk-3.0 -I/opt/local/include/at-spi2-atk/2.0 -I/opt/local/include/gtk-3.0 -I/opt/local/include/gio-unix-2.0/ -I/opt/local/include -I/opt/local/include/cairo -I/opt/local/include/pango-1.0 -I/opt/local/include/harfbuzz -I/opt/local/include/pango-1.0 -I/opt/local/include/atk-1.0 -I/opt/local/include/cairo -I/opt/local/include/pixman-1 -I/opt/local/include -I/opt/local/include/freetype2 -I/opt/local/include -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -I/opt/local/include -I/opt/local/include/gdk-pixbuf-2.0 -I/opt/local/include/libpng16 -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include -D_REENTRANT -I/opt/local/include/evince/3.0 -I/opt/local/include/gtk-3.0 -I/opt/local/include/at-spi2-atk/2.0 -I/opt/local/include/gtk-3.0 -I/opt/local/include/gio-unix-2.0/ -I/opt/local/include -I/opt/local/include/cairo -I/opt/local/include/pango-1.0 -I/opt/local/include/harfbuzz -I/opt/local/include/pango-1.0 -I/opt/local/include/atk-1.0 -I/opt/local/include/cairo -I/opt/local/include/pixman-1 -I/opt/local/include -I/opt/local/include/freetype2 -I/opt/local/include -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -I/opt/local/include -I/opt/local/include/gdk-pixbuf-2.0 -I/opt/local/include/libpng16 -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include -D_HAVE_FLUIDSYNTH_ -I/opt/local/include -D_HAVE_RUBBERBAND_ -I/opt/local/include -D_HAVE_PORTAUDIO_ -I/opt/local/include -I/opt/local/include/aubio -I/opt/local/include -I/opt/local/include -D_HAVE_PORTMIDI_ -D_HAVE_X11_ -Wl,-headerpad_max_install_names -arch x86_64 -o generate_source generate_source.o -D_HAVE_JACK_ -D_HAVE_FLUIDSYNTH_ -D_HAVE_RUBBERBAND_ -D_HAVE_X11_  -L/opt/local/lib -lguile -lgmp -lltdl -lxml2 -lrsvg-2 -lsndfile -ljack -lpthread -framework CoreAudio -framework CoreServices -framework AudioUnit -lgtksourceview-3.0 -levview3 -levdocument3 -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpangoft2-1.0 -lpango-1.0 -lfontconfig -lfreetype -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lgthread-2.0 -lglib-2.0 -lintl -lfluidsynth -lrubberband -lportaudio -framework AudioToolbox -framework Carbon -laubio -lfftw3 -lm -lportmidi -lporttime
ld: library not found for -lporttime
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [generate_source] Error 1


Configure output shows the headers were detected:


checking portmidi.h usability... yes
checking portmidi.h presence... yes
checking for portmidi.h... yes
checking porttime.h usability... yes
checking porttime.h presence... yes
checking for porttime.h... yes


However there is indeed no libporttime.dylib in MacPorts' portmidi 217 package, only libportmidi.dylib and libpmjni.dylib.

Brief Googling leads me to see that some distributions have made libporttime a symlink to libportmidi, but if they're the same library, why even try to use libporttime?

I'm attaching a patch to the configure script that fixes the problem for me.

Ryan Carsten Schmidt <ryandesign>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #29881:  patch-configure.diff added by ryandesign (394B - application/octet-stream - patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by eloi (Posted a comment)
  • -email is unavailable- added by rshann (Posted a comment)
  • -email is unavailable- added by ryandesign (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-02-11 rshann Open/ClosedOpen Closed
    2013-12-13 rshann StatusNone Duplicate
    2013-12-11 ryandesign Attached File- Added patch-configure.diff, #29881

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code