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

interfacing openFoam - other software

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 1 Post By emiliano
  • 1 Post By emiliano
  • 1 Post By joegi.geo

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 23, 2012, 14:08
Default interfacing openFoam - other software
  #1
New Member
 
Join Date: Sep 2011
Posts: 5
Rep Power: 15
vittorio.bissaro is on a distinguished road
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
vittorio.bissaro is offline   Reply With Quote

Old   January 23, 2012, 16:40
Default
  #2
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Greetings Vittorio,

How about reversing the start-up list?
Quote:
Originally Posted by vittorio.bissaro View Post
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
source /opt/openfoam201/etc/bashrc
You can also try and figure out which versions of "libforces.so" exist by running:
Code:
(export PATH=$PATH:$LD_LIBRARY_PATH; which libforces.so)
#or: (export PATH=$PATH:$LD_LIBRARY_PATH; which -a libforces.so)
The parenthesis will create a sub-shell, therefore it will not contaminate the working shell environment.

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
Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   January 24, 2012, 13:23
Default
  #3
New Member
 
Join Date: Sep 2011
Posts: 5
Rep Power: 15
vittorio.bissaro is on a distinguished road
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
vittorio.bissaro is offline   Reply With Quote

Old   January 25, 2012, 19:02
Default
  #4
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi Vittorio,

Quote:
Originally Posted by vittorio.bissaro View Post
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
Something crazy is going on there... try commenting the line for OpenFOAM, to see if Dakota still works or not.

Quote:
Originally Posted by vittorio.bissaro View Post
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?
Yes, it's possible, but it will seriously depend on how they actually interact! Who calls who and how? Is it the solver that calls a Dakota application, or is it an OpenFOAM application that calls Dakota?

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:
Originally Posted by vittorio.bissaro View Post
I do not understand what do you suggest later?
What the goal to figure out what version of libforces.so exist?
Because if "libforces.so" isn't loadable by the OpenFOAM application, then it might be because the wrong library might be getting incorrectly loaded.
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
Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   February 27, 2013, 09:21
Default
  #5
New Member
 
Emiliano
Join Date: Mar 2009
Location: Italy
Posts: 3
Rep Power: 17
emiliano is on a distinguished road
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
waku2005 likes this.
emiliano is offline   Reply With Quote

Old   September 1, 2013, 16:59
Default
  #6
New Member
 
giovanni ingrassia
Join Date: May 2010
Posts: 16
Rep Power: 16
giov_ingr is on a distinguished road
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
giov_ingr is offline   Reply With Quote

Old   September 1, 2013, 17:59
Default
  #7
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
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
And when Allwmake is finished, you should have OpenFOAM up and running with the "libOFsampling.so" library!

If by any chance you have OpenFOAM installed in "/opt", then:
  1. Run the following command:
    Code:
    echo "source $(foamEtcFile bashrc)"
  2. Copy the outputted text line.
  3. Switch to root mode, e.g.:
    Code:
    sudo -s
    Or:
    Code:
    su -
  4. Paste the line from step #2 and run it.
  5. Then run the commands from the beginning of this post.
Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   September 1, 2013, 21:14
Default
  #8
New Member
 
giovanni ingrassia
Join Date: May 2010
Posts: 16
Rep Power: 16
giov_ingr is on a distinguished road
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
giov_ingr is offline   Reply With Quote

Old   September 2, 2013, 06:08
Default
  #9
New Member
 
Emiliano
Join Date: Mar 2009
Location: Italy
Posts: 3
Rep Power: 17
emiliano is on a distinguished road
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
wyldckat likes this.
emiliano is offline   Reply With Quote

Old   September 3, 2013, 17:50
Default
  #10
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Greetings to all!

@Giovanni:
Quote:
Originally Posted by giov_ingr View Post
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?
For better or for worst, personally I've never used Dakota
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
__________________
wyldckat is offline   Reply With Quote

Old   September 10, 2013, 21:31
Default
  #11
Senior Member
 
joegi
Join Date: Nov 2009
Location: genoa
Posts: 104
Rep Power: 17
joegi.geo is on a distinguished road
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
wyldckat likes this.
joegi.geo is offline   Reply With Quote

Old   October 14, 2014, 15:52
Default
  #12
Member
 
Seroga
Join Date: Dec 2011
Posts: 41
Rep Power: 15
Seroga is on a distinguished road
Could you, please, tell how to compile Dakota as a static library?
That would be very helpful for me.
Seroga is offline   Reply With Quote

Old   October 14, 2014, 16:01
Default
  #13
Senior Member
 
joegi
Join Date: Nov 2009
Location: genoa
Posts: 104
Rep Power: 17
joegi.geo is on a distinguished road
Check this link,

http://openfoamwiki.net/index.php/Si...llation_issues
joegi.geo is offline   Reply With Quote

Old   October 14, 2014, 16:07
Default
  #14
Member
 
Seroga
Join Date: Dec 2011
Posts: 41
Rep Power: 15
Seroga is on a distinguished road
Thanks for such a quick answer! I'll do that.
Seroga is offline   Reply With Quote

Old   October 15, 2014, 15:07
Default
  #15
Member
 
Seroga
Join Date: Dec 2011
Posts: 41
Rep Power: 15
Seroga is on a distinguished road
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?
Seroga is offline   Reply With Quote

Old   October 15, 2014, 15:23
Default
  #16
Senior Member
 
joegi
Join Date: Nov 2009
Location: genoa
Posts: 104
Rep Power: 17
joegi.geo is on a distinguished road
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
joegi.geo is offline   Reply With Quote

Old   November 11, 2014, 16:40
Default
  #17
Member
 
Björn Bergqvist
Join Date: Mar 2009
Location: Gothenburg, Västra Götaland, Sweden
Posts: 43
Rep Power: 17
bjornthe is on a distinguished road
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_____________
bjornthe is offline   Reply With Quote

Old   November 15, 2019, 07:19
Default Issues building Dakota
  #18
Senior Member
 
Sita Drost
Join Date: Mar 2009
Location: Arnhem, The Netherlands
Posts: 227
Rep Power: 18
sita is on a distinguished road
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
sita is offline   Reply With Quote

Reply

Tags
environment, force, library, path, software


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
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


All times are GMT -4. The time now is 12:01.