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

How can I pass fpermissive to g

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 30, 2008, 18:44
Default Hi, I tried today to build
  #1
Senior Member
 
Mirko Vukovic
Join Date: Mar 2009
Posts: 159
Rep Power: 17
mirko is on a distinguished road
Hi,

I tried today to build the OF-dev version with gcc-4.3 (on 64-bit RHEL5). (I am naively following a suggestion to use the newest release -- maybe I am too optimistic).

I did manage to build paraview-2.4.4 (it required tweaks in include statements in three files -- I can send those, but to whome?).

But OF is a different story.

For many files the errors are related to missing declarations of memset, strlen, abs, abort, strcopy.

I tried setting CXXFLAGS to -fpermissive in the .OpenFOAM.../bashrc file (followd by . ~/.bashrc).

But that does not seem to have made it into the build environment: I do not see it on the g++ statements.

echo $CXXFLAGS does show it:
> set | grep CXX
CXX=g++
CXXFLAGS='-m64 -fPIC -fpermissive'

So, again, how to pass that flag to g++.

Thanks,

Mirko
mirko is offline   Reply With Quote

Old   May 1, 2008, 07:18
Default Sorry about paraview problems
  #2
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,907
Rep Power: 33
hjasak will become famous soon enough
Sorry about paraview problems - it is a bit weird that you had to edit the files by hand. It always built for me without much trouble... Sounds like you are missing some basic c headers

If you wish to add more flags to the C++ compiler for OpenFOAM, go to:

OpenFOAM-1.4.1-dev/wmake/rules

and look for your machine - mine is

echo $WM_ARCH$WM_COMPILER

linux64Gcc

Go in there and in the file c++ add the options to your heart's content

Enjoy,

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   May 1, 2008, 10:18
Default I think the problem is using g
  #3
Senior Member
 
Mirko Vukovic
Join Date: Mar 2009
Posts: 159
Rep Power: 17
mirko is on a distinguished road
I think the problem is using gcc-4.3 instead of 4.2

The paraview modifications were minor - otherwise I would not have been able to fix them:

DICOMAppHelper.cxx -- had to #include <string.h>
DICOMFile.cxx -- had to replace #include <string> with #include <string.h>
DICOMParser.cxx -- same as DICOMFile.cxx

I found the c++ rules file and added -fpermissive, but that did not help with OF compilation.

I will go back to the gcc-4.2 compiler. I was able to compile OF with that.

Thanks,

Mirko
mirko is offline   Reply With Quote

Old   May 1, 2008, 13:58
Default Hello Mirko, Looks to me yo
  #4
Senior Member
 
Martin Beaudoin
Join Date: Mar 2009
Posts: 332
Rep Power: 22
mbeaudoin will become famous soon enough
Hello Mirko,

Looks to me your installation of gcc-4.3 is incomplete because you should not have to replace #include <string> with #include <string.h>.

How did you install gcc-4.3 on your system?

On your Linux system, do you have any libstdc++ devel packages installed for gcc-4.3?

For instance, what is the output of the following command on your system:

rpm -qa | grep std

You should see something that looks like :

libstdc++43-devel-something

Martin
mbeaudoin is offline   Reply With Quote

Old   May 1, 2008, 14:16
Default Martin, I downloaded gcc-4.
  #5
Senior Member
 
Mirko Vukovic
Join Date: Mar 2009
Posts: 159
Rep Power: 17
mirko is on a distinguished road
Martin,

I downloaded gcc-4.3 from the gnu web site and installed it in OF/linux64. Here is what I found there:

> cd linux64/gcc-4.3.0/
> find . -name "libstdc*"
./share/locale/fr/LC_MESSAGES/libstdc++.mo
./share/locale/de/LC_MESSAGES/libstdc++.mo
./lib64/libstdc++.so
./lib64/libstdc++.so.6.0.10
./lib64/libstdc++.so.6
./lib64/libstdc++.la
./lib64/libstdc++.a

Does this tell you anything? I am not a c/c++ programmer. I use prehistoric languages: fortran and lisp :-)

Mirko
mirko is offline   Reply With Quote

Old   May 1, 2008, 14:41
Default Hi Mirko, So you have compi
  #6
Senior Member
 
Martin Beaudoin
Join Date: Mar 2009
Posts: 332
Rep Power: 22
mbeaudoin will become famous soon enough
Hi Mirko,

So you have compiled and installed gcc 4.3 yourself... good!

How did you compile it?

How about the file "string"?

cd linux64/gcc-4.3.0/
find . -name "string"

Finally, just to be sure, what is the output of the command:

which g++

Martin
mbeaudoin is offline   Reply With Quote

Old   May 1, 2008, 15:34
Default Martin, I compiled it as Hr
  #7
Senior Member
 
Mirko Vukovic
Join Date: Mar 2009
Posts: 159
Rep Power: 17
mirko is on a distinguished road
Martin,

I compiled it as Hrvoje suggested in his notes.

I checked the installation by running OF-dev/bin/foamInstallationTest. It found the correct compiler (

As for :string":

> find . -name "string*"
./lib/gcc/x86_64-unknown-linux-gnu/4.3.0/include-fixed/bits/string2.h
./lib/gcc/x86_64-unknown-linux-gnu/4.3.0/include/ssp/string.h
./include/c++/4.3.0/bits/stringfwd.h
./include/c++/4.3.0/string
./include/c++/4.3.0/ext/pb_ds/detail/trie_policy/string_trie_e_access_traits_imp .hpp
./include/c++/4.3.0/debug/string

As I said, I am now rebuilding the same OF/paraview sources with 4.2.2

Mirko
mirko is offline   Reply With Quote

Old   June 10, 2008, 16:41
Default I ran across this thread while
  #8
New Member
 
Tom Chyczewski
Join Date: Mar 2009
Location: Bethpage, New York, USA
Posts: 15
Rep Power: 17
chyczewski is on a distinguished road
I ran across this thread while trying to build OpenFOAM. I saw the same errors as Mirko using gcc 4.3.0: declaration/usage problems with abs, strlen, memset and abort.

I went back to gcc 4.2.1 as suggested by Mirko. I downloaded the source from GNU and installed it the same way I had 4.3.0 (using the same gmp (4.2.2) and mpfr (2.3.1) libraries, binutils (2.17) etc).

After a couple other hiccups (problems with READLINELINK and some missing X11 files) I was able to get OF to compile properly (I think).

Like Mirko I suspect that there might be an issue with gcc 4.3.0. Has anyone succeeded with this version? If so, can you offer a resolution? If not, maybe an experienced user/developer should take a look.

In case you are interested, here is the first error I see in the screen output during Allwmake:

/home/chyczth/OpenFOAM/OpenFOAM-1.4.1/src/OpenFOAM/lnInclude/stringI.H: In member function 'size_t Foam::string::hash::operator()(const Foam::string&, size_t) const':
/home/chyczth/OpenFOAM/OpenFOAM-1.4.1/src/OpenFOAM/lnInclude/stringI.H:169: error: '::abs' has not been declared

Here is the last set of errors before the build finally dies:

/home/chyczth/OpenFOAM/OpenFOAM-1.4.1/src/OpenFOAM/lnInclude/IOobjectI.H: In static member function 'static void Foam::IOobject::writeBanner(Stream&)':
/home/chyczth/OpenFOAM/OpenFOAM-1.4.1/src/OpenFOAM/lnInclude/IOobjectI.H:39: error: there are no arguments to 'memset' that depend on a template parameter, so a declaration of 'memset' must be available
/home/chyczth/OpenFOAM/OpenFOAM-1.4.1/src/OpenFOAM/lnInclude/IOobjectI.H:39: error: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
/home/chyczth/OpenFOAM/OpenFOAM-1.4.1/src/OpenFOAM/lnInclude/IOobjectI.H:40: error: there are no arguments to 'strlen' that depend on a template parameter, so a declaration of 'strlen' must be available
/home/chyczth/OpenFOAM/OpenFOAM-1.4.1/src/OpenFOAM/lnInclude/IOobjectI.H: In static member function 'static void Foam::IOobject::writeLogBanner(Stream&)':
/home/chyczth/OpenFOAM/OpenFOAM-1.4.1/src/OpenFOAM/lnInclude/IOobjectI.H:63: error: there are no arguments to 'memset' that depend on a template parameter, so a declaration of 'memset' must be available
/home/chyczth/OpenFOAM/OpenFOAM-1.4.1/src/OpenFOAM/lnInclude/IOobjectI.H:64: error: there are no arguments to 'strlen' that depend on a template parameter, so a declaration of 'strlen' must be available
make[2]: *** [Make/linuxGccDPOpt/engineSwirl.o] Error 1

I know very little C/C++ so I don't have more than a superficial understanding of these errors.

Tom
chyczewski is offline   Reply With Quote

Reply


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
fluid pass through a filter(pressure drop setting) Jasica Siemens 1 September 13, 2008 10:42
How to pass a variable from a define macro... Padian FLUENT 2 May 30, 2008 06:22
Which values to pass Ralf Schmidt FLUENT 0 November 25, 2005 09:50
How to pass parallel computing by background ? qzhu FLUENT 1 December 14, 2000 22:33
Flow pass a group of building:Wind tunnel test vs. CFD simulation Tomb Main CFD Forum 7 June 15, 2000 10:27


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