Skip to content

Instantly share code, notes, and snippets.

@voluntas
Last active October 24, 2025 14:20
Show Gist options
  • Save voluntas/303d0ca6cfe3869497a8da37f143f946 to your computer and use it in GitHub Desktop.
Save voluntas/303d0ca6cfe3869497a8da37f143f946 to your computer and use it in GitHub Desktop.
Erlang/OTP ソースコードインストール

Erlang/OTP ソースコードインストール

この資料は定期的に更新される

概要

Erlang/OTP を GitHub にあるソースコードからビルドして利用する方法についてまとめている。

前提

  • 株式会社時雨堂 の商用製品向けのビルド設定
  • パッケージングに利用する Erlang/OTP は OpenSSL を dynamic link しない
  • OpenSSL 最新版を自前ビルドする
  • 利用していないモジュールはビルドしない
    • jinterface
    • odbc
    • wx
    • debugger
    • observer
    • et
    • tftp
    • ftp
    • megaco
    • eldap
    • diameter
    • jinterface
    • mnesia
    • snmp
    • ssh
    • erl_docgen
    • mnesia
  • GitHub から clone してきてビルドする

Linux

古いカーネルは利用しないほうがいい

  • 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

OpenSSL

curl -LO https://github.com/openssl/openssl/releases/download/openssl-3.6.0/openssl-3.6.0.tar.gz
tar xvfz openssl-3.6.0.tar.gz
cd openssl-3.6.0
./Configure --prefix=/opt/openssl/3.6.0 no-shared no-module
make -j$(nproc)
make install_sw

Erlang/OTP

git clone した otp は pull 専用にしてビルドするのは別リポジトリにする

git clone https://github.com/erlang/otp
git clone otp otp-28.1.1 -b OTP-28.1.1
cd otp-28.1.1
./configure --prefix=/opt/erlang/28.1.1 \
            --enable-kernel-poll \
            --enable-dirty-schedulers \
            --enable-jit \
            --disable-sctp \
            --disable-dynamic-ssl-lib \
            --disable-sharing-preserving \
            --with-ssl=/opt/openssl/3.6.0 \
            --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

  • Erlang/OTP 最新版を積極的に利用
  • OpenSSL 開発版を積極的に利用
  • microstate-accounting を有効化
curl -LO https://www.openssl.org/source/openssl-3.6.0.tar.gz
tar xvfz openssl-3.6.0.tar.gz
cd openssl-3.6.0
./Configure --prefix=/opt/openssl/3.6.0 no-shared no-module
make -j$(nproc)
make install_sw
git clone https://github.com/erlang/otp
git clone otp OTP-28.1.1 -b OTP-28.1.1
cd OTP-28.1.1
./configure --prefix=/opt/erlang/28.1.1 \
            --enable-kernel-poll \
            --enable-dirty-schedulers \
            --enable-jit \
            --disable-sctp \
            --disable-dynamic-ssl-lib \
            --disable-sharing-preserving \
            --with-ssl=/opt/openssl/3.6.0 \
            --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

docker images

https://github.com/shiguredo/docker-erlang-otp/pkgs/container/erlang

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment