Does anyone have a sample YACSGEN - SALOME module generator script that I can use to get started making Salome modules from C++ or Fortran? I tried a few times to put a script together after reading the documentation, but I don’t think I am putting everything into the script needed to make it work.
If someone could provide a working sample script for a simple component that would really help me get going.
I am using Ubuntu 20.04, Salome-9.9.0.
I run from terminal:
source env_build.sh
python mymodule.py
Where mymodule,py contains the following:
from module_generator import *
import os
kernel_root_dir=os.environ["KERNEL_ROOT_DIR"]
gui_root_dir=os.environ["GUI_ROOT_DIR"]
yacs_root_dir=os.environ["YACS_ROOT_DIR"]
salome_env="~/programs/SALOME-9.9.0/env_build.sh"
context={'update':1,
"prerequisites":salome_env,
"kernel":kernel_root_dir,
"yacs":yacs_root_dir
}
c1=CPPComponent("mycompo",
services=[
Service("myservice",
inport=[("inputport","double"),],
outport=[("outputport","double")],
defs="#include <iostream>",
body="outputport=2*inputport;",
),
]
)
m=Module("mymodule",components=[c1],prefix="myInstall")
g=Generator(m,context)
g.generate()
g.configure()
g.make()
g.install()
g.make_appli("myappli",restrict=["KERNEL","GUI","YACS"])
The error I get is:
Traceback (most recent call last):
File "mymodule.py", line 32, in <module>
g.make_appli("myappli",restrict=["KERNEL","GUI","YACS"])
File "/home/dan/programs/SALOME-9.9.0/INSTALL/YACSGEN/lib/python3.8/site-packages/module_generator/gener.py", line 954, in make_appli
salome_context = os.path.join(ROOT_SALOME, "salome_context.cfg")
File "/usr/lib/python3.8/posixpath.py", line 76, in join
a = os.fspath(a)
TypeError: expected str, bytes or os.PathLike object, not NoneType
Note that:
echo ${ROOT_SALOME}
indicates ROOT_SALOME is empty.
Thanks in advance,
Sesqui