parser.add_option('m', 'module', 'list2', 'modules',
_("Optional: the restricted list of module(s) to include in the "
"application"))
+parser.add_option('', 'use_mesa', 'boolean', 'use_mesa',
+ _("Optional: Create a launcher that will use mesa products\n\t"
+ "It can be usefull whan salome is used on a remote machine through ssh"))
##
# Creates an alias for runAppli.
if options.modules:
runner.cfg.APPLICATION.virtual_app['modules'] = options.modules
+ # activate mesa use in the generated application
+ if options.use_mesa:
+ src.activate_mesa_property(runner.cfg)
+
# set name and application_name
if options.name:
runner.cfg.APPLICATION.virtual_app['name'] = options.name
import stat
import src
+import src.debug as DBG
parser = src.options.Options()
_("Optional: Create a resources catalog for the specified machines "
"(separated with ',') \n\tNOTICE: this command will ssh to retrieve"
" information to each machine in the list"))
+parser.add_option('', 'use_mesa', 'boolean', 'use_mesa',
+ _("Optional: Create a launcher that will use mesa products\n\t"
+ "It can be usefull whan salome is used on a remote machine through ssh"))
def generate_launch_file(config,
logger,
logger)
additional_environ = copy_catalog(runner.cfg, catalog_path)
+ # activate mesa use in the generated launcher
+ if options.use_mesa:
+ src.activate_mesa_property(runner.cfg)
+
# Generate the launcher
launcherPath = generate_launch_file( runner.cfg,
logger,
l_source_dir = []
l_not_installed = []
l_sources_not_present = []
+ generate_mesa_launcher = False # a flag to know if we generate a mesa launcher
for prod_name, prod_info in l_product_info:
# Add the sources of the products that have the property
else:
l_sources_not_present.append(prod_name)
+ # if at least one of the application products has the "is_mesa" property
+ if src.get_property_in_product_cfg(prod_info, "is_mesa") == "yes":
+ generate_mesa_launcher = True # we will generate a mesa launcher
+
# ignore the native and fixed products for install directories
if (src.product.product_is_native(prod_info)
or src.product.product_is_fixed(prod_info)
launcher_name,
binaries_dir_name,
not(options.without_commercial))
-
d_products["launcher"] = (launcher_package, launcher_name)
+
+ # if the application contains mesa products, we generate in addition to the
+ # classical salome launcher a launcher using mesa and called mesa_salome
+ # (the mesa launcher will be used for remote usage through ssh).
+ if generate_mesa_launcher:
+ #if there is one : store the use_mesa property
+ restore_use_mesa_option=None
+ if ('properties' in config.APPLICATION and
+ 'use_mesa' in config.APPLICATION.properties):
+ restore_use_mesa_option = config.APPLICATION.properties.use_mesa
+
+ # activate mesa property, and generate a mesa launcher
+ src.activate_mesa_property(config) #activate use_mesa property
+ launcher_mesa_name="mesa_"+launcher_name
+ launcher_package_mesa = produce_relative_launcher(config,
+ logger,
+ tmp_working_dir,
+ launcher_mesa_name,
+ binaries_dir_name,
+ not(options.without_commercial))
+ d_products["launcher (mesa)"] = (launcher_package_mesa, launcher_mesa_name)
+
+ # if there was a use_mesa value, we restore it
+ # else we set it to the default value "no"
+ if restore_use_mesa_option != None:
+ config.APPLICATION.properties.use_mesa=restore_use_mesa_option
+ else:
+ config.APPLICATION.properties.use_mesa="no"
+
if options.sources:
# if we mix binaries and sources, we add a copy of the launcher,
# prefixed with "bin",in order to avoid clashes
if not pprty in product_cfg.properties:
return None
return product_cfg.properties[pprty]
+
+def activate_mesa_property(config):
+ """Add mesa property into application properties
+
+ :param config Config: The global configuration. It must have an application!
+ """
+ # Verify the existence of the file
+ if not 'properties' in config.APPLICATION:
+ config.APPLICATION.addMapping( 'properties', src.pyconf.Mapping(), None )
+ config.APPLICATION.properties.use_mesa="yes"
+
# Get the informations corresponding to the product
pi = src.product.get_product_config(self.cfg, product)
+
+ # skip mesa product, unless use_mesa property was activated
+
+ if not ("APPLICATION" in self.cfg and
+ "properties" in self.cfg.APPLICATION and
+ "use_mesa" in self.cfg.APPLICATION.properties and
+ self.cfg.APPLICATION.properties.use_mesa == "yes") :
+ if ("properties" in pi and
+ "is_mesa" in pi.properties and
+ pi.properties.is_mesa == "yes") :
+ logger.write(_("Skip mesa product %s\n") % pi.name, 4)
+ return
+
if self.for_package:
pi.install_dir = os.path.join("out_dir_Path",
This package includes a binary installation of the application ¤{application}.
The binaries are stored in BINARIES directory.
-Warning : This binary installation depends upon some native packages.
+Warning : This binary installation depends upon some native linux packages.
If some of these packages are missing on your system, the execution may fail.
-If this is the case, please check if the file *_dep_sys_rpms.txt is present (it contains the known dependencies),
-and install the missing ones.
+If this is the case, please install the missing ones with your linux package manager.
To run the application, launch the following command:
> $ROOT/¤{launcher}
+Note for the use of Salome on a remote computer through ssh:
+ When salome is used on a remote machine, the use of openGL 3 is not compatible with X11 forwarding (ssh -X).
+ This cause segmentation faults when the 3D viewers are used.
+ For people who have no other choice and need to use ssh, we provide a mesa laucher called $ROOT/mesa_¤{launcher}.
+ It will avoid the segmentation faults, at the price of poor performance : it should only be used in this case!
+ If performance is required, a solution based on the use of VirtualGL and TurboVNC/x2go would be recommended.
+ But this requires some configuration of the tools to be done as root.
+