Thank you for your detailed and useful advice! It passes the following tests:
./salome context
cd $OMNIORB_ROOT_DIR/lib
ls *.so |xargs ldd | grep “not found”
cd $OMNIORB_ROOT_DIR/lib/python3.8/site-packages
ls *.so |xargs ldd | grep “not found”
There were no missing files.
It also passes the test, but only when run while terminal is in the path the above tests left it in (cd $OMNIORB_ROOT_DIR/lib/python3.8/site-packages):
python3
import omniORB
print(omniORB.file)
from omniORB import CORBA
print(CORBA.file)
Running the above import omniORB test with terminal located at cd $OMNIORB_ROOT_DIR/lib fails. It also fails when run with terminal located at SALOME_ROOT_DIR.
Here is the procedure I used to make the MYPYHELLO module and run salome which resulted in getting the no omniORB module found error:
Here is the procedure to follow:
0 - extract SALOME
tar zxf SALOME-9.9.0-native-UB20.04-SRC.tar.gz
cd SALOME-9.9.0-native-UB20.04-SRC
chmod +x ./install_bin.sh
#- 1 - setup developer mode
./install_bin.sh
2 - clone CONFIGURATION
./sat/sat prepare SALOME-9.9.0-native -p CONFIGURATION
3 - generate environment scripts
./sat/sat environ SALOME-9.9.0-native
4 - setup SALOME build environment
source ./env_build.sh
5 - clone the migrated PYHELLO
cd SALOME-9.9.0/SOURCES
git clone https://git.salome-platform.org/gitpub/samples/pyhello.git MYPYHELLO
cd MYPYHELLO
6 - rename all directories from PYHELLO to MYPHELLO
find . -execdir rename ‘s/PYHELLO/MYPYHELLO/’ ‘{}’ +
find . -execdir rename ‘s/pyhello/mypyhello/’ ‘{}’ +
7 - rename all occurences of PYHELLO to MYPHELLO
find . -type f -exec sed -i ‘s/PYHELLO/MYPYHELLO/g’ {} +
find . -type f -exec sed -i ‘s/pyhello/mypyhello/g’ {} +
8 - build my module MYPYHELLO
mkdir -p SALOME-9.9.0/BUILD/MYPYHELLO
cd SALOME-9.9.0/BUILD/MYPYHELLO
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=…/…/INSTALL/MYPYHELLO …/…/SOURCES/MYPYHELLO <–fixes the destination of the INSTALL for MYPYHELLO
make
make install
9 - generate SALOME launcher.
cd SALOME-9.9.0
./sat/sat launcher SALOME-9.9.0-native
10 - edit file salome and just before section: # [APPLI variables], add following lines:
#[MYPYHELLO]
context.setVariable(r"MYPYHELLO_ROOT_DIR", r"SALOME-9.9.0/INSTALL/MYPYHELLO", overwrite=True)
context.addToPath(r"${MYPYHELLO_ROOT_DIR}/bin/salome")
context.addToLdLibraryPath(r"${MYPYHELLO_ROOT_DIR}/lib/salome")
context.addToPythonPath(r"${MYPYHELLO_ROOT_DIR}/bin/salome")
context.addToPythonPath(r"${MYPYHELLO_ROOT_DIR}/lib/salome")
context.addToPythonPath(r"${MYPYHELLO_ROOT_DIR}/${PYTHON_LIBDIR}/salome")
appendPath(r"SALOME_MODULES", r"MYPYHELLO",separator=",")
appendPath(r"SalomeAppConfig", r"${MYPYHELLO_ROOT_DIR}/share/salome/resources/mypyhello",separator=":")
11 - Launch SALOME either with your module only or with all modules
cd SALOME-9.9.0
./salome -m MYPYHELLO
ANALYSIS:
Since “import omniORB” test passes when run from “$OMNIORB_ROOT_DIR/lib/python3.8/site-packages” I noted that the salome launcher defines that path as:
$OMNIORB_ROOT_DIR/lib/${PYTHON_VERSION}/site-packages
But earlier in the salome launcher file it defines ${PYTHON_VERSION} as 2.7, which makes the path to the omniORB = “$OMNIORB_ROOT_DIR/lib/python2.7/site-packages”; which by the way does not exist.
So I changed the salome launcher to define PYTHON_VERSION as 3.8 as follows:
#[Python]
context.setVariable(r"PYTHON_ROOT_DIR", r"/usr", overwrite=True)
context.setVariable(r"PYTHON_INCLUDE", r"/usr/local/include/python2.7", overwrite=True)
context.setVariable(r"PYTHON_VERSION", r"2.7", overwrite=True)
context.setVariable(r"PYTHONBIN", r"/usr/bin/python2", overwrite=True)
context.setVariable(r"PYTHON_LIBDIR", r"lib/python${PYTHON_VERSION}/site-packages", overwrite=True)
Becomes:
#[Python]
context.setVariable(r"PYTHON_ROOT_DIR", r"/usr", overwrite=True)
context.setVariable(r"PYTHON_INCLUDE", r"/usr/local/include/python3.8", overwrite=True)
context.setVariable(r"PYTHON_VERSION", r"3.8", overwrite=True)
context.setVariable(r"PYTHONBIN", r"/usr/bin/python3", overwrite=True)
context.setVariable(r"PYTHON_LIBDIR", r"lib/python${PYTHON_VERSION}/site-packages", overwrite=True)
Now when running “./salome -m MYPYHELLO” salome launches, BUT it is loaded with GEOMETRY, SHAPE, MESH, PARAVIS, etc. Note, none of the premade example modules were loaded. And the MYPYHELLO module is not loaded.
I was under the impression that the only module that would be loaded following the command ./salome -m MYPYHELLO would be MYPYHELLO.
At any rate, hopefully this may prompt further insight/discussion towards resolving this issue.
Best regards,
Sesqui