[#43713] Re: 演算子の優先順位(was: Re: irb と python のバグ?) — "きむらこういち" <hogemuta@...>

木村です。

20 messages 2007/07/14
[#43715] Re: 演算子の優先順位(was: Re: irb — TunTun-m <tntn@...> 2007/07/14

bc では次式の結果は 0.81 ではなく 0.8 になります。

[ruby-list:43686] Re: rubyをソースからコンパイルしての質問

From: "Nobuyuki Inaba" <nobuyuki.inaba@...>
Date: 2007-07-09 00:58:23 UTC
List: ruby-list #43686
いなばです。

お話の、ext/readline/mkmf.logです。
==============================================================
have_library: checking for tgetnum() in -lncurses... -------------------- no

"gcc -o conftest -I../.. -I../../. -I../.././ext/readline  -g -O2
conftest.c  -L'../..'  -rdynamic -Wl,-export-dynamic     -lruby-static
-lncurses  -ldl -lcrypt -lm   -lc"
conftest.c: In function 't':
conftest.c:3: error: 'tgetnum' undeclared (first use in this function)
conftest.c:3: error: (Each undeclared identifier is reported only once
conftest.c:3: error: for each function it appears in.)
checked program was:
/* begin */
1: /*top*/
2: int main() { return 0; }
3: int t() { void ((*volatile p)()); p = (void ((*)()))tgetnum; return 0; }
/* end */

"gcc -o conftest -I../.. -I../../. -I../.././ext/readline  -g -O2
conftest.c  -L'../..'  -rdynamic -Wl,-export-dynamic     -lruby-static
-lncurses  -ldl -lcrypt -lm   -lc"
/usr/bin/ld: cannot find -lncurses
collect2: ld はステータス 1 で終了しました
checked program was:
/* begin */
1: /*top*/
2: int main() { return 0; }
3: int t() { tgetnum(); return 0; }
/* end */

--------------------

have_library: checking for tgetnum() in -ltermcap... -------------------- no

"gcc -o conftest -I../.. -I../../. -I../.././ext/readline  -g -O2
conftest.c  -L'../..'  -rdynamic -Wl,-export-dynamic     -lruby-static
-ltermcap  -ldl -lcrypt -lm   -lc"
conftest.c: In function 't':
conftest.c:3: error: 'tgetnum' undeclared (first use in this function)
conftest.c:3: error: (Each undeclared identifier is reported only once
conftest.c:3: error: for each function it appears in.)
checked program was:
/* begin */
1: /*top*/
2: int main() { return 0; }
3: int t() { void ((*volatile p)()); p = (void ((*)()))tgetnum; return 0; }
/* end */

"gcc -o conftest -I../.. -I../../. -I../.././ext/readline  -g -O2
conftest.c  -L'../..'  -rdynamic -Wl,-export-dynamic     -lruby-static
-ltermcap  -ldl -lcrypt -lm   -lc"
/usr/bin/ld: cannot find -ltermcap
collect2: ld はステータス 1 で終了しました
checked program was:
/* begin */
1: /*top*/
2: int main() { return 0; }
3: int t() { tgetnum(); return 0; }
/* end */

--------------------

have_library: checking for tgetnum() in -lcurses... -------------------- no

"gcc -o conftest -I../.. -I../../. -I../.././ext/readline  -g -O2
conftest.c  -L'../..'  -rdynamic -Wl,-export-dynamic     -lruby-static
-lcurses  -ldl -lcrypt -lm   -lc"
conftest.c: In function 't':
conftest.c:3: error: 'tgetnum' undeclared (first use in this function)
conftest.c:3: error: (Each undeclared identifier is reported only once
conftest.c:3: error: for each function it appears in.)
checked program was:
/* begin */
1: /*top*/
2: int main() { return 0; }
3: int t() { void ((*volatile p)()); p = (void ((*)()))tgetnum; return 0; }
/* end */

"gcc -o conftest -I../.. -I../../. -I../.././ext/readline  -g -O2
conftest.c  -L'../..'  -rdynamic -Wl,-export-dynamic     -lruby-static
-lcurses  -ldl -lcrypt -lm   -lc"
/usr/bin/ld: cannot find -lcurses
collect2: ld はステータス 1 で終了しました
checked program was:
/* begin */
1: /*top*/
2: int main() { return 0; }
3: int t() { tgetnum(); return 0; }
/* end */

--------------------

have_header: checking for readline/readline.h... -------------------- no

"gcc -E -I../.. -I../../. -I../.././ext/readline  -g -O2  conftest.c
-o conftest.i"
conftest.c:1:31: error: readline/readline.h: No such file or directory
checked program was:
/* begin */
1: #include <readline/readline.h>
/* end */

--------------------

have_header: checking for editline/readline.h... -------------------- no

"gcc -E -I../.. -I../../. -I../.././ext/readline  -g -O2  conftest.c
-o conftest.i"
conftest.c:1:31: error: editline/readline.h: No such file or directory
checked program was:
/* begin */
1: #include <editline/readline.h>
/* end */

--------------------
=============================================================================================================


readline  の 情報は
 dpkg -l | grep readline
として、
ii  libreadline-ruby1.8   1.8.5-4ubuntu2   Readline interface for Ruby 1.8
ii  libreadline5           5.2-2ubuntu1     GNU readline and history
libraries, run-time libraries
ii  libreadline5-dev       5.2-2ubuntu1     GNU readline and history
libraries, development files
ii  readline-common        5.2-2ubuntu1     GNU readline and history
libraries, common files

と表示されたので入っているかと思いますが、わからないことも多いので、まちがっていたらごめんなさい。

$ gzip -dc ruby-1.8.6.tar.gz | tar xf -
$ cd ruby-1.8.6
$ ./configure
$ make
$ make test
$ sudo make install

としました。

In This Thread