tag:blogger.com,1999:blog-2999455244261692537.post1013866440662971837..comments2023-04-12T11:30:27.686+02:00Comments on Hopscotch: Building OpenFOAM on OS X999http://www.blogger.com/profile/07567030127854361710noreply@blogger.comBlogger49125tag:blogger.com,1999:blog-2999455244261692537.post-74350178892419723762015-12-18T00:50:30.005+01:002015-12-18T00:50:30.005+01:00Well - "...like you would in Linux..." -...Well - "...like you would in Linux..." - I have never done this. I always have default version and environment is automatically set up for this version.<br /><br />You can use this file: https://github.com/mrklein/openfoam-os-x/blob/master/files/openfoam-env-setup.sh (download it, add 'source /path/to/the/openfoam-env-setup.sh' to your profile). Then after if you have ~/.OpenFOAM/OpenFOAM-release file with version inside, disk i automatically mounted, environment is set up. Otherwise you get of22x, of231, etc functions to set up environment. Also it is explained in wiki: https://github.com/mrklein/openfoam-os-x/wiki/Post-configuration. 999https://www.blogger.com/profile/07567030127854361710noreply@blogger.comtag:blogger.com,1999:blog-2999455244261692537.post-61017041055121293672015-12-17T22:34:46.084+01:002015-12-17T22:34:46.084+01:00Hi,
I'm just wondring if there's a way to...Hi,<br /><br />I'm just wondring if there's a way to execute openfoam by entering some command (say, of230) like you would in Linux instead of automatically mounting the disk image every time I open the terminal? <br /><br />Thank you for your help!<br />Jiho Yanghttps://www.blogger.com/profile/17181564173204279696noreply@blogger.comtag:blogger.com,1999:blog-2999455244261692537.post-48470634686345311772015-11-11T21:01:30.463+01:002015-11-11T21:01:30.463+01:00Please see my reply at cfd-online.Please see my reply at cfd-online.999https://www.blogger.com/profile/07567030127854361710noreply@blogger.comtag:blogger.com,1999:blog-2999455244261692537.post-33370193179435485772015-11-11T18:09:31.187+01:002015-11-11T18:09:31.187+01:00Hi Alexey!
I am trying to compile OpenFOAM-3.0.0 ...Hi Alexey!<br /><br />I am trying to compile OpenFOAM-3.0.0 following your guidelines and your newly posted patch for OF3.0.0 on your repository https://github.com/mrklein/openfoam-os-x. I tried both with macports and homebrew, and I managed to compile it both without any bad issues. However when I run the cavity case I always have this issue:<br /><br />Code:<br />Starting time loop<br /><br />Time = 0.005<br /><br />Courant Number mean: 0 max: 0<br />smoothSolver: Solving for Ux, Initial residual = 1, Final residual = 8.90511e-06, No Iterations 19<br />smoothSolver: Solving for Uy, Initial residual = 0, Final residual = 0, No Iterations 0<br />DICPCG: Solving for p, Initial residual = 1, Final residual = 7.55423e-07, No Iterations 35<br />time step continuity errors : sum local = 5.03808e-09, global = -7.94093e-21, cumulative = -7.94093e-21<br />DICPCG: Solving for p, Initial residual = 0.523588, Final residual = 9.72371e-07, No Iterations 34<br />time step continuity errors : sum local = 1.07766e-08, global = 2.00426e-19, cumulative = 1.92485e-19<br />dyld: lazy symbol binding failed: Symbol not found: __ZN4FoamlsERNS_7OstreamEl<br /> Referenced from: /Users/oleg/OpenFOAM/OpenFOAM-3.0.x/platforms/darwin64ClangDPInt32Opt/bin/icoFoam<br /> Expected in: flat namespace<br /><br />dyld: Symbol not found: __ZN4FoamlsERNS_7OstreamEl<br /> Referenced from: /Users/oleg/OpenFOAM/OpenFOAM-3.0.x/platforms/darwin64ClangDPInt32Opt/bin/icoFoam<br /> Expected in: flat namespace<br /><br />Trace/BPT trap: 5<br />Basically, I didn't create a new sparse image for particularly this OF version, because I used 2.1 before. So i compiled on the disk image I had created before.<br /><br />I posted the same thing on cfd-online :)<br />Thank you in advance!<br />OlegOleg Kotsurhttps://www.blogger.com/profile/02164157614317358200noreply@blogger.comtag:blogger.com,1999:blog-2999455244261692537.post-91473346966411477612015-06-24T21:27:21.266+02:002015-06-24T21:27:21.266+02:00Everything's working fine now! Thank you !Everything's working fine now! Thank you !Jiho Yanghttps://www.blogger.com/profile/17181564173204279696noreply@blogger.comtag:blogger.com,1999:blog-2999455244261692537.post-10749443199462116492015-06-23T15:11:16.325+02:002015-06-23T15:11:16.325+02:00You can unmount disk image (though I do not see th...You can unmount disk image (though I do not see the point), .openfoam-env-setup.sh tries to mount disk image if it can not find bashrc file.999https://www.blogger.com/profile/07567030127854361710noreply@blogger.comtag:blogger.com,1999:blog-2999455244261692537.post-69638356325119455512015-06-23T14:04:32.808+02:002015-06-23T14:04:32.808+02:00It works! I can't thank you more :) Thank you ...It works! I can't thank you more :) Thank you so much you made my day!<br /><br />Regarding to disk image mount, do I have to leave the OpenFOAM disk mounted at all times? Is there a way to make it to be mounted automatically whenever I wish to use OpenFOAM instead of having it always mounted? <br /><br />ThanksJiho Yanghttps://www.blogger.com/profile/17181564173204279696noreply@blogger.comtag:blogger.com,1999:blog-2999455244261692537.post-68417487462064088412015-06-23T13:51:42.486+02:002015-06-23T13:51:42.486+02:00Hi,
I would suggest you this: https://github.com/...Hi,<br /><br />I would suggest you this: https://github.com/mrklein/openfoam-os-x/wiki/Post-configuration#combining-two-approaches<br /><br />I.e.<br />1. start Terminal.app<br />2. Enter the following commands (or copy-paste them from here):<br />2.1. cd $HOME<br />2.2. curl -L https://raw.githubusercontent.com/mrklein/openfoam-os-x/master/files/openfoam-env-setup.sh > .openfoam-env-setup.sh<br />2.3. printf "\nsource \$HOME/.openfoam-env-setup.sh\n\n" >> .profile<br />2.4. mkdir -p .OpenFOAM<br />2.5. echo '2.3.1' > $HOME/.OpenFOAM/OpenFOAM-release<br />3. close Terminal.app<br /><br />After these steps every time you start Terminal.app environment will be preconfigured for version 2.3.1.<br /><br />Alias approach, described in the post, is somewhat outdated and buggy.999https://www.blogger.com/profile/07567030127854361710noreply@blogger.comtag:blogger.com,1999:blog-2999455244261692537.post-10514156147715525102015-06-23T13:38:52.688+02:002015-06-23T13:38:52.688+02:00Hi, thank you for your reply.
Right.. I am very n...Hi, thank you for your reply.<br /><br />Right.. I am very new to OpenFOAM, Linux and even to OS X so I am very ignorant in all this. If I wish to follow your first method for post-configuration (defining alias), do I just type in "source $HOME/.profile" and then "alias of2NM='hdiutil attach -quiet -mountpoint $HOME/OpenFOAM OpenFOAM.sparsebundle; sleep 1; source $HOME/OpenFOAM/OpenFOAM-2.N.M/etc/bashrc' " on my terminal ?? <br /><br />Again, thank you so much for your helpJiho Yanghttps://www.blogger.com/profile/17181564173204279696noreply@blogger.comtag:blogger.com,1999:blog-2999455244261692537.post-19977617628370725082015-06-23T09:26:45.769+02:002015-06-23T09:26:45.769+02:00Why do you "type in $HOME /.profile"? Th...Why do you "type in $HOME /.profile"? This file is executed automatically every time you open Terminal.app. Since in general it does not have execution permission, you get the error from your message. If you would like to run commands from this file, you should use either "source $HOME/.profile" or ". $HOME/.profile" (there is a space between first dot and $HOME).<br /><br />Concerning disk image mount. If you have chosen to use openfoam-env-setup.sh, then it will try to mount disk image if it can not find OpenFOAM's bashrc file (and this is the case if either you have ejected OpenFOAM folder, or deleted bashrc file).<br /><br />Unfortunately I was not able to deduce from your comment, where did you stuck in Post-configuration phase, so my answer could be irrelevant.999https://www.blogger.com/profile/07567030127854361710noreply@blogger.comtag:blogger.com,1999:blog-2999455244261692537.post-25732135397215558712015-06-23T01:00:42.241+02:002015-06-23T01:00:42.241+02:00Thank you so much for such a fantastic post.
I ma...Thank you so much for such a fantastic post.<br /><br />I managed to install OpenFOAM 2.3.1 using (https://github.com/mrklein/openfoam-os-x/wiki/OpenFOAM%20release%20&%20Homebrew) on Yosemite. Everything works fine but I am struggling to work on the post-configuration.<br /><br />When I type in $HOME /.profile, I get the following message: -bash: /Users/Jiho/.profile: Permission denied<br /><br />Could you be able to help me on this? I am only using the 2.3.1 version and I wish it to be good to go once I open my terminal.app. <br /><br />Also, what happens if I eject the OpenFOAM folder? Would the post-configuration be able to mount it back automatically as long as my source file is available? <br /><br />I am very new to all this and your help will be greatly appreciated.<br /><br />ThanksJiho Yanghttps://www.blogger.com/profile/17181564173204279696noreply@blogger.comtag:blogger.com,1999:blog-2999455244261692537.post-42545058248146177552014-09-16T22:12:31.940+02:002014-09-16T22:12:31.940+02:00Thanks for the log-file. The error that caused all...Thanks for the log-file. The error that caused all others is the same as in the comments by Jarle Andre Kramer and hans gusseisen:<br /><br />...<br />Make/darwinIntel64ClangDPOpt/STLsurfaceFormatASCII.C:5981:18: error: out-of-line definition of 'LexerInput' does not match any declaration in 'yyFlexLexer'<br />int yyFlexLexer::LexerInput( char* buf, int max_size )<br /> ^~~~~~~~~~<br />Make/darwinIntel64ClangDPOpt/STLsurfaceFormatASCII.C:6008:19: error: out-of-line definition of 'LexerOutput' does not match any declaration in 'yyFlexLexer'<br />void yyFlexLexer::LexerOutput( const char* buf, int size )<br /> ^~~~~~~~~~~<br />2 errors generated.<br />make: *** [Make/darwinIntel64ClangDPOpt/STLsurfaceFormatASCII.o] Error 1<br />...<br /><br />And it is caused by non-standard flex installation (while clang++ tries to use FlexLexer.h from Apple distribution).999https://www.blogger.com/profile/07567030127854361710noreply@blogger.comtag:blogger.com,1999:blog-2999455244261692537.post-290982275938934802014-09-16T20:55:26.150+02:002014-09-16T20:55:26.150+02:00Hey Alexey, here you have the log file when Macpor...Hey Alexey, here you have the log file when Macport and Homebrew was installed and got the errors:<br /><br />https://github.com/hballesteros/OpenFoam-Notes<br /><br />Thanks againAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-2999455244261692537.post-79662406589079269672014-09-16T20:16:54.780+02:002014-09-16T20:16:54.780+02:00Good.
Maybe it's worth updating the post to m...Good.<br /><br />Maybe it's worth updating the post to mention about the problem with Macports. I thought Macports users usually use Bernhard Gschaider's patch (https://sourceforge.net/p/openfoam-extend/svn/HEAD/tree/trunk/Breeder_2.3/distroPatches/MacPatch/)999https://www.blogger.com/profile/07567030127854361710noreply@blogger.comtag:blogger.com,1999:blog-2999455244261692537.post-73118205307207497872014-09-16T20:10:04.453+02:002014-09-16T20:10:04.453+02:00Uninstalling macports fix everything; ALL IS WORKI...Uninstalling macports fix everything; ALL IS WORKING FINE<br />Thanks for this excellent post !!!<br /><br />cheers<br /><br />HugoAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-2999455244261692537.post-14402972565636895822014-09-16T17:33:38.472+02:002014-09-16T17:33:38.472+02:00The dates you request me: (after uninstall macport...The dates you request me: (after uninstall macports)<br /><br />ProductName: Mac OS X<br />ProductVersion: 10.9.4<br />BuildVersion: 13E28<br /><br />flex 2.5.35 Apple(flex-31)<br />/usr/bin/flex<br /><br />Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)<br />Target: x86_64-apple-darwin13.3.0<br />Thread model: posix<br /><br />Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-2999455244261692537.post-76768190187036866622014-09-16T17:22:44.642+02:002014-09-16T17:22:44.642+02:00Thanks Alexey; I'm considering sending the CD ...Thanks Alexey; I'm considering sending the CD to this address: haha joke<br />I think the problem was that from a previous article I used macports to install packages and then fell into this using homebrew; I will uninstall macports and try again; if I have no succeed I'll upload the logfile to my github account for you to look.<br /><br />Again many thanks for all<br /><br />HugoAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-2999455244261692537.post-47159343403293887752014-09-16T16:55:49.127+02:002014-09-16T16:55:49.127+02:00Hi,
well, wherever you'd like in fact ;) if y...Hi,<br /><br />well, wherever you'd like in fact ;) if you have Dropbox, you can put it in Public folder and post a link here; there's pastebin.com (though I think your log-file is rather large so pastebin will reject it); if you have account on bitbucket.org, you can create repository for the file and post if there; if you have account on github.com, you can create repository for the file and post it there; there's SpiderOak, there's Wuala, there's Windows Live, there's Yandex Disk... finally, you can burn it to CD and send it via post to l'Institute Jean Lamour in Nancy.<br /><br />Along with a link to your log-file please post the output, of:<br />$ sw_vers<br />$ flex --version<br />$ which flex<br />$ clang++ --version<br /><br />I guess, you've got custom version of flex utility installed, and this causes problems during compilation.<br /><br />Regards,<br /><br />Alexey999https://www.blogger.com/profile/07567030127854361710noreply@blogger.comtag:blogger.com,1999:blog-2999455244261692537.post-12511159409695667192014-09-16T16:33:06.074+02:002014-09-16T16:33:06.074+02:00Hi Alexey, I have done all the steps as described ...Hi Alexey, I have done all the steps as described in the article but when compiled several errors appear. The latter is the following:<br /><br />ld: library not found for -lfiniteVolume<br />clang: error: linker command failed with exit code 1 (use -v to see invocation)<br />make[2]: *** [/Users/huguito/OpenFOAM/OpenFOAM-2.3.0/platforms/darwinIntel64ClangDPOpt/bin/solidEquilibriumDisplacementFoam] Error 1<br />make[1]: *** [solidEquilibriumDisplacementFoam] Error 2<br />make[1]: Target `application' not remade because of errors.<br />make: *** [stressAnalysis] Error 2<br />make: Target `application' not remade because of errors.<br /><br />I have the log file where I could send it?<br /><br />Cheers<br /><br />HugoAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-2999455244261692537.post-73801830960380293722014-09-15T08:09:31.160+02:002014-09-15T08:09:31.160+02:00Hi
It was the flex thing that was the problem. I ...Hi<br /><br />It was the flex thing that was the problem. I actually have no idea how I have managed to install a different version of flex, so I decided to revert back to the default version, i.e. the one you have. This worked fine! OpenFOAM is now running :)<br /><br />Thanks a lot, the help is greatly appreciated!Anonymoushttps://www.blogger.com/profile/00529437175613012306noreply@blogger.comtag:blogger.com,1999:blog-2999455244261692537.post-85596641195479696602014-09-14T10:43:43.114+02:002014-09-14T10:43:43.114+02:00Well, maybe I should also try to explain why you&#...Well, maybe I should also try to explain why you're doing it. If you just type flex on the command prompt shell will look to executable flex in PATH environment variable, and it will find it in '/opt/local/bin/' as it seems your Macports installation requires this path supersede '/usr/bin'.<br /><br />So first of all you should change 'flex' to exactly '/usr/bin/flex'. I.e. you need all these slashes.<br /><br />As you can see inside these files only one string 'flex' is present, so you should change the line<br /><br />'ltoo = flex -o$*.c $$SOURCE ; $(cc) $(cFLAGS) -c $*.c -o $@'<br /><br />to<br /><br />'ltoo = /usr/bin/flex -o$*.c $$SOURCE ; $(cc) $(cFLAGS) -c $*.c -o $@'<br /><br />for the flex file.<br /><br />Also I'm not quite sure it'll help, maybe there will be more problems, as I've never mixed Homebrew and Macports in one installation.999https://www.blogger.com/profile/07567030127854361710noreply@blogger.comtag:blogger.com,1999:blog-2999455244261692537.post-9554014590981295722014-09-14T03:49:59.848+02:002014-09-14T03:49:59.848+02:00Hi,
sorry for the question but I'm a bloody be...Hi,<br />sorry for the question but I'm a bloody beginner, the flex file look like this:<br /><br />.SUFFIXES: .l<br /><br />ltoo = flex -o$*.c $$SOURCE ; $(cc) $(cFLAGS) -c $*.c -o $@<br /><br />.l.dep:<br /> $(MAKE_DEP)<br /><br /><br />and the flex ++ file: <br /><br />.SUFFIXES: .L<br /><br />Ltoo = flex -+ -o$*.C -f $$SOURCE ; $(CC) $(c++FLAGS) -c $*.C -o $@<br /><br />.L.dep:<br /> $(MAKE_DEP)<br /><br />What I have to change to 'usr/bin/flex' ? Anonymoushttps://www.blogger.com/profile/05850354635312478017noreply@blogger.comtag:blogger.com,1999:blog-2999455244261692537.post-85793328264829685132014-09-13T14:44:45.728+02:002014-09-13T14:44:45.728+02:00And I guess you've also go Macports installed?...And I guess you've also go Macports installed?<br /><br />Edit $HOME/OpenFOAM/OpenFOAM-2.2.2/wmake/rules/General/flex and $HOME/OpenFOAM/OpenFOAM-2.2.2/wmake/rules/General/flex++ files (I guess you're building version 2.2.2). Change there flex to /usr/bin/flex, after that wmake will use Apple version of flex, and with this version everything builds fine.999https://www.blogger.com/profile/07567030127854361710noreply@blogger.comtag:blogger.com,1999:blog-2999455244261692537.post-48623091873168199822014-09-13T14:13:05.494+02:002014-09-13T14:13:05.494+02:00Hi,
It is:
$ /opt/local/bin/flexHi, <br />It is:<br />$ /opt/local/bin/flexAnonymoushttps://www.blogger.com/profile/05850354635312478017noreply@blogger.comtag:blogger.com,1999:blog-2999455244261692537.post-74381525916725712412014-09-13T10:55:45.334+02:002014-09-13T10:55:45.334+02:00Hi,
your error is the same as in Jarle Andre Kram...Hi,<br /><br />your error is the same as in Jarle Andre Kramer's comment. So can you please post output of the command:<br /><br />$ which flex<br /><br />?<br /><br />We've got the same OS X version, the same clang version but for some reason you've got strange version of flex utility.999https://www.blogger.com/profile/07567030127854361710noreply@blogger.com