[tex-live] dvisvgm with libgs on mac os x

jfbu jfbu at free.fr
Mon Mar 12 12:50:08 CET 2018

Le 12 mars 2018 à 00:26, Mojca Miklavec <mojca.miklavec.lists at gmail.com> a écrit :

> On 12 March 2018 at 00:02, jfbu wrote:
>> hi,
>> asking for help on how to compile dvisvgm from TeXLive sources
>> so that it can locate the libgs library on my mac which is at
>> /opt/local/lib
>> (/opt/local/lib/libgs.dylib is a symlink to libgs.9.22.dylib)
>> With the vanilla ./Build produced dvisvgm, I need to pass --libgs option
>> to dvisvgm binary when using it like this
>> $ dvisvgm --libgs="/opt/local/lib/libgs.dylib" temp.dvi
>> and it does work fine (temp.dvi contains 18 postscript specials)
> I would try with
>    export LDFLAGS="-L/opt/local/lib"
>    export CXXFLAGS="-I/opt/local/include"

I have tried but this does not suffice (details below)
> But keep in mind that when ghostscript gets updated, you might need to
> recompile the binary. Why don't you use
>    sudo port install dvisvgm
> instead?

Indeed the dvisvgm  from MacPorts does find /opt/local/lib/libgs.dylib
I did port upgrade outdated the other day and ghostscript was
moved to 9.22, and the texlive binaries were updated including dvisvgm
(to binaries from October 2017)

> I tried to update it just now (the latest version is not in the repo
> yet). Two tests fail:
> FAIL: DVIReaderTest
> FAIL: FontManagerTest
> but I'm not sure about how the situation was before.
>> I tried to play with the configure options listed at
>> http://tug.org/texlive/doc/tlbuild.html#Configure-options-for-texk_002fdvisvgm
>> my last attempt did
>> Work$ ../configure --disable-all-pkgs --disable-native-texlive-build --enable-multiplatform --prefix="/opt/local" --disable-cxx-runtime-hack --enable-dvisvgm --with-system-libgs --with-libgs-includes="/opt/local/include/ghostscript" --with-libgs-libdir="/opt/local/lib/"
>> but it did not seem to succeed.
>> Is there something wrong in my environment variables
> No. But when neither pkg-config nor cmake know where to find the
> binaries, you need to provide explicit hints.
>> (I noticed /opt/local/lib is not in my PATH, I have no idea if that matters)
> It should not be.
>> I googled a bit for location of dylib's on the mac, and found no
>> immediately usable answer
> They are spread all over the place. The dylibs in /opt/local/lib
> (usually) come from MacPorts, but that's by far not the only place
> where you can find them. Usually each .app bundle ships its own copy
> of libraries.

Thanks for the info. My situation is seen is the following

Work$ echo $CXXFLAGS

Work$ echo $LDFLAGS

Work$ ../configure --disable-all-pkgs --disable-native-texlive-build --enable-multiplatform --prefix="/opt/local" --enable-dvisvgm --with-system-libgs

(or various variants)

Then I do the "make" and from its voluminous output I extract the following

=== configuring in dvisvgm (/opt/src/tldevsrc/source/Work/texk/dvisvgm)
[lines snipped]
checking ghostscript/iapi.h usability... no
checking ghostscript/iapi.h presence... no
checking for ghostscript/iapi.h... no
checking for dlopen in -ldl... yes
configure: not linking to libgs, trying to arrange for dynamic loading

But I have :

Work$ pushd /opt && find . -name 'iapi.h' && popd
/opt /opt/src/tldevsrc/source/Work /opt
/opt/src/tldevsrc/source/Work /opt

Then I tried manually editing the Makefile in Work/texk/dvisvgm

LDFLAGS = -L/opt/local/lib
LIBGS_INCLUDES = -I/opt/local/include/ghostscript
LIBGS_LIBS = /opt/local/lib/libgs.dylib

where the LDFLAGS was already as above

but I am not sure which target to use for make there, and anyway
it doesn't work

I am just completely unknowledgeable about the autoconf machinery
etc, hence I have some difficulties understanding these Makefiles



More information about the tex-live mailing list