CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Community Contributions (https://www.cfd-online.com/Forums/openfoam-community-contributions/)
-   -   [swak4Foam] difficulties installing swak4foam (https://www.cfd-online.com/Forums/openfoam-community-contributions/103805-difficulties-installing-swak4foam.html)

navid2 March 2, 2014 14:03

swak4foam
 
i am a beginner in linux and i have installed linux-ubuntu 13.04 with openfoam 2.3 (newest version). i wonna install swak4foam but i don't know which version of swak4foam is compatible with this configuration, i don't know where i can download it.
Could you please help me? Thank you.

gschaider March 2, 2014 14:23

Quote:

Originally Posted by navid2 (Post 477594)
i am a beginner in linux and i have installed linux-ubuntu 13.04 with openfoam 2.3 (newest version). i wonna install swak4foam but i don't know which version of swak4foam is compatible with this configuration, i don't know where i can download it.
Could you please help me? Thank you.

The current released version does not compile with 2.3. You've got to get the development version as described in http://openfoamwiki.net/index.php/Co...am#Development (or the fourth option under "Tarballs")

kingjewel1 March 2, 2014 14:43

I used this to download swak4foam:

Code:

svn checkout svn://svn.code.sf.net/p/openfoam-extend/svn/trunk/Breeder_2.0/libraries/swak4Foam/ swak4Foam_2.x
My problem is similar:

Code:

wmake all
This is a clean install
No file 'swakConfiguration'. Python etc won't work. See README for details
Checking swak4Foam-version and generating file
Swak version is 0.3.0
Bison is version 2.3
swak4Foam only confirmed to work with Bison >= 2.4

openfoam version is:

Code:

icoFoam
/*---------------------------------------------------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  2.1.1                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
Build  : 2.1.1-221db2718bbb

Does this need some patch? Or is this a problem with the python compiler?

wyldckat March 2, 2014 15:02

Greetings to all!

@kingjewel1:
Quote:

Originally Posted by kingjewel1 (Post 477600)
Code:

wmake all
This is a clean install
No file 'swakConfiguration'. Python etc won't work. See README for details
Checking swak4Foam-version and generating file
Swak version is 0.3.0
Bison is version 2.3
swak4Foam only confirmed to work with Bison >= 2.4


As this was an installation problem, I moved your post from this thread: http://www.cfd-online.com/Forums/ope...locity-bc.html

Which Linux distribution are you using?

Best regards,
Bruno

kingjewel1 March 2, 2014 15:13

Quote:

Originally Posted by wyldckat (Post 477603)
Greetings to all!

@kingjewel1:

As this was an installation problem, I moved your post from this thread: http://www.cfd-online.com/Forums/ope...locity-bc.html

Which Linux distribution are you using?

Best regards,
Bruno

Thank you for reorganising the post. I'm a user on a HPC cluster... can i actually install this addon myself or does it have to be done by admin?

wyldckat March 2, 2014 15:39

Quote:

Originally Posted by kingjewel1 (Post 477605)
Thank you for reorganising the post. I'm a user on a HPC cluster... can i actually install this addon myself or does it have to be done by admin?

Well... swak4Foam was designed for the user to build it, without the need for administrative intervention.

The problem is that the system's Bison version is 2.3 and swak4Foam is asking for at least 2.4. Since Bison is only needed for the build process, I suggest that you do the following steps:
  1. Go into the source code folder where you have swak4Foam's source code.
  2. Download and unpack Bison in the swak4Foam folder: http://ftpmirror.gnu.org/bison/bison-2.7.tar.gz
  3. Go into the Bison folder, configure it and compile+install it:
    Code:

    cd bison-2.7
    ./configure --prefix $PWD/../bison
    make
    make install

    It will install into the folder named bison inside swak4Foam.
  4. Go back into the main folder and add it to the search path:
    Code:

    cd ..
    export PATH=$PWD/bison/bin:$PATH

  5. Now you can proceed to building swak4Foam:
    Code:

    ./Allwmake

gschaider March 2, 2014 15:49

Quote:

Originally Posted by wyldckat (Post 477609)
Well... swak4Foam was designed for the user to build it, without the need for administrative intervention.

The problem is that the system's Bison version is 2.3 and swak4Foam is asking for at least 2.4. Since Bison is only needed for the build process, I suggest that you do the following steps:

As this still happens a lot and the problem starts to emerge "on the other end" (distros with a bison that is too advanced) I added the possibiliy to compile and use a "private" installation of bison for swak (only requires running a script) just this week (currently only available in the development version)

http://sourceforge.net/apps/mantisbt...iew.php?id=211

kingjewel1 March 2, 2014 16:19

EDIT: I've installed the FLEX thing and swak is installing... I'll update soon :)


Quote:

Originally Posted by wyldckat (Post 477609)
Well... swak4Foam was designed for the user to build it, without the need for administrative intervention.

The problem is that the system's Bison version is 2.3 and swak4Foam is asking for at least 2.4. Since Bison is only needed for the build process, I suggest that you do the following steps:
  1. Go into the source code folder where you have swak4Foam's source code.
  2. Download and unpack Bison in the swak4Foam folder: http://ftpmirror.gnu.org/bison/bison-2.7.tar.gz
  3. Go into the Bison folder, configure it and compile+install it:
    Code:

    cd bison-2.7
    ./configure --prefix $PWD/../bison
    make
    make install

    It will install into the folder named bison inside swak4Foam.
  4. Go back into the main folder and add it to the search path:
    Code:

    cd ..
    export PATH=$PWD/bison/bin:$PATH

  5. Now you can proceed to building swak4Foam:
    Code:

    ./Allwmake

This worked until I need a different version of FLEX:

Code:

[cenmk@login2 swak4Foam_2.x]$ ./Allwmake
Previously compiled for OpenFOAM 2.1.1
No file 'swakConfiguration'. Python etc won't work. See README for details
Checking swak4Foam-version and generating file
Swak version is 0.3.0
Bison is version 2.7
Flex is version 2.5.4 (Minor version: 4)
swak4Foam only confirmed to work with Flex >= 2.5.35 (2.5.33 may work, but 2.5.4 definitely not)
Set the environment variable USE_OLD_FLEX if you want to continue anyway

I downloaded Flex 2.5.37 and unpacked the tar.gz file but not sure where to go from there... Any thoughts?

kingjewel1 March 2, 2014 16:44

Code:

mkdir: `': No such file or directory
make: *** [/libswak4FoamParsers.so] Error 1
Parser library did not compile OK. No sense continuing as everything else depends on it

Requirements for Library not satisfied. I see no sense in going on

Would this problem we solved using gschaider's recommended download?

wyldckat March 2, 2014 17:14

Quote:

Originally Posted by gschaider (Post 477610)
I added the possibiliy to compile and use a "private" installation of bison for swak (only requires running a script) just this week (currently only available in the development version)

I knew I had read about that somewhere, and while writing the instructions above, I had a look into the README file for 0.3.0. Since I didn't find anything, I kept writing...

Quote:

Originally Posted by kingjewel1 (Post 477612)
I downloaded Flex 2.5.37 and unpacked the tar.gz file but not sure where to go from there... Any thoughts?

In theory, it's just a matter of doing the same steps done for Bison.

Quote:

Originally Posted by kingjewel1 (Post 477615)
Code:

mkdir: `': No such file or directory
Would this problem we solved using gschaider's recommended download?

The error message is complaining about giving a path that is empty, i.e., no text given for the address to a folder or file.
Usually the real problem is further upwards. Look for the first occurrence of an error message, not the last one. You can send the output from Allwmake into a file, by running it like this:
Code:

./Allwmake > make.log 2>&1
The output will all be placed into the file "make.log".

kingjewel1 March 2, 2014 18:08

Quote:

Originally Posted by wyldckat (Post 477620)
I knew I had read about that somewhere, and while writing the instructions above, I had a look into the README file for 0.3.0. Since I didn't find anything, I kept writing...


In theory, it's just a matter of doing the same steps done for Bison.


The error message is complaining about giving a path that is empty, i.e., no text given for the address to a folder or file.
Usually the real problem is further upwards. Look for the first occurrence of an error message, not the last one. You can send the output from Allwmake into a file, by running it like this:
Code:

./Allwmake > make.log 2>&1
The output will all be placed into the file "make.log".

I still have this same error...
Code:

[cenmk@login2 swak4Foam_2.x]$ tail -f make.log
No file 'swakConfiguration'. Python etc won't work. See README for details
Checking swak4Foam-version and generating file
Swak version is 0.3.0
Bison is version 2.3
swak4Foam only confirmed to work with Bison >= 2.4
Compiles with 2.3 but has offset-problems with locations which break the Plugin-functionality
Set the environment variable USE_OLD_BISON if you want to continue anyway

Requirements for Library not satisfied. I see no sense in going on


navid2 March 3, 2014 03:08

swak4foam
 
1 Attachment(s)
Quote:

Originally Posted by gschaider (Post 477598)
The current released version does not compile with 2.3. You've got to get the development version as described in http://openfoamwiki.net/index.php/Co...am#Development (or the fourth option under "Tarballs")

thanks Bernhard for your attention. i downloaded the "tarball", but when i type ./Allwmake in terminal, an unfinished process is teken place. i waited 10 minutes but the process was not finished(my system has 4 core with rate 2.6). output message from linux terminal is attached.
any help is appreciated.




wyldckat March 3, 2014 07:27

@kingjewel1:
Quote:

Originally Posted by kingjewel1 (Post 477624)
I still have this same error...
Code:

[cenmk@login2 swak4Foam_2.x]$ tail -f make.log
No file 'swakConfiguration'. Python etc won't work. See README for details
Checking swak4Foam-version and generating file
Swak version is 0.3.0
Bison is version 2.3


What happened to the custom Bison build? If it's still in the place where I detailed on post #46, then run:
Code:

export PATH=$PWD/bison/bin:$PATH
./Allwmake > make.log 2>&1


kingjewel1 March 3, 2014 08:22

Quote:

Originally Posted by wyldckat (Post 477714)
@kingjewel1:

What happened to the custom Bison build? If it's still in the place where I detailed on post #46, then run:
Code:

export PATH=$PWD/bison/bin:$PATH
./Allwmake > make.log 2>&1


It seems to fail on mkdir even with correct bison and flex.

Code:

[cenmk@login2 swak4Foam_2.x]$ bison -V
bison (GNU Bison) 2.7
[cenmk@login2 swak4Foam_2.x]$ flex -V
flex 2.5.37

Then looking at make.log

Code:

Previously compiled for OpenFOAM 2.1.1
No file 'swakConfiguration'. Python etc won't work. See README for details
Checking swak4Foam-version and generating file
Swak version is 0.3.0
Bison is version 2.7
Flex is version 2.5.37 (Minor version: 37)
OpenFOAM-version: Major 2 Minor 1 Patch 1 (-1 == x)
No change to swak4FoamParsers/foamVersion4swak.H
mkdir: `': No such file or directory
make: *** [/libswak4FoamParsers.so] Error 1


wyldckat March 3, 2014 08:37

@kingjewel1:
There are two very important details that seem to be missing:
  1. Previous build attempts seem to have damaged something. Usually this is fixed if you run:
    Code:

    ./Allwclean
  2. It seems like the OpenFOAM shell environment is not properly active. To understand what I'm referring to, please read this page: http://openfoamwiki.net/index.php/In...with_the_Shell
  3. edit: Associated to #2, what does this command give you?
    Code:

    echo $FOAM_USER_LIBBIN

kingjewel1 March 3, 2014 08:44

Quote:

Originally Posted by wyldckat (Post 477730)
@kingjewel1:
There are two very important details that seem to be missing:
  1. Previous build attempts seem to have damaged something. Usually this is fixed if you run:
    Code:

    ./Allwclean
  2. It seems like the OpenFOAM shell environment is not properly active. To understand what I'm referring to, please read this page: http://openfoamwiki.net/index.php/In...with_the_Shell
  3. edit: Associated to #2, what does this command give you?
    Code:

    echo $FOAM_USER_LIBBIN


That gives no reply:

Code:

[cenmk@login2 ~]$ echo $FOAM_USER_LIBBIN

[cenmk@login2 ~]$


wyldckat March 3, 2014 09:45

Quote:

Originally Posted by kingjewel1 (Post 477732)
That gives no reply:

Code:

[cenmk@login2 ~]$ echo $FOAM_USER_LIBBIN

[cenmk@login2 ~]$


This isn't good... I'm guessing that the cluster administrator decided that the user should not use their own solvers and libraries, which is a bit... annoying :(

OK, if the following 2 commands gives you any valid output:
Code:

echo $WM_PROJECT_DIR
echo $HOME

Then run the following commands, before you run Allwmake:
Code:

mkdir $HOME/.OpenFOAM
echo 'export WM_PROJECT_USER_DIR=$HOME/$WM_PROJECT/$USER-$WM_PROJECT_VERSION' > $HOME/.OpenFOAM/prefs.sh
echo 'export FOAM_USER_APPBIN=$WM_PROJECT_USER_DIR/platforms/$WM_OPTIONS/bin' >> $HOME/.OpenFOAM/prefs.sh
echo 'export FOAM_USER_LIBBIN=$WM_PROJECT_USER_DIR/platforms/$WM_OPTIONS/lib'  >> $HOME/.OpenFOAM/prefs.sh

echo 'export PATH=$PATH:$FOAM_USER_APPBIN'  >> $HOME/.OpenFOAM/prefs.sh
echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$FOAM_USER_LIBBIN'  >> $HOME/.OpenFOAM/prefs.sh

source $HOME/.OpenFOAM/prefs.sh

Then run Allwmake as before.
When Allwmake is finished and if everything went well, then next time you start a new terminal, it will activate the necessary environment variables, which OpenFOAM's environment scripts should pick up automatically. If it does not do it automatically, then run:
Code:

source $HOME/.OpenFOAM/prefs.sh

kingjewel1 March 3, 2014 10:10

I believe the users of this cluster are able to write and use their own solvers. There must be something wrong with my bash file:

Code:

# .bashrc

# Source global definitions
if [ -f /etc/bashrc ]; then
        . /etc/bashrc
fi
#.... Some lines regarding licenses and alias etc
module switch openmpi/1.4 openmpi/1.5.3
module switch intel/11.1.059 gnu/4.7.1
module switch intel gnu/4.8.1
#module add matlab
module add openfoam

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/apps/applications/openfoam/2.1.1-test/1/default/ThirdParty-2.1.1/platforms/linux64GccDPOpt/lib/openmpi-1.5.3
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/apps/applications/openfoam/2.1.1-test/1/default/platforms/linux64GccDPOpt/lib/dummy/
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/apps/applications/openfoam/2.1.1-test/1/default/ThirdParty-2.1.1/platforms/linux64GccDPOpt/lib/

export PATH
export PATH=$HOME/.local/bin:$PATH
export LD_LIBRARY_PATH=$HOME/.local/lib

Then to check loaded modules, checks out ok.
Code:

[cenmk@login2 swak4Foam_2.x]$ module list
Currently Loaded Modulefiles:
  1) licenses        2) sge              3) bit/64          4) gnu/4.7.1        5) openmpi/1.5.3    6) user            7) ansys/14.0      8) openfoam/2.1.1


The first commands of your last post went OK. (added a " ' ") to one of the exports

Then Allwmake gives:

Code:

[cenmk@login2 swak4Foam_2.x]$ ./Allwmake
This is a clean install
No file 'swakConfiguration'. Python etc won't work. See README for details
Checking swak4Foam-version and generating file
Swak version is 0.3.0
Bison is version 2.7
Flex is version 2.5.37 (Minor version: 37)
OpenFOAM-version: Major 2 Minor 1 Patch 1 (-1 == x)
No swak4FoamParsers/foamVersion4swak.H. Generated
wmakeLnInclude: linking include files to simpleFunctionObjects/lnInclude
/apps/compilers/gnu/4.7.1/1/bit-64/libexec/gcc/x86_64-unknown-linux-gnu/4.7.1/cc1: error while loading shared libraries: libcloog.so.0: cannot open shared object file: No such file or directory
/apps/compilers/gnu/4.7.1/1/bit-64/libexec/gcc/x86_64-unknown-linux-gnu/4.7.1/cc1: error while loading shared libraries: libcloog.so.0: cannot open shared object file: No such file or directory
wmakeLnInclude: linking include files to ./lnInclude
'libNULL.so' is up to date.
/apps/compilers/gnu/4.7.1/1/bit-64/libexec/gcc/x86_64-unknown-linux-gnu/4.7.1/cc1: error while loading shared libraries: libcloog.so.0: cannot open shared object file: No such file or directory
/apps/compilers/gnu/4.7.1/1/bit-64/libexec/gcc/x86_64-unknown-linux-gnu/4.7.1/cc1: error while loading shared libraries: libcloog.so.0: cannot open shared object file: No such file or directory
wmakeLnInclude: linking include files to ./lnInclude
'libNULL.so' is up to date.
/apps/compilers/gnu/4.7.1/1/bit-64/libexec/gcc/x86_64-unknown-linux-gnu/4.7.1/cc1: error while loading shared libraries: libcloog.so.0: cannot open shared object file: No such file or directory
/apps/compilers/gnu/4.7.1/1/bit-64/libexec/gcc/x86_64-unknown-linux-gnu/4.7.1/cc1: error while loading shared libraries: libcloog.so.0: cannot open shared object file: No such file or directory
wmakeLnInclude: linking include files to ./lnInclude
'libNULL.so' is up to date.
/apps/compilers/gnu/4.7.1/1/bit-64/libexec/gcc/x86_64-unknown-linux-gnu/4.7.1/cc1: error while loading shared libraries: libcloog.so.0: cannot open shared object file: No such file or directory
/apps/compilers/gnu/4.7.1/1/bit-64/libexec/gcc/x86_64-unknown-linux-gnu/4.7.1/cc1: error while loading shared libraries: libcloog.so.0: cannot open shared object file: No such file or directory
wmakeLnInclude: linking include files to ./lnInclude
'libNULL.so' is up to date.
/apps/compilers/gnu/4.7.1/1/bit-64/libexec/gcc/x86_64-unknown-linux-gnu/4.7.1/cc1: error while loading shared libraries: libcloog.so.0: cannot open shared object file: No such file or directory
/apps/compilers/gnu/4.7.1/1/bit-64/libexec/gcc/x86_64-unknown-linux-gnu/4.7.1/cc1: error while loading shared libraries: libcloog.so.0: cannot open shared object file: No such file or directory
wmakeLnInclude: linking include files to ./lnInclude
'libNULL.so' is up to date.
/apps/compilers/gnu/4.7.1/1/bit-64/libexec/gcc/x86_64-unknown-linux-gnu/4.7.1/cc1: error while loading shared libraries: libcloog.so.0: cannot open shared object file: No such file or directory
/apps/compilers/gnu/4.7.1/1/bit-64/libexec/gcc/x86_64-unknown-linux-gnu/4.7.1/cc1: error while loading shared libraries: libcloog.so.0: cannot open shared object file: No such file or directory
wmakeLnInclude: linking include files to ./lnInclude
'libNULL.so' is up to date.
/apps/compilers/gnu/4.7.1/1/bit-64/libexec/gcc/x86_64-unknown-linux-gnu/4.7.1/cc1: error while loading shared libraries: libcloog.so.0: cannot open shared object file: No such file or directory
/apps/compilers/gnu/4.7.1/1/bit-64/libexec/gcc/x86_64-unknown-linux-gnu/4.7.1/cc1: error while loading shared libraries: libcloog.so.0: cannot open shared object file: No such file or directory
wmakeLnInclude: linking include files to ./lnInclude
'libNULL.so' is up to date.
/apps/compilers/gnu/4.7.1/1/bit-64/libexec/gcc/x86_64-unknown-linux-gnu/4.7.1/cc1: error while loading shared libraries: libcloog.so.0: cannot open shared object file: No such file or directory
/apps/compilers/gnu/4.7.1/1/bit-64/libexec/gcc/x86_64-unknown-linux-gnu/4.7.1/cc1: error while loading shared libraries: libcloog.so.0: cannot open shared object file: No such file or directory
wmakeLnInclude: linking include files to ./lnInclude
'libNULL.so' is up to date.
/apps/compilers/gnu/4.7.1/1/bit-64/libexec/gcc/x86_64-unknown-linux-gnu/4.7.1/cc1: error while loading shared libraries: libcloog.so.0: cannot open shared object file: No such file or directory
/apps/compilers/gnu/4.7.1/1/bit-64/libexec/gcc/x86_64-unknown-linux-gnu/4.7.1/cc1: error while loading shared libraries: libcloog.so.0: cannot open shared object file: No such file or directory
wmakeLnInclude: linking include files to ./lnInclude
'libNULL.so' is up to date.
/apps/compilers/gnu/4.7.1/1/bit-64/libexec/gcc/x86_64-unknown-linux-gnu/4.7.1/cc1: error while loading shared libraries: libcloog.so.0: cannot open shared object file: No such file or directory
/apps/compilers/gnu/4.7.1/1/bit-64/libexec/gcc/x86_64-unknown-linux-gnu/4.7.1/cc1: error while loading shared libraries: libcloog.so.0: cannot open shared object file: No such file or directory
wmakeLnInclude: linking include files to ./lnInclude
'libNULL.so' is up to date.
/apps/compilers/gnu/4.7.1/1/bit-64/libexec/gcc/x86_64-unknown-linux-gnu/4.7.1/cc1: error while loading shared libraries: libcloog.so.0: cannot open shared object file: No such file or directory
/apps/compilers/gnu/4.7.1/1/bit-64/libexec/gcc/x86_64-unknown-linux-gnu/4.7.1/cc1: error while loading shared libraries: libcloog.so.0: cannot open shared object file: No such file or directory
wmakeLnInclude: linking include files to ./lnInclude
'libNULL.so' is up to date.

SWAK_PYTHON_INCLUDE not defined .... no Python-Integration. Most people are fine without it

....etc

int, Foam::DynamicList<char, 0u, 2u, 1u>&, int&, int, bool, Foam::IOstream::streamFormat, Foam::IOstream::versionNumber)'
collect2: error: ld returned 1 exit status
make[1]: *** [OpenFOAM.out] Error 1
make[1]: Leaving directory `/nobackup/cenmk/swak4Foam_2.x/Utilities/replayTransientBC'
make: *** [replayTransientBC] Error 2
make: Target `application' not remade because of errors.


wyldckat March 3, 2014 10:26

Sorry, I was a bit of in a hurry and didn't notice the 2 typos:
  1. I did forget one " ' ", as you've indicated.
  2. The line regarding LD_LIBRARY_PATH was broken.
Please edit the file "$HOME/.OpenFOAM/prefs.sh" and change the last line to this:
Code:

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$FOAM_USER_LIBBIN
(edit: not APPBIN, but LIBBIN)
Then you'll have to start a new terminal, because the other one is now contaminated :(


And I didn't know you were using modules. This would explain why it's not working as expected, because these modules are usually created manually.
If you prefer, you can move the contents of the file "$HOME/.OpenFOAM/prefs.sh" directly into your ".bashrc" file.

gschaider March 3, 2014 10:58

Quote:

Originally Posted by navid2 (Post 477659)
thanks Bernhard for your attention. i downloaded the "tarball", but when i type ./Allwmake in terminal, an unfinished process is teken place. i waited 10 minutes but the process was not finished(my system has 4 core with rate 2.6). output message from linux terminal is attached.
any help is appreciated.

The relevant output is (copied from your word-file):
Code:

SOURCE=FieldValueExpressionParser.yy ; rm -f Make/linux64GccDPOpt/FieldValueExpressionParser.C Make/linux64GccDPOpt/FieldValueExpressionParser.tab.hh; mkdir $$; cd $$; bison -ra -v  -d ../$SOURCE ; mv *.tab.cc ../Make/linux64GccDPOpt/FieldValueExpressionParser.C ; sed -i.bak "s/position.hh/FieldValueExpressionParser_position.hh/" location.hh ; mv location.hh ../lnInclude/FieldValueExpressionParser_location.hh ; mv stack.hh ../lnInclude/FieldValueExpressionParser_stack.hh ; mv position.hh ../lnInclude/FieldValueExpressionParser_position.hh ; sed -i.bak "s/stack.hh/FieldValueExpressionParser_stack.hh/;s/location.hh/FieldValueExpressionParser_location.hh/" FieldValueExpressionParser.tab.hh ;mv *.hh ../lnInclude ; touch -r ../$SOURCE ../lnInclude/FieldValueExpressionParser*.hh ; cd ..; rm -r $$; if [ -z "" ]; then echo -e "\n\nIf compilation of the grammers takes prohibitivly long set SWAK_COMPILE_GRAMMAR_OPTION to something like -O1\n\n" ; fi;  g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-100 -IMake/linux64GccDPOpt          -I/opt/openfoam230/src/finiteVolume/lnInclude -I/opt/openfoam230/src/sampling/lnInclude -I/opt/openfoam230/src/fileFormats/lnInclude -I/opt/openfoam230/src/triSurface/lnInclude -I/opt/openfoam230/src/surfMesh/lnInclude -I/opt/openfoam230/src/lagrangian/basic/lnInclude -I/opt/openfoam230/src/meshTools/lnInclude -IlnInclude -I. -I/opt/openfoam230/src/OpenFOAM/lnInclude -I/opt/openfoam230/src/OSspecific/POSIX/lnInclude  -fPIC  -c Make/linux64GccDPOpt/FieldValueExpressionParser.C -o Make/linux64GccDPOpt/FieldValueExpressionParser.o
-e

If compilation of the grammers takes prohibitivly long set SWAK_COMPILE_GRAMMAR_OPTION to something like -O1

It seems that it is the compilation of the grammar that takes quite long. The problem is that bison generates a rather large C++-file and some compiler versions (of G++ or clang) think that they have to optimize it very thoroughly which takes a looong time (situation gets even worse if WM_NCOMPPROCS is set to values 2 or larger. Then there might even be a memory-problem).

Anyway: this problem is known, there is a fix and a hint to the solution is given in the output. What annoys me now is how people seem to not read that hint. So a question like "I'm new with Linux. What does 'set xxx to yyy' mean" is a valid question and I might gladly answer that with something like "Do on the command-line 'export SWAK_COMPILE_GRAMMAR_OPTION=-O1' and then compile (you'll know that you correctly set the variable when the 'If compilation ...' output is not there)" or a question like "I tried SWAK_COMPILE_GRAMMAR_OPTION=-O1, it doesn't help" might trigger a "Strange. Which compiler-version?" but a Word-file with the problem (and the probable solution) copy/pasted makes me only look to the sky and say "why do I even bother?" (the answer is: because silently I hope that it is only every fifth user that doesn't read the output before asking)


All times are GMT -4. The time now is 18:16.