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.49 for TeXLive 2019. To start, I’ve
doenloaded asymptote-2.49.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 2017-07-16 12:41:04.536385000 +0200
+++ configure.ac 2017-07-16 12:59:11.120412000 +0200
@@ -347,8 +347,8 @@
AC_MSG_NOTICE([*** Could not find libglut: will compile without GLUT support ***]))
esac
if test "x$enable_offscreen" != "xno"; then
- AC_CHECK_LIB([OSMesa],OSMesaCreateContext,,
- AC_MSG_NOTICE([*** Could not find libOSMesa: will compile without offscreen rendering support ***]))
+ AC_CHECK_LIB([OSMesa],OSMesaCreateContext,LIBS=$LIBS"-lOSMesa -lunwind ",
+ AC_MSG_NOTICE([*** Could not find libOSMesa: will compile without offscreen rendering support ***]), -lunwind)
fi
fi
cd ~/tmp/src
tar xf ../asymptote-2.49.src.tgz
cd asymptote-2.49
# Apply the patch to configure.ac
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/2019/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: libglut.so.3 => /usr/local/lib/libglut.so.3 (0x80058b000) libGL.so.1 => /usr/local/lib/libGL.so.1 (0x800642000) librt.so.1 => /usr/lib/librt.so.1 (0x8006d7000) libsigsegv.so.2 => /usr/local/lib/libsigsegv.so.2 (0x8006df000) libz.so.6 => /lib/libz.so.6 (0x8006e6000) libm.so.5 => /lib/libm.so.5 (0x800700000) libgsl.so.25 => /usr/local/lib/libgsl.so.25 (0x800732000) libgslcblas.so.0 => /usr/local/lib/libgslcblas.so.0 (0x800a49000) libOSMesa.so.8 => /usr/local/lib/libOSMesa.so.8 (0x800c00000) libunwind.so.8 => /usr/local/lib/libunwind.so.8 (0x8014a0000) libc++.so.1 => /usr/lib/libc++.so.1 (0x800a9c000) libcxxrt.so.1 => /lib/libcxxrt.so.1 (0x800b6c000) libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x800b8d000) libthr.so.3 => /lib/libthr.so.3 (0x800ba7000) libc.so.7 => /lib/libc.so.7 (0x8016ba000) libusbhid.so.4 => /usr/lib/libusbhid.so.4 (0x800bd4000) libSM.so.6 => /usr/local/lib/libSM.so.6 (0x800bdb000) libICE.so.6 => /usr/local/lib/libICE.so.6 (0x801ab1000) libX11.so.6 => /usr/local/lib/libX11.so.6 (0x801ace000) libXext.so.6 => /usr/local/lib/libXext.so.6 (0x800be6000) libXrandr.so.2 => /usr/local/lib/libXrandr.so.2 (0x801c17000) libXxf86vm.so.1 => /usr/local/lib/libXxf86vm.so.1 (0x801c24000) libXi.so.6 => /usr/local/lib/libXi.so.6 (0x801c2c000) libexpat.so.1 => /usr/local/lib/libexpat.so.1 (0x801c3e000) libxcb-dri3.so.0 => /usr/local/lib/libxcb-dri3.so.0 (0x800bfb000) libxcb-xfixes.so.0 => /usr/local/lib/libxcb-xfixes.so.0 (0x801c6b000) libxcb-present.so.0 => /usr/local/lib/libxcb-present.so.0 (0x801c75000) libxcb-sync.so.1 => /usr/local/lib/libxcb-sync.so.1 (0x801c7a000) libxshmfence.so.1 => /usr/local/lib/libxshmfence.so.1 (0x801c83000) libglapi.so.0 => /usr/local/lib/libglapi.so.0 (0x801c87000) libXdamage.so.1 => /usr/local/lib/libXdamage.so.1 (0x801ce6000) libXfixes.so.3 => /usr/local/lib/libXfixes.so.3 (0x801ceb000) libX11-xcb.so.1 => /usr/local/lib/libX11-xcb.so.1 (0x801cf3000) libxcb.so.1 => /usr/local/lib/libxcb.so.1 (0x801cf7000) libxcb-glx.so.0 => /usr/local/lib/libxcb-glx.so.0 (0x801d24000) libxcb-dri2.so.0 => /usr/local/lib/libxcb-dri2.so.0 (0x801d41000) libdrm.so.2 => /usr/local/lib/libdrm.so.2 (0x801d47000) libLLVM-8.so => /usr/local/llvm80/lib/libLLVM-8.so (0x801e00000) liblzma.so.5 => /usr/lib/liblzma.so.5 (0x801d5e000) libXrender.so.1 => /usr/local/lib/libXrender.so.1 (0x801d8a000) libXau.so.6 => /usr/local/lib/libXau.so.6 (0x801d97000) libXdmcp.so.6 => /usr/local/lib/libXdmcp.so.6 (0x801d9c000) libedit.so.0 => /usr/local/lib/libedit.so.0 (0x801da4000) libexecinfo.so.1 => /usr/lib/libexecinfo.so.1 (0x801ddd000) libncurses.so.8 => /lib/libncurses.so.8 (0x805ba1000) libelf.so.2 => /lib/libelf.so.2 (0x801de2000)
The asymptote program uses the following ports:
- devel/libedit
- devel/libsigsegv
- devel/libunwind
- devel/llvm80
- graphics/freeglut
- graphics/libdrm
- graphics/libosmesa
- graphics/mesa-libs
- math/gsl
- textproc/expat2
- x11/libICE
- x11/libSM
- x11/libX11
- x11/libXau
- x11/libxcb
- x11/libXdamage
- x11/libXdmcp
- x11/libXext
- x11/libXfixes
- x11/libXi
- x11/libXrandr
- x11/libXrender
- x11/libxshmfence
- x11/libXxf86vm
For comments, please send me an e-mail.
Related articles
- Compiling asymptote for TeXLive on FreeBSD
- Installing asymptote 2.38 in TeXLive 2016
- Installing asymptote 2.35 in TeXLive 2015
- Adding scale markers to a scanned image
- Gnumeric build fix for FreeBSD