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

[OpenFOAM.org] Compile OF 2.3 on Mac OS X .... the patch

Register Blogs Community New Posts Updated Threads Search

Like Tree8Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 28, 2015, 07:38
Default
  #181
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 39
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

As the path in error is

Code:
/bin/tools/RunFunctions
I would suppose you did not set up environment variables, because this is the line in the script where it sources RunFunctions

Code:
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
as your environment was not set up, $WM_PROJECT_DIR is expanded into empty string.
alexeym is offline   Reply With Quote

Old   March 31, 2015, 11:03
Default
  #182
Senior Member
 
Join Date: Mar 2015
Posts: 250
Rep Power: 12
KateEisenhower is on a distinguished road
Hi,

I am not sure if I understand what you are trying to tell me. Has it something to do with the post-configuration part of the Hopscotch Building OpenFOAM on OS X guide (http://matveichev.blogspot.fr/2014/0...on-os-x.html)?
I didn't understand this part and I guess it didn't work on my machine.

How do I set up environment variables?
Quote:
Originally Posted by alexeym View Post
Hi,

As the path in error is

Code:
/bin/tools/RunFunctions
I would suppose you did not set up environment variables, because this is the line in the script where it sources RunFunctions

Code:
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
as your environment was not set up, $WM_PROJECT_DIR is expanded into empty string.
KateEisenhower is offline   Reply With Quote

Old   March 31, 2015, 11:12
Default
  #183
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 39
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

Maybe here it is written clearer - https://github.com/mrklein/openfoam-...-configuration.

If you were able to build OpenFOAM, then once you have set up environment variables. In general it is done with 'source $HOME/OpenFOAM/OpenFOAM-2.3.1/etc/bashrc' command. But before issuing this command you have to mount disk image with case sensitive file system you have created.
alexeym is offline   Reply With Quote

Old   March 31, 2015, 11:20
Default
  #184
Senior Member
 
Join Date: Mar 2015
Posts: 250
Rep Power: 12
KateEisenhower is on a distinguished road
Hi,

everytime I reboot my mac I am typing the following:
Code:
hdiutil attach -mountpoint $HOME/OpenFOAM OpenFOAM.sparsebundle
source $HOME/OpenFOAM/OpenFOAM-2.3.1/etc/bashrc
So I guess that is not the problem. Am I wrong?

p.s.: Thank you for the post configuration guide. I will try this!
KateEisenhower is offline   Reply With Quote

Old   March 31, 2015, 11:28
Default
  #185
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 39
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Well, commands seems to be OK. What is the output of the commands?

Post-configuration guide is just trying to automate the commands you are entering. If they do not work then re-reading the guide in general will not help.
alexeym is offline   Reply With Quote

Old   March 31, 2015, 11:37
Default
  #186
Senior Member
 
Join Date: Mar 2015
Posts: 250
Rep Power: 12
KateEisenhower is on a distinguished road
The output is:

Code:
Kates-MacBook-Pro:~ kateeisenhower$ hdiutil attach -mountpoint $HOME/OpenFOAM OpenFOAM.sparsebundle
/dev/disk2          	GUID_partition_scheme          	
/dev/disk2s1        	EFI                            	
/dev/disk2s2        	Apple_HFS                      	/Users/kateeisenhower/OpenFOAM
Kates-MacBook-Pro:~ kateeisenhower$ source $HOME/OpenFOAM/OpenFOAM-2.3.1/etc/bashrc
Using paraview in directory /Applications/paraview.app
KateEisenhower is offline   Reply With Quote

Old   March 31, 2015, 11:39
Default
  #187
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 39
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
And then you open new terminal and try to run tutorial case? You have to do 'source $HOME/OpenFOAM/OpenFOAM-2.3.1/etc/bashrc' every time you open new terminal session.
alexeym is offline   Reply With Quote

Old   March 31, 2015, 11:40
Default
  #188
Senior Member
 
Join Date: Mar 2015
Posts: 250
Rep Power: 12
KateEisenhower is on a distinguished road
I never close terminal.
KateEisenhower is offline   Reply With Quote

Old   March 31, 2015, 11:42
Default
  #189
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 39
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
And you always work in one tab/window? You never open new windows/tabs?
alexeym is offline   Reply With Quote

Old   March 31, 2015, 11:46
Default
  #190
Senior Member
 
Join Date: Mar 2015
Posts: 250
Rep Power: 12
KateEisenhower is on a distinguished road
Not within the terminal app.

Ah, now I got it. When I double click on the Allrun script, it opens in a new window automatically. I will try to follow the guide you recommended me for automating the process of mounting disk image and setup environment variables. This will solve the problem, right?

Thank you very much for your help!
KateEisenhower is offline   Reply With Quote

Old   April 1, 2015, 04:50
Default
  #191
Senior Member
 
Join Date: Mar 2015
Posts: 250
Rep Power: 12
KateEisenhower is on a distinguished road
Quote:
Originally Posted by alexeym View Post
Hi,

Maybe here it is written clearer - https://github.com/mrklein/openfoam-...-configuration.

If you were able to build OpenFOAM, then once you have set up environment variables. In general it is done with 'source $HOME/OpenFOAM/OpenFOAM-2.3.1/etc/bashrc' command. But before issuing this command you have to mount disk image with case sensitive file system you have created.
Hello,

I tried to follow the default version approach but I have two questions:

1) In which directory do I have to be when I make the directory .OpenFOAM?

2) Where is my ~/.profile?

Thanks in advance
KateEisenhower is offline   Reply With Quote

Old   April 1, 2015, 05:08
Default
  #192
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 39
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

1. Really, I have omitted this in guide. You should be in $HOME folder (/Users/kateeisenhower).

2. In general on Unices ~ refers to home folder, so your ~/.profile is /Users/kateeisenhower/.profile.

You can check if installation succeeded by executing Allrun in Terminal instead of Finder. I.e. in the terminal, where you have mounted disk image and then executed 'source $HOME/OpenFOAM/OpenFOAM-2.3.1/etc/bashrc', you write (text starting from # is a commentary)

Code:
tut # will got to tutorials folder
cd incompressible/simpleFoam/motorBike # go to motorBike tutorial
./Allrun # run tutorial
alexeym is offline   Reply With Quote

Old   April 1, 2015, 06:17
Default
  #193
Senior Member
 
Join Date: Mar 2015
Posts: 250
Rep Power: 12
KateEisenhower is on a distinguished road
Quote:
Originally Posted by alexeym View Post
Hi,

1. Really, I have omitted this in guide. You should be in $HOME folder (/Users/kateeisenhower).

2. In general on Unices ~ refers to home folder, so your ~/.profile is /Users/kateeisenhower/.profile.

You can check if installation succeeded by executing Allrun in Terminal instead of Finder. I.e. in the terminal, where you have mounted disk image and then executed 'source $HOME/OpenFOAM/OpenFOAM-2.3.1/etc/bashrc', you write (text starting from # is a commentary)

Code:
tut # will got to tutorials folder
cd incompressible/simpleFoam/motorBike # go to motorBike tutorial
./Allrun # run tutorial
1) I read the guide another time but I couldn't find it. However I tried to create a file with the version inside:
Code:
Kates-MacBook-Pro:~ kateeisenhower$ mkdir -p .OpenFOAM
Kates-MacBook-Pro:~ kateeisenhower$ echo '2.3.1' > .OpenFOAM/OpenFOAM-release
Kates-MacBook-Pro:~ kateeisenhower$
2) I know that, but in my home folder there is no such file. So I asked again.
KateEisenhower is offline   Reply With Quote

Old   April 1, 2015, 06:31
Default
  #194
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 39
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
And the result of these operations? Do you still have problems with tutorial execution or it started to work?
alexeym is offline   Reply With Quote

Old   April 1, 2015, 06:33
Default
  #195
Senior Member
 
Join Date: Mar 2015
Posts: 250
Rep Power: 12
KateEisenhower is on a distinguished road
There was no result. I have posted everything which I could see in terminal.
I did not try the tutorials because I was not able to do step two of the post configuration guide because of the missing .profile.
KateEisenhower is offline   Reply With Quote

Old   April 1, 2015, 06:45
Default
  #196
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 39
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
And you can not create it? Even with just

Code:
echo 'source $HOME/openfoam-env-setup.sh' > $HOME/.profile
alexeym is offline   Reply With Quote

Old   April 1, 2015, 06:50
Default
  #197
Senior Member
 
Join Date: Mar 2015
Posts: 250
Rep Power: 12
KateEisenhower is on a distinguished road
No, it doesn't work. I looked again, but there are only my documents, music, pictures... folders as well as my OpenFOAM image and OpenFOAM.sparsebundle.
KateEisenhower is offline   Reply With Quote

Old   April 1, 2015, 06:52
Default
  #198
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 39
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
How did you do 'I looked again...'? With Finder? Or with 'ls -la' in Terminal?
alexeym is offline   Reply With Quote

Old   April 1, 2015, 06:56
Default
  #199
Senior Member
 
Join Date: Mar 2015
Posts: 250
Rep Power: 12
KateEisenhower is on a distinguished road
Okay, this worked. I can see the file now. Yes, I looked with the Finder. I don't know why but I really can't see all the files there. I am trying to complete the post configuration now.

Thank you for your help!
KateEisenhower is offline   Reply With Quote

Old   April 1, 2015, 07:54
Default
  #200
Senior Member
 
Join Date: Mar 2015
Posts: 250
Rep Power: 12
KateEisenhower is on a distinguished road
Okay, I managed to change the .profile. It looks like this now:

Code:
Kates-MacBook-Pro:~ kateeisenhower$ cat .profile
source $HOME/openfoam-env-setup.sd
if [ -f "$HOME/.OpenFOAM/OpenFOAM-release" ]; then
    FOAM_DISK_IMAGE=$HOME/OpenFOAM.sparsebundle
    FOAM_MOUNT_POINT=$HOME/OpenFOAM
    FOAM_VERSION=$(cat $HOME/.OpenFOAM/OpenFOAM-release)
    if [ ! -f "$HOME/OpenFOAM/OpenFOAM-$FOAM_VERSION/etc/bashrc" ]; then
        hdiutil attach -quiet -mountpoint "$FOAM_MOUNT_POINT" "$FOAM_DISK_IMAGE" &&
                . "$HOME/OpenFOAM/OpenFOAM-$FOAM_VERSION/etc/bashrc"
    else
        source "$HOME/OpenFOAM/OpenFOAM-$FOAM_VERSION/etc/bashrc"
    fi
fi
The first line already existed. I guess I was not supposed to delete this file.

After rebooting my mac and starting Terminal I got the following:

Code:
-bash: /Users/kateeisenhower/openfoam-env-setup.sd: No such file or directory
Using paraview in directory /Applications/paraview.app
I think the error relates to the first line in my .profile. Do I have to worry about it?

Also i ran the motorBike tutorial and snappyHexMesh worked fine.
KateEisenhower 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
[Other] dynamicTopoFVMesh and pointDisplacement RandomUser OpenFOAM Meshing & Mesh Conversion 6 April 26, 2018 08:30
Near wall treatment in k-omega SST Arnoldinho OpenFOAM Running, Solving & CFD 38 March 8, 2017 14:48
[mesh manipulation] Importing Multiple Meshes thomasnwalshiii OpenFOAM Meshing & Mesh Conversion 18 December 19, 2015 19:57
createPatch Segmentation Fault (CORE DUMPED) sam.ho OpenFOAM Pre-Processing 2 April 21, 2014 03:01
[Gmsh] Import gmsh msh to Foam adorean OpenFOAM Meshing & Mesh Conversion 24 April 27, 2005 09:19


All times are GMT -4. The time now is 20:08.