Roland's homepage

My random knot in the Web

Compiling asymptote for TeXLive on FreeBSD

As of TeXLive 2015 there is no TeXLive binary for FreeBSD included anymore. So I’m building my own, using the current version 2.65 for TeXLive 2020. To start, I’ve doenloaded asymptote-2.65.src.tgz and asymptote.pdf from the website.

Building asymptote with OpenGL and off-screen rendering support was done as follows. Note that the configure.ac file needs a small patch, because libOSMesa requires libunwind.

--- configure.ac.orig       2022-02-13 09:59:54.422672000 +0100
+++ configure.ac    2022-02-13 10:02:06.306716000 +0100
@@ -425,7 +425,7 @@
                                    AC_MSG_NOTICE([*** Could not find libGL: will compile without OpenGL support ***]))
esac
    if test "x$enable_offscreen" = "xyes"; then
-           AC_CHECK_LIB([OSMesa],OSMesaCreateContext,,
+           AC_CHECK_LIB([OSMesa],OSMesaCreateContext,LIBS=$LIBS"-lOSMesa -lunwind ",
                        AC_MSG_NOTICE([*** Could not find libOSMesa: will compile without offscreen rendering support ***]))
    fi
fi
cd ~/tmp/src
tar xf ../asymptote-2.65.src.tgz
cd asymptote-2.65
patch < ../asy-configure.ac.patch
autoheader
autoconf
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

For installation I used the packages from the installation DVD, mounted at /media/cd1/, but provided the binary myself.

tlmgr install --file /media/cd1/texlive/archive/asymptote.tar.xz
tlmgr install --file /media/cd1/texlive/archive/asymptote.doc.tar.xz
install asy /usr/local/texlive/2020/bin/amd64-freebsd/

During testing of 2.35, I had problems with labels. According to a bug report, I should use Ghostscript 9.16, and I’m using 9.06. So I’ve updated my ghostscript port from print/ghostscript9-x11 (which is version 9.06) to print/ghostscript9-agpl-x11 (9.16). This solved the problem.

Settings

Additionally, I have the following set in ~/.asy/config.asy, this is geared toward the binary with off-screen rendering support.

import settings;
dir="/usr/local/texlive/2019/texmf-dist/asymptote:/home/rsmith/lib/asy";
outformat="pdf";
pdfviewer="mupdf";
prc=false;
offscreen=true;

Requirements

The asy binary links to the following libraries:

> ldd asy
asy:
    libGLX.so.0 => /usr/local/lib/libGLX.so.0 (0x800575000)
    libglut.so.3 => /usr/local/lib/libglut.so.3 (0x8005aa000)
    librt.so.1 => /usr/lib/librt.so.1 (0x800669000)
    libsigsegv.so.2 => /usr/local/lib/libsigsegv.so.2 (0x800672000)
    libz.so.6 => /lib/libz.so.6 (0x800678000)
    libgsl.so.27 => /usr/local/lib/libgsl.so.27 (0x800694000)
    libgslcblas.so.0 => /usr/local/lib/libgslcblas.so.0 (0x8009ba000)
    libGL.so.1 => /usr/local/lib/libGL.so.1 (0x800a0c000)
    libOSMesa.so.8 => /usr/local/lib/libOSMesa.so.8 (0x800c00000)
    libunwind.so.8 => /usr/local/lib/libunwind.so.8 (0x800a98000)
    libc++.so.1 => /usr/lib/libc++.so.1 (0x800ab2000)
    libcxxrt.so.1 => /lib/libcxxrt.so.1 (0x800b89000)
    libm.so.5 => /lib/libm.so.5 (0x800bab000)
    libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x800be6000)
    libthr.so.3 => /lib/libthr.so.3 (0x80198b000)
    libc.so.7 => /lib/libc.so.7 (0x8019b8000)
    libGLdispatch.so.0 => /usr/local/lib/libGLdispatch.so.0 (0x801dc2000)
    libdl.so.1 => /usr/lib/libdl.so.1 (0x801e7a000)
    libX11.so.6 => /usr/local/lib/libX11.so.6 (0x801e7e000)
    libusbhid.so.4 => /usr/lib/libusbhid.so.4 (0x801fc9000)
    libXrandr.so.2 => /usr/local/lib/libXrandr.so.2 (0x801fd0000)
    libXxf86vm.so.1 => /usr/local/lib/libXxf86vm.so.1 (0x801fdd000)
    libXi.so.6 => /usr/local/lib/libXi.so.6 (0x801fe5000)
    libglapi.so.0 => /usr/local/lib/libglapi.so.0 (0x801ff7000)
    libLLVM-12.so => /usr/local/llvm12/lib/libLLVM-12.so (0x802200000)
    liblzma.so.5 => /usr/lib/liblzma.so.5 (0x80205d000)
    libxcb.so.1 => /usr/local/lib/libxcb.so.1 (0x802089000)
    libXext.so.6 => /usr/local/lib/libXext.so.6 (0x8020b6000)
    libXrender.so.1 => /usr/local/lib/libXrender.so.1 (0x8020cb000)
    libexecinfo.so.1 => /usr/lib/libexecinfo.so.1 (0x8020d7000)
    libxml2.so.2 => /usr/local/lib/libxml2.so.2 (0x80793e000)
    libmd.so.6 => /lib/libmd.so.6 (0x8020dd000)
    libXau.so.6 => /usr/local/lib/libXau.so.6 (0x8020fb000)
    libXdmcp.so.6 => /usr/local/lib/libXdmcp.so.6 (0x802101000)
    libelf.so.2 => /lib/libelf.so.2 (0x802109000)

The asymptote program uses the following ports:

  • graphics/libglvnd
  • graphics/freeglut
  • devel/libsigsegv
  • graphics/libosmesa
  • devel/libunwind
  • x11/libX11
  • x11/libXrandr
  • x11/libXxf86vm
  • x11/libXi
  • graphics/mesa-libs
  • devel/llvm12
  • x11/libxcb
  • x11/libXext
  • x11/libXrender
  • textproc/libxml2
  • x11/libXau
  • x11/libXdmcp

History

Date Log
2020-07-05 Moved from ~/bits/problems.rst
2022-02-13 Update for Asymptote 2.65.

For comments, please send me an e-mail.


Related articles


←  Removing big files from git history Transplanting noscript settings and bookmarks to another machine  →