CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Installation (http://www.cfd-online.com/Forums/openfoam-installation/)
-   -   ./Allwmake: 39: wmakeCheckPwd: not found (http://www.cfd-online.com/Forums/openfoam-installation/91844-allwmake-39-wmakecheckpwd-not-found.html)

rob3rt 0ng August 24, 2011 09:37

./Allwmake: 39: wmakeCheckPwd: not found
 
Hi All,

I am trying to install OF-2.0.x as outlined from here http://www.openfoam.org/git.php but when I tried to compile ./Allwmake it gave me error
PHP Code:

[I]./Allwmake39wmakeCheckPwdnot found
Error
Current directory is not $WM_THIRD_PARTY_DIR
    The environment variables are inconsistent with the installation
.
    
Check the OpenFOAM entries in your dot-files and source them.[/I

Before tried compiling I added source $HOME/OpenFOAM/OpenFOAM-2.0.x/etc/bashrc in my ~/.bashrc then when I source $HOME/.bashrc it gave me
PHP Code:

bash: /home/roberto/OpenFOAM/OpenFOAM-2.0.x/etc/bashrcNo such file or directory 

And when I deleted the source $HOME/OpenFOAM/OpenFOAM-2.0.x/etc/bashrc from ~/.bashrc and ran source $HOME/.bashrc, it was fine. But then it failed when I tried to compile as per aforementioned error about wmakeCheckPwd: not found.

Please help as this is getting quite frustated :p

Thanks and regards,
Robert

wyldckat August 24, 2011 16:29

Greetings Robert,

Does the folder even exist? Have you checked? Are you 100% certain that every single character is identical!? Keep in mind that "OpenFOAM" is not the same as "openFOAM"!

Anyway, you can check if the file really exists by running these commands:
Code:

ls -l $HOME/OpenFOAM/OpenFOAM-2.0.x/etc/bashrc
ls -l $HOME/OpenFOAM/OpenFOAM-2.0.x/etc/
ls -l $HOME/OpenFOAM/OpenFOAM-2.0.x/
ls -l $HOME/OpenFOAM/

These will check if:
  1. the aforementioned file does exist or not;
  2. If the folder where it should be does exist or not;
  3. then the parent folder...
  4. then the parent folder of the previous folder.
If none of these give you the files we are looking for, then you better check what you've been doing ;)

Best regards,
Bruno

rob3rt 0ng August 27, 2011 06:12

Hi Bruno,

Thanks for your instant reply! I did mess up something before and got it fixed.

I've tried OF.2.0.x and found some compilation error for my solver which works fine in OF.1.6.x. AFAIK, things like readSIMPLECONTROLS.H and readPIMPLECONTROLS.H are no longer exist, so I think for now I will stick with OF1.6.x.

However, I encountered some discrepancy between Ubuntu Natty gcc version (4.5.2) with respect to OF1.6.x (4.3), thus I got errors in compiling it. Can you please guide me on how to solve this? or do I have to use an older Ubuntu version?

Thanks very much for your time.

Regards,
Robert

l_r_mcglashan August 27, 2011 06:28

There are a number of differences in OF2.0. In particular there are now classes such as simpleControl and pimpleControl that take the place of readSimpleControls.H. It's really not very difficult to change to the new classes.

As for compiler errors, you can post them up here!

wyldckat August 27, 2011 06:30

Hi Robert,

Bad idea: do not try to build OpenFOAM 1.6.x with gcc 4.5!! It's not compatible, due to some stuff that changed between 4.4 and 4.5. Gcc 4.5 can be used with OpenFOAM 1.7.1 and above.

Go to the Synaptic Package Manager and search for "gcc-4.3-base" and/or "gcc-4.4-base". Install 4.4 or both, it's up to you. Install "g++-4.4" as well.
Then... I know I've explained this before somewhere... Ah, here we go, see post #2: http://www.cfd-online.com/Forums/ope...tml#post278809 - but instead of replacing with gcc44 and g++44, use gcc-4.4 and g++-4.4.

Best regards and good luck!
Bruno

l_r_mcglashan August 27, 2011 06:34

Quote:

Originally Posted by wyldckat (Post 321890)

Bad idea: do not try to build OpenFOAM 1.6.x with gcc 4.5!! It's not compatible, due to some stuff that changed between 4.4 and 4.5. Gcc 4.5 can be used with OpenFOAM 1.7.1 and above.

Really? Do you have a link to the issues?

wyldckat August 27, 2011 06:47

Hi Laurence,
Quote:

Originally Posted by l_r_mcglashan (Post 321891)
Really? Do you have a link to the issues?

Of course I do :cool:: http://www.cfd-online.com/Forums/ope...gcc-4-5-x.html

I didn't back up my claim immediately because I was feeling lazy and didn't seem very important ;)

And I know I've got a link to the repo with the necessary changes somewhere here in the forum... odd, I can't find it... I'll keep looking and post back here :)

edit: This should be the commit that fixes the issue with gcc 4.5: 24257a08dc25c30946fb

Best regards,
Bruno

l_r_mcglashan August 27, 2011 06:55

Cheers, I was just curious, I don't remember it for some reason!

rob3rt 0ng August 27, 2011 12:44

Thanks to both of you for taking time to reply :)

@Bruno: As you suggested, I downloaded gcc and g++ 4.4 from the synaptic manager then followed your instructions but it gave me the same compilation errors complaining about wmake error: file 'Make/linux64GccDPOpt/objectFiles' could not be created. Then I looked up in ~/OpenFOAM/OpenFOAM-1.6.x/wmake/rules and found only gcc 4.2 and 4.3 are listed. I tried to search for gcc and g++ 4.3 from synaptic, however, they are not longer there. Could you please give me a little bit more hints of what to do next?

@Laurence: I'd like to try out OF.2.0.x without having to re-adjust my solvers :p but thanks to your hints I think the changes are not very difficult to implement.

Regards,
Robert

wyldckat August 27, 2011 14:42

Hi Robert,

Quote:

Originally Posted by rob3rt 0ng (Post 321921)
@Bruno: As you suggested, I downloaded gcc and g++ 4.4 from the synaptic manager then followed your instructions but it gave me the same compilation errors complaining about wmake error: file 'Make/linux64GccDPOpt/objectFiles' could not be created.

Mmm... I've got a feeling that you're not managing properly the various OpenFOAM versions you have.

To have more than one version available on your system, remove/comment any lines related to OpenFOAM that you have in the file "$HOME/.bashrc" and (for example) add these instead:
Code:

alias of16x='. $HOME/OpenFOAM/OpenFOAM-1.6.x/etc/bashrc'
alias of20x='. $HOME/OpenFOAM/OpenFOAM-2.0.x/etc/bashrc'

Then whenever you start a new terminal window or tab, you can choose which environment you want by running of16x or of20x.
Keep in mind that you cannot change OpenFOAM environments when on the same terminal window or tab; this means that if you want to run solvers from both versions at the same time, you'll need two separate terminal windows/tabs for running each one.

Quote:

Originally Posted by rob3rt 0ng (Post 321921)
Then I looked up in ~/OpenFOAM/OpenFOAM-1.6.x/wmake/rules and found only gcc 4.2 and 4.3 are listed. I tried to search for gcc and g++ 4.3 from synaptic, however, they are not longer there.

That's somewhat normal. The rules linuxGcc and linux64Gcc will work well with Gcc 4.4.

Quote:

Originally Posted by rob3rt 0ng (Post 321921)
Could you please give me a little bit more hints of what to do next?

Again, I still have the feeling that your shell environment is contaminated with more than one OpenFOAM environment. Nonetheless, here's what I suggest:
  1. What do these commands output:
    Code:

    echo $WM_CC
    echo $WM_CXX
    which $WM_CC
    which $WM_CXX

    They should show you where gcc-4.4 and g++-4.4 are.
  2. Restart the build with a clean start at OpenFOAM's 1.6.x project folder:
    Code:

    wcleanAll
    wcleanLnIncludeAll
    export WM_NCOMPPROCS=8
    ./Allwmake > make.log 2>&1

    8 is the number of cores/threads your machine has... well, change to the value that your machine has, since this will speed things up for the building part. The whole building process will be logged in the file make.log. This way it's easier to keep track of what's going on.
  3. In case this still don't build, edit make.log, search & replace any sensitive data; save and compress and attach the file in your next post.
Other than this, only with more information will I be able to figure out what's going on...

Best regards,
Bruno

rob3rt 0ng August 27, 2011 23:21

1 Attachment(s)
Hi Bruno,

I've only got OF-1.6.x now so there should not be any sourcing environment problems I hope.

These commands gave me
Code:

echo $WM_CC: gcc-4.4
echo $WM_CXX: g++-4.4
which $WM_CC: /usr/bin/gcc-4.4
which $WM_CXX: /usr/bin/g++-4.4

just as you predicted.
However it still gave me the same compilation error. Please find the attached for the make.log, bashrc and settings.sh. I'm not very sure what do you mean by search & replace sensitive data so I didn't do this I hope you don't mind:p

Thanks and regards,
Robert

Attachment 8977

wyldckat August 28, 2011 07:27

OpenFOAM 1.6.x on Ubuntu 11.04 Natty
 
Hi Robert,

I installed Natty 64bit in a virtual machine and had a go at it with OpenFOAM 1.6.x. Here are my findings:

Well, there is a binary not very well known as "cpp" which pre-processes code for GNU code building applications. This is a very important binary and in your system there should also exist a version for gcc 4.4 named cpp-4.4:
Code:

which cpp-4.4
If not, install it!
So edit the file "wmake/rules/linux64Gcc/general" and change the line:
Code:

CPP        = cpp $(GFLAGS)
To:
Code:

CPP        = cpp-4.4 $(GFLAGS)
Another tool needed to be installed: bison
Code:

sudo apt-get install bison
It's necessary for libscotch.

edit: binutils-dev also has to be installed:
Code:

sudo apt-get install binutils-dev
Now we must do a full clean up (or almost full) to the ThirdParty-1.6.x folder:
Code:

foam3rdParty
wcleanLnIncludeAll
./Allclean
wclean libso scotch_5.1/src/libscotch
wclean libso metis-5.0pre2/GKlib
wclean libso metis-5.0pre2/libmetis
( cd ParMetis-3.1 && WM_OPTIONS=${WM_OPTIONS}$WM_MPLIB && wclean libso METISLib && wclean libso ParMETISLib )
wclean libso ParMGridGen-1.0/MGridGen/IMlib
wclean libso ParMGridGen-1.0/MGridGen/Lib

Note: the first command will jump to the ThirdParty-1.6.x folder.

Now it's time to clean up the OpenFOAM-1.6.x folder as well and have ago at it once more (the first command will jump to there):
Code:

foam
wcleanAll
wcleanLnIncludeAll
./Allwmake > make.log 2>&1

Note: if you started on a new terminal, don't forget to set WM_NCOMPPROCS.

More notes: Ignore the errors related to "hoard" and "fsbmalloc": those are very outdated pieces of technology that are no longer supported... at least in OpenFOAM 1.7.x and 2.0.x.

It's still building on my virtual machine, so I don't know if there any more errors to come by...

Best regards,
Bruno

rob3rt 0ng August 29, 2011 00:34

Hi Bruno,

That solved it! Thanks very much for your time and sorry for the work/time you spent for this during the weekend :)

Kind Regards,
Robert


All times are GMT -4. The time now is 07:33.