日曜日, 12月 17, 2017

フリーの最適化ソフト DAKOTAをFedora24にインストール

cmake -DCMAKE_INSTALL_PREFIX=/usr/local/dakota /home/.../dakota-6.7.0.src
という感じでインストールを試したところ

CMake Error at CMakeLists.txt:245 (enable_language):
  No CMAKE_CXX_COMPILER could be found.
  Tell CMake where to find the compiler by setting either the environment
  variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
  to the compiler, or to the compiler name if it is in the PATH.
というエラーが出てうまくいきません。
そこで
sudo yum install gcc-c++
を実行して
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/dakota /home/.../dakota-6.7.0.src -CMAKE_CXX_COMPILER=/usr/bin/g++
を試してみると、今度は
CMake Error at CMakeLists.txt:315 (find_package):
  Could not find a package configuration file provided by "LAPACK" with any
  of the following names:
    LAPACKConfig.cmake
    lapack-config.cmake
  Add the installation prefix of "LAPACK" to CMAKE_PREFIX_PATH or set
  "LAPACK_DIR" to a directory containing one of the above files.  If "LAPACK"
  provides a separate development package or SDK, be sure it has been
  installed.
というエラーが出てしまいます。そこでliblapack.so.3gf(シンボリックリンク)があるのが/usr/lib
なので
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/dakota /home/.../dakota-6.7.0.src -CMAKE_CXX_COMPILER=/usr/bin/g++ -CMAKE_LAPACK_DIR=/usr/lib
を試してみると、だいぶ進みますが
CMake Error at packages/external/teuchos/cmake/tribits/modules/FindPythonInterp.cmake:119 (IF):
  if given arguments:
    "VERSION_LESS" "2.4"
  Unknown arguments specified
というエラーが出ます。
を参考に
dakota-6.7.0.src/ackages/external/teuchos/cmake/tribits/modules/FindPythonInterp.cmake
を修正します。
今度は
CMake Error at packages/external/teuchos/cmake/tribits/package_arch/TribitsTplDeclareLibraries.cmake:342 (MESSAGE):
  Could not find the BLAS Library! Please manually set BLAS_LIBRARY_DIRS
  and/or BLAS_LIBRARY_NAMES or just TPL_BLAS_LIBRARIES to point to the BLAS
  libraries!
というエラーが出ます。

そこで~/.bashrcに
export BLAS_LIBS=/usr/lib
export LAPACK_LIBS=/usr/lib
と記述して
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/dakota /home/hiromitsu/Simulation/dakota-6.7.0.src -CMAKE_CXX_COMPILER=/usr/bin/g++ -CMAKE_LAPACK_DIR=/usr/lib/ -DBLAS_LIBS=/usr/lib/libblas.so.3gf.0 -DLAPACK_LIBS=/usr/lib/liblapack.so.3gf.0
と実行すると、さらに進みますが

CMake Error at packages/external/acro/packages/colin/CMakeLists.txt:11 (message):
   Cannot build colin without Boost.  Please enable USE_BOOST and set Boost_INCLUDE_DIR

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
Boost_INCLUDE_DIR (ADVANCED)
というエラーが出ます。

今日はここまで。。。

フリーの最適化ソフト DAKOTAをFedora24にインストール(事前準備)

http://mogura7.zenno.info/~et/wordpress/ocse/?p=871#more-871
を参考に、事前準備を実施。

Boostは上記サイトにあるようにインストールできるが、
BLAS, LAPACKは
動的ライブラリ(*.so)が必要とのこと。

そこで
https://qiita.com/AnchorBlues/items/69c1744de818b5e045ab
にある手順をベースにしつつも
make.incのgfortranでのコンパイルオプションに
-fPICを追加してコンパイル。

コンパイル後、
BLAS/SRC/で
gfortran -shared -lpthread -lgomp -o libblas.so *.o
sudo ln -s /home/.../lapack-3.8.0/BLAS/SRC/libblas.so /usr/lib/libblas.so.3gf.0

SRC/で
gfortran -shared -lpthread -lgomp -o liblapack.so *.o
sudo ln -s  /home/.../lapack-3.8.0/SRC/liblapack.so /usr/lib/liblapack.so.3gf
を実行
https://qiita.com/_akisato/items/d5de60e38b5a69387bde
を参考にしてみた)。

ただし、まだ正しく*.soが作成できたかは不明。
これからDAKOTAのインストールを試してみる。

Fedora24用 gfortran rpmファイル

事情により再びFedoraで数値計算をする必要が出たが、
gfortranがyumでインストールできないため
下記サイトからrpmファイルをダウンロードして
インストール。

su
(パスワード入力)
rpm -ivh gcc-gfortran-6.3.1-1.fc24.x86_64.rpm
でインストール

http://rpm.pbone.net/index.php3/stat/4/idpl/39452465/dir/fedora_24/com/gcc-gfortran-6.3.1-1.fc24.x86_64.rpm.html

なんで最新版のFedoraではないかというと、既にインストール済で
その環境をそのまま使いたかったから。

火曜日, 11月 28, 2017

Athena++で並列計算

OpenMPIをインストールした後で
atheta++に関するconfigure実行時に、-mオプションを追加。

make実行時に
mpicxx: error while loading shared libraries: libopen-pal.so.20: cannot open shared object file: No such file or directory
といったエラーが出る場合は、
sudo ldconfig
を実行する。

ただし、現状では
src/outputs/athena_hdf5.cpp
のコンパイルでエラーが出てしまう。

Ubuntu 16.04でVisit+Athena++環境構築(その2)

./athena: error while loading shared libraries: libhdf5.so.101: cannot open shared object file: No such file or directory
というエラーが実行時に出た場合は、
~/.bashrcに
export LD_LIBRARY_PATH=/usr/local/hdf5/lib:$LD_LIBRARY_PATH
を追記して、
source ~/.bashrc
を実行してから再度athenaを実行する。

土曜日, 8月 12, 2017

Ubuntu 16.04でVisit+Athena++環境構築(その1)

1. まずはgitをインストール
sudo apt-get install git

2. Athena++をダウンロード
git clone https://github.com/PrincetonUniversity/athena-public-version

3. hdf5ライブラリをインストール
https://www.hdfgroup.org/downloads/hdf5/source-code/
からtar.gzをダウンロード

tar.gzを解凍。

解凍されたディレクトリに移動。

./configure --prefix=/usr/local/hdf5 --enable-fortran --enable-cxx
make -j8
make -j8 check
sudo make install
sudo make check-install

金曜日, 2月 24, 2017

pgplotインストール時のコンパイラ

g77だと
"リンクが完了しなかったのでリンカの入力ファイルは使われませんでした"
というメッセージがたくさん出てしまう。
なのでgfortranに変更する。

LORENEはlibcpgplot.aも使用するので
make cpg
も実行する。

月曜日, 2月 20, 2017

Fedora 24にGSLをインストール

rootで
yum install gsl
を実行。

しかし、libgsl.aが作成されないので、
https://na-inet.jp/na/gsl.html
を参考に、
http://www.ring.gr.jp/pub/GNU/gsl/
から gsl-2.1.tar.gzをダウンロードし、
% ./configure --prefix=/usr/local; make; su
# make install
を実行。

インストールが成功すると
/usr/local/lib/libgsl.a
ができる。

金曜日, 12月 30, 2016

Fedora 23でLORENEコードをインストール

64bit環境なので、まずは
Lorene/Local_settings_examples/local_settings_linux_gcc-4_x86-64

Lorene/local_settings
にコピー。

https://github.com/FFTW/fftw3
からzipファイルをダウンロード。
unzipで解凍して、
fftw3-master/api/fftw3.h

/usr/include/
にコピーする。

mkdir /user/include/gsl
を実行したのち、
https://github.com/ampl/gsl
からzipファイルをダウンロード。
unzipで解凍して、
gsl-master/
もしくは
gsl-master/specfunc/
にある
gsl_inline.h
gsl_precision.h
gsl_sf_result.h
gsl_mode.h
gsl_sf_bessel.h
gsl_types.h

/usr/include/gsl/
にコピーする。

最後に
Lorene/
でmakeを実行する。

月曜日, 12月 26, 2016

日曜日, 11月 06, 2016

dviファイルからpdfファイルに変換

dvips
でpsファイルに変換。

ps2pdf
でpdfファイルに変換。

Ubuntu14.04のpdfビューア

http://sicklylife.hatenablog.com/entry/2014/10/04/204523

evince

Ubuntu 14.04にlatexをインストール

http://qiita.com/ynakayama/items/706ae9e59c1b6fd3e3d2
を参考にインストール。

sudo apt-get -y install texlive # 本体
sudo apt-get -y install texlive-lang-cjk # 日本語版 (UTF8 対応)
sudo apt-get -y install xdvik-ja # プレビューを見るのに必要
sudo apt-get -y install dvipsk-ja # DVI から PostScript への変換用
sudo apt-get -y install gv #  Ghostscript 、 ps 形式の図を取り込んだ文書の作成用
sudo apt-get -y install texlive-fonts-recommended texlive-fonts-extra # TeX 用フォント
を実行。 

土曜日, 9月 03, 2016

Ubuntu16.04にTensorFlowをインストール

深層学習が流行りということで、
とりあえずライブラリ(TensorFlow)をインストールしてみる。

OSはUbuntu 16.04。

まずはAnaconda(Pythonのパッケージとのこと)をインストール。
http://pythondatascience.plavox.info/python%e3%81%ae%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab/anaconda-ubuntu-linux/

conda -V
を実行する前に
source ~/.bashrc
を実行すること。
もしくは新しいterminalを立ち上げてから実行する。

TensorFlow自体のインストールは下記サイトを参考に実行。
http://pythondatascience.plavox.info/tensorflow%E3%81%A7%E3%83%87%E3%82%A3%E3%83%BC%E3%83%97%E3%83%A9%E3%83%BC%E3%83%8B%E3%83%B3%E3%82%B0/ubuntu-linux%E3%81%AB%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB/

木曜日, 8月 18, 2016

IllinoisGRMHDインストール方法 備忘録 追記

●事前の準備
・gitのインストール
yum (もしくはapt-get) install git

・subversionのインストール
yum (もしくはapt-get) install subversion

・Einstein Toolkitのインストール
curl -kLO https://raw.githubusercontent.com/gridaphobe/CRL/ET_2016_05/GetComponents
chmod a+x GetComponents
./GetComponents --parallel https://bitbucket.org/einsteintoolkit/manifest/raw/ET_2016_05/einsteintoolkit.th

・OpenMPIのインストール
http://hi-a-tus.hatenablog.com/entry/2014/11/30/120452
を参考にする。

日曜日, 7月 31, 2016

gfortranでのライブラリのパスのあて方

http://myfuturesightforpast.blogspot.jp/2014/12/gfortran-has-no-include-and-library.html
にあるように、LD_LIBRARY_PATHの変数に登録しても、
パスは通らない。

-L/home/...といった感じでコンパイル時のオプションで指定するか、
/usr/local/libにコピーする必要がある。

Ubuntsu 14.04でLAPACKを使う

まず、準備としてコンパイラをインストール。
sudo apt-get install gcc g++ gfortran
を実行。
 
実際のLAPACKのインストールは
http://qiita.com/AnchorBlues/items/69c1744de818b5e045ab
にある通りに実行する。 

金曜日, 6月 17, 2016

IllinoisGRMHDインストール方法 備忘録

Fedoraにインストールするための備忘録。

http://math.wvu.edu/~zetienne/ILGRMHD/getstarted.html
を参考にすれば、基本的にはOK。

Step 4 の前に
cp simfactory/mdb/optionlists/ubuntu.cfg .
を実行する。

 ubuntu.cfgをエディタで開き、MPI_DIR = 以降にOpenMPIを
インストールしたディレクトリを指定。
http://hi-a-tus.hatenablog.com/entry/2014/11/30/120452
を参考にインストールした今回は、
/usr/local/openmpi-1.10.3_gcc-5.3.1/
を指定。
 
Step 4にあるように、
make_config-runmefirstをエディタで開き
options=ubuntu.cfgと修正する。

あとは、参考サイトの通り進める。

木曜日, 6月 16, 2016

Fedora23へのOpenMPIのインストール

http://hi-a-tus.hatenablog.com/entry/2014/11/30/120452
を参考にした。
なお現時点でOpenMPIの最新バージョンは1.10.3なので
バージョンの数字は適宜変更。

土曜日, 6月 04, 2016

Intel(インテル)のコンパイラの置き換え

makeする時などの
環境変数の置き換え

●Fortran
ifort⇒gfortran

●C
icc⇒gcc

●C++
icpc⇒g++