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.
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.