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: Thanks in advance! Tomislav |
(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 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. |
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. |
Hi prof. Jasak,
yep... :) I've actually figured that one out... Let me quote myself (I've always wanted to do this :) ): Quote:
|
All times are GMT -4. The time now is 22:23. |