View Issue Details

IDProjectCategoryView StatusLast Update
0002376Slicer4Core: Base Codepublic2017-06-07 23:27
Reporterfedorov Assigned Tojcfr  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version 
Target VersionSlicer 4.3.0Fixed in VersionSlicer 4.3.0 
Summary0002376: Inconsistent behavior of Slicer launcher command options output across systems
Description

On Windows "$Slicer --settings-path" does not produce output. Also, "Slicer --help" output is different from
Mac:

On Mac:

[fedorov@bear Slicer-build]
/Applications/Slicer.app/Contents/MacOS/Slicer --help
--, --ignore-rest Ignores the rest of the
labeled arguments following this flag. (default: false)
-h, --help Display available command line
arguments.
--testing Activate testing mode. Doesn't
use user settings in that mode. (default: false)
--disable-python Disable python support. This
is equivalent to build the application with Slicer_USE_PYTHONQT=OFF.
--python-script Python script to execute after
slicer loads.
--python-code Python code to execute after
slicer loads.
-c Python code to execute after
slicer loads. By default, no modules are loaded and Slicer exits
afterward.
--ignore-slicerrc Do not load the Slicer
resource file (~/.slicerrc.py).
--additional-module-paths List of additional module path
to consider when searching for modules to load.
--disable-cli-modules Disables the loading of
Command Line Modules.
--disable-loadable-modules Disables the loading of
Loadable Modules.
--disable-scripted-loadable-modules Disables the loading of
Scripted Loadable Modules.
--version Displays version information and exits.
--program-path Displays application program
path and exits.
--home Displays home path and exits.
--settings-path Displays settings path and exits.
--verbose-module-discovery Enable verbose output during
module discovery process.
--disable-settings Start application ignoring
user settings.
--disable-message-handlers Start application disabling
the 'terminal' message handlers.
--disable-tooltips Disables toolstips in the user
interface.
--no-splash Disables the startup splash screen.
--no-main-window Disables display of the main
slicer window. Use with --python-script for alternate interface
--show-python-interactor Show Python interactor at startup.
--qt-testing Enable QtTesting in the user interface

On Windows in cygwin:

$ ./Slicer.exe --help
Usage
Slicer [options]

Options
--launcher-help Display help
--launcher-version Show launcher version information
--launcher-verbose Verbose mode
--launch Specify the application to launch
--launcher-detach Launcher will NOT wait for the
application to finish
--launcher-no-splash Hide launcher splash
--launcher-timeout Specify the time in second before
the launcher kills the application. -1 means no timeout (default: -1)
--launcher-dump-environment Launcher will print environment
variables to be set, then exit
--launcher-additional-settings Additional settings file to consider
--launcher-generate-template Generate an example of setting file
Usage
Slicer [options]

Options
--launcher-help Display help
--launcher-version Show launcher version information
--launcher-verbose Verbose mode
--launch Specify the application to launch
--launcher-detach Launcher will NOT wait for the
application to finish
--launcher-no-splash Hide launcher splash
--launcher-timeout Specify the time in second before
the launcher kills the application. -1 means no timeout (default: -1)
--launcher-dump-environment Launcher will print environment
variables to be set, then exit
--launcher-additional-settings Additional settings file to consider
--launcher-generate-template Generate an example of setting file

On Windows in "cmd" "Slicer --help" does not produce any output.

I am testing with 2012-07-25 nightly build on Windows 7. On this
Windows machine I have XNAT module installed that crashes Slicer on
startup. I discovered the issues above while trying to disable it.

TagsNo tags attached.

Relationships

related to 0001683 closedjcfr ctk app launcher doesn't handle windows command console 
related to 0002917 closedjcfr Ensure --cmd option is available in installed package 
parent of 0002934 assignedjcfr Console output logging for Windows 
related to 0002691 closedjcfr No output messages in the slicer command 
Not all the children of this issue are yet resolved or closed.

Activities

fedorov

fedorov

2012-07-31 12:44

developer   ~0005471

For the reference, there was no popup dialog with the message.

jcfr

jcfr

2012-10-18 11:13

administrator   ~0006621

--settings-path issue fixed in r21210
See http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=21210

Output will now be consistent between built tree and installed tree. Fixed in r21211
See http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=21211

Duplicated output on the launcher help will be fixed with the coming release of the launcher. See https://github.com/commontk/AppLauncher/issues/32

fedorov

fedorov

2012-10-18 17:38

developer   ~0006634

Another inconsistency: on Windows, Slicer detaches itself from cmd terminal on startup. Also, there is no error log, and if Slicer crashes, there is no way to know what happened. Can this be resolved at some point?

jcfr

jcfr

2012-10-19 07:23

administrator   ~0006641

When using the installed binaries, by default it's expected to have the main executable detach from the console. You should be able to keep attach by using the "--no-splash" argument.

fedorov

fedorov

2012-10-19 07:25

developer   ~0006642

Checked with Oct 5 binary (what I have installed on my VirtualBox Win7), slicer is detached from the console when I use --no-splash argument.

jcfr

jcfr

2012-10-22 10:28

administrator   ~0006681

Good point. On windows installed tree, the version of the launcher build without IO support is used. The entry point "WinMain" is called [1] and is defacto detached from the console.

Providing a SlicerWithOutput executable would allow to obtain the output.

[1] https://github.com/commontk/AppLauncher/blob/master/Main.cpp#L123

fedorov

fedorov

2012-10-24 11:20

developer   ~0006726

Potentially related issue?

http://massmail.spl.harvard.edu/public-archives/slicer-devel/2012/010375.html

Hi,

I have a script that I am running from command line using
--python-script option to the launcher with the latest nightly build
of Slicer on Win7.

If I run it without --no-splash, I have Slicer crash. With
--no-splash, it completes without issues.

Perhaps it could be relevant that the script produces a lot of console
output as it imports a large DICOM series (of course, all of this
output is not captured since Slicer detaches itself from the console
as described in http://www.na-mic.org/Bug/view.php?id=2376).

AF

jcfr

jcfr

2012-10-24 11:25

administrator   ~0006728

Consistency of launcher has been addressed with version 0.1.9

Output on windows will be addressed while working on issue 0001683

Consider also reading the following note referencing a topic were preliminary work has been done: http://www.na-mic.org/Bug/view.php?id=1683#c6686

fedorov

fedorov

2013-02-06 08:25

developer   ~0007827

From http://massmail.spl.harvard.edu/public-archives/slicer-devel/2013/011259.html

==> Francois Budin:

Thanks Andriy,

I don't think that it has been fixed. It seems to be targeted for
Slicer4.3.0.

Francois

On 02/06/2013 12:39 PM, Andriy Fedorov wrote:

Francois,

I reported a similar issue some time ago, but didn't have time to test
the resolution on Windows. It may be that the issue has not been
resolved, see here: http://www.na-mic.org/Bug/view.php?id=2376

AF

On Wed, Feb 6, 2013 at 11:41 AM, Francois Budin <fbudin at unc.edu> wrote:

Hello everybody,

I am trying to debug some problems I have on windows and I was trying to
use the launcher in Slicer. However, when I do, the standard output
seems to be redirected somewhere because nothing is printed. As a matter
of fact, even when I run "Slicer --help" it doesn't print the help. Does
anybody know how to have access to the text that is normally printed on
the standard output in windows? Is there a log file somewhere?
Thank you,

Francois


finetjul

finetjul

2013-02-06 08:30

administrator   ~0007828

As a side note, there is a Slicer_BUILD_WIN32_CONSOLE cmake option that can be set to ON at configure time.

jcfr

jcfr

2013-02-06 09:01

administrator   ~0007829

On windows, by design the distributed application is built with no console output. See [1], [2], [3] and [4].

For windows, 2 flavor of the launcher are available [4]:

  • CTKAppLauncher : Console IO support
  • CTKAppLauncherW: NO console IO support - The W is a shortcut for WIN32. See [5]

Since the inconsistency reported in issue 2376 have been fixed and there are no console output by design, I am thinking to resolve the issue.

We should probably open a new issue described as: "On windows, propose a mechanism allowing to report textual information associated with command line switch when Slicer is build within console IO support"

In other word, when the following command are issued:
.\Slicer.exe --help
.\Slicer.exe --settings-path

For this set of option requiring console output, what should happen ?

  • a dialog ?
  • start a new terminal with the env setup and call: .\SlicerApp-real.exe --name-of-option. There is already the option --cmd allowing to open a new terminal.

[1] https://github.com/Slicer/DashboardScripts/blob/master/factory-south-win7-vs2008-64bits_slicer_422_release_package.cmake#L49
[2] https://github.com/Slicer/Slicer/blob/master/Applications/SlicerApp/CMakeLists.txt#L27-32
[3] https://github.com/Slicer/Slicer/blob/master/Applications/SlicerApp/CMakeLists.txt#L321-329
[4] https://github.com/commontk/AppLauncher/blob/master/CMakeLists.txt#L278-290
[5] http://www.cmake.org/cmake/help/v2.8.8/cmake.html#prop_tgt:WIN32_EXECUTABLE

jcfr

jcfr

2013-02-06 09:26

administrator   ~0007830

From Francois:

I think even just a log file would be very helpful to know if and what went wrong. Otherwise, being able to just open a new terminal with the environment set up would be great too.
I tried to run "Slicer --cmd" since you mentioned that such an option already exists but I didn't get anything (apart from opening a new instance of Slicer).
Thanks,

jcfr

jcfr

2013-02-06 09:41

administrator   ~0007831

From Andriy:

I agree with Francois. I am perfectly fine with inconsistent behavior
across platforms (meaning, no console output on Windows), as long as
there is some way to get that output log. IMO, a log file of some sort
would be more helpful than a dialog box.

jcfr

jcfr

2013-02-06 09:42

administrator   ~0007832

Inconsistency has been already addressed. Issue 0002917 capture the fact "--cmd" option is not available from an installed Slicer.

jcfr

jcfr

2017-06-07 23:27

administrator   ~0014539

Fix committed to 1683-launcher-with-output branch.

Related Changesets

Slicer: 1683-launcher-with-output 5b08d1b4

2012-10-18 15:09:59

jcfr

Details Diff
ENH: Using "--settings-path" output text an all platform

See http://www.na-mic.org/Bug/view.php?id=2376

Fixes 0002376

git-svn-id: http://svn.slicer.org/Slicer4/trunk@21210 3bd1e089-480b-0410-8dfb-8563597acbee
mod - Applications/SlicerApp/CMakeLists.txt Diff File

Slicer: 1683-launcher-with-output ad584f51

2012-10-18 15:10:01

jcfr

Details Diff
BUG: Display "Usage" and "Options" when using installed MacOSX Slicer executable

See http://www.na-mic.org/Bug/view.php?id=2376

Fixes 0002376

git-svn-id: http://svn.slicer.org/Slicer4/trunk@21211 3bd1e089-480b-0410-8dfb-8563597acbee
mod - Base/QTCore/qSlicerCoreApplication.cxx Diff File

Slicer: 1683-launcher-with-output 16d828ff

2012-10-22 17:41:38

jcfr

Details Diff
BUG: Fix CTK AppLauncher to have consistent output across platform.

* Now uses CTK AppLauncher 0.1.9

* Note that doesn't fix issue 0001683. See http://www.na-mic.org/Bug/view.php?id=1683

See http://www.na-mic.org/Bug/view.php?id=2376

Fixes 0002376

git-svn-id: http://svn.slicer.org/Slicer4/trunk@21223 3bd1e089-480b-0410-8dfb-8563597acbee
mod - SuperBuild/External_CTKAPPLAUNCHER.cmake Diff File

Issue History

Date Modified Username Field Change
2012-07-28 20:15 fedorov New Issue
2012-07-28 20:15 fedorov Status new => assigned
2012-07-28 20:15 fedorov Assigned To => pieper
2012-07-29 06:38 pieper Assigned To pieper => jcfr
2012-07-31 12:39 fedorov Relationship added related to 0001683
2012-07-31 12:44 fedorov Note Added: 0005471
2012-08-21 12:58 jcfr Target Version => Slicer 4.3.0
2012-10-18 11:13 jcfr Note Added: 0006621
2012-10-18 17:38 fedorov Note Added: 0006634
2012-10-19 07:23 jcfr Note Added: 0006641
2012-10-19 07:25 fedorov Note Added: 0006642
2012-10-22 10:28 jcfr Note Added: 0006681
2012-10-24 11:20 fedorov Note Added: 0006726
2012-10-24 11:25 jcfr Note Added: 0006728
2012-10-24 11:25 jcfr Status assigned => resolved
2012-10-24 11:25 jcfr Fixed in Version => Slicer 4.2.0 - coming release
2012-10-24 11:25 jcfr Resolution open => fixed
2012-10-29 08:25 fedorov Relationship added related to 0002691
2013-02-06 08:25 fedorov Note Added: 0007827
2013-02-06 08:25 fedorov Status resolved => feedback
2013-02-06 08:25 fedorov Resolution fixed => reopened
2013-02-06 08:30 finetjul Note Added: 0007828
2013-02-06 09:01 jcfr Note Added: 0007829
2013-02-06 09:26 jcfr Note Added: 0007830
2013-02-06 09:37 jcfr Relationship added related to 0002917
2013-02-06 09:41 jcfr Note Added: 0007831
2013-02-06 09:42 jcfr Note Added: 0007832
2013-02-06 09:42 jcfr Status feedback => resolved
2013-02-06 09:42 jcfr Resolution reopened => fixed
2013-02-10 03:42 fedorov Status resolved => closed
2013-02-11 09:15 fedorov Relationship added parent of 0002934
2013-02-12 09:40 jcfr Fixed in Version Slicer 4.2.0 => Slicer 4.3.0
2017-06-07 23:27 jcfr Changeset attached => Slicer 1683-launcher-with-output 16d828ff
2017-06-07 23:27 jcfr Changeset attached => Slicer 1683-launcher-with-output ad584f51
2017-06-07 23:27 jcfr Changeset attached => Slicer 1683-launcher-with-output 5b08d1b4
2017-06-07 23:27 jcfr Note Added: 0014539