この資料は定期的に更新される
Erlang/OTP を GitHub にあるソースコードからビルドして利用する方法についてまとめている。
- 株式会社時雨堂 の商用製品向けのビルド設定
- パッケージングに利用する Erlang/OTP は OpenSSL / AWS-LC を dynamic link しない
- OpenSSL / AWS-LC 最新版を自前ビルドする
- 利用していないモジュールはビルドしない
- jinterface
- odbc
- wx
- debugger
- observer
- et
- tftp
- ftp
- megaco
- eldap
- diameter
- jinterface
- mnesia
- snmp
- ssh
- erl_docgen
- mnesia
- GitHub から clone してきてビルドする
古いカーネルは利用しないほうがいい
- Ubuntu 24.04 x86_64 | arm64
apt install build-essential libncurses5-dev autoconf
- Ubuntu 22.04 x86_64 | arm64
apt install build-essential libncurses5-dev autoconf
- Red Hat Enterprise Linux 10 x86_64
dnf install autoconf gcc glibc-devel make ncurses-devel perl
- Red Hat Enterprise Linux 9 x86_64
dnf install autoconf gcc glibc-devel make ncurses-devel perl
curl -LO https://github.com/openssl/openssl/releases/download/openssl-3.6.1/openssl-3.6.1.tar.gz
tar xvfz openssl-3.6.1.tar.gz
cd openssl-3.6.1
./Configure --prefix=/opt/openssl/3.6.1 no-shared no-module
make -j$(nproc)
make install_swgit clone した otp は pull 専用にしてビルドするのは別リポジトリにする
git clone https://github.com/erlang/otp
git clone otp otp-28.3 -b OTP-28.3
cd otp-28.3
./configure --prefix=/opt/erlang/28.3 \
--enable-kernel-poll \
--enable-dirty-schedulers \
--enable-jit \
--disable-sctp \
--disable-dynamic-ssl-lib \
--disable-sharing-preserving \
--with-ssl=/opt/openssl/3.6.1 \
--without-javac \
--without-odbc \
--without-wx \
--without-debugger \
--without-observer \
--without-crashdump_viewer \
--without-et \
--without-tftp \
--without-ftp \
--without-megaco \
--without-eldap \
--without-diameter \
--without-jinterface \
--without-snmp \
--without-ssh \
--without-erl_docgen \
--without-mnesia
make -j$(nproc)
make install- Erlang/OTP 最新版を積極的に利用
- microstate-accounting を有効化
git clone https://github.com/erlang/otp
git clone otp OTP-28.3 -b OTP-28.3
cd OTP-28.3
./configure --prefix=/opt/erlang/28.3 \
--enable-kernel-poll \
--enable-dirty-schedulers \
--enable-jit \
--disable-sctp \
--disable-dynamic-ssl-lib \
--disable-sharing-preserving \
--with-ssl=/opt/openssl/3.6.1 \
--with-microstate-accounting=extra \
--without-javac \
--without-odbc \
--without-wx \
--without-debugger \
--without-observer \
--without-crashdump_viewer \
--without-et \
--without-tftp \
--without-ftp \
--without-megaco \
--without-eldap \
--without-diameter \
--without-jinterface \
--without-snmp \
--without-ssh \
--without-erl_docgen \
--without-mnesia
make -j$(nproc)
make install時雨堂では AWS が開発している AWS-LC を OpenSSL の代わりに利用し始めてる。 ただしパッチを当てる必要があるので、要注意。
AWS-LC のビルドには CMake と Ninja と Go が必要なのでインストールしておくこと。
git clone --branch v1.67.0 --depth 1 https://github.com/aws/aws-lc
cd aws-lc
cmake -GNinja -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/opt/aws-lc/v1.67.0
ninja -C build
sudo $(which ninja) -C build installAWS-LC を利用できるようにパッチを当てている shiguredo/otp の aws-lc-support ブランチまたは aws-lc-* タグを利用する。
git clone https://github.com/shiguredo/otp
cd otp
git checkout aws-lc-OTP-29.0-rc1
./configure --prefix=/opt/erlang/29.0-rc1 \
--enable-kernel-poll \
--enable-dirty-schedulers \
--enable-jit \
--disable-sctp \
--disable-dynamic-ssl-lib \
--disable-sharing-preserving \
--with-ssl=/opt/aws-lc/v1.67.0 \
--with-ssl-rpath=no \
--without-javac \
--without-odbc \
--without-wx \
--without-debugger \
--without-observer \
--without-crashdump_viewer \
--without-et \
--without-tftp \
--without-ftp \
--without-megaco \
--without-eldap \
--without-diameter \
--without-jinterface \
--without-snmp \
--without-ssh \
--without-erl_docgen \
--without-mnesia
make -j$(nproc)
make install
crypto:info(). で AWS-LC と表示されていることを確認してください。
Erlang/OTP 29 [RELEASE CANDIDATE 1] [erts-17.0] [source-c1e85e4910] [64-bit] [smp:14:14] [ds:14:14:10] [async-threads:1] [jit]
Eshell V17.0 (press Ctrl+G to abort, type help(). for help)
1> crypto:info().
#{otp_crypto_version => "5.9",compile_type => normal,
link_type => static,
cryptolib_version_compiled =>
"OpenSSL 1.1.1 (compatible; AWS-LC 1.67.0)",
cryptolib_version_linked => "AWS-LC 1.67.0"}
OpenSSL 版と AWS-LC 版両方のイメージを提供しています。
https://github.com/shiguredo/docker-erlang-otp/pkgs/container/erlang