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 file needs a small patch, because libOSMesa requires libunwind.

---       2022-02-13 09:59:54.422672000 +0100
+++    2022-02-13 10:02:06.306716000 +0100
@@ -425,7 +425,7 @@
                                    AC_MSG_NOTICE([*** Could not find libGL: will compile without OpenGL support ***]))
    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 ***]))
cd ~/tmp/src
tar xf ../asymptote-2.65.src.tgz
cd asymptote-2.65
patch < ../
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

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.


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

import settings;


The asy binary links to the following libraries:

> ldd asy
asy: => /usr/local/lib/ (0x800575000) => /usr/local/lib/ (0x8005aa000) => /usr/lib/ (0x800669000) => /usr/local/lib/ (0x800672000) => /lib/ (0x800678000) => /usr/local/lib/ (0x800694000) => /usr/local/lib/ (0x8009ba000) => /usr/local/lib/ (0x800a0c000) => /usr/local/lib/ (0x800c00000) => /usr/local/lib/ (0x800a98000) => /usr/lib/ (0x800ab2000) => /lib/ (0x800b89000) => /lib/ (0x800bab000) => /lib/ (0x800be6000) => /lib/ (0x80198b000) => /lib/ (0x8019b8000) => /usr/local/lib/ (0x801dc2000) => /usr/lib/ (0x801e7a000) => /usr/local/lib/ (0x801e7e000) => /usr/lib/ (0x801fc9000) => /usr/local/lib/ (0x801fd0000) => /usr/local/lib/ (0x801fdd000) => /usr/local/lib/ (0x801fe5000) => /usr/local/lib/ (0x801ff7000) => /usr/local/llvm12/lib/ (0x802200000) => /usr/lib/ (0x80205d000) => /usr/local/lib/ (0x802089000) => /usr/local/lib/ (0x8020b6000) => /usr/local/lib/ (0x8020cb000) => /usr/lib/ (0x8020d7000) => /usr/local/lib/ (0x80793e000) => /lib/ (0x8020dd000) => /usr/local/lib/ (0x8020fb000) => /usr/local/lib/ (0x802101000) => /lib/ (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


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  →