[笔记1.0]AFEPack软件包安装备忘

重装系统:2007年四月发布的 Ubuntu 7.04 - the Feisty Fawn -
按照以前别人帮助下记录的步骤,完整装了一次deal.II-3.1.0和AFEPack(2007.3.15打包版)
参考资料:作者主页 http://dsec.pku.edu.cn/~rli/  上的安装说明和某不知名前辈的安装笔记。
经过加工改写为本菜鸟的备忘录,特此对获得的所有帮助一并表示十二万分感谢。

1、先确保系统安装如下工具:
gcc-3.3
g++-3.3
autoconf
automake

2、指定编译器,设置链接:

$ ls -al /usr/bin/gcc
$ ls -al /usr/bin/g++

$ cd /usr/bin

$ sudo rm gcc
$ sudo rm g++

$ sudo ln -s gcc-3.3 gcc
$ sudo ln -s g++-3.3 g++

$ ls -al /usr/bin/gcc
lrwxrwxrwx  1 root root 7 2006-04-18 11:09 /usr/bin/gcc -> gcc-3.3
$ ls -al /usr/bin/g++
lrwxrwxrwx  1 root root 7 2006-04-18 11:09 /usr/bin/g++ -> g++-3.3

$ ls -al /usr/bin/c++
lrwxrwxrwx  1 root root 21 2006-04-18 01:03 /usr/bin/c++ -> /etc/alternatives/c++
$ ls -al /etc/alternatives/c++
lrwxrwxrwx  1 root root 12 2006-04-18 01:03 /etc/alternatives/c++ -> /usr/bin/g++

3、开始解压安装:

$ sudo cp AFEPack.tar.gz /usr/local/
$ sudo cp deal.II-3.1.0.tar.gz /usr/local/

(1)deal.II
cd /usr/local
sudo tar zxvf deal.II-3.1.0.tar.gz
cd deal.II

**@ubuntu:/usr/local/deal.II/base/include/base$ sudo vi thread_management.h
343行   class ArgCollector换为 public:class ArgCollector

**@ubuntu:/usr/local/deal.II$ sudo ./configure
**@ubuntu:/usr/local/deal.II$ sudo make base lac

不正常的信息,似乎没有影响
cd /usr/local/deal.II/base ; make  libg
make[1]: Entering directory `/usr/local/deal.II/base'
Makefile:121: lib/Makefile.dep: No such file or directory
============================ Remaking forward_declarations.h
make[1]: [/usr/local/deal.II/base/include/base/forward_declarations.h] 错误 1 (忽略)
============================          file remade
============================ Remaking Makefile



cd /usr/local/deal.II/lac ; make  libg
make[1]: Entering directory `/usr/local/deal.II/lac'
Makefile:88: lib/Makefile.dep: No such file or directory
============================ Remaking forward_declarations.h
make[1]: [/usr/local/deal.II/lac/include/lac/forward_declarations.h] 错误 1 (忽略)
============================          file remade
============================ Remaking Makefile




将 deal.II 的头文件和库文件链接到系统目录下:

    sudo ln -s /usr/local/deal.II/base/include/base /usr/local/include/base
    sudo ln -s /usr/local/deal.II/lac/include/lac /usr/local/include/lac

    sudo ln -s /usr/local/deal.II/base/lib/lib* /usr/local/lib/
    sudo ln -s /usr/local/deal.II/lac/lib/lib* /usr/local/lib/


以下也许需要修改:
    chmod +r /usr/local/include/base/logstream.h  # I don't know why there is a file without read permit.

早期版本(2005.3.4打包版)还需要修改:
    cp src_pathname/sparse_matrix.h /usr/local/deal.II/lac/include/lac/sparse_matrix .h
    cp src_pathname/sparsity_pattern.h /usr/local/deal.II/lac/include/lac/sparsity_pattern.h

修改后的sparsity_pattern.h sparse_matrix.h,实际是在
class SparsityPattern : public Subscriptor
class SparseMatrix : public Subscriptor
类里分别加了:friend class AMGSolver;
但是2007.3.15打包版本里的class AMGSolver有所改进,似乎不再需要上面的替换了


(2)AFEPack
cd /usr/local
sudo tar zxvf AFEPack.tar.gz
cd AFEPack

用命令序列重新产生出 configure 脚本:
      aclocal
      automake
      autoconf

    sudo ./configure
    sudo make

      目录 example 下的内容编译的时候会有问题,可以在做完下一步以后再在 exmaple 目录下运行 make 进行编译;
      在 example/tools 下会编译出来很多很有用的可执行程序,帮助您做很多数据文件的格式转换,很值得试一下;

    sudo ln -s /usr/local/AFEPack/library/include /usr/local/include/AFEPack
    sudo ln -s /usr/local/AFEPack/library/lib/lib*    /usr/local/lib/


4、运行例程验证安装成功
(1)
编译通过,运行失败报错:
./main: error while loading shared libraries: libAFEPack.so: cannot open shared object file: No such file or directory

需要编辑/etc/ld.so.conf文件,确保/usr/local/lib在其中某一行出现
比如:我的/etc/ld.so.conf文件只有一行:
include /etc/ld.so.conf.d/*.conf
那么在/etc/ld.so.conf.d/目录下创建一个文件:AFEPack.conf
$ sudo vi /etc/ld.so.conf.d/AFEPack.conf
加一行:    /usr/local/lib

$ sudo ldconfig   #/sbin/ldconfig 使ld.so.conf的改动生效

(2)
可能需要libAFEPack.g.so库,造个假链接-_-!
/usr/local/lib$ ln -s /usr/local/AFEPack/library/lib/libAFEPack.so libAFEPack.g.so

(3)
**@ubuntu:~$  sudo vi .bashrc  
加入
export AFEPACK_TEMPLATE_PATH=/usr/local/AFEPack/template/triangle:/usr/local/AFEPack/template/rectangle

 

你可能感兴趣的:(AFEPack/RealHP)