CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Installation (https://www.cfd-online.com/Forums/openfoam-installation/)
-   -   [OpenFOAM.org] Mac OS X 10.11 and OpenFOAM 3.0: Error when running ParaFoam with "command not found" (https://www.cfd-online.com/Forums/openfoam-installation/166206-mac-os-x-10-11-openfoam-3-0-error-when-running-parafoam-command-not-found.html)

hua February 4, 2016 10:55

Mac OS X 10.11 and OpenFOAM 3.0: Error when running ParaFoam with "command not found"
 
I install openfoam 3.0.0 and paraview on mac os 10.11, I succeed install them and I can run the openfoam solver and paraview without problem. But after the calculation, when I run the "paraFoam" command, I meet some error with:

➜ cavity paraFoam
Created temporary 'cavity.foam'
/Users/huaweizhuo/OpenFOAM/OpenFOAM-3.0.0/bin/paraFoam: line 283: paraview: command not found
➜ cavity which paraview
paraview () {
"/Applications/paraview.app/Contents/MacOS/paraview" "$@"
}
➜ cavity type paraveiw
paraveiw not found
➜ cavity type paraview
paraview is a shell function from /Users/huaweizhuo/OpenFOAM/OpenFOAM-3.0.0/etc/config/paraview-osx.sh

I will really appreciate it if you can help me, thank you!

wyldckat February 6, 2016 17:08

Quick question: What does this command give you?
Code:

ls -l /Applications/paraview.app/Contents/MacOS/paraview

alexeym February 7, 2016 07:18

@wyldckat

To reduce total number of questions:

- Yes, paraview is installed (since TS can run paraview from command line)
- Shell is zsh

Bash can execute functions in non-interactive shells, yet it seems zsh can not (so paraview can be executed from command line, but not from paraFoam script). Guess, the easiest way to solve the problem is to symlink /Applications/.../paraview in $WM_PROJECT_DIR/bin.

[RANT] Since I do not use zsh and has no desire to learn its idiosyncrasies, in the bug report on github I have proposed TS to find a solution, since he loves zsh. In two months he decided to look for help here (instead of zsh-related forum). [/RANT]

wyldckat February 7, 2016 11:17

@alexeym: I see: https://github.com/mrklein/openfoam-os-x/issues/17
Many thanks for the heads up!

Well, I did give zsh a quick go on Ubuntu and I wasn't able to reproduce the problem, even after doing something similar to what's done in "paraview-osx.sh", so... I don't know.
I guess this should work :confused::
Code:

bash paraFoam

alexeym February 7, 2016 12:27

@wyldckat

Guess, this issue could be version-dependent. On Ubuntu it is 5.1.1 (according to https://launchpad.net/ubuntu/+source/zsh), on OS X it could be either 5.0.8 (system), or 5.1.1 (Macports), or 5.2 (Homebrew).

Since paraFoam script on OS X could be reduced to

Code:

F=$(basename $PWD).foam; touch $F && /Applications/paraview.app/Contents/MacOS/paraview --data=$F; rm $F
The line could be set as an alias to paraFoam (though do not know if in zsh aliases have priority over PATH content, maybe alias name could be just pf).

Nevertheless this does not change the fact, that the problem has nothing to do with OpenFOAM, paraview, or OS X.

hua February 8, 2016 09:38

➜ ~ ls -l /Applications/paraview.app/Contents/MacOS/paraview
-r-x------@ 1 huaweizhuo admin 970452 Sep 12 06:37 /Applications/paraview.app/Contents/MacOS/paraview

hua February 8, 2016 09:58

Quote:

Originally Posted by alexeym (Post 584062)
@wyldckat

To reduce total number of questions:

- Yes, paraview is installed (since TS can run paraview from command line)
- Shell is zsh

Bash can execute functions in non-interactive shells, yet it seems zsh can not (so paraview can be executed from command line, but not from paraFoam script). Guess, the easiest way to solve the problem is to symlink /Applications/.../paraview in $WM_PROJECT_DIR/bin.

[RANT] Since I do not use zsh and has no desire to learn its idiosyncrasies, in the bug report on github I have proposed TS to find a solution, since he loves zsh. In two months he decided to look for help here (instead of zsh-related forum). [/RANT]

As I am a newbee in Linux(or Mac OS), So would you mind me ask some simple question? how to symlink /Applications/.../paraview in $WM_PROJECT_DIR/bin, thank you very much!

alexeym February 8, 2016 10:21

Hi,

Well, what if you try:

https://duckduckgo.com/?q=how+to+cre...ink+on+os+x%3F

To avoid problem of choice:

http://apple.stackexchange.com/quest...nk-in-terminal

http://hints.macworld.com/article.ph...01110610290643

Then you can try

https://duckduckgo.com/?q=paraview+o...m+os+x+symlink

And go to section 6 of https://openfoamwiki.net/index.php/I...OpenFOAM_2.2.2.

[RANT]Though I still not quite understand why you are able to change default shell to zsh (guess you wanted that fancy prompt with arrow?), and can not create symlink or use search engine.[/RANT]

hua February 8, 2016 11:44

Quote:

Originally Posted by alexeym (Post 584202)
Hi,

Well, what if you try:

https://duckduckgo.com/?q=how+to+cre...ink+on+os+x%3F

To avoid problem of choice:

http://apple.stackexchange.com/quest...nk-in-terminal

http://hints.macworld.com/article.ph...01110610290643

Then you can try

https://duckduckgo.com/?q=paraview+o...m+os+x+symlink

And go to section 6 of https://openfoamwiki.net/index.php/I...OpenFOAM_2.2.2.

[RANT]Though I still not quite understand why you are able to change default shell to zsh (guess you wanted that fancy prompt with arrow?), and can not create symlink or use search engine.[/RANT]

This is the result after I create the Symlink.
➜ ~ ln -s /Applications/paraview/Contents/MacOS/paraview $WM_PROJECT_DIR/bin/paraview
ln: /Users/huaweizhuo/OpenFOAM/OpenFOAM-3.0.0/bin/paraview: File exists
➜ ~ ls OpenFOAM/OpenFOAM-3.0.0/bin
engridFoam foamExec foamPackBin foamTags
findEmptyMake foamGraphExecTime foamPackBinAll foamUpdateCaseFileHeader
foamAllHC foamGraphResKE foamPackDoxygen mpirunDebug
foamCheckJobs foamGraphResUVWP foamPackSource org-html
foamCleanPath foamInstallationTest foamPackThirdParty org-latex
foamCleanPolyMesh foamJob foamPackThirdPartyBin org-pdflatex
foamCleanTutorials foamLog foamPackThirdPartyBinAll paraFoam
foamCloneCase foamMonitor foamPrintJobs paraview
foamCopySettings foamNew foamProcessInfo rmcore

It seems that the Symlink is created successfully, but the problem is still not settled.

hua February 10, 2016 23:45

change the shell to bash, the problem is settled
 
Absolutely, this is a problem caused by zsh shell. After I uninstall oh_my_zsh using command "uninstall_oh_my_zsh", I change the shell back to bash and the problem is settled.
Thank you very much for your help.
By the way, if I want to use oh_my_zsh, how to tackle the problem?


All times are GMT -4. The time now is 23:44.