DelFEM のサンプルをコンパイルしてみたメモ2009年12月9日 | |
DelFEMDelFEM 1.1.10 (ここ から入手) Visual Studio .NET 2003 Standard Edition によるコンパイルGLUT のセットアップここ から glut-3.7.6-bin.zip を入手する。ファイルを以下の場所に入れる。
DelFEM のコンパイル
Visual Studio 2008 Express Edition によるコンパイルどうせならタダでやりたいということで。 64 bit Windows 上にて。 GLUT のセットアップここ から glut-3.7.6-bin.zip を入手する。ファイルを以下の場所に入れる。
DelFEM のコンパイル
Visual Studio 2008 Express Edition によるコンパイル (64 bit 版)せっかくなので 64 bit 版に挑戦。 GLUT のセットアップここ から glut-3.7.6-src.zip を入手する。dsw ファイルがあるので、それを開いてプラットフォーム x64 でコンパイル。
できたファイルを以下の場所に入れる。
DelFEM のコンパイルdsw ファイルを開いてプラットフォーム x64 でコンパイル。 プログラムを実行して、タスクマネージャのプロセス名に "*32" がついていなければ OK。 MinGW でコンパイルVer. 1.1.10 から MinGW 用 Makefile が用意されているので。 MinGW 5.1.4, GCC 3.4.5。 GLUT のセットアップここ から GLUT-MinGW-3.7.6-4.mp.zip を入手。ファイルを以下の場所に入れる。
DelFEM のコンパイルホームディレクトリ以下 (C:\msys\1.0\home 以下) に DelFEM のパッケージを展開し、ディレクトリに入り、make を実行するのみ。 Linux でコンパイルMinGW でいけるのなら、Linux でもいけるだろうということで。 Fedora 9 x86_64、GCC 4.3.3 (OpenFOAM 付属)、あるいはシステムの GCC 4.3.0。 GLUT のセットアップfreeglut が入っていたので、freeglut-devel を入れる。 DelFEM のコンパイルパッケージを展開し、ディレクトリに入り、make を実行。 src/Com/DrawerGLUtility.cpp: In member function ‘void Com::View::CDrawerCoord::SetTrans(const Com::View::CCamera&, int)’: src/Com/DrawerGLUtility.cpp:297: error: ‘strlen’ was not declared in this scope src/Com/DrawerGLUtility.cpp:325: error: ‘strlen’ was not declared in this scope make: *** [Lib/DrawerGLUtility.o] エラー 1 src/Com/DrawerGLUtility.cpp に "#include <cstring>" を追加。make。 src/Cad/../Com/Serialize.h: In member function ‘void Com::CSerializer::Get(const char*, ...)’: src/Cad/../Com/Serialize.h:74: error: ‘strlen’ was not declared in this scope src/Cad/CadObj2D.cpp: In member function ‘bool Cad::CCadObj2D::Serialize(Com::CSerializer&)’: src/Cad/CadObj2D.cpp:2759: error: ‘strncmp’ was not declared in this scope make: *** [Lib/CadObj2D.o] エラー 1 src/Cad/CadObj2D.cpp に "#include <cstring>" を追加。make。 src/Cad/CadParts2D.cpp: In member function ‘void Cad::CEdge2D::GetBoundingBox(double&, double&, double&, double&) const’: src/Cad/CadParts2D.cpp:81: error: ‘abort’ was not declared in this scope make: *** [Lib/CadParts2D.o] エラー 1 src/Cad/CadParts2D.cpp に "#include <cstdlib>" を追加。make。 …とまあ、こんな感じで:
また Test_glut/fem_view_Evaluate/main.cpp: In function ‘void ShowFPS()’: Test_glut/fem_view_Evaluate/main.cpp:49: error: cast from ‘void*’ to ‘int’ loses precision Test_glut/fem_view_Evaluate/main.cpp:76: warning: deprecated conversion from string constant to ‘char*’ これに対して、次のように書き換えた。
void ShowFPS(){
...
//int font=(int)GLUT_BITMAP_8_BY_13;
int *font=(int *)GLUT_BITMAP_8_BY_13;
以下同様。
Test_glut/fem_view_Fluid2D/main.exe を実行してうねうね動くのを確認。 | |
| PENGUINITIS | |