Roland's homepage

My random knot in the Web

Installing asymptote 2.35 in TeXLive 2015

Since the previous article on this subject, I’ve updated my workstation to FreeBSD 10.2-STABLE. Compiling asymptot 2.23 no longer works because it uses deprecated C++ features. So I thought I’d try and compile version 2.35. Since my TeXLive is not installed from the FreeBSD ports tree, I cannot use the asymptote port since it depends on the TeXLive port.

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.35.src.tgz
> cd asymptote-2.35/
> cp ../../asymptote.pdf doc/
> touch doc/asymptote.pdf
> patch <<EOF
---        2015-12-27 17:14:00.487564000 +0100
+++     2015-12-27 17:14:58.080481000 +0100
@@ -94,10 +94,10 @@
#ifdef __APPLE__
string defaultPDFViewer="open";
-string defaultPDFViewer="acroread";
+string defaultPDFViewer="gv";
string defaultGhostscript="gs";
-string defaultGhostscriptLibrary="/usr/lib/";
+string defaultGhostscriptLibrary="/usr/local/lib/";
string defaultDisplay="display";
string defaultAnimate="animate";
void queryRegistry() {}
> 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 \
> 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;

  • expat-2.1.0_3 (textproc/expat2)
  • freeglut-3.0.0 (graphics/freeglut)
  • gcc-4.8.5_2 (lang/gcc)
  • gsl-1.16_2 (math/gsl)
  • libGL-11.0.8 (graphics/libGL)
  • libGLU-9.0.0_2 (graphics/libGLU)
  • libICE-1.0.9_1,1 (x11/libICE)
  • libSM-1.2.2_3,1 (x11/libSM)
  • libX11-1.6.3,1 (x11/libX11)
  • libXau-1.0.8_3 (x11/libXau)
  • libXdamage-1.1.4_3 (x11/libXdamage)
  • libXdmcp-1.1.2 (x11/libXdmcp)
  • libXext-1.3.3_1,1 (x11/libXext)
  • libXfixes-5.0.1_3 (x11/libXfixes)
  • libXi-1.7.6,1 (x11/libXi)
  • libXrandr-1.5.0 (x11/libXrandr)
  • libXrender-0.9.9 (x11/libXrender)
  • libXxf86vm-1.1.4_1 (x11/libXxf86vm)
  • libdrm-2.4.65_1,1 (graphics/libdrm)
  • libglapi-11.0.8 (graphics/libglapi)
  • libosmesa-11.0.8 (graphics/libosmesa)
  • libpthread-stubs-0.3_6 (devel/libpthread-stubs)
  • libxcb-1.11.1 (x11/libxcb)
  • ncurses-6.0_2 (devel/ncurses)

Running gmake install doesn’t work; it complains about asymptote.pdf even though I put it in the source tree. So I decided to do a manual install. First I checked where the asymptote files are in the TeXLive directory structure;

> find /usr/local/texlive/2015/ -type d -name asymptote
> ls /usr/local/texlive/2015/texmf-dist/tex/latex/asymptote
asycolors.sty  asymptote.sty  latexmkrc      ocg.sty
> ls /usr/local/texlive/2015/texmf-dist/tex/context/asymptote/
> ls /usr/local/texlive/2015/texmf-dist/doc/asymptote
CAD.pdf                  asy-latex.pdf            asymptote.pdf
TeXShopAndAsymptote.pdf  asyRefCard.pdf           examples/
> ls /usr/local/texlive/2015/texmf-dist/asymptote/
CAD.asy               flowchart.asy         plain_Label.asy       size10.asy
GUI/                  fontsize.asy          plain_arcs.asy        size11.asy
animate.asy           geometry.asy          plain_arrows.asy      slide.asy
animation.asy         graph.asy             plain_bounds.asy      slopefield.asy
annotate.asy          graph3.asy            plain_boxes.asy       solids.asy
asy-init.el           graph_settings.asy    plain_constants.asy   stats.asy           graph_splinetype.asy  plain_debugger.asy    syzygy.asy
asy-keywords.el       grid3.asy             plain_filldraw.asy    texcolors.asy
asy-mode.el           interpolate.asy       plain_margins.asy     three.asy
asy.vim               labelpath.asy         plain_markers.asy     three_arrows.asy
asy_filetype.vim      labelpath3.asy        plain_paths.asy       three_light.asy          latin1.asy            plain_pens.asy        three_margins.asy
babel.asy             lmfit.asy             plain_picture.asy     three_surface.asy
bezulate.asy          markers.asy           plain_prethree.asy    three_tube.asy
binarytree.asy        math.asy              plain_scaling.asy     tree.asy
bsp.asy               metapost.asy          plain_shipout.asy     trembling.asy
contour.asy         plain_strings.asy     tube.asy
contour3.asy          obj.asy               plain_xasy.asy        unicode.asy
drawtree.asy          ode.asy               pstoedit.asy          version.asy
embed.asy             palette.asy           reload.js             x11colors.asy
external.asy          patterns.asy          roundedpath.asy
feynman.asy           plain.asy             simplex.asy

Since the style files are not found in the asymptote distribution, 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/2015/texmf-dist/
# mv asymptote old-asymptote
# mkdir asymptote
# cp -Rp /home/rsmith/tmp/src/asymptote-2.35/base/* asymptote/
# rm asymptote/
# mkdir asymptote/GUI
# cp -Rp /home/rsmith/tmp/src/asymptote-2.35/GUI/* asymptote/GUI
# chown -R root:wheel asymptote/
# install /home/rsmith/tmp/src/asymptote-2.35/asy ../bin/amd64-freebsd/
# chown -R root:wheel ../bin/amd64-freebsd/asy
# cp /home/rsmith/tmp/asymptote.pdf doc/asymptote/

After this, asymptote seems to work normally.

For comments, please send me an e-mail.

Related articles

←  Preventing the ~/Desktop direcory Installing OpenProject on FreeBSD  →