CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

error libswakPythonIntegration

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 29, 2013, 07:22
Default error libswakPythonIntegration
  #1
Senior Member
 
Eelco van Vliet
Join Date: Mar 2009
Location: The Netherlands
Posts: 124
Rep Power: 19
eelcovv is on a distinguished road
Hi All,

I just installed OF 2.2.0 and the latest swak4foam version from the tar ball
Swak4Foam_2.x_release_0.2.3

Compilation went like a charm, and swak4foam seems to ok except for one issue: when using the libswakPythonIntegration.so library I got an message

Code:
--> FOAM Warning : 
    From function dlOpen(const fileName&, const bool)
    in file POSIX.C at line 1179
    dlopen error : /home/eelco/OpenFOAM/eelco-2.2.x/platforms/linux64GccDPOpt/lib/libswakPythonIntegration.so: undefined symbol: PyFunction_Type
--> FOAM Warning : 
    From function dlLibraryTable::open(const fileName&, const bool)
    in file db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C at line 99
    could not load "libswakPythonIntegration.so"
At the start of the run. PyFoam was installed as well and
I have set the environment variables


Code:
export SWAK4FOAM_SRC="$WM_PROJECT_SITE_DIR/swak4foam/Swak4Foam_2.x_release_0.2.3/Libraries"
export SWAK_PYTHON_INCLUDE="-I/usr/include/python2.7"
export SWAK_PYTHON_LINK="-L/usr/lib/python2.7 -lpython2.7
Also, python 2.7 is correctly installed.

Any idea what could be wrong?

Any hints appreciated!

Regards
Eelco
eelcovv is offline   Reply With Quote

Old   April 5, 2013, 13:59
Default
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by eelcovv View Post
Hi All,

I just installed OF 2.2.0 and the latest swak4foam version from the tar ball
Swak4Foam_2.x_release_0.2.3

Compilation went like a charm, and swak4foam seems to ok except for one issue: when using the libswakPythonIntegration.so library I got an message

Code:
--> FOAM Warning : 
    From function dlOpen(const fileName&, const bool)
    in file POSIX.C at line 1179
    dlopen error : /home/eelco/OpenFOAM/eelco-2.2.x/platforms/linux64GccDPOpt/lib/libswakPythonIntegration.so: undefined symbol: PyFunction_Type
--> FOAM Warning : 
    From function dlLibraryTable::open(const fileName&, const bool)
    in file db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C at line 99
    could not load "libswakPythonIntegration.so"
At the start of the run. PyFoam was installed as well and
I have set the environment variables


Code:
export SWAK4FOAM_SRC="$WM_PROJECT_SITE_DIR/swak4foam/Swak4Foam_2.x_release_0.2.3/Libraries"
export SWAK_PYTHON_INCLUDE="-I/usr/include/python2.7"
export SWAK_PYTHON_LINK="-L/usr/lib/python2.7 -lpython2.7
Also, python 2.7 is correctly installed.

Any idea what could be wrong?

Any hints appreciated!

Regards
Eelco
No idea. Probably ANOTHER library is needed. Could you let me know which linux-distro you're using (I remember that dynamic linker in recent distros does less automatic loading)

One more thing: is you system 64 bit and maybe you want to link to "/usr/lib64/python2.7" (but your milage may vary).

Another possibility. Do

grep PyFunction_Type /usr/lib/python2.7/*.so

and if additional libraries pop up try adding them to SWAK_PYTHON_LINK
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   April 19, 2013, 11:36
Default Link swak4foam 0.2.3
  #3
MB2
New Member
 
Becker
Join Date: Apr 2012
Posts: 3
Rep Power: 14
MB2 is on a distinguished road
The links on http://openfoamwiki.net/index.php/Co...am#Downloading do not work at the moment.
Can you post a link for swak4foam 0.2.3 (for OF 2.2.0) ?
MB2 is offline   Reply With Quote

Old   April 19, 2013, 15:17
Default
  #4
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by MB2 View Post
The links on http://openfoamwiki.net/index.php/Co...am#Downloading do not work at the moment.
Can you post a link for swak4foam 0.2.3 (for OF 2.2.0) ?
If you had spent just 20 seconds to read the rest of the paragraph you might have spotted the lines "temporary download" with the links you spent 23 seconds asking for in your post. Would have saved you 3 seconds of your lifetime and the embarrassment.

Sorry for being sarcastic, but people keep asking for this on almost a daily basis when the solution is looking straight in their eye
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   September 11, 2013, 18:16
Default
  #5
Senior Member
 
Joachim Herb
Join Date: Sep 2010
Posts: 650
Rep Power: 21
jherb is on a distinguished road
I got the same error if I forgot to add -lpython2.7 (or actually -lpython2.6 in my case) to SWAK_PYTHON_LINK. But I guess you can drop the -L/usr/lib/python2.7 because the libpython2.7.so.* files are stored in /usr/lib (or /usr/lib on a 64bit machine) which is used automatically.


Quote:
Originally Posted by eelcovv View Post
Hi All,
Code:
--> FOAM Warning : 
    From function dlOpen(const fileName&, const bool)
    in file POSIX.C at line 1179
    dlopen error : /home/eelco/OpenFOAM/eelco-2.2.x/platforms/linux64GccDPOpt/lib/libswakPythonIntegration.so: undefined symbol: PyFunction_Type
--> FOAM Warning : 
    From function dlLibraryTable::open(const fileName&, const bool)
    in file db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C at line 99
    could not load "libswakPythonIntegration.so"
At the start of the run. PyFoam was installed as well and
I have set the environment variables


Code:
export SWAK4FOAM_SRC="$WM_PROJECT_SITE_DIR/swak4foam/Swak4Foam_2.x_release_0.2.3/Libraries"
export SWAK_PYTHON_INCLUDE="-I/usr/include/python2.7"
export SWAK_PYTHON_LINK="-L/usr/lib/python2.7 -lpython2.7
jherb is offline   Reply With Quote

Old   October 20, 2013, 07:18
Default
  #6
Member
 
Join Date: Mar 2009
Posts: 90
Rep Power: 17
aerogt3 is on a distinguished road
Code:
--> FOAM Warning :
From function dlOpen(const fileName&, const bool)
in file POSIX.C at line 1179
dlopen error : libsimpleSwakFunctionObjects.so: cannot open shared object file: No such file or directory
--> FOAM Warning :
From function dlLibraryTable::open(const fileName&, const bool)
in file db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C at line 99
could not load "libsimpleSwakFunctionObjects.so"
--> FOAM Warning :
From function dlOpen(const fileName&, const bool)
in file POSIX.C at line 1179
dlopen error : libswakFunctionObjects.so: cannot open shared object file: No such file or directory
--> FOAM Warning :
From function dlLibraryTable::open(const fileName&, const bool)
in file db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C at line 99
could not load "libswakFunctionObjects.so"
--> FOAM Warning :
From function dlOpen(const fileName&, const bool)
in file POSIX.C at line 1179
dlopen error : libswakPythonIntegration.so: cannot open shared object file: No such file or directory
--> FOAM Warning :
From function dlLibraryTable::open(const fileName&, const bool)
in file db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C at line 99
could not load "libswakPythonIntegration.so"
I have the same issue, I get the above errors despite everything compiling correctly. Questions:

1.) these files are actually in /root/OpenFOAM/root-2.2.x. Is there a way to control where they are placed? I would like to have everything together in /usr/local/OpenFOAM

2.) How can I get openfoam to see the .so files? I believe I have the environment variables from the first post correctly set...

Code:
$SWAK_PYTHON_LINK 
bash: /usr/lib/python2.7: Is a directory
$SWAK_PYTHON_INCLUDE 
bash: /usr/include/python2.7: Is a directory
$SWAK4FOAM_SRC 
bash: /usr/local/OpenFOAM/swak4Foam_2.x/Libraries: Is a directory
SWAK4FOAM_SRC is set manually like this: export SWAK4FOAM_SRC="/usr/local/OpenFOAM/swak4Foam_2.x/Libraries"

I don't even know if that's correct, but I tried using the following line from the first post, but $WM_PROJECT_SITE_DIR does not exist, and I don't see it defined in OpenFOAM/etc/bash_rc or anywhere else.

Code:
export SWAK4FOAM_SRC="$WM_PROJECT_SITE_DIR/swak4foam/Swak4Foam_2.x_release_0.2.3/Libraries"
aerogt3 is offline   Reply With Quote

Old   October 20, 2013, 07:39
Default
  #7
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by aerogt3 View Post
Code:
--> FOAM Warning :
From function dlOpen(const fileName&, const bool)
in file POSIX.C at line 1179
dlopen error : libsimpleSwakFunctionObjects.so: cannot open shared object file: No such file or directory
--> FOAM Warning :
From function dlLibraryTable::open(const fileName&, const bool)
in file db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C at line 99
could not load "libsimpleSwakFunctionObjects.so"
--> FOAM Warning :
From function dlOpen(const fileName&, const bool)
in file POSIX.C at line 1179
dlopen error : libswakFunctionObjects.so: cannot open shared object file: No such file or directory
--> FOAM Warning :
From function dlLibraryTable::open(const fileName&, const bool)
in file db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C at line 99
could not load "libswakFunctionObjects.so"
--> FOAM Warning :
From function dlOpen(const fileName&, const bool)
in file POSIX.C at line 1179
dlopen error : libswakPythonIntegration.so: cannot open shared object file: No such file or directory
--> FOAM Warning :
From function dlLibraryTable::open(const fileName&, const bool)
in file db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C at line 99
could not load "libswakPythonIntegration.so"
I have the same issue, I get the above errors despite everything compiling correctly. Questions:
The Python-integration doesn't compile if the environment variables are not set. There is a mention of this during the compilation
Quote:
Originally Posted by aerogt3 View Post
1.) these files are actually in /root/OpenFOAM/root-2.2.x. Is there a way to control where they are placed? I would like to have everything together in /usr/local/OpenFOAM
There are but I don't endorse them as they may lead to subtle problems (they are mentioned in the documentation. I don't point out where on purpose because people not finding them should take this a sign that this isn't for them. I have no intention in leading people into a "DLL-hell" that causes more questions on the message board). Anyway. Compiling swak as root is not recommended

Quote:
Originally Posted by aerogt3 View Post
2.) How can I get openfoam to see the .so files? I believe I have the environment variables from the first post correctly set...

Code:
$SWAK_PYTHON_LINK 
bash: /usr/lib/python2.7: Is a directory
$SWAK_PYTHON_INCLUDE 
bash: /usr/include/python2.7: Is a directory
$SWAK4FOAM_SRC 
bash: /usr/local/OpenFOAM/swak4Foam_2.x/Libraries: Is a directory
Add an "echo" before it and you get the real values of the variables
Quote:
Originally Posted by aerogt3 View Post
SWAK4FOAM_SRC is set manually like this: export SWAK4FOAM_SRC="/usr/local/OpenFOAM/swak4Foam_2.x/Libraries"

I don't even know if that's correct, but I tried using the following line from the first post, but $WM_PROJECT_SITE_DIR does not exist, and I don't see it defined in OpenFOAM/etc/bash_rc or anywhere else.

Code:
export SWAK4FOAM_SRC="$WM_PROJECT_SITE_DIR/swak4foam/Swak4Foam_2.x_release_0.2.3/Libraries"
SWAK4FOAM_SRC is not needed for the python-integration. It's good to set it but not necessary

Start from the beginning: create a swakConfiguration file that reflects your setup (from the examples in the sources). Recompile swak as yourself (not root) and the python-integration should work
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   October 24, 2013, 06:06
Default
  #8
Member
 
Join Date: Mar 2009
Posts: 90
Rep Power: 17
aerogt3 is on a distinguished road
Quote:
Originally Posted by gschaider View Post
There are but I don't endorse them as they may lead to subtle problems (they are mentioned in the documentation. I don't point out where on purpose because people not finding them should take this a sign that this isn't for them. I have no intention in leading people into a "DLL-hell" that causes more questions on the message board). Anyway. Compiling swak as root is not recommended
Well, the reasoning was that if the files are places in the compiling users' home, the installation becomes user specific. I usually like to install software in common locations to avoid this, but if it causes problems to move files around I'll leave it as is.
aerogt3 is offline   Reply With Quote

Old   October 24, 2013, 06:49
Default
  #9
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by aerogt3 View Post
Well, the reasoning was that if the files are places in the compiling users' home, the installation becomes user specific. I usually like to install software in common locations to avoid this, but if it causes problems to move files around I'll leave it as is.
The thing is that as soon as people start compiling their own copy of swak because "I need this feature from the development version" they might experience problems (because they might get libraries from different swak-versions). But if you're sure that people will not do this look into the maintainanceScripts (but you've been warned)
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Reply


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



All times are GMT -4. The time now is 11:16.