ctffindをMacOSX向けにコンパイルしようとしたら GSL CBLAS が必要と言われた。
っで、[[https://github.com/dreal/dreal3/issues/179>+https://github.com/dreal/dreal3/issues/179]]から [[Apple/GCC-4.9.3]]では無理そうなので GCC-5.3.0を使うことにした

コンパイル方法は [[Apple/GCC-4.9.3]] とほぼ同じ。[[Apple/CommandLineTools]]で提供されるAppleのGCC(clang)でコンパイルします。
[[Open MPI>Apple/GCC-5.3.0/OpenMPI]]

既に [[Apple/GCC-4.9.3]] での
-GNU Multiple Precision Library
-MPFR Library
-MPC Library
-CLooG
-ISL Library

らは導入済みとします。
っでソースコードを入手して、展開します。
#code(nonumber){{
mac:~ Supervisor$ cd src/
mac:src Supervisor$ curl -O http://ftp.tsukuba.wide.ad.jp/software/gcc/releases/gcc-5.3.0/gcc-5.3.0.tar.bz2
mac:src Supervisor$ bzip2 -cd gcc-5.3.0.tar.bz2 | tar xf -
}}
その後、コンパイルを開始。紅茶とケーキを用意しましょう。
#code(nonumber){{
mac:src Supervisor$ mkdir gcc-build && cd gcc-build

mac:gcc-build Supervisor$ export PATH=/usr/bin:/bin:/usr/local/bin
mac:gcc-build Supervisor$ ../gcc-5.3.0/configure \
--enable-languages=c,c++,fortran \
--enable-bootstrap \
--enable-shared \
--enable-threads=posix \
--enable-checking=release \
--with-system-zlib \
--enable-__cxa_atexit \
--enable-gnu-unique-object \
--with-gmp=/usr/local --with-gmp-include=/usr/local/include  \
--with-mpfr=/usr/local --with-mpfr-include=/usr/local/include  \
--with-mpc=/usr/local --with-mpc-include=/usr/local/include  \
--with-isl=/usr/local --with-isl-include=/usr/local/include  \
--with-cloog=/usr/local --with-cloog-include=/usr/local/include  \
--prefix=/usr/local/gcc530 \
--with-pkgversion="gcc-5.3.0 20160326 by chaperone" --without-bugurl --disable-multilib \
--with-build-config=bootstrap-debug

mac:gcc-build Supervisor$ make -j4
mac:gcc-build Supervisor$ sudo make install
}}

作ったバイナリの確認

#code(nonumber){{
mac:gcc-build Supervisor$ /usr/local/gcc530/bin/gcc -v
Using built-in specs.
COLLECT_GCC=/usr/local/gcc530/bin/gcc
COLLECT_LTO_WRAPPER=/usr/local/gcc530/libexec/gcc/x86_64-apple-darwin15.3.0/5.3.0/lto-wrapper
Target: x86_64-apple-darwin15.3.0
Configured with: ../gcc-5.3.0/configure --enable-languages=c,c++,fortran --enable-bootstrap 
--enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib 
--enable-__cxa_atexit --enable-gnu-unique-object --with-gmp=/usr/local --with-gmp-include=/usr/local/include
--with-mpfr=/usr/local --with-mpfr-include=/usr/local/include --with-mpc=/usr/local 
--with-mpc-include=/usr/local/include --with-isl=/usr/local --with-isl-include=/usr/local/include 
--with-cloog=/usr/local --with-cloog-include=/usr/local/include --prefix=/usr/local/gcc530 
--with-pkgversion='gcc-5.3.0 20160326 by chaperone' --without-bugurl --disable-multilib 
--with-build-config=bootstrap-debug
Thread model: posix
gcc version 5.3.0 (gcc-5.3.0 20160326 by chaperone)
mac:gcc-build Supervisor$
}}
使用する際には、

#code(nonumber){{
mac:~ Supervisor$ export PATH=/usr/local/gcc530/bin:$PATH
}}
として使用します。

***openmpi-1.10.2 [#u3f470e6]
#code(nonumber){{
mac:~ Supervisor$ cd src
mac:src Supervisor$ curl -O https://www.open-mpi.org/software/ompi/v1.10/downloads/openmpi-1.10.2.tar.bz2
mac:src Supervisor$ bzip2 -cd openmpi-1.10.2.tar.bz2 | tar xf - && cd openmpi-1.10.2

mac:openmpi-1.10.2 Supervisor$ export PATH=/usr/local/gcc530/bin:/usr/bin:/bin:/usr/local/bin

mac:openmpi-1.10.2 Supervisor$ ./configure --prefix=/usr/local/openmpi-1.10.2-gcc530

mac:openmpi-1.10.2 Supervisor$ make && make check && sudo make install
}}

openmpi-1.10.2 の openmpi-1.10.2/examples にテスト向けファイルがある。
#code(nonumber){{
mac:openmpi-1.10.2 Supervisor$ cd examples
mac:examples Supervisor$

mac:examples Supervisor$ export PATH=/usr/local/openmpi-1.10.2-gcc530/bin:/usr/local/gcc530/bin:/usr/bin:/bin

mac:examples Supervisor$ make
mpicc -g    hello_c.c   -o hello_c
mpicc -g    ring_c.c   -o ring_c
mpicc -g    connectivity_c.c   -o connectivity_c
mpic++ -g    hello_cxx.cc   -o hello_cxx
mpic++ -g    ring_cxx.cc   -o ring_cxx
mpifort -g hello_mpifh.f -o hello_mpifh
mpifort -g ring_mpifh.f -o ring_mpifh
mpifort -g hello_usempi.f90 -o hello_usempi
mpifort -g ring_usempi.f90 -o ring_usempi
mpifort -g hello_usempif08.f90 -o hello_usempif08
mpifort -g ring_usempif08.f90 -o ring_usempif08
mac:examples Supervisor$
}}

コンパイルはこれで終了。実行してみます。
#code(nonumber){{
mac:examples Supervisor$ mpirun -np 2 ./connectivity_c
Connectivity test on 2 processes PASSED.

mac:examples Supervisor$
}}
1

トップ   編集 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS