opengate icon indicating copy to clipboard operation
opengate copied to clipboard

Wheel needed to be installed inside Slicer

Open BishopWolf opened this issue 1 year ago • 8 comments

I need Gate inside Slicer, therefore I run a simple pip installation there, and it failed as it required a whl (python wheel): see this thread. Slicer has a bundled python 3.9, so the version is OK.

BishopWolf avatar Apr 07 '23 10:04 BishopWolf

According to your thread, your are using windows system. For the moment, the wheel is only available for Mac and Linux. For Windows, it's on going (see https://github.com/OpenGATE/opengate/pull/115)

tbaudier avatar Apr 07 '23 11:04 tbaudier

I am trying now in Linux. The wheels install, but they do not work :

>>> import opengate as gate
opengate_core is not detected. Be sure to execute these lines before to run python:
export LD_LIBRARY_PATH=/home/alex/Programas/Slicer-5.3.0-2023-03-16-linux-amd64/bin/../lib/Python/lib/python3.9/site-packages/opengate_core.libs:${LD_LIBRARY_PATH}
export LD_PRELOAD=/home/alex/Programas/Slicer-5.3.0-2023-03-16-linux-amd64/bin/../lib/Python/lib/python3.9/site-packages/opengate_core.libs/libG4processes-9232ba54.so:/home/alex/Programas/Slicer-5.3.0-2023-03-16-linux-amd64/bin/../lib/Python/lib/python3.9/site-packages/opengate_core.libs/libG4geometry-fbd76286.so:${LD_PRELOAD}

Is there a workaround?

BishopWolf avatar Apr 07 '23 19:04 BishopWolf

Hey @BishopWolf, since your post is from April, could you be so kind and check if opengate now installs and works correctly for you? The code has evolved quite a lot since then ... Thanks

nkrah avatar Aug 07 '23 16:08 nkrah

Hey @BishopWolf, since your post is from April, could you be so kind and check if opengate now installs and works correctly for you? The code has evolved quite a lot since then ... Thanks

>>> from opengate import gate
opengate_core is not detected. Be sure to execute these lines before to run python:
export LD_LIBRARY_PATH=/Data/Programas/Slicer-5.3.0-2023-07-05-linux-amd64/bin/../lib/Python/lib/python3.9/site-packages/opengate_core.libs:${LD_LIBRARY_PATH}
export LD_PRELOAD=/Data/Programas/Slicer-5.3.0-2023-07-05-linux-amd64/bin/../lib/Python/lib/python3.9/site-packages/opengate_core.libs/libG4processes-92d9f07e.so:/Data/Programas/Slicer-5.3.0-2023-07-05-linux-amd64/bin/../lib/Python/lib/python3.9/site-packages/opengate_core.libs/libG4geometry-0c687114.so:${LD_PRELOAD}
>>> 

It's the same error, there is no way to start gate from within slicer. Adding the suggested lines before launching Slicer yields

$ export LD_LIBRARY_PATH=/Data/Programas/Slicer-5.3.0-2023-07-05-linux-amd64/bin/../lib/Python/lib/python3.9/site-packages/opengate_core.libs:${LD_LIBRARY_PATH}
export LD_PRELOAD=/Data/Programas/Slicer-5.3.0-2023-07-05-linux-amd64/bin/../lib/Python/lib/python3.9/site-packages/opengate_core.libs/libG4processes-92d9f07e.so:/Data/Programas/Slicer-5.3.0-2023-07-05-linux-amd64/bin/../lib/Python/lib/python3.9/site-packages/opengate_core.libs/libG4geometry-0c687114.so:${LD_PRELOAD}

-------- EEEE ------- G4Exception-START -------- EEEE -------

*** ExceptionHandler is not defined ***
*** G4Exception : HadDevPara_004
      issued by : G4HadronicDeveloperParameters
Parameter BERT_FERMI_SCALE is already defined.
*** Fatal Exception ***
-------- EEEE ------- G4Exception-END -------- EEEE -------


*** G4Exception: Aborting execution ***
bash: --------: command not found
bash: 14.6: command not found
bash: 14.6: command not found
bash: eval: line 11: syntax error near unexpected token `('
bash: eval: line 11: `      issued by : G4CrossSectionFactoryRegistry::Register(...)'

-------- EEEE ------- G4Exception-START -------- EEEE -------

*** ExceptionHandler is not defined ***
*** G4Exception : HadDevPara_004
      issued by : G4HadronicDeveloperParameters
Parameter BERT_FERMI_SCALE is already defined.
*** Fatal Exception ***
-------- EEEE ------- G4Exception-END -------- EEEE -------


*** G4Exception: Aborting execution ***

BishopWolf avatar Aug 08 '23 17:08 BishopWolf

Thanks for reporting back. I quickly looked at the thread on the Slicer discourse. From what I understand, slicer provides a proper wrapper of pip install, correct? Thus, the issue is probably related to where and how Slicer installs the python modules, so that opengate does not find them when executed within Slicer.

Personally, I do not use Slicer, but it seems a good idea to be able to run gate from Slicer, for dose calculation in your case, correct? The possibility to interface GATE with other software was one of the motivations to develop a new python-based version of GATE.

If you are interested, we could schedule a video meeting and look at the issue a bit more in detail together. What do you think?

nkrah avatar Aug 09 '23 10:08 nkrah

Dear @nkrah, it would be nice to have this meeting. I will be available next Tuesday, Paris Time zone.

Send me your emails to include you in a zoom/teams meeting (add also thomas @tbaudier )

BishopWolf avatar Aug 11 '23 10:08 BishopWolf

@nkrah @tbaudier , any news on this?

BishopWolf avatar Sep 06 '23 13:09 BishopWolf

yes sure, please could you wait for few weeks, we are still working on this and this is not consolidated yet. We can plan something around end of Octobre, thanks ;)

dsarrut avatar Sep 06 '23 14:09 dsarrut