CodeSaturn 3.2.1 with Salome 7.3.0 sip.setapi fails

All questions about installation
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
mcoyne
Posts: 2
Joined: Tue Feb 04, 2014 7:37 pm

CodeSaturn 3.2.1 with Salome 7.3.0 sip.setapi fails

Post by mcoyne »

I have built / upgraded open_saturn to 3.2.1 from 3.1.1 and upgraded Salome from 7.2.0 to 7.3.0 from source on Opensuse 13.1 x86_64. In doing so i am not able to use the "launch gui" feature in "salome" 3.2.1 to set up the case as i had in 3.1.1 . I am starting the application with "code_saturn salome" Which brings up the salome gui with cfdstudy in the drop down . When i enable the cfdstudy module it seems to initialize corretly but after setting up the case it fails when i try to open up the gui with "ouput in the launch terminal window"
...
th. 140221801072384 - Trace /opt/salome/7.3.0/SALOME/KERNEL_SRC_7.3.0/src/Container/SALOME_ContainerManager.cxx [617] : [GiveContainer] waiting 60 second steps container /Containers/darkhorse/FactoryServerPy
th. 140221801072384 - Trace /opt/salome/7.3.0/SALOME/KERNEL_SRC_7.3.0/src/Container/SALOME_ContainerManager.cxx [418] : [GiveContainer] container /Containers/darkhorse/FactoryServerPy launched
Traceback (most recent call last):
File "/opt/saturn/lib/python2.7/site-packages/salome/CFDSTUDYGUI_ActionsHandler.py", line 1641, in slotRunGUI
wm = self._SolverGUI.ExecGUI(self.dskAgent().workspace(), sobjxml, aCase, aCmd)
File "/opt/saturn/lib/python2.7/site-packages/salome/CFDSTUDYGUI_SolverGUI.py", line 176, in ExecGUI
mw = self.lauchGUI(WorkSpace, aCase, sobjXML, Args)
File "/opt/saturn/lib/python2.7/site-packages/salome/CFDSTUDYGUI_SolverGUI.py", line 318, in lauchGUI
from cs_gui import process_cmd_line
File "/opt/salome/7.3.0/modules/KERNEL_V7_3_0/lib/python2.7/site-packages/salome/import_hook.py", line 175, in import_hook
module= original_import(name, globals, locals, fromlist, *args, **kwds)
File "/opt/salome/7.3.0/modules/KERNEL_V7_3_0/lib/python2.7/site-packages/salome/import_hook.py", line 175, in import_hook
module= original_import(name, globals, locals, fromlist, *args, **kwds)
File "/opt/saturn/lib/python2.7/site-packages/code_saturne/cs_gui.py", line 46, in <module>
sip.setapi('QString', 2)
ValueError: API 'QString' has already been set to version 1
...
It would appear that the PyQT api has already be set/used/defaulted as version 1 in the running salome and it will not allow the code to bring up the saturn gui using version 2 of the api. It seems sip.setapi('QString', 2) was added in svn commit 5077 i believe. How can i bring the rest of the salome build up to the sipapi of v2 ? or downgrade code_saturn back to v1 ?
I should note that "code_saturn gui" works fine as far as i can tell , i am pretty new at code_saturn so i was having challanges/ wanting to view the mesh when setting up "definition of boundry regions"

Any help would be appreciated.
Yvan Fournier
Posts: 4081
Joined: Mon Feb 20, 2012 3:25 pm

Re: CodeSaturn 3.2.1 with Salome 7.3.0 sip.setapi fails

Post by Yvan Fournier »

Hello,

Indeed, we switched to API 2 for the Code_Saturne GUI, so as to prepare for future versions of Qt.
It is not possible to downgrade to API 1 in Code_Satune, because Code_Saturnethe Python code was modified quite a bit, and does not support API 1 anymore (supporting both would have been quite difficult).

I can reproduce the issue with the SALOME build from the salome-platform.org site, but we did not have this issue with the internal EDF build. Meaning there is probably a build option for SALOME allowing either API 1 or 2 (but I don't know where). Recompiling or reinstalling SALOME with the "compatible" options may not be fun, but I'll try to mention this issue to people from the SALOME team and see what recommendations they have.

I'll keep you informed.

Regards,

Yvan
Yvan Fournier
Posts: 4081
Joined: Mon Feb 20, 2012 3:25 pm

Re: CodeSaturn 3.2.1 with Salome 7.3.0 sip.setapi fails

Post by Yvan Fournier »

Hello,

We have looked into this in detail, and although initial tests prior to switching to PyQt API 2 seemed to indicate no issue, there are many traps.

Finally, the only "robust" solution we found was adding a compatibility layer so that the GUI can use both API 1 and 2, so if PyQt is pre-loaded (such as when running under SALOME), it can adapt itself. Cyril has finished adding that layer to trunk (there will probably still be a few minor bugs to iron out over the next few weeks, but nothing essential).

So when Code_Saturne 3.3 comes out (probably in April), it should work fine with SALOME 7.3

As this solution is quite intrusive, it is a bit big for a "patch", so the GUI incompatibility between in Code_Saturne 3.2 and Salome 7.3 will probably not be fixed (Code_Saturne 3.2 being an "intermediate" version, which will be retired late 2014 when 3.4 or 4.0-beta, whichever we decide to call it, comes out) . Meaning you need to run Code_Saturne's GUI separately with this version.

Sorry for not detecting this issue earlier, and thanks for reporting it soon enough that we had time to fix it for the next release (which you can get a sample of if you want to pull the trunk form our SVN repository).

Best regards,

Yvan
mcoyne
Posts: 2
Joined: Tue Feb 04, 2014 7:37 pm

Re: CodeSaturn 3.2.1 with Salome 7.3.0 sip.setapi fails

Post by mcoyne »

Thank you for your time and efforts. I built code_saturn from SVN this morning at the Gui seems to work properly with Salome 7.3.0 now.
ketoni

Re: CodeSaturn 3.2.1 with Salome 7.3.0 sip.setapi fails

Post by ketoni »

I want to say thank you for this thread because it saved me lots of hair-pulling. In the meantime I've gone back to code_saturne 3.1.3.
Post Reply