A record for OF installation

The motivation for this blog is to help me get out of the tedious work when I have to do some labors just same as this one.

From the beginning, I was going to install the OF latest version 2.3.0, but the os is Red Hat 5.3 which is not adapted to this version.

So, I rely onto the old version of OF cuz I don't want to bother the yum or some other complex stuff

First I need to check which version of OF that the waveFoam could run on, but my gcc version is too low to match any version of waveFoam compiling.

:-<.......................

I have to run over again...

I got an idea that use the apt-get instead of yum on RHEL then I can run some updated rpm to take a newer gcc first.

So, I find the apt rpm files from Google. I remember there are three files...

And then get into the directory /etc/apt/sources.list.d/ to edit the file of os.list. Just uncomment some useful lines and done.

After 'apt-get update' I found there is nothing to do with the new version of gcc cuz the system is reeeeeeeeeeeeeeeeeally old and the repo does not support any nowadays stuff.

Sad though, I have to figure it out.

Tough enough, I download the source tarball from GCC and after some zigzag ways I did the follows fromgcc website:

Why does my ./configure and make fail?

[ Permalink ]

GCC tends to have problems when configured in the same directory as the GCC source code, or in any subdirectory therein, as stated in theConfiguration page in the install documentation.

What should be done is to untar the GCC source code, then in the source directory run./contrib/download_prerequisites (which will download and untar MPFR, MPC and GMP in the same GCC source code directory as per theprerequisites documentation.)

Then make a peer gcc-build directory next to the GCC source code directory.

Then run the configure either by fully qualified path or by relative path while in the thegcc-build current working directory.

A makefile will be created in the gcc-build directory. Runmake in the gcc-build current working directory to begin the build of GCC.

(If building a cross-compiler, there are several more prerequisite steps involved.)

The above steps are atypical of most GNU packages. GCC builds in multiple passes; which, if done within the GCC source code directory, befouls the source code directory itself. Hence the need to build in a separate build directory.

MPFR, MPC and GMP are used by GCC itself, internally. GCC does not use those facilities in the code compiled by GCC.

Configuration fails with ''configure: error: cannot compute suffix of object files: cannot compile''. What is the problem?

[ Permalink ]

Like any of the GNU projects, GCC is using the GNU autotools to commonly configure the compilation for the specifics of the build system. The configure script thereby uses small test programs - usually called conftest.c - to test if certain functions and/or features are available. If the compilation of such a test program fails, you'll see an error message like:

checking for suffix of object files... configure: error: in `/home/manu/gcc/gcc/i686-pc-linux-gnu/libgcc':
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.
make[2]: *** [configure-stage1-target-libgcc] Error 1
make[2]: Leaving directory `/home/manu/gcc/gcc'

This error message is quite misleading and frequently the problem has nothing to do with the message. You have to check the file 'config.log' in the directory where the error occurred. In the example above, you would have to check the 'config.log' file in the directory '/home/manu/gcc/gcc/i686-pc-linux-gnu/libgcc'. There might be several test programs that failed during the configuration, but some of these failures are non-critical. Check for the lasterror entry in the file.

Common causes for this error message are:

  • Required libraries for the GCC build are missing, specifically MPFR, GMP and MPC. If installed as shared libraries they must be in the runtime linker's search path so they can be found. Please, follow the instructions in the answer toWhy does my ./configure and make fail?

  • The compiler crashed. For example, if there is an error such as 'conftest.c: internal compiler error:', this indicates a bug in the compiler. If you are using an unmodified version of GCC, pleasefollow the procedure to report the bug.

Finally I am done with it by removing the old lib dynamic link and relink to the new installed libs: gmp, mpfr and mpc, since I do not understand why I modified the ~/.bashrc file and source it but still the environment did not change at all when I type 'env' in the shell. Note that even so I still use the option of 'with-mpc=...' when configuring in case of the compiler cannot find the mpc.h


BUT!!!!!!!!!!!!!!!!!!!!! I quit finally and am beat by the large dependencies!

I got Centos 7.0 to rebuild the system and all issues were tackled down

The OpenFOAM 2.3.0 installation just follows the instructions on the website of OF.

Here I wanna talk about the waveFoam installation part:

copy the 'applications' dir from OpenFOAM-2.3.0 to username-2.3.0

and copy the wave2Foam dir to ~/OpenFOAM/username-2.3.0/applications/utilities

and modify the files the Wiki told you to that interFoam in applications/solver/multiphase shall be modified and renamed as waveFoam, and into the utilities dir typing ./Allwmake done.

Make sure each time before your compiling, an original file dir with only authentic modifications should be available.

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值