|
[Sponsors] |
January 23, 2012, 14:08 |
interfacing openFoam - other software
|
#1 |
New Member
Join Date: Sep 2011
Posts: 5
Rep Power: 15 |
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 |
|
January 23, 2012, 16:40 |
|
#2 | |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Greetings Vittorio,
How about reversing the start-up list? Quote:
Code:
(export PATH=$PATH:$LD_LIBRARY_PATH; which libforces.so) #or: (export PATH=$PATH:$LD_LIBRARY_PATH; which -a 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
__________________
|
||
January 24, 2012, 13:23 |
|
#3 |
New Member
Join Date: Sep 2011
Posts: 5
Rep Power: 15 |
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 |
|
January 25, 2012, 19:02 |
|
#4 | |||
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
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
__________________
|
||||
February 27, 2013, 09:21 |
|
#5 |
New Member
Emiliano
Join Date: Mar 2009
Location: Italy
Posts: 3
Rep Power: 17 |
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 |
|
September 1, 2013, 16:59 |
|
#6 |
New Member
giovanni ingrassia
Join Date: May 2010
Posts: 16
Rep Power: 16 |
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 |
|
September 1, 2013, 17:59 |
|
#7 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Greetings Giovanni,
Run the following commands, with OpenFOAM's shell environment ready to be used: Code:
foam sed -i -e 's=libsampling=libOFsampling=' src/sampling/Make/files find . -name options | xargs sed -i -e 's=-lsampling=-lOFsampling=' rm $FOAM_LIBBIN/libsampling.so ./Allwmake > make.log 2>&1 If by any chance you have OpenFOAM installed in "/opt", then:
Bruno
__________________
|
|
September 1, 2013, 21:14 |
|
#8 |
New Member
giovanni ingrassia
Join Date: May 2010
Posts: 16
Rep Power: 16 |
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 |
|
September 2, 2013, 06:08 |
|
#9 |
New Member
Emiliano
Join Date: Mar 2009
Location: Italy
Posts: 3
Rep Power: 17 |
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 |
|
September 3, 2013, 17:50 |
|
#10 | |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
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
__________________
|
||
September 10, 2013, 21:31 |
|
#11 |
Senior Member
joegi
Join Date: Nov 2009
Location: genoa
Posts: 104
Rep Power: 17 |
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 |
|
October 14, 2014, 15:52 |
|
#12 |
Member
Seroga
Join Date: Dec 2011
Posts: 41
Rep Power: 15 |
Could you, please, tell how to compile Dakota as a static library?
That would be very helpful for me. |
|
October 14, 2014, 16:01 |
|
#13 |
Senior Member
joegi
Join Date: Nov 2009
Location: genoa
Posts: 104
Rep Power: 17 |
||
October 14, 2014, 16:07 |
|
#14 |
Member
Seroga
Join Date: Dec 2011
Posts: 41
Rep Power: 15 |
Thanks for such a quick answer! I'll do that.
|
|
October 15, 2014, 15:07 |
|
#15 |
Member
Seroga
Join Date: Dec 2011
Posts: 41
Rep Power: 15 |
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? |
|
October 15, 2014, 15:23 |
|
#16 |
Senior Member
joegi
Join Date: Nov 2009
Location: genoa
Posts: 104
Rep Power: 17 |
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 |
|
November 11, 2014, 16:40 |
|
#17 |
Member
Björn Bergqvist
Join Date: Mar 2009
Location: Gothenburg, Västra Götaland, Sweden
Posts: 43
Rep Power: 17 |
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.
__________________
________________________________________ Björn Bergqvist, creator of Discretizer, a free mesh generator for OpenFOAM _________http://www.discretizer.org_____________
|
|
November 15, 2019, 07:19 |
Issues building Dakota
|
#18 |
Senior Member
Sita Drost
Join Date: Mar 2009
Location: Arnhem, The Netherlands
Posts: 227
Rep Power: 18 |
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 |
|
Tags |
environment, force, library, path, software |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
OpenFOAM 1.6 and ThirdParty Software Paraview | dunlopjp | OpenFOAM Installation | 0 | February 24, 2010 12:35 |
openfoam 1.5-dev on opensuse10.3-64bit | anon_c | OpenFOAM | 2 | December 4, 2009 01:33 |
64bitrhel5 OF installation instructions | mirko | OpenFOAM Installation | 2 | August 12, 2008 19:07 |
OpenFOAM Debian packaging current status problems and TODOs | oseen | OpenFOAM Installation | 9 | August 26, 2007 14:50 |
OpenFOAM Training and Workshop | Hrvoje Jasak | Main CFD Forum | 0 | October 7, 2005 08:14 |