CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Installation

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

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   December 10, 2011, 08:19
Default error: 'size_t' has not been declared: compilation, 1.6-ext, Fedora 15 x86_64
  #1
Senior Member
 
Tomislav Maric
Join Date: Mar 2009
Location: Darmstadt, Germany
Posts: 260
Blog Entries: 5
Rep Power: 11
tomislav_maric is on a distinguished road
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 is offline   Reply With Quote

Old   December 11, 2011, 10:19
Default
  #2
Senior Member
 
Tomislav Maric
Join Date: Mar 2009
Location: Darmstadt, Germany
Posts: 260
Blog Entries: 5
Rep Power: 11
tomislav_maric is on a distinguished road
(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.
tomislav_maric is offline   Reply With Quote

Old   December 12, 2011, 06:29
Default
  #3
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,762
Rep Power: 21
hjasak will become famous soon enough
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.
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   December 12, 2011, 06:36
Default
  #4
Senior Member
 
Tomislav Maric
Join Date: Mar 2009
Location: Darmstadt, Germany
Posts: 260
Blog Entries: 5
Rep Power: 11
tomislav_maric is on a distinguished road
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 View Post
(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.
tomislav_maric is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Compile calcMassFlowC aurore OpenFOAM Programming & Development 12 March 18, 2014 05:22
Compile problem ivanyao OpenFOAM Running, Solving & CFD 1 October 12, 2012 09:31
checking the system setup and Qt version vivek070176 OpenFOAM Installation 22 June 1, 2010 12:34
How to get the max value of the whole field waynezw0618 OpenFOAM Running, Solving & CFD 4 June 17, 2008 05:07
Compiling problems with hello worldC fw407 OpenFOAM Installation 21 January 6, 2008 18:38


All times are GMT -4. The time now is 14:45.