[FreeBSD-users-jp 96219] FreeFem++ のインストール問題

Kouichi Hirabayashi kh @ mogami.com
2018年 6月 11日 (月) 05:41:39 UTC


FreeFem++ (http://www.freefem.org/) freefem++-3.60.tar.gz
の描画プログラム ffglut を動かす方法を見つけた方はおられないでしょうか?

例えば、FreeBSD-10.3, FreeBSD-11.1 などで、

$ ./configure --enable-download --without-mpi

で compile できる(注1)のですが、描画プログラム ffglut が動きません。

$ ./ffglut
/usr/local/lib/compat/libstdc++.so.6: version GLIBCXX_3.4.11 required by ..

とか

/lib/libgcc_s.so.1: version GCC_4.6.0 required by /usr/local/lib/gcc48..

ライブラリの矛盾で起動せず、無理に

LD_LIBRARY_PATH=/usr/local/lib/gcc48 ffglut

と起動しても『セグメンテーション違反 (core dumped)』で使えません。(注2)


どなたか、問題を解決していただけると嬉しいです。


注1 - compile 法

FreeBSD-10.3 で行った方法を書いておきます。

ports/graphics/freeglut がインストールされていて、wget, perl, bash
が存在することを確認してから、実行してください。

1) compile 中で使われるコマンドの準備

Linux 前提の script になっていますので、例えば、

 ln -s /usr/local/bin/wget /usr/bin/wget
 ln -s /usr/local/bin/perl /usr/bin/perl
 ln -s /usr/local/bin/bash /bin/bash
 mv /usr/bin/make /usr/bin/make.bsd
 ln -s /usr/local/bin/gmake /usr/bin/make

すべての仕事が終った後で /usr/bin/make を元に戻します。

 rm /usr/bin/make
 mv /usr/bin/make.bsd /usr/bin/make
 あるいは ln -s /usr/bin/make.bsd /usr/bin/make

2) FreeBSD で必要な変更

*** src/fflib/AFunction.cpp.orig	2018-04-13 18:14:48.000000000 +0900
--- src/fflib/AFunction.cpp	2018-06-10 20:00:03.967376000 +0900
***************
*** 35,41 ****
  //  put here some def dur to c++11 
  // problem with mixed with using namespace std; 
  // to correct bug in g++ v 4.8.1 add std
! #if defined (_WIN32  ) || (__GNUC__ >=5)
  #define NM_STD std::
  #else
  #define NM_STD 
--- 35,41 ----
  //  put here some def dur to c++11 
  // problem with mixed with using namespace std; 
  // to correct bug in g++ v 4.8.1 add std
! #if defined (_WIN32  ) || (__GNUC__ >=4)
  #define NM_STD std::
  #else
  #define NM_STD 
***************
*** 67,72 ****
--- 67,73 ----
  #include "array_init.hpp"
  
  // Add FH to get memroy used in test .. march 2014
+ #include <stdlib.h>
  #if __APPLE__
  #include <malloc/malloc.h>
  #elif HAVE_MALLOC_H
*** src/femlib/CheckPtr.cpp.orig	2018-04-13 18:14:48.000000000 +0900
--- src/femlib/CheckPtr.cpp	2018-06-10 20:07:06.831087000 +0900
***************
*** 25,35 ****
--- 25,39 ----
   void* operator new (std::size_t size, const std::nothrow_t& nothrow_value) noexcept;
   p
   */
+ #if __FreeBSD__
+ #include <stdlib.h>
+ #else
  #if __APPLE__
  #include <malloc/malloc.h>
  #else
  #include <malloc.h>
  #endif
+ #endif
  
  static long verbosity;
  
3) compile

  ./configure --enable-download --without-mpi
  make

これで src/nw/FreeFem++, FreeFem++-nw, ffglut ができます。

  ./configure --enable-download --without-mpi --enable-debug

だと、デバッグ用のバイナリができます。

--without-mpi を指定しなければ MPI を使う FreeFem++-mpi もできます。


注2 - グラフィック表示なしの FreeFEM-nw は正常に動作します。

平林 浩一


freebsd-users-jp メーリングリストの案内