アフィリエイト広告を利用しています

2023年04月02日

システム管理: Emacs HEAD のコンパイルとインストール

Emacs HEAD のコンパイルとインストールを行う.

$ export AUTOCONF_VERSION="2.71"
$ export AUTOMAKE_VERSION="1.16"
$ ./autogen.sh
$ ./configure \
'CFLAGS=-I/usr/include -I/usr/X11R6/include -I/usr/local/include' \
'LDFLAGS=-L/usr/lib -L/usr/X11R6/lib -L/usr/local/lib -lgccjit' \
--prefix=/usr/local \
--mandir=/usr/local/share/man \
--infodir=/usr/local/info \
--with-x-toolkit=athena \
--with-imagemagick \
--with-xaw3d \
--with-x \
--without-xim \
--with-xpm=ifavailable \
--with-native-compilation

libgccjit のチェックの際にエラーが出た.

checking for gcc_jit_context_acquire in -lgccjit... yes
checking for libgccjit.h... yes
configure: error: The installed libgccjit failed to compile and run a test program using
the libgccjit library; see config.log for the details of the failure.
The test program can be found here:
<https://gcc.gnu.org/onlinedocs/jit/intro/tutorial01.html>.
You can try compiling it yourself to investigate the issues.
Please report the issue to your distribution if libgccjit was installed
through that.
You can find the instructions on how to compile and install libgccjit from
source on this site:
<https://gcc.gnu.org/wiki/JIT>.

メッセージに従って, https://gcc.gnu.org/onlinedocs/jit/intro/tutorial01.html にあるテストプログラム tut01-hello-world.c をコンパイルして動かしてみる.

$ egcc -I/usr/include -I/usr/local/include -L/usr/lib -L/usr/local/lib \
tut01-hello-world.c -o tut01-hello-world -lgccjit
$ ./tut01-hello-world
ld: error: unable to find library -lgcc
ld: error: unable to find library -lgcc
libgccjit.so: error: error invoking gcc driver
NULL result

libgcc が見つからないというエラーが出る.
探したらディレクトリー /usr/local/lib/gcc/x86_64-unknown-openbsd7.3/11.2.0 に libgcc.a があった.
そこで環境変数 LD_LIBRARY_PATH にこのディレクトリーを指定してテストプログラムを実行する.

$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib/gcc/x86_64-unknown-openbsd7.3/11.2.0
$ ./tut01-hello-world
hello world

今度はうまく行った.

上記のように環境変数 LD_LIBRARY_PATH を設定した状況で Emacs HEAD のコンパイルとインストールを行う.

$ ./autogen.sh
$ ./configure \
'CFLAGS=-I/usr/include -I/usr/X11R6/include -I/usr/local/include' \
'LDFLAGS=-L/usr/lib -L/usr/X11R6/lib -L/usr/local/lib -lgccjit' \
--prefix=/usr/local \
--mandir=/usr/local/share/man \
--infodir=/usr/local/info \
--with-x-toolkit=athena \
--with-imagemagick \
--with-xaw3d \
--with-x \
--without-xim \
--with-xpm=ifavailable \
--with-native-compilation
$ git pull
$ gmake bootstrap
$ gmake check
# gmake install


また, \$/.emacs.d/init.el の中でも環境変数 LD_LIBRARY_PATH を

(setenv "LD_LIBRARY_PATH" "$LD_LIBRARY_PATH:/usr/local/lib/gcc/x86_64-unknown-openbsd7.3/11.2.0")

のように設定した.

これまではなぜうまく動いていたのだろうかという疑問は残るが, 最新版のシステムを使っていればこういうことはある.
この記事へのコメント
コメントを書く

お名前:

メールアドレス:


ホームページアドレス:

コメント:

この記事へのトラックバックURL
https://fanblogs.jp/tb/11929165

この記事へのトラックバック
ファン
検索
<< 2024年04月 >>
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30        
最新記事
最新コメント
眼科の定期検査 〜 散歩 by コトタマ (02/15)
眼科の定期検査 by 三文字寄れば文殊のヒフミヨ (09/21)
本を読んで過ごす by 底彦 (12/13)
本を読んで過ごす by ねこ (12/12)
数学の計算をする by 底彦 (12/04)
タグクラウド
カテゴリアーカイブ
仕事(59)
社会復帰(22)
(40)
コンピューター(197)
(1349)
借金(8)
勉強(7)
(12)
数学(97)
運動(8)
日常生活(1316)
(198)
健康(33)
読書(19)
プロフィール

ブログランキング・にほんブログ村へ
にほんブログ村
にほんブログ村 メンタルヘルスブログ うつ病(鬱病)へ
にほんブログ村
にほんブログ村 科学ブログ 数学へ
にほんブログ村
にほんブログ村 IT技術ブログ プログラム・プログラマーへ
にほんブログ村