CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Installation (http://www.cfd-online.com/Forums/openfoam-installation/)
-   -   error: 'size_t' has not been declared: compilation, 1.6-ext, Fedora 15 x86_64 (http://www.cfd-online.com/Forums/openfoam-installation/95231-error-size_t-has-not-been-declared-compilation-1-6-ext-fedora-15-x86_64-a.html)

tomislav_maric December 10, 2011 08:19

error: 'size_t' has not been declared: compilation, 1.6-ext, Fedora 15 x86_64
 
Hi everyone,

I'm seeing an unusual error during the compilation of OpenFOAM-1.6-ext (Thirdparty) on Fedora 15 x86_64: during Allmake.stage3 (mesquite compilation), the type size_t (glibc, stl) does not seem to be declared:

src/ObjectiveFunction/ObjectiveFunction.hpp:273:27: error: 'size_t' has not been declared
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I./include -I./itaps -DNDEBUG -DMSQ_TRAP_FPE -DHAVE_TERMIOS_H -DHAVE_SYS_IOCTL_H -DHAVE_VSNPRINTF -DHAVE_VSPRINTF -DHAVE_CLOCK -DHAVE_TIMES -DHAVE_CBRT -DHAVE_FEENABLEEXCEPT -Iinclude -Iitaps -I./include -I./src/Mesh -I./src/Control -I./src/Control/Wrappers -I./src/MappingFunction -I./src/MappingFunction/Lagrange -I./src/MappingFunction/Linear -I./src/Misc -I./src/ObjectiveFunction -I./src/QualityAssessor -I./src/QualityImprover -I./src/QualityImprover/TopologyModifier -I./src/QualityImprover/VertexMover -I./src/QualityImprover/VertexMover/ConjugateGradient -I./src/QualityImprover/VertexMover/Relaxation -I./src/QualityImprover/VertexMover/SteepestDescent -I./src/QualityImprover/VertexMover/NonSmoothDescent -I./src/QualityImprover/VertexMover/FeasibleNewton -I./src/QualityImprover/VertexMover/Randomize -I./src/QualityImprover/VertexMover/TrustRegion -I./src/QualityImprover/VertexMover/QuasiNewton -I./src/QualityMetric -I./src/QualityMetric/Shape -I./src/QualityMetric/Smoothness -I./src/QualityMetric/TMP -I./src/QualityMetric/TMP/2D -I./src/QualityMetric/TMP/3D -I./src/QualityMetric/Untangle -I./src/QualityMetric/Volume -I./src/TargetCalculator -I./itaps -I./itaps -I./itaps -Wall -pipe -m64 -fPIC -O2 -MT XYRectangle.lo -MD -MP -MF .deps/XYRectangle.Tpo -c src/Misc/XYRectangle.cpp -o XYRectangle.o >/dev/null 2>&1
make[2]: *** [CompositeOFAdd.lo] Error 1
make[2]: *** Waiting for unfinished jobs....
mv -f .deps/XYRectangle.Tpo .deps/XYRectangle.Plo
make[2]: Leaving directory `/opt/OpenFOAM/OpenFOAM-1.6-ext/ThirdParty/rpmBuild/BUILD/mesquite-2.1.2'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/opt/OpenFOAM/OpenFOAM-1.6-ext/ThirdParty/rpmBuild/BUILD/mesquite-2.1.2'
make: *** [all] Error 2
error: Bad exit status from /opt/OpenFOAM/OpenFOAM-1.6-ext/ThirdParty/rpmBuild/tmp/rpm-tmp.6pJwSA (%build)


Code:

RPM build errors:
    Bad exit status from /opt/OpenFOAM/OpenFOAM-1.6-ext/ThirdParty/rpmBuild/tmp/rpm-tmp.6pJwSA (%build)
Installing package: mesquite-2.1.2
  Uninstalling mesquite-2.1.2 using RPM: mesquite-2.1.2-linux64GccDPOpt.x86_64
  Installing mesquite-2.1.2 using RPM file: /opt/OpenFOAM/OpenFOAM-1.6-ext/ThirdParty/rpmBuild/RPMS/x86_64/mesquite-2.1.2-linux64GccDPOpt.x86_64.rpm
error: open of /opt/OpenFOAM/OpenFOAM-1.6-ext/ThirdParty/rpmBuild/RPMS/x86_64/mesquite-2.1.2-linux64GccDPOpt.x86_64.rpm failed: No such file or directory
Done installing package

I've checked all the -dev packages for C++ and they all seem to be there, if anyone has any idea about this, it would save me some digging time!

Thanks in advance!

Tomislav

tomislav_maric December 11, 2011 10:19

(bump)

:)


Well, I've figured it out. It seems that there have been some changes in gcc-4.6.1 involving stl headers.

The answer is to compile 1.6-ext with an older gcc compiler.

So, this is a micro how-to for compiling OpenFOAM-1.6-ext in /opt/OpenFOAM on Fedora 16, x86_64:

1) in $WM_PROJECT_DIR/etc/settings.sh change the variable 'compilerInstall':

compilerInstall=OpenFOAM

2) set the compiler version to Gcc44 at the top of settings.sh

export WM_COMPILER=Gcc44

3) set the compiler version back to Gcc inside the switch-case at the bottom of settings.sh (line 182-ish):

Code:

case "$WM_COMPILER" in
Gcc*)
        export WM_COMPILER='Gcc'

the line that should be added is export WM_COMPILER='Gcc', because of the rules for wmake are set with the 'Gcc' not 'Gcc44' or 'Gcc45' string suffix, so if the WM_COMPILER is left to be 'Gcc*' (* is determined in Thirdparty, explained below).

4) source the $WM_PROJECT_DIR/etc/settings.sh (you'll get errors on missing directories in Thirdparty, e.g. gcc-4.4.5 if you have set WM_COMPILER='Gcc44' at the top of settings.sh : do not worry about this it will be set by Thirdparty installation when the directories are created at the end of the compilation process).

5) Go to the ThirdParty directory.

6) Uncomment the appropriate lines in AllMake.stage1 for gcc-4.4.5

7) ./AllMake 2>&1 | tee log.errors

Checkout the log.errors for errors in the Thirdparty compilation and if there were some, post to this thread. :)

If not, compile on, src, apps and utilities should compile without a problem.

T.

hjasak December 12, 2011 06:29

Compiler problem: std::size_t in C++ instead of size_t in C.

Nothing to do with FOAM, just the new compilers starting with strict checking.

tomislav_maric December 12, 2011 06:36

Hi prof. Jasak,

yep... :) I've actually figured that one out... Let me quote myself (I've always wanted to do this :) ):

Quote:

Originally Posted by tomislav_maric (Post 335438)
(bump)

:)


Well, I've figured it out. It seems that there have been some changes in gcc-4.6.1 involving stl headers.

The answer is to compile 1.6-ext with an older gcc compiler.

(snip)

Btw, running OpenFOAM on Fedora 15 is not a good idea, reverting to an older version of gcc messes up the new Gnome 3 shell.


All times are GMT -4. The time now is 13:39.