Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#28160 closed defect (worksforme)

Unable to use LaTeX after upgrading (dyld libpng14 problem?)

Reported by: vinay.d.shah@… Owned by: drkp (Dan Ports)
Priority: Normal Milestone:
Component: ports Version: 1.9.2
Keywords: Cc:
Port: texlive-bin texlive-latex

Description

Hello,

I had originally installed LaTeX using MacTeX. I needed to install texlive-publishers for something else, so I did that (and also installed texlive.) This upgraded libpng to version 14. I now get this error when I try to run LaTeX

$ latex
dyld: Library not loaded: /opt/local/lib/libpng12.0.dylib
  Referenced from: /opt/local/bin/latex
  Reason: image not found
Trace/BPT trap

There is no libpng12.0.dylib file in /opt/local/lib, presumably because it has been upgraded. However, I do have /opt/local/lib/libpng14.dylib, /opt/local/lib/libpng14.14.dylib and /opt/local/lib/libpng.dylib

I have already tried sudo port selfupdate && sudo port upgrade installed and this has not fixed the issue. I have also checked that latex is indeed provided by macports now:

$ which latex
/opt/local/bin/latex
$ port provides /opt/local/bin/latex
/opt/local/bin/latex is provided by: texlive-latex

I also get this error when running pdflatex, which makes me think that this is a problem with a latex dependency rather than latex itself, but I am not sure how to isolate this

Thanks for the help!

Change History (11)

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

Owner: changed from macports-tickets@… to dports@…

texlive-latex probably simply needs its revision increased so that a rebuild occurs and it links with libpng 1.4.

comment:2 Changed 13 years ago by vinay.d.shah@…

I think ideally it should link to libpng.dylib (which is a symlink to the latest version) instead. Is there anything I can do to fix this myself in the mean time, or does the owner of texlive-latex need to do something?

comment:3 Changed 13 years ago by jmroot (Joshua Root)

Port: texlive-bin added

texlive-latex only installs a symlink to the binary provided by texlive-bin, which was rev bumped in r75159.

comment:4 Changed 13 years ago by vinay.d.shah@…

You are right

/opt/local/bin/latex -> /opt/local/bin/pdftex /opt/local/bin/pdftex -> /opt/local/libexec/texlive/binaries/pdftex /opt/local/libexec/texlive/binaries/pdftex is provided by: texlive-bin

sudo port upgrade texlive-bin does not fix this problem

comment:5 in reply to:  3 Changed 13 years ago by drkp (Dan Ports)

Resolution: worksforme
Status: newclosed

Replying to jmr@…:

texlive-latex only installs a symlink to the binary provided by texlive-bin, which was rev bumped in r75159.

Correct on both counts.

As far as I'm concerned, this should be fixed already with the revbump, which should force a rebuild of texlive-bin. I would suggest port selfupdate and port upgrade outdated but you say you've done that already, so I don't know why you're still seeing this problem. port -n upgrade --force texlive-bin should explicitly force a rebuild and get you working again.

comment:6 Changed 13 years ago by eddieh (Eddie Hillenbrand)

Resolution: worksforme
Status: closedreopened
port selfupdate

followed by

port upgrade outdated

and then

port -n upgrade --force texlive-bin

does not get this working again! The rebuild fails. The log mentions

checking whether gs has the pngalpha device... dyld: Library not loaded: /opt/local/lib/libpng12.0.dylib
  Referenced from: /opt/local/lib/libgs.9.00.dylib
  Reason: image not found
no
checking whether gs has the png16m device... dyld: Library not loaded: /opt/local/lib/libpng12.0.dylib
  Referenced from: /opt/local/lib/libgs.9.00.dylib
  Reason: image not found
no
configure: WARNING: Your EPS inclusions may not work.
        Upgrade/install GhostScript to avoid this.

and then later fails with

checking for gdImageCreate... no
configure: error: cannot find/use libgd
This drawing library can be downloaded at http://www.boutell.com/gd
=== configuring in dvipng failed
make[2]: *** [subtexk] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive] Error 1

comment:7 Changed 13 years ago by drkp (Dan Ports)

The two errors you mention suggest that two other ports -- ghostscript and gd2 -- were not rebuilt after you upgraded libpng. I don't know how this would happen, as both were also revbumped at the same time to force them to be rebuilt.

comment:8 Changed 13 years ago by vinay.d.shah@…

Hi eh88,

I managed to fix this with jmr's help earlier today.

To fix it, try running this script: http://paste.lisp.org/display/119064

(for others, you may need to change libpng to the appropriate version if yours isn't 12)

This will tell you which packages are still trying to link to libpng12.0.dylib

For each of these, sudo port -n upgrade --force [port-name]

Note that you will need to build these ports reverse order of dependencies (that is, force the upgrade on the dependencies first.) There's probably a more clever way of doing this, but my list was short enough that I could do port rdeps [port-name] and figure out which packages needed to be built first.

Hope this helps!

comment:9 Changed 13 years ago by vinay.d.shah@…

By the way, I am not sure what I (and eh88) did to get in this state where ports that depend on libpng are built before libpng. However, since it happened to both of us, I wonder if this could be indicative of a bug or faulty mirror somewhere

comment:10 Changed 13 years ago by jmroot (Joshua Root)

Resolution: worksforme
Status: reopenedclosed

I can't tell you what you did, but I do know there's bad advice out there on the net suggesting to use e.g. the -R and/or -n flags when upgrading. I'm closing this ticket as there is no evidence that the maintainer of this port has done anything wrong. You can file a bug against base if you find a reproducible test case.

comment:11 Changed 13 years ago by phillicl@…

I am having this same problem but I can't open your script that you posted to try to find all the packages that are linked to libpng12.0.dylib. What did you do?

Note: See TracTickets for help on using tickets.