Roland's homepage

My random knot in the Web

Installing asymptote 2.38 in TeXLive 2016

Since the previous article [1] I’ve updated TexLive to 2016. This comes with asymptote 2.38, but not with a FreeBSD binary for it.

My TeXLive is not installed from the FreeBSD ports tree, so I cannot use the asymptote port since it depends on the TeXLive port.

That’s why I’m compiling and installing it myself.

Commands preceeded by > can be carried out as a normal user while # signifies commands that have to be carried out by the root user.

The following commands where necessary to compile the software:

> cd ~/tmp/src/
> tar xf ../asymptote-2.38.src.tgz
> cd asymptote-2.38/
> cp ../../asymptote.pdf doc/
> touch doc/asymptote.pdf
> patch <<EOF
--- settings.cc.orig        2016-07-24 10:44:48.428548000 +0200
+++ settings.cc     2016-07-24 10:47:53.122489000 +0200
@@ -95,10 +95,10 @@
#ifdef __APPLE__
string defaultPDFViewer="open";
#else
-string defaultPDFViewer="acroread";
+string defaultPDFViewer="mupdf";
#endif
string defaultGhostscript="gs";
-string defaultGhostscriptLibrary="/usr/lib/libgs.so";
+string defaultGhostscriptLibrary="/usr/local/lib/libgs.so";
string defaultDisplay="display";
string defaultAnimate="animate";
void queryRegistry() {}
EOF
> env LDFLAGS=-L/usr/local/lib CPPFLAGS=-I/usr/local/include CC=clang \
CXX=clang++ ./configure --prefix=/tmp/asyinst --enable-texlive-build \
--disable-gc --disable-fftw --disable-readline --enable-gsl --enable-gl \
--enable-offscreen
> gmake -j4
> strip asy

From analyzing the output of the command ldd asy, it has been determined that the following packages (ports) were used by asymptote;

> ldd asy | awk '{print $3}' | grep local | xargs pkg which
/usr/local/lib/libOSMesa.so.8 was installed by package libosmesa-11.2.2
/usr/local/lib/libglut.so.3 was installed by package freeglut-3.0.0
/usr/local/lib/libGLU.so.1 was installed by package libGLU-9.0.0_2
/usr/local/lib/libGL.so.1 was installed by package libGL-11.2.2
/usr/local/lib/libgsl.so.0 was installed by package gsl-1.16_2
/usr/local/lib/libgslcblas.so.0 was installed by package gsl-1.16_2
/usr/local/lib/libglapi.so.0 was installed by package libglapi-11.2.2
/usr/local/lib/libSM.so.6 was installed by package libSM-1.2.2_3,1
/usr/local/lib/libICE.so.6 was installed by package libICE-1.0.9_1,1
/usr/local/lib/libX11.so.6 was installed by package libX11-1.6.3,1
/usr/local/lib/libXext.so.6 was installed by package libXext-1.3.3_1,1
/usr/local/lib/libXrandr.so.2 was installed by package libXrandr-1.5.0
/usr/local/lib/libXxf86vm.so.1 was installed by package libXxf86vm-1.1.4_1
/usr/local/lib/libXi.so.6 was installed by package libXi-1.7.6,1
/usr/local/lib/libexpat.so.1 was installed by package expat-2.2.0
/usr/local/lib/libXdamage.so.1 was installed by package libXdamage-1.1.4_3
/usr/local/lib/libXfixes.so.3 was installed by package libXfixes-5.0.1_3
/usr/local/lib/libX11-xcb.so.1 was installed by package libX11-1.6.3,1
/usr/local/lib/libxcb-glx.so.0 was installed by package libxcb-1.11.1
/usr/local/lib/libxcb-dri2.so.0 was installed by package libxcb-1.11.1
/usr/local/lib/libxcb.so.1 was installed by package libxcb-1.11.1
/usr/local/lib/libdrm.so.2 was installed by package libdrm-2.4.66,1
/usr/local/lib/libXrender.so.1 was installed by package libXrender-0.9.9
/usr/local/lib/libXau.so.6 was installed by package libXau-1.0.8_3
/usr/local/lib/libpthread-stubs.so.0 was installed by package libpthread-stubs-0.3_6
/usr/local/lib/libXdmcp.so.6 was installed by package libXdmcp-1.1.2

To prevent any mishaps, I decided to do a manual install just like I did the previous times. I only installed the files from the base directory in the distribution, the binary and the documentation PDF. Of course I made a backup of the total TeXLive installation before proceeding.

# cd /usr/local/texlive/2016/texmf-dist/
# mv asymptote old-asymptote
# mkdir asymptote
# install -m 644 /home/rsmith/tmp/src/asymptote-2.38/base/* asymptote/
# rm asymptote/asymptote.py
# mkdir asymptote/GUI
# install -m 644 /home/rsmith/tmp/src/asymptote-2.38/GUI/* asymptote/GUI
# install /home/rsmith/tmp/src/asymptote-2.38/asy ../bin/amd64-freebsd/
# install -m 644 /home/rsmith/tmp/asymptote.pdf doc/asymptote/

After this, asymptote seems to work normally.


For comments, please send me an e-mail.


Related articles


←  Reading xlsx files with Python Adding text or graphics to a PDF file  →