
Ubuntu日本語フォーラム
ログインしていません。
Higuchiと申します。
ここ数年間Ubuntu16.04 LTSを使用して、octopusコードやquantum-espressoコードで第一原理計算を行ってきました。計算は今まで何の問題もなく出来ていました。Ubuntu 18.04.1 LTSへのアップグレードの案内が来たので、アップグレードしたところ、下記エラーが出て計算ができなくなりました。対処法をご存知の方がいらっしゃいましたら教えてください。よろしくお願い致します。
(1)エラーの内容は下記です。
Error while loading shared libraries: libxc.so.1 cannot open shared object file: no such file or directory.
(2)そこでlibxc.so.1というファイルの所在を確かめましたが、同名のファイルはありませんでした。似たようなファイルとしては下記がありました。
libxc-dev usr/share/doc
libxc.so usr/lib/x86_64-linux-gnu
libxc.so.4 usr/ lib/x86_64-linux-gnu
libxc.so.4.0.0 usr/lib/x86_64-Linux-gnu
(3).bashrcに下記パスを入れてみましたが、結果は同じでした。
export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/:$LD_LIBRARY_PATH octopus
(4)ちなみにパソコンの仕様は下記です。
Ubuntu 18.04.1 LTS (従来Ubuntu 16.04 LTS)
メモリ 31.3 GiB
プロセッサ Intel core TM [email protected]×4
グラフィック Quadro K620/PCle/SSE2
GNOME 3.28.2
OSの種類 64ビット
ディスク 483.8 GB
SSD (Samsung SSD 850 EVO Serious 500GB)
パソコンのメーカー BPOパソコンでSTORM社製です。品名はStorm Linux Box Mini Tower Quadro SPで、2015年6月に購入しました。
オフライン
両方とも再度
./configure make all
したほうが良いのではないかと思いますが。
オフライン
array様
Higuchiです。
早速コメントを戴きありがとうございます。
./configureしたところ、
configure: error: Could not find required libxc library ( >= v 2.0.0).
というエラーメッセージが出てきました。
以下が./configureの結果です。エラーは1ケ所のみで、最後から2行目のところに出ています。
最後から2-4行に何かヒントがありそうですが、どうすれば良いかが分かりません。
教えてください。よろしくお願い致します。
user@user-desktop:~$ cd /home/user/octopus-4.1.2/octopus-4.1.2
user@user-desktop:~/octopus-4.1.2/octopus-4.1.2$ ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking whether ln -s works... yes
checking whether make sets $(MAKE)... (cached) yes
checking for ranlib... ranlib
checking for bison... no
checking for byacc... no
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking dependency style of gcc... gcc3
checking for inline... inline
checking for C/C++ restrict keyword... __restrict
checking for __builtin_prefetch... yes
checking for dirent.h that defines DIR... yes
checking for library containing opendir... none required
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking signal.h usability... yes
checking signal.h presence... yes
checking for signal.h... yes
checking errno.h usability... yes
checking errno.h presence... yes
checking for errno.h... yes
checking for size_t... yes
checking for working alloca.h... yes
checking for alloca... yes
checking for an ANSI C-conforming const... yes
checking for pid_t... yes
checking for size_t... (cached) yes
checking whether time.h and sys/time.h may both be included... yes
checking size of void*... 8
checking size of size_t... 8
checking for uint32_t... yes
checking for uint64_t... yes
checking size of unsigned int... 4
checking size of unsigned long... 8
checking size of unsigned long long... 8
checking whether gcc needs -traditional... no
checking whether lstat correctly handles trailing slash... yes
checking whether stat accepts an empty string... no
checking for gettimeofday... yes
checking for strndup... yes
checking for tcgetpgrp... yes
checking for scandir... yes
checking for alphasort... yes
checking for sigaction... yes
checking for readdir... yes
checking for closedir... yes
checking for strchr... yes
checking for strtod... yes
checking for perror... yes
checking for strcasestr... yes
checking for sbrk... yes
checking for getopt_long... yes
checking for uname... yes
checking for ioctl... yes
checking papi.h usability... no
checking papi.h presence... no
checking for papi.h... no
checking for PAPI_library_init... no
checking whether the compiler accepts the __m128d type... yes
checking whether FMA4 instructions can be used... no
checking whether the compiler accepts the __m256d type... yes
checking whether AVX instructions can be used... no
configure: Architecture-specific code:
***************************
This is a x86_64 processor:
vectorial code: yes (sse2)
***************************
checking whether NEWUOA is enabled... no
checking for perl... /usr/bin/perl
checking for xlf90... no
checking for f90... no
checking for pgf90... no
checking for pghpf... no
checking for epcf90... no
checking for gfortran... gfortran
checking whether we are using the GNU Fortran compiler... yes
checking whether gfortran accepts -g... yes
checking for Fortran flag to compile .f90 files... none
configure: Using FCFLAGS="-pipe -O3 -funroll-loops -ffast-math -ffree-line-length-none"
checking how to get verbose linking output from gfortran... -v
checking for Fortran libraries of gfortran... -L/usr/lib/gcc/x86_64-linux-gnu/7 -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/7/../../.. -lgfortran -lm -lquadmath
checking for dummy main to link with Fortran libraries... none
checking for Fortran name-mangling scheme... lower case, underscore, no extra underscore
checking for the size of a Fortran integer... 4 bytes
checking for which C type corresponds to Fortran integer... int
checking for flush... yes
checking for Fortran sizeof intrinsic... yes
checking for loc... yes
checking whether the compiler accepts very long lines... yes
checking whether the compiler accepts "line-number" lines cast by the preprocessor... yes
checking how to access command line arguments... Fortran 2003
checking for Fortran 2003 c_ptr type... yes
checking fortran 90 modules inclusion flag... -I
**********************************************
*** octopus + utilities will be generated
**********************************************
checking for libxc... no (-I/usr/include -lxc)
no (-I/usr/include -L/lib -lxc)
configure: error: Could not find required libxc library ( >= v 2.0.0).
user@user-desktop:~/octopus-4.1.2/octopus-4.1.2$
オフライン
octopusのバージョンが古すぎるのではないでしょうか。
私の環境でも4.1.2はconfigureでlibxcのエラーが出ましたが、
6.0、7.2、8.2は大丈夫なようです。
array による投稿:
多分、Octpusはこれだとおもうんですが、これならdebがあるのでそのままインストールすれば良いのでは?
debファイルはOctopus 5.0までしかないみたいです。
それもUbuntu 14.04用ですし。
オフライン
aaabbbcccdddeeefffggghhh様
array様
Higuchiです。
色々と教えて頂きありがとうございます。
octopusのバージョンが古すぎるのでは? とのことだったので、octopus-6.0をインストールしてみました。
しかし結果は同じで、runしたところ、下記エラーがでました。
Error while loading shared libraries: libxc.so.1 cannot open shared object file: no such file or directory.
初心者のため、octopus-6.0がちゃんとインストールされていないかも知れません。
どういう情報を報告すべきかも良く分かっていません。
必要な情報がありましたら教えてください。
よろしくお願い致します。
それから、octopus やquantum-espressoのことをちゃんと書かず申し訳ありませんでした。
Octopusはarray様が示されたものです。
Quantum-Espressoは、フリーの平面波擬ポテンシャル法による第一原理計算プログラムです。(http://www.quantum-espresso.org/) このプログラムを使って結晶やガラス等の固体物質の第一原理計算を行うことができます。
オフライン
Higuchi による投稿:
octopusのバージョンが古すぎるのでは? とのことだったので、octopus-6.0をインストールしてみました。
しかし結果は同じで、runしたところ、下記エラーがでました。
Error while loading shared libraries: libxc.so.1 cannot open shared object file: no such file or directory.
では端末で以下の二つのコマンドを実行してから、octopusを実行してみてください。
cd /usr/lib/x86_64-linux-gnu/
sudo ln -s libxc.so.4.0.0 libxc.so.1
オフライン
余談ですが、私の環境 (Ubuntu 18.10) で octopus-6.0 を ./configure、make、sudo make install した場合、libxc.so.4 をリンクするため、
Higuchi による投稿:
Error while loading shared libraries: libxc.so.1 cannot open shared object file: no such file or directory.
というエラーは出ないようです。
~/Downloads/octopus-6.0$ ldd /usr/local/bin/octopus linux-vdso.so.1 (0x00007ffd73fdb000) libfftw3.so.3 => /usr/lib/x86_64-linux-gnu/libfftw3.so.3 (0x00007f1463e31000) liblapack.so.3 => /usr/lib/x86_64-linux-gnu/liblapack.so.3 (0x00007f1463797000) libblas.so.3 => /usr/lib/x86_64-linux-gnu/libblas.so.3 (0x00007f146372a000) libgsl.so.23 => /usr/lib/x86_64-linux-gnu/libgsl.so.23 (0x00007f14634b0000) libgfortran.so.5 => /usr/lib/x86_64-linux-gnu/libgfortran.so.5 (0x00007f1463235000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f14630a8000) libxcf90.so.4 => /usr/lib/x86_64-linux-gnu/libxcf90.so.4 (0x00007f14630a0000) libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f1463086000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f1462e9c000) libgslcblas.so.0 => /usr/lib/x86_64-linux-gnu/libgslcblas.so.0 (0x00007f1462e5b000) libquadmath.so.0 => /usr/lib/x86_64-linux-gnu/libquadmath.so.0 (0x00007f1462e19000) /lib64/ld-linux-x86-64.so.2 (0x00007f1464e3b000) libxc.so.4 => /usr/lib/x86_64-linux-gnu/libxc.so.4 (0x00007f1462d06000)
オフライン
aaabbbcccdddeeefffggghhh様
Higuchiです。
お忙しい中、色々と教えて頂きありがとうございます。
(1) 端末で以下の二つのコマンドを実行して、octopusを実行
********************************
cd /usr/lib/x86_64-linux-gnu/
sudo ln -s libxc.so.4.0.0 libxc.so.1
********************************
⇒ 教えに従い実行しましたところ、
Error while loading shared libraries: libxc.so.1 cannot open shared object file: no such file or directory.
というエラーは出なくなりました。
しかし、
******************************************************
symbol lookup error: octopus: undefined symbol: xc_f90_func_init_
******************************************************
という新たなエラーが出るようになりました。libxcに関するエラーのようです。
エラーの内容は下記です。
********************************************
Running octopus
Version : 4.1.2
Revision : 11533 [vxc_inc.F90 2013-11-18]
Build time : Sat Jun 6 16:09:21 JST 2015
Configuration options : max-dim=3 sse2
Optional libraries :
Architecture : x86_64
C compiler : gcc
C compiler flags : -O3 -I/usr/include
Fortran compiler : gfortran
Fortran compiler flags : -O3
The octopus is swimming in user-desktop (Linux)
Calculation started on 2018/11/04 at 16:44:29
************************** Calculation Mode **************************
Input: [CalculationMode = gs]
**********************************************************************
Reading Coordinates from Coordinates block
****************************** Species *******************************
Reading pseudopotential from file:
'/home/user/octopus-4.1.2/octopus-4.1.2/share/octopus/PP/PSF/C.psf'
Calculating atomic pseudo-eigenfunctions for species C ....
octopus: symbol lookup error: octopus: undefined symbol: xc_f90_func_init_
user@user-desktop:~/octopus-4.1.2/octopus-4.1.2/TEST1$ octopus > out.log
octopus: symbol lookup error: octopus: undefined symbol: xc_f90_func_init_
user@user-desktop:~/octopus-4.1.2/octopus-4.1.2/TEST1$
**************************************************************
(2)余談ですが、aaabbbcccdddeeefffggghhh様の環境 (Ubuntu 18.10) で octopus-6.0 を ./configure、make、sudo make install した場合、libxc.so.4 をリンクするため、
Error while loading shared libraries: libxc.so.1 cannot open shared object file: no such file or directory.
というエラーは出ないようです。
⇒octopus-6.0をインストールしたつもりでいましたが、実際にはインストールされていませんでした。頑張ってみます。
オフライン
Higuchi による投稿:
しかし、
******************************************************
symbol lookup error: octopus: undefined symbol: xc_f90_func_init_
******************************************************
という新たなエラーが出るようになりました。libxcに関するエラーのようです。
駄目でしたか…。
ではOctopus 6.0以降をmakeし直してみてください。
ちなみに私がmakeを行った手順は以下の通りです。
sudo apt install make g++ libxc-dev fftw-dev libblas-dev liblapack-dev libgsl-dev gfortran libfftw3-dev
tar xavf octopus-6.0.tar.gz
cd octopus-6.0/
./configure
make
sudo make install
オフライン
aaabbbcccdddeeefffggghhh様
Higuchiです。
教えて頂いた方法でoctopus-6.0をインストールし、簡単なプログラムを流してみました。
結果はOKです。
お忙しい中、親切に教えて頂き本当にありがとうございました。
今後ともご指導の程、よろしくお願いいたします。
教えて頂いた方法と、私が今までやっていた方法を下記してみました。
何が間違っていたのか知っておきたいと思います。
もし時間が取れた時で結構ですので、教えて頂ければと思っています。
(急いではいません。)
[A] Ubuntu 18.04.1 LTSにoctopus-6.0をインストール
<<< aaabbbcccdddeeefffggghhh様の方法 >>>
[1] sudo apt install make g++ libxc-dev fftw-dev libblas-dev liblapack-dev libgsl-dev gfortran libfftw3-dev
[2] tar xavf octopus-6.0.tar.gz
[3] cd octopus-6.0/
[4] ./configure
[5] make
[6] sudo make install
[b] Ubuntu 16.04 LTSにoctopus-4.0.1をインストール
<<< Higuchiの方法 >>
[1] gfortran, gcc, make, automake, m4, libtool, libgsl0-dev, libblas-dev, liblapack-dev, およびlibfftw3-dev, cl-fftw3, libsl0-dev, およびlibxc-devをubuntu software centerより入手。
[2] tar xavf octopus-4.0.1.tar.gz
[3] cd octopus-4.0.1/
[4] ./configure --prefix=`pwd` CC=gcc FC=gfortran FCCPP="/lib/cpp -ansi" FCFLAGS=-O3 CFLAGS=-O3
[5] make
[6] sudo make install
***備考***
aaabbbcccdddeeefffggghhh様とHiguchiでは、
[1] g++, fftw-dev, libqsl-dev
[4] ./configure
が違うような気がします。
オフライン
手順自体に問題は無いように思います。
今回の件をまとめますと、
1.) Ubuntu 16.04では動いていたoctopus-4が、Ubuntu 18.04にアップグレードしたら動かなくなった。なぜか?
2.) octopus-4がエラーを出して動かなくなったのは、動作に必要なlibxcがアップグレードされたため (libxc.so.1 → libxc.so.4)
3.) libxc.so.1という名前でlibxc.so.4へのシンボリックリンクを作成してもoctopus-4は動かない
4.) libxc.so.1を16.04から18.04にコピーしたり、18.04で古いlibxcをmakeしてインストールする方法もあるが、古いライブラリが18.04で正常に動作する保証は無い
5.) ゆえにoctopus-4を18.04でmakeし直してlibxc.so.4を使用するようにする必要があるが、octopus-4が古すぎる (4.1.0は2013年6月リリース) からか、18.04ではmakeできない
6.) どうしようもないのでoctopusのバージョンを上げ、octopus-6.0 (2016年9月リリース) を18.04でmakeして解決
という事になると思います。
Higuchi による投稿:
[1] g++, fftw-dev, libqsl-dev
[4] ./configure
が違うような気がします。
g++に関しては、cl-fftw3をインストールすると依存関係でg++も一緒にインストールされるので問題ありません。
libgsl-devは元々、Ubuntu 14.04まではlibgsl0-devという名前で、16.04以降はlibgsl-devという名前に変更され、古い方のlibgsl0-devをインストールしようとすると、新しい方のlibgsl-devがインストールされるようになっているので問題ありません。
fftw-devに関してですが、これはfftw2関連のパッケージなので、私が間違えてインストールしただけのような気がします。すみません。
./configureに関しては私は何もオプションを付けませんでしたが、
Higuchi による投稿:
CC=gcc FC=gfortran FCCPP="/lib/cpp -ansi"
この部分に関しては恐らく違いは無いと思います。
Higuchi による投稿:
--prefix=`pwd`
これはインストール先の指定で、指定しないと /usr/local 以下にインストールされるようになっているので、インストール先の都合が悪い場合は上記オプションを付けてmakeし直してみてください。
Higuchi による投稿:
CFLAGS=-O3
これは最適化に関するオプションですが、octopus-6.0のデフォルトのオプションはCFLAGS=-O2になっているようなので、ひょっとしたらoctopusの実行速度に差が出るかもしれません。以前と比べて実行速度に問題があるようでしたら、このオプションを付けてmakeし直してみてください。
オフライン
aaabbbcccdddeeefffggghhh様
Higuchiです。
今回の問題に関するまとめ、私の質問に対する回答、すべて論理的に説明していただき良い勉強になります。
本当にありがとうございました。
そういえば、aaabbbcccdddeeefffggghhh様には2016年2月にも "Synapic パッケージマネージャでlibopenmpi-devをインストールしようとしましたが、上手く行きません" でもお世話になりました。
重ね重ねお礼申し上げます。
ありがとうございました。
オフライン