Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add --avail-toolchain-opts #1830

Merged
merged 5 commits into from Jul 5, 2016

Conversation

Caylo
Copy link
Contributor

@Caylo Caylo commented Jul 4, 2016

see easybuilders/easybuild#66

eb --avail-toolchain opts intel

Available options for intel toolchain:
    32bit: Compile 32bit target (default: False)
    cciscxx: Use CC as CXX (default: False)
    cstd: Specify C standard (default: None)
    debug: Enable debug (default: False)
    defaultopt: Default compiler optimizations (default: False)
    defaultprec: Default precision (default: False)
    error-unknown-option: Error instead of warning for unknown options (default: False)
    i8: Integers are 8 byte integers (default: False)
    intel-static: Link Intel provided libraries statically (default: False)
    loose: Loose precision (default: False)
    lowopt: Low compiler optimizations (default: False)
    no-icc: Don't set Intel specific macros (default: False)
    noopt: Disable compiler optimizations (default: False)
    openmp: Enable OpenMP (default: False)
    opt: High compiler optimizations (default: False)
    optarch: Enable architecture optimizations (default: True)
    packed-linker-options: Pack the linker options as comma separated list (default: False)
    pic: Use PIC (default: False)
    precise: High precision (default: False)
    r8: Real is 8 byte real (default: False)
    shared: Build shared library (default: False)
    static: Build static library (default: False)
    strict: Strict (highest) precision (default: False)
    unroll: Unroll loops (default: False)
    usempi: Use MPI compiler as default compiler (default: False)
    verbose: Verbose output (default: False)
    veryloose: Very loose precision (default: False)

eb --avail-toolchain opts intel --output-format=rst

Available options for intel toolchain:
--------------------------------------

=========================    ===============================================    =========
option                       description                                        default  
=========================    ===============================================    =========
``32bit``                    Compile 32bit target                               ``False``
``cciscxx``                  Use CC as CXX                                      ``False``
``cstd``                     Specify C standard                                 ``None`` 
``debug``                    Enable debug                                       ``False``
``defaultopt``               Default compiler optimizations                     ``False``
``defaultprec``              Default precision                                  ``False``
``error-unknown-option``     Error instead of warning for unknown options       ``False``
``i8``                       Integers are 8 byte integers                       ``False``
``intel-static``             Link Intel provided libraries statically           ``False``
``loose``                    Loose precision                                    ``False``
``lowopt``                   Low compiler optimizations                         ``False``
``no-icc``                   Don't set Intel specific macros                    ``False``
``noopt``                    Disable compiler optimizations                     ``False``
``openmp``                   Enable OpenMP                                      ``False``
``opt``                      High compiler optimizations                        ``False``
``optarch``                  Enable architecture optimizations                  ``True`` 
``packed-linker-options``    Pack the linker options as comma separated list    ``False``
``pic``                      Use PIC                                            ``False``
``precise``                  High precision                                     ``False``
``r8``                       Real is 8 byte real                                ``False``
``shared``                   Build shared library                               ``False``
``static``                   Build static library                               ``False``
``strict``                   Strict (highest) precision                         ``False``
``unroll``                   Unroll loops                                       ``False``
``usempi``                   Use MPI compiler as default compiler               ``False``
``verbose``                  Verbose output                                     ``False``
``veryloose``                Very loose precision                               ``False``
=========================    ===============================================    =========

@@ -713,6 +715,10 @@ def _postprocess_list_avail(self):
if self.options.list_toolchains:
msg += list_toolchains(self.options.output_format)

# dump known toolchain options
if self.options.avail_toolchain_opts:
msg += avail_toolchain_opts(str(self.options.avail_toolchain_opts), self.options.output_format)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why str(...)?

@boegel boegel added this to the v2.9.0 milestone Jul 4, 2016
@boegel
Copy link
Member

boegel commented Jul 4, 2016

@Caylo please add a comment in the PR with how the output looks like (both with txt and rst)

table_values = [
['``%s``' % opt_name for opt_name in tc_dict.keys()],
['%s' % val[1] for val in tc_dict.values()],
['``%s``' % val[0] for val in tc_dict.values()],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

two more problems here: sorting, and you have no strict guarantee that .values() will return things in the same key-order when being called twice

so, collect .items() before, and sort by key, then build up table_values

@boegel boegel modified the milestones: v2.9.0, v2.8.2 Jul 4, 2016
"""Show list of known options for given toolchain."""
tc_class, _ = search_toolchain(name)
if not tc_class:
return "Couldn't find toolchain: '%s'. To see available toolchains, use --list-toolchains" % name
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use raise EasyBuildError here (which will print to stderr and exit)

@boegel
Copy link
Member

boegel commented Jul 5, 2016

Going in, thanks @Caylo!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants