interfacing openFoam - other software
Hi everybody,
- I have a problem when using OpenFoam and I'm looking for "forces" as output. The output is: could not load "libforces.so" [..] Looking at the last line of .bashrc (whats happens when I open the terminal) I have : source /opt/openfoam201/etc/bashrc export PATH=/usr/local/dakota/bin/:$PATH export LD_LIBRARY_PATH=/usr/local/dakota/lib/:$LD_LIBRARY_PATH export LD_LIBRARY_PATH=/usr/lib/:$LD_LIBRARY_PATH The last three line needed if using Dakota - optimization software. - If I modify the .bashrc in : source /opt/openfoam201/etc/bashrc # export PATH=/usr/local/dakota/bin/:$PATH # export LD_LIBRARY_PATH=/usr/local/dakota/lib/:$LD_LIBRARY_PATH # export LD_LIBRARY_PATH=/usr/lib/:$LD_LIBRARY_PATH everything work and I am able to get my "forces" What is the problem? How can I export these folder without loosing the ability to calculate forces? Thanks a lot and my best wishes to this great forum. Cheers, Vittorio |
Greetings Vittorio,
How about reversing the start-up list? Quote:
Code:
(export PATH=$PATH:$LD_LIBRARY_PATH; which libforces.so) Another thing is to run ldd on "libforces.so" to see what is getting loaded and from where. Example: Code:
ldd $HOME/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/libforces.so Bruno |
Bruno, thanks a lot for helping.
If I try to reverse the start-up list in this case I have a problem with my first called program Dakota and its library. dakota: symbol lookup error: /usr/local/dakota/lib/libdakota_src.so: undefined symbol: _ZTV14DDaceOASampler Maybe It's a linux problem, but How can I get independent the two program? Is it possible to create two different sub-shell enviroment where the different program works without affecting each other? I do not understand what do you suggest later? What the goal to figure out what version of libforces.so exist? Thanks a lot, Vittorio |
Hi Vittorio,
Quote:
Quote:
Either way, the following blog post of mine might give you some more information on this subject: Advanced tips for working with the OpenFOAM shell environment And this one might also come in handy: http://www.cfd-online.com/Forums/ope...tml#post303512 - it's for MATLAB, but the logic might be similar to how you use Dakota. Quote:
The other possibility is that one of the Dakota libraries are somehow getting in the way. The following command should also give some more hints as to what gets loaded and from where: Code:
ldd $FOAM_LIBBIN/libforces.so Bruno |
Hello there, I had the same problem and I solved it.
The setting-up of the OpenFOAM environment uses a library called "libsampling.so" which has the same name of a DAKOTA library (see the DAKOTA_installation_dir/lib directory). Hence, if you wish to use both the codes, you have to modify one of the two compilation processes in order to rename that library with another name. I did it renaming the OF library as "libOFsampling.so". Hope it helps! Regards, Emiliano |
Dear Emiliano,
I have the same compatibility problem between Dakota and OpenFoam, could you please explain me how to compile openFoam substituting libsampling.so with libOFsampling.so. Do you know how to do it in cmake if I would compile differently Dakota instead of openFoam? Thank you in advance. Best regards, Giovanni |
Greetings Giovanni,
Run the following commands, with OpenFOAM's shell environment ready to be used: Code:
foam If by any chance you have OpenFOAM installed in "/opt", then:
Bruno |
Dear Bruno,
Thank you very much for your fast and precise answer. During the last hours I have been trying to change the libsampling.so in dakota and finally I succeded doing it. Now I have a libdakotasampling.so library in my LD_LIBRARY_PATH. I suppose that you would have some experience in coupling OpenFoam and Dakota. Could you please address me to some material for shape design optimization? Best regards, Giovanni |
Right, I used a similar command
grep -R -i "\-lsampling" * | awk '{a=index($1,":");print substr($1,1,a-1)}' | xargs sed -i 's/lsampling/lOFsampling/' to be executed in the OF root folder. Greetings, Emiliano |
Greetings to all!
@Giovanni: Quote:
But from the brief searches I've done in the past, on what exists about optimization with Dakota (including OpenFOAM), it's very easy to find things about it online! Good luck! Best regards, Bruno |
I don't like to change the name of the original libraries, it is just a personal preferences. So the solution for me was to compile dakota as an static library - problem solved -.
jg |
Could you, please, tell how to compile Dakota as a static library?
That would be very helpful for me. |
|
Thanks for such a quick answer! I'll do that.
|
Finally I managed to build Dakota with static libs and it works. Thanks a lot for your help!
But I have one more question. I needed Boost1.4.9 for Dakota installation. And during the Boost installation it removed OpenFOAM. So after I had Dakota installed I had to reinstall OpenFOAM. During the OpenFOAM installation Boost was removed but as I can see it didn't affected the Dakota. Can you tell me why could it be? Won't it affect Dakota's functionality in future? |
Honestly, I have no clue what could be the problem.
Just check if openfoam and dakota are working, if both are working I dont see any reason to worry about. jg |
I also ran into this problem. Think it's better to source the OpenFOAM bashrc file from the simulation script instead. In the simulation script it's also possible to change the LD_LIBRARY_PATH. The change is only present while the script executes.
|
Issues building Dakota
Hi all,
Does anyone know whether there are any up-to-date instructions for installing Dakota for use with OpenFOAM (i.e. building Dakota from source, with static libraries)? The Wiki (http://openfoamwiki.net/index.php/Si...llation_issues) seems a bit outdated, and just following the instructions on the Dakota website doesn't get me there. More specifically, the Trilinos/Teuchos package is giving me trouble; the cmake configuration keeps throwing errors related to that, so I tried manually switching off all Teuchos-related options (I don't think I'll need Teuchos anyway), but somehow during configuration, these options are set back to ON, resulting in errors. I'd greatly appreciate any help on this! Sita |
All times are GMT -4. The time now is 09:23. |