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

interfacing openFoam - other software

Register Blogs Members List Search Today's Posts Mark Forums Read

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

Reply
 
LinkBack Thread Tools Display Modes
Old   January 23, 2012, 14:08
Default interfacing openFoam - other software
  #1
New Member
 
Join Date: Sep 2011
Posts: 5
Rep Power: 5
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
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,511
Blog Entries: 34
Rep Power: 86
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
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: 5
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
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,511
Blog Entries: 34
Rep Power: 86
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
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: OpenFOAM command from inside MATLAB - 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: 8
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, 15:59
Default
  #6
New Member
 
giovanni ingrassia
Join Date: May 2010
Posts: 16
Rep Power: 7
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, 16:59
Default
  #7
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,511
Blog Entries: 34
Rep Power: 86
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
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, 20:14
Default
  #8
New Member
 
giovanni ingrassia
Join Date: May 2010
Posts: 16
Rep Power: 7
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, 05:08
Default
  #9
New Member
 
Emiliano
Join Date: Mar 2009
Location: Italy
Posts: 3
Rep Power: 8
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, 16:50
Default
  #10
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,511
Blog Entries: 34
Rep Power: 86
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
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, 20:31
Default
  #11
Member
 
joegi
Join Date: Nov 2009
Location: genoa
Posts: 67
Rep Power: 7
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, 14:52
Default
  #12
Member
 
Seroga
Join Date: Dec 2011
Posts: 41
Rep Power: 5
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, 15:01
Default
  #13
Member
 
joegi
Join Date: Nov 2009
Location: genoa
Posts: 67
Rep Power: 7
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, 15:07
Default
  #14
Member
 
Seroga
Join Date: Dec 2011
Posts: 41
Rep Power: 5
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, 14:07
Default
  #15
Member
 
Seroga
Join Date: Dec 2011
Posts: 41
Rep Power: 5
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, 14:23
Default
  #16
Member
 
joegi
Join Date: Nov 2009
Location: genoa
Posts: 67
Rep Power: 7
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: 8
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

Reply

Tags
environment, force, library, path, software

Thread Tools
Display Modes

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 On
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 18:07
OpenFOAM Debian packaging current status problems and TODOs oseen OpenFOAM Installation 9 August 26, 2007 13:50
OpenFOAM Training and Workshop Hrvoje Jasak Main CFD Forum 0 October 7, 2005 07:14


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