Opened 14 years ago

Closed 13 years ago

#25926 closed defect (fixed)

ffmpeg v 0.6 fail on build

Reported by: chicagotripp (Altoine Barker) Owned by: dbevans (David B. Evans)
Priority: Normal Milestone:
Component: ports Version: 1.9.1
Keywords: Cc: dwc@…, tomemm, ultrajoe@…, Themanwithoutaplan, spaceboy@…, sewebster@…, daitakahashi, ryandesign (Ryan Carsten Schmidt)
Port: ffmpeg

Description (last modified by jmroot (Joshua Root))

I am running OSX 10.5.8 on a G4 PPC using Macports 1.9.1. I receive the following error after running the command port -d install ffmpeg and receive the following error:

There is a ticketLD    libavutil/libavutil.50.dylib
ld: library not found for -lavutil
collect2: ld returned 1 exit status
gmake: *** [libavutil/libavutil.50.dylib] Error 1
shell command " cd  "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_multimedia_ffmpeg/work/ffmpeg-0.6"
&& gmake all " returned error 2
Error: Target org.macports.build returned: shell command failed
DEBUG: Backtrace: shell command failed while executing "command_exec build" (procedure "portbuild::build_main" line 8)
invoked from within
"$procedure $targetname"
Warning: the following items did not execute (for ffmpeg):
org.macports.activate org.macports.build org.macports.destroot
org.macports.install
Log for ffmpeg is at:
 /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_ports_multimedia_ffmpeg/main.log
Error: Status 1 encountered during processing.
 To report a bug, see <http://guide.macports.org/#project.tickets>

Attachments (7)

main.log (621.1 KB) - added by dwc@… 14 years ago.
Full build log on 10.5.8 (Darwin dovinia.dwc.homedns.org 9.8.0 Darwin Kernel Version 9.8.0: Wed Jul 15 16:57:01 PDT 2009; root:xnu-1228.15.4~1/RELEASE_PPC Power Macintosh)
main.log.bz (12.0 KB) - added by tomemm 14 years ago.
ffmpeg-0.6 build error on G3 PPC Tiger
main.2.log (120.0 KB) - added by Themanwithoutaplan 14 years ago.
Build log on 10.6
main.log-shows-ffmpeg-build-failure-at-libavutil.txt.gz (12.6 KB) - added by rjt-macports-20081108@… 14 years ago.
Failure log
main.log-j2-test-ffmpeg-successful-install.txt.gz (14.4 KB) - added by rjt-macports-20081108@… 14 years ago.
Success log
main.3.log (457.9 KB) - added by aylwin@… 14 years ago.
portfile-ffmpeg-remove-libswscale-makefile-patch.diff (867 bytes) - added by daitakahashi 13 years ago.
patch for portfile; remove build.jobs hack and libswscale/Makefile patch

Download all attachments as: .zip

Change History (39)

comment:1 Changed 14 years ago by jmroot (Joshua Root)

Description: modified (diff)
Owner: changed from macports-tickets@… to devans@…

Please remember to cc the maintainer, and use WikiFormatting for preformatted text (or better, add the log file as an attachment).

comment:2 Changed 14 years ago by dwc@…

Cc: dwc@… added

Cc Me!

Changed 14 years ago by dwc@…

Attachment: main.log added

Full build log on 10.5.8 (Darwin dovinia.dwc.homedns.org 9.8.0 Darwin Kernel Version 9.8.0: Wed Jul 15 16:57:01 PDT 2009; root:xnu-1228.15.4~1/RELEASE_PPC Power Macintosh)

Changed 14 years ago by tomemm

Attachment: main.log.bz added

ffmpeg-0.6 build error on G3 PPC Tiger

comment:3 Changed 14 years ago by tomemm

Cc: tome@… added

Cc Me!

comment:4 Changed 14 years ago by ultrajoe@…

I had a similar issue just now. The log file is essentially identical to the already-attached main.log (haven't checked the .bz'ed version yet), but with one additional error that might be of interest:

:info:build ld: /opt/local/lib/libavutil.dylib can't be linked because it has the same install_name (/opt/local/lib/libavutil.dylib) as the output
:info:build ld: warning can't open dynamic library: /opt/local/lib/libx264.93.dylib referenced from: /opt/local/lib/libavutil.dylib (checking for undefined symbols may be affected) (No such file or directory, errno = 2)

The part about "it has the same install_name" makes me wonder.

Oh, the only other differences were the install date, the OS version (10.4 for me), and an additional -pipe directive. If you really want another virtually identical copy, let me know, but the above should provide adequate information.

comment:5 Changed 14 years ago by ultrajoe@…

Cc: ultrajoe@… added

Cc Me!

comment:6 Changed 14 years ago by Themanwithoutaplan

Fails on 10.6 also on libavutil but different error.

:info:build LD  libavutil/libavutil.50.dylib
:info:build ld: library not found for -lavutil
:info:build collect2: ld returned 1 exit status
:info:build gmake: *** [libavutil/libavutil.50.dylib] Fehler 1
:info:build shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_multimedia_ffmpeg/work/ffmpeg-0.6" && gmake all " returned error 2
:error:build Target org.macports.build returned: shell command failed
:debug:build Backtrace: shell command failed


Changed 14 years ago by Themanwithoutaplan

Attachment: main.2.log added

Build log on 10.6

comment:7 Changed 14 years ago by Themanwithoutaplan

Cc: charlie.clark@… added

Cc Me!

comment:8 Changed 14 years ago by spaceboy@…

Cc: spaceboy@… added

Cc Me!

comment:9 Changed 14 years ago by spaceboy@…

I ran into the "library not found for -lavutil" issue during a build on a single-core host, while the same version of the ffmpeg port had just built successfully on a 4-core host. I was able to fix it by forcing a parallel make on the single-core host, editing ffmpeg/Portfile and changing the build.cmd to "gmake -j2".

comment:10 in reply to:  9 Changed 14 years ago by tomemm

Replying to spaceboy@…:

I ran into the "library not found for -lavutil" issue during a build on a single-core host, while the same version of the ffmpeg port had just built successfully on a 4-core host. I was able to fix it by forcing a parallel make on the single-core host, editing ffmpeg/Portfile and changing the build.cmd to "gmake -j2".

Worked for me! I have not tried ffmpeg yet (other than just ffmpeg without args), but I did get a clean build, and what looked like a successful Macports install. Thanks!!!

comment:11 in reply to:  9 Changed 14 years ago by bobby.mccallum@…

Replying to spaceboy@…:

I ran into the "library not found for -lavutil" issue during a build on a single-core host, while the same version of the ffmpeg port had just built successfully on a 4-core host. I was able to fix it by forcing a parallel make on the single-core host, editing ffmpeg/Portfile and changing the build.cmd to "gmake -j2".

@spaceboy: Would you be able to tell me more about how you did this. I don't understand what you mean by 'forcing a parallel make'. NAy help is appreciated.

Bobby

comment:12 Changed 14 years ago by sewebster@…

Does this fix actually make any sense?

comment:13 Changed 14 years ago by sewebster@…

Cc: sewebster@… added

Cc Me!

comment:14 Changed 14 years ago by spaceboy@…

The -jN flag tells gmake to attempt to keep at least N parallel tasks running whenever it can. This flag should default to 1 task on a single-core host, while on a multicore host Macports should automatically detect multiple cores and set N > 1.

Unfortunately the -j1 build failed, where a parallel build of -j2 or -j4 worked for me. I didn't have time to determine the root cause of the -j1 build failure, I just noticed it, applied the fix below and moved on.

Exact steps I took to get my ffmpeg build working on a single-core host.

 % vi ports/multimedia/ffmpeg/Portfile
 Change build.cmd from "gmake" to "gmake -j2"
 Clean and rebuild ffmpeg.

comment:15 Changed 14 years ago by sewebster@…

Right. I can see cases where parallel building causes a problem, and you have to force a single task build, but this opposite situation doesn't make much sense to me.

comment:16 Changed 14 years ago by ultrajoe@…

FYI, confirmed that the gmake -j2 fixes the problem for me.

comment:17 Changed 14 years ago by jon.hermansen@…

Also can confirm that "gmake -j2" fixes the problem for me (uni building on 10.4.8, ppc+i386)

comment:18 in reply to:  17 Changed 14 years ago by dubois.michel@…

Hello,

This works for me too MacOS X 10.5.8 Macbook 2Ghz Intel Core Duo Thanks

comment:19 Changed 14 years ago by drechsel@…

Works for me too! (-; - 10.5.8, G4 PPC

comment:20 in reply to:  14 ; Changed 14 years ago by omeara.brian@…

Replying to spaceboy@…: Thank you, this worked for me. Just FYI for others (since I had to find where the relevant ports directory is), the full path is:

/opt/local/var/macports/sources/rsync.macports.org/release/ports/multimedia/ffmpeg/Portfile

comment:21 in reply to:  20 Changed 14 years ago by ultrajoe@…

Replying to omeara.brian@…:

Replying to spaceboy@…: Thank you, this worked for me. Just FYI for others (since I had to find where the relevant ports directory is), the full path is:

/opt/local/var/macports/sources/rsync.macports.org/release/ports/multimedia/ffmpeg/Portfile

FYI, you can always use port file ffmpeg to get this information, then select it and copy it, or middle-click (if you have a mouse with a scroll wheel) to "quick paste" it when needed.

comment:22 in reply to:  9 Changed 14 years ago by rjt-macports-20081108@…

gmake -j2 worked around the libavutil build failure for me as well.

Problem had started for me with the latest ffmpeg port changes to MacPorts that I pulled down on 14 August 2010.

System is Mac OS X 10.5.8 fully updated with all Apple patches. MacPorts tree was freshly updated before each testing session. Clean start was set up for all tests using port clean ffmpeg.

Changed 14 years ago by rjt-macports-20081108@…

Failure log

Changed 14 years ago by rjt-macports-20081108@…

Success log

comment:23 Changed 14 years ago by dbevans (David B. Evans)

Status: newassigned

Thanks to all for their input on this to date.

I have confirmed the problem and that the proposed solution works although it still isn't clear to me what is happening and exactly where things went wrong. My current thinking is that it is some inappropriate interaction between gmake and ffmpeg's Makefile.

I have committed a change that causes -j2 to be added to the build command on single processor machines while not limiting machines with more than two cores in r71172.

This is intended as a temporary measure to allow ffmpeg to build for those effected while the investigation into the root cause proceeds and potentially a better long term solution.

In the meantime, I will leave the ticket open and encourage further input from anyone who has any insight into the problem.

comment:24 Changed 14 years ago by robert.botto@…

I'm experiencing a similar problem when trying to build on an 8 core Mac Pro. The parallel jobs flag after gmake is being set to 16 rather than 8 resulting in the same lavutil error. I can work around it by setting "build.jobs 8" after the #25926 bug fix code in my Portfile.

Changed 14 years ago by aylwin@…

Attachment: main.3.log added

comment:25 Changed 14 years ago by aylwin@…

Hi,

Build is failing for me too. Here's the commandline output (after trying the j2 fix):

--->  Computing dependencies for ffmpeg
--->  Dependencies to be installed: libsdl xorg-libXext xorg-libX11 xorg-libxcb python26 db46 gdbm readline sqlite3 xorg-libpthread-stubs xorg-xcb-proto xorg-util-macros xorg-xcmiscproto xorg-xextproto xorg-xf86bigfontproto xorg-xtrans xorg-libXrandr xorg-randrproto xrender xorg-renderproto libtheora libvorbis libvpx yasm schroedinger orc speex texi2html x264
--->  Building db46
Error: Target org.macports.build returned: shell command failed
Log for db46 is at: /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_ports_databases_db46/main.log
Error: The following dependencies failed to build: libsdl xorg-libXext xorg-libX11 xorg-libxcb python26 db46 gdbm readline sqlite3 xorg-libpthread-stubs xorg-xcb-proto xorg-util-macros xorg-xcmiscproto xorg-xextproto xorg-xf86bigfontproto xorg-xtrans xorg-libXrandr xorg-randrproto xrender xorg-renderproto libtheora libvorbis libvpx yasm schroedinger orc speex texi2html x264
Error: Status 1 encountered during processing.
To report a bug, see <http://guide.macports.org/#project.tickets>

comment:26 Changed 14 years ago by sewebster@…

Aylwin, your problem is with db46, not ffmpeg.

comment:27 Changed 14 years ago by cstarknyc (Colin Stark)

Same problem as robert.botto:

  • 8-core Mac Pro
  • OS 10.6.6
  • uptodate everything 2011/3/9

Install for ffmpeg fails because libavutil not found:

 :info:build ld: library not found for -lavutil
 :info:build collect2: ld returned 1 exit status
 :info:build gmake: *** [libavutil/libavutil.50.dylib] Error 1

Apparently because the config designates build jobs incorrectly as -j16 rather than -j8

Modded the ffmpeg Portfile as follows

  • added 'build.jobs 8' before 'build.cmd ...' line

Install then worked.

comment:28 Changed 14 years ago by daitakahashi

The log shows that the LD tried to use libavutil when it creates libavutil.50.dylib itself. The file did not exist at the moment, therefore the LD failed immediately. After some investigation, I concluded that the redefinition of a variable EXTRALIBS by patchfile patch-libswscale-Makefile.diff introduced this problem (but I am not sure why... it seems to be redefined again at config.mac included from libavutil/Makefile:1).

libswscale/Makefile : 3
EXTRALIBS := -L$(BUILD_ROOT)/libavutil -lavutil$(BUILDSUF) $(EXTRALIBS)

LD problem was disappeared after the removal of this patch (even when I set build.jobs 1). My enviromnent is OS X 10.6.7 on Macbook Pro (eqrly 2011).

The patch was added to fix #16101, however, the option -L$(BUILD_ROOT)/libavutil appear to be included by default, and -lavutil will be added automatically if it is requested. So I think it is not needed now.

comment:29 Changed 14 years ago by daitakahashi

Cc: dtakahashi42@… added

Cc Me!

comment:30 Changed 14 years ago by daitakahashi

I found that there is an macro guard at config.mak:2. That means config.mak will be included only once for each make process, and the modified EXTRALIBS at libswscale/Makefile is sometimes leaked to targets outside of the libswscale.

Under the parallel build, build process of libswscale and other targets (in particular libavutils) tend to run in separate processes, therefore, the problem was (sometimes) suppressed.

This problem still remains (#29384), so could someone confirm if the removal of patch-libswscale-Makefile.diff solves the problem without introducing another bugs?

comment:31 in reply to:  28 Changed 13 years ago by daitakahashi

The patch was added to fix #16101, ...

There is one point that I misunderstood... The patch-libswscale-Makefile.diff was added at r35073, and #14234 (Adds variant avfilter together with vhook) seems to be the most relevant issue to this patch (but I cannot find any descriptions of the patch).

Changed 13 years ago by daitakahashi

patch for portfile; remove build.jobs hack and libswscale/Makefile patch

comment:32 Changed 13 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: ryandesign@… added
Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.