2012-02-23 17 views
0

SageはCythonを使ってコンパイルされたコードを作成できるはずです。私はこれを一度も動かすことはできませんでした。私のSageのインストールでは問題があるようです。コンパイルが失敗したためです。私はインストール中に何か特別なことをしたとは思わないが、明らかに私は何か間違っている。Sageがコードをコンパイルしないのはなぜですか?

Compiling ./factorial.spyx... Error compiling cython file: Error compiling ./factorial.spyx: running build running build_ext building '_home_oliver_Desktop_sage_4_7_1_linux_32bit_ubuntu_10_04_lts_i686_Linux_examples_programming_sagex_factorial_spyx_0' extension creating build creating build/temp.linux-i686-2.6 gcc -fno-strict-aliasing -g -O2 -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -I/home/oliver/Desktop/sage-4.7.1-linux-32bit-ubuntu_10.04_lts-i686-Linux/local/include/csage/ -I/home/oliver/Desktop/sage-4.7.1-linux-32bit-ubuntu_10.04_lts-i686-Linux/local/include/ -I/home/oliver/Desktop/sage-4.7.1-linux-32bit-ubuntu_10.04_lts-i686-Linux/local/include/python2.6/ -I/home/oliver/Desktop/sage-4.7.1-linux-32bit-ubuntu_10.04_lts-i686-Linux/local/lib/python2.6/site-packages/numpy/core/include -I/home/oliver/Desktop/sage-4.7.1-linux-32bit-ubuntu_10.04_lts-i686-Linux/devel/sage/sage/ext/ -I/home/oliver/Desktop/sage-4.7.1-linux-32bit-ubuntu_10.04_lts-i686-Linux/devel/sage/ -I/home/oliver/Desktop/sage-4.7.1-linux-32bit-ubuntu_10.04_lts-i686-Linux/devel/sage/sage/gsl/ -I. -I/home/oliver/Desktop/sage-4.7.1-linux-32bit-ubuntu_10.04_lts-i686-Linux/local/include/python2.6 -c _home_oliver_Desktop_sage_4_7_1_linux_32bit_ubuntu_10_04_lts_i686_Linux_examples_programming_sagex_factorial_spyx_0.c -o build/temp.linux-i686-2.6/_home_oliver_Desktop_sage_4_7_1_linux_32bit_ubuntu_10_04_lts_i686_Linux_examples_programming_sagex_factorial_spyx_0.o -w -O2 creating build/lib.linux-i686-2.6 gcc -pthread -shared build/temp.linux-i686-2.6/_home_oliver_Desktop_sage_4_7_1_linux_32bit_ubuntu_10_04_lts_i686_Linux_examples_programming_sagex_factorial_spyx_0.o -L/home/oliver/Desktop/sage-4.7.1-linux-32bit-ubuntu_10.04_lts-i686-Linux/local//lib/ -L/home/wstein/build/sage-4.7.1/local/lib -lmpfr -lgmp -lgmpxx -lstdc++ -lpari -lm -lcurvesntl -lg0nntl -ljcntl -lrankntl -lgsl -lgslcblas -latlas -lntl -lcsage -lpython2.6 -o build/lib.linux-i686-2.6/_home_oliver_Desktop_sage_4_7_1_linux_32bit_ubuntu_10_04_lts_i686_Linux_examples_programming_sagex_factorial_spyx_0.so -L/home/oliver/Desktop/sage-4.7.1-linux-32bit-ubuntu_10.04_lts-i686-Linux/local//lib

/usr/bin/ld: cannot find -lstdc++ collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1

任意の提案:私は、私は次のメッセージを取得しようとするとSage tutorial

In order to make your own compiled Sage code, give the file an .spyx extension (instead of .sage). If you are working with the command-line interface, you can attach and load compiled code exactly like with interpreted code (at the moment, attaching and loading Cython code is not supported with the notebook interface). The actual compilation is done “behind the scenes” without your having to do anything explicit. See $SAGE_ROOT/examples/programming/sagex/factorial.spyx for an example of a compiled implementation of the factorial function that directly uses the GMP C library. To try this out for yourself, cd to $SAGE_ROOT/examples/programming/sagex/, then do the following:

sage: load "factorial.spyx" 

言いますか?ありがとう。

+0

(1)通常、-lstdC++を呼び出すC++コードをコンパイルできますか? (2)/ home/wstein /は経路上にあるべきではありませんが、私は通常、いくつかのrepointingを行うソースビルドで作業します。 – DSM

+0

ありがとうございます。それはまさに私が聞く必要があったものでした。 g ++ - multilibを再インストールしたところ、うまくいきました。 – Oliver

+3

それを聞いてうれしいです。 2つのメモ:最初に、あなたは答えとしてあなたのコメントを書いてそれを受け入れることができます。第二に、ask.sagemath.orgでより具体的なSageのヘルプを得ることができます。ここでかなりの数の開発者が出かけています。 – DSM

答えて

1

DSMのコメントごとに、g ++ - multilibを再インストールしましたが、すべて正常に動作します。

関連する問題