On Linux and macOS, vfox install builds Erlang/OTP from source unless USE_PREBUILT_OTP is set (see prebuilt.md). This page lists the build dependencies and the environment variables that change the build.
- Downloads the source archive from
https://github.com/erlang/otp/archive/: the tagOTP-<version>for a release, or the branch formaster,maintandmaint-<number>(such asmaint-27). - Runs
./configure --prefix=<sdk>/release, with the arguments fromOTP_CONFIGURE_ARGS. - Runs
makeandmake install. - Runs
make docsandmake install-docswithDOC_TARGETS, which defaults tochunks.
<sdk> is the directory that vfox manages for the version. By default vfox keeps SDKs under ~/.vfox/cache, see the vfox configuration guide. The build output goes to <sdk>/release, and the plugin adds <sdk>/release/bin to PATH.
The install path, which is <sdk>, must not contain a space, a tab, a newline, an apostrophe ('), a double quote ("), a dollar sign ($) or a backtick. OTP's configure cannot take these characters: an apostrophe breaks its quoting, the others are expanded, and a space, a tab or a newline splits the path in a cd that configure runs without quotes. The plugin stops before configure starts, and the error names the character. Set VFOX_HOME to a path without them. See troubleshooting.md.
Ubuntu 22.04:
sudo apt-get -y install build-essential autoconf m4 libncurses5-dev libwxgtk3.0-gtk3-dev libwxgtk-webview3.0-gtk3-dev libgl1-mesa-dev libglu1-mesa-dev libpng-dev libssh-dev unixodbc-dev xsltproc fop libxml2-utils libncurses-dev openjdk-11-jdkUbuntu 24.04 uses the same list with two changes: libwxgtk3.2-dev libwxgtk-webview3.2-dev replace the 3.0 wxWidgets packages, and libncurses5-dev is left out, because Ubuntu 24.04 has no installation candidate for it:
sudo apt-get -y install build-essential autoconf m4 libwxgtk3.2-dev libwxgtk-webview3.2-dev libgl1-mesa-dev libglu1-mesa-dev libpng-dev libssh-dev unixodbc-dev xsltproc fop libxml2-utils libncurses-dev openjdk-11-jdkmacOS, with Homebrew:
brew install autoconf libxslt fop wxwidgets opensslThe utilities and libraries these packages provide:
autoconf(withm4) generates the configure script.- ncurses and the other
-devpackages provide the headers and libraries that the build compiles against. The OpenSSL headers come fromlibssl-dev, whichlibssh-devdepends on. Ifconfigurereports that OpenSSL is missing, installlibssl-dev. xsltprocis needed by the documentation step;fopand OpenJDK are needed for PDF documentation.
| Variable | Default | Effect |
|---|---|---|
MAKEFLAGS |
unset | Passed to make, for example -j8 for parallel jobs |
OTP_CONFIGURE_ARGS |
empty | Extra arguments for ./configure |
DOC_TARGETS |
chunks |
Target for make docs and make install-docs |
Set them before vfox install.
A build takes about five minutes on a fast computer. To run make in parallel, set MAKEFLAGS to -j and a number of jobs:
export MAKEFLAGS=-j8The value is passed to ./configure. For the available options, see the OTP installation guide.
export OTP_CONFIGURE_ARGS="--enable-jit --enable-kernel-poll"On macOS, if configure cannot find OpenSSL, point it at the Homebrew copy:
export OTP_CONFIGURE_ARGS="--with-ssl=$(brew --prefix openssl@3)"The default chunks builds EEP-48 documentation chunks. They let h(lists). and shell_docs show documentation in the Erlang shell, and let editor language servers show documentation hints. Setting another value changes what make docs builds, and h(lists). may stop working. Check it after an install, as described below.
export MAKEFLAGS=-j8
export OTP_CONFIGURE_ARGS="--enable-jit"
vfox install erlang@26.2.3Then check the install:
eval "$(vfox activate bash)"
vfox use -g erlang@26.2.3
erl -noshell -eval 'erlang:display({otp_release, erlang:system_info(otp_release)}), halt().'
erl -noshell -eval 'erlang:display(shell_docs:get_doc(lists)), halt().' | grep "functions for list processing"The second command prints a line containing functions for list processing when the documentation chunks are installed.
The variables are read when vfox installs the version. To rebuild an installed version with other settings, uninstall it first:
vfox uninstall erlang@26.2.3
vfox install erlang@26.2.3Save the whole output to a file, then read the first error:
vfox install erlang@26.2.3 2>&1 | tee /tmp/otp-build.log
grep -n -i "error" /tmp/otp-build.log | head -n 20The source tree is in <sdk>, so ./configure --help run there lists the options that OTP_CONFIGURE_ARGS accepts. Common causes and fixes are in troubleshooting.md.
