LinuxでRMeCabのインストールが失敗します

アールメカブ フォーラム RMeCab LinuxでRMeCabのインストールが失敗します

  • このトピックには3件の返信、2人の参加者があり、最後にishidaにより6年、 7ヶ月前に更新されました。
4件の投稿を表示中 - 1 - 4件目 (全4件中)
  • 投稿者
    投稿
  • #834
    Hosaka
    ゲスト

    AmazonLinux上で
    mecabのバージョン0.996をインストールした後にRMeCabをインストールしようとしたら失敗します。

    失敗インストールのログは以下です。

    > sudo R -e ‘install.packages(“RMeCab”, repos=”http://rmecab.jp/R”, type = “source”)’

    R version 3.2.2 (2015-08-14) — “Fire Safety”
    Copyright (C) 2015 The R Foundation for Statistical Computing
    Platform: x86_64-redhat-linux-gnu (64-bit)

    R is free software and comes with ABSOLUTELY NO WARRANTY.
    You are welcome to redistribute it under certain conditions.
    Type ‘license()’ or ‘licence()’ for distribution details.

    Natural language support but running in an English locale

    R is a collaborative project with many contributors.
    Type ‘contributors()’ for more information and
    ‘citation()’ on how to cite R or R packages in publications.

    Type ‘demo()’ for some demos, ‘help()’ for on-line help, or
    ‘help.start()’ for an HTML browser interface to help.
    Type ‘q()’ to quit R.

    > install.packages(“RMeCab”, repos=”http://rmecab.jp/R”, type = “source”)
    Installing package into ‘/usr/lib64/R/library’
    (as ‘lib’ is unspecified)
    trying URL ‘http://rmecab.jp/R/src/contrib/RMeCab_0.99991.tar.gz’
    Content type ‘application/x-gzip’ length 57192 bytes (55 KB)
    ==================================================
    downloaded 55 KB

    * installing *source* package ‘RMeCab’ …
    ** libs
    g++ -m64 -I/usr/include/R -DNDEBUG -I. -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector –param=ssp-buffer-size=4 -m64 -mtune=generic -c RMeCab.cpp -o RMeCab.o
    RMeCab.cpp: In function ‘char* meisiCode()’:
    RMeCab.cpp:73:70: warning: narrowing conversion of ‘229’ from ‘int’ to ‘const char’ inside { } is ill-formed in C++11 [-Wnarrowing]
    const char meisi_utf8[] = {0xe5, 0x90, 0x8d, 0xe8, 0xa9, 0x9e, 0}; //名詞
    ^
    RMeCab.cpp:73:70: warning: narrowing conversion of ‘144’ from ‘int’ to ‘const char’ inside { } is ill-formed in C++11 [-Wnarrowing]
    RMeCab.cpp:73:70: warning: narrowing conversion of ‘141’ from ‘int’ to ‘const char’ inside { } is ill-formed in C++11 [-Wnarrowing]
    RMeCab.cpp:73:70: warning: narrowing conversion of ‘232’ from ‘int’ to ‘const char’ inside { } is ill-formed in C++11 [-Wnarrowing]
    RMeCab.cpp:73:70: warning: narrowing conversion of ‘169’ from ‘int’ to ‘const char’ inside { } is ill-formed in C++11 [-Wnarrowing]
    RMeCab.cpp:73:70: warning: narrowing conversion of ‘158’ from ‘int’ to ‘const char’ inside { } is ill-formed in C++11 [-Wnarrowing]
    RMeCab.cpp: In function ‘char* keiyouCode()’:
    RMeCab.cpp:104:11: warning: narrowing conversion of ‘229’ from ‘int’ to ‘const char’ inside { } is ill-formed in C++11 [-Wnarrowing]
    0}; //形容詞
    ^
    RMeCab.cpp:104:11: warning: narrowing conversion of ‘189’ from ‘int’ to ‘const char’ inside { } is ill-formed in C++11 [-Wnarrowing]
    RMeCab.cpp:104:11: warning: narrowing conversion of ‘162’ from ‘int’ to ‘const char’ inside { } is ill-formed in C++11 [-Wnarrowing]
    RMeCab.cpp:104:11: warning: narrowing conversion of ‘229’ from ‘int’ to ‘const char’ inside { } is ill-formed in C++11 [-Wnarrowing]
    RMeCab.cpp:104:11: warning: narrowing conversion of ‘174’ from ‘int’ to ‘const char’ inside { } is ill-formed in C++11 [-Wnarrowing]
    RMeCab.cpp:104:11: warning: narrowing conversion of ‘185’ from ‘int’ to ‘const char’ inside { } is ill-formed in C++11 [-Wnarrowing]
    RMeCab.cpp:104:11: warning: narrowing conversion of ‘232’ from ‘int’ to ‘const char’ inside { } is ill-formed in C++11 [-Wnarrowing]
    RMeCab.cpp:104:11: warning: narrowing conversion of ‘169’ from ‘int’ to ‘const char’ inside { } is ill-formed in C++11 [-Wnarrowing]
    RMeCab.cpp:104:11: warning: narrowing conversion of ‘158’ from ‘int’ to ‘const char’ inside { } is ill-formed in C++11 [-Wnarrowing]
    RMeCab.cpp: In function ‘char* kigoCode()’:
    RMeCab.cpp:127:69: warning: narrowing conversion of ‘232’ from ‘int’ to ‘const char’ inside { } is ill-formed in C++11 [-Wnarrowing]
    const char kigo_utf8[] = {0xe8, 0xa8, 0x98, 0xe5, 0x8f, 0xb7, 0}; //記号
    ^
    RMeCab.cpp:127:69: warning: narrowing conversion of ‘168’ from ‘int’ to ‘const char’ inside { } is ill-formed in C++11 [-Wnarrowing]
    RMeCab.cpp:127:69: warning: narrowing conversion of ‘152’ from ‘int’ to ‘const char’ inside { } is ill-formed in C++11 [-Wnarrowing]
    RMeCab.cpp:127:69: warning: narrowing conversion of ‘229’ from ‘int’ to ‘const char’ inside { } is ill-formed in C++11 [-Wnarrowing]
    RMeCab.cpp:127:69: warning: narrowing conversion of ‘143’ from ‘int’ to ‘const char’ inside { } is ill-formed in C++11 [-Wnarrowing]
    RMeCab.cpp:127:69: warning: narrowing conversion of ‘183’ from ‘int’ to ‘const char’ inside { } is ill-formed in C++11 [-Wnarrowing]
    RMeCab.cpp: In function ‘SEXPREC* collocate(SEXP, SEXP, SEXP, SEXP)’:
    RMeCab.cpp:2879:33: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    while( (z + y) <= vec1.size()){// node後の語の処理
    ^
    g++ -m64 -shared -L/usr/lib64/R/lib -L/usr/local/lib64 -o RMeCab.so RMeCab.o -L/usr/local/lib -lmecab -L/usr/lib64/R/lib -lR
    installing to /usr/lib64/R/library/RMeCab/libs
    ** R
    ** preparing package for lazy loading
    ** help
    *** installing help indices
    converting help for package ‘RMeCab’
    finding HTML links … done
    Ngram html
    NgramDF html
    NgramDF2 html
    RMeCabC html
    RMeCabDF html
    RMeCabDoc html
    RMeCabFreq html
    RMeCabMx html
    RMeCabText html
    coOccurrence html
    collScores html
    collocate html
    docDF html
    docMatrix html
    docMatrix2 html
    docMatrixDF html
    docNgram html
    docNgram2 html
    docNgramDF html
    print.docMatrix html
    rmSign html
    weights html
    ** building package indices
    ** testing if installed package can be loaded
    Error in dyn.load(file, DLLpath = DLLpath, …) :
    unable to load shared object ‘/usr/lib64/R/library/RMeCab/libs/RMeCab.so’:
    libmecab.so.2: cannot open shared object file: No such file or directory
    Error: loading failed
    Execution halted
    ERROR: loading failed
    * removing ‘/usr/lib64/R/library/RMeCab’

    The downloaded source packages are in
    ‘/tmp/Rtmp4lDiEB/downloaded_packages’
    Updating HTML index of packages in ‘.Library’
    Making ‘packages.html’ … done
    Warning message:
    In install.packages(“RMeCab”, repos = “http://rmecab.jp/R&#8221;, type = “source”) :
    installation of package ‘RMeCab’ had non-zero exit status
    >
    >

    sessionInfo()の結果は以下です。

    > sessionInfo()
    R version 3.2.2 (2015-08-14)
    Platform: x86_64-redhat-linux-gnu (64-bit)
    Running under: Amazon Linux AMI 2015.09

    locale:
    [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
    [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
    [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
    [7] LC_PAPER=en_US.UTF-8 LC_NAME=C
    [9] LC_ADDRESS=C LC_TELEPHONE=C
    [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

    attached base packages:
    [1] stats graphics grDevices utils datasets methods base

    何か間違っておりますでしょうか?また何か足りない情報がありましたらお知らせください。

    #835
    ishida
    キーマスター

    AmazonLinux を使ったことがないのですが、libmecab.so がないというメッセージがあるようなので、インストールされたというMeCabのライブラリの位置が認識できていないようです。以下、通常のLinux環境からの推測で書きます。間違っているかもしれませんので、ご注意ください。

    libmecab.so がどこにインストールされているのか分からないのですが、/usr/local/lib あたりにないでしょうか?以下で確認してみてください。

    
    $ ls -la /usr/local/lib/libmecab*
    

    また /etc/ld.so.conf というファイルがないでしょうか。あれば、中身を確認し、/usr/local/lib が記載されているか確認します。恐らく無いと思うので、追記します。
    例えば以下のようにします。

    
    sudo echo "/usr/local/lib >> /etc/ld.so.conf
    

    その上で以下を実行してみてください。

    
    $ ldconfig
    
    • この返信は6年、 7ヶ月前にishidaが編集しました。
    • この返信は6年、 7ヶ月前にishidaが編集しました。
    • この返信は6年、 7ヶ月前にishidaが編集しました。
    #839
    Hosaka
    ゲスト

    こちらご指摘のように
    /usr/local/lib
    をライブラリパスに指定しましたら、解決してうまくインストールできました。
    ありがとうございました。

    AmazonLinuxなどのCentOS系は/usr/local/libがライブラリパスに入っていない事があるようで、その場合は入れる設定をしてあげたら、うまくインストールできるようでした。

    #840
    ishida
    キーマスター

    AmazonLinux は CentOS系なのですね。情報ありがとうございました。

4件の投稿を表示中 - 1 - 4件目 (全4件中)
  • フォーラム「RMeCab」には新規投稿および返信を追加できません。