Ejemplo n.º 1
0
/*
 * Show the version of Open MPI
 */
void ompi_info_show_ompi_version(const char *scope)
{
    char *tmp;

    ompi_info_out("Package", "package", OPAL_PACKAGE_STRING);
    asprintf(&tmp, "%s:version:full", ompi_info_type_ompi);
    ompi_info_out("Open MPI", tmp,
                  make_version_str(scope, 
                                   OMPI_MAJOR_VERSION, OMPI_MINOR_VERSION, 
                                   OMPI_RELEASE_VERSION, 
                                   OMPI_GREEK_VERSION,
                                   OMPI_WANT_REPO_REV, OMPI_REPO_REV));
    free(tmp);
    asprintf(&tmp, "%s:version:repo", ompi_info_type_ompi);
    ompi_info_out("Open MPI repo revision", tmp, OMPI_REPO_REV);
    free(tmp);
    asprintf(&tmp, "%s:version:release_date", ompi_info_type_ompi);
    ompi_info_out("Open MPI release date", tmp, OMPI_RELEASE_DATE);
    free(tmp);
    
    asprintf(&tmp, "%s:version:full", ompi_info_type_orte);
    ompi_info_out("Open RTE", tmp,
                  make_version_str(scope, 
                                   ORTE_MAJOR_VERSION, ORTE_MINOR_VERSION, 
                                   ORTE_RELEASE_VERSION, 
                                   ORTE_GREEK_VERSION,
                                   ORTE_WANT_REPO_REV, ORTE_REPO_REV));
    free(tmp);
    asprintf(&tmp, "%s:version:repo", ompi_info_type_orte);
    ompi_info_out("Open RTE repo revision", tmp, ORTE_REPO_REV);
    free(tmp);
    asprintf(&tmp, "%s:version:release_date", ompi_info_type_orte);
    ompi_info_out("Open RTE release date", tmp, ORTE_RELEASE_DATE);
    free(tmp);
    
    asprintf(&tmp, "%s:version:full", ompi_info_type_opal);
    ompi_info_out("OPAL", tmp,
                  make_version_str(scope, 
                                   OPAL_MAJOR_VERSION, OPAL_MINOR_VERSION, 
                                   OPAL_RELEASE_VERSION, 
                                   OPAL_GREEK_VERSION,
                                   OPAL_WANT_REPO_REV, OPAL_REPO_REV));
    free(tmp);
    asprintf(&tmp, "%s:version:repo", ompi_info_type_opal);
    ompi_info_out("OPAL repo revision", tmp, OPAL_REPO_REV);
    free(tmp);
    asprintf(&tmp, "%s:version:release_date", ompi_info_type_opal);
    ompi_info_out("OPAL release date", tmp, OPAL_RELEASE_DATE);
    free(tmp);
    
    ompi_info_out("Ident string", "ident", OPAL_IDENT_STRING);
}
Ejemplo n.º 2
0
static VALUE
oletypelib_search_registry2(VALUE self, VALUE args)
{
    HKEY htypelib, hguid, hversion;
    double fver;
    DWORD j;
    LONG err;
    VALUE found = Qfalse;
    VALUE tlib;
    VALUE ver;
    VALUE version_str;
    VALUE version = Qnil;
    VALUE typelib = Qnil;
    HRESULT hr;
    ITypeLib *pTypeLib;

    VALUE guid = rb_ary_entry(args, 0);
    version_str = make_version_str(rb_ary_entry(args, 1), rb_ary_entry(args, 2));

    err = reg_open_key(HKEY_CLASSES_ROOT, "TypeLib", &htypelib);
    if(err != ERROR_SUCCESS) {
        return Qfalse;
    }
    err = reg_open_vkey(htypelib, guid, &hguid);
    if (err != ERROR_SUCCESS) {
        RegCloseKey(htypelib);
        return Qfalse;
    }
    if (version_str != Qnil) {
        err = reg_open_vkey(hguid, version_str, &hversion);
        if (err == ERROR_SUCCESS) {
            tlib = reg_get_val(hversion, NULL);
            if (tlib != Qnil) {
                typelib = tlib;
                version = version_str;
            }
        }
        RegCloseKey(hversion);
    } else {
        fver = 0.0;
        for(j = 0; ;j++) {
            ver = reg_enum_key(hguid, j);
            if (ver == Qnil)
                break;
            err = reg_open_vkey(hguid, ver, &hversion);
            if (err != ERROR_SUCCESS)
                continue;
            tlib = reg_get_val(hversion, NULL);
            if (tlib == Qnil) {
                RegCloseKey(hversion);
                continue;
            }
            if (fver < atof(StringValuePtr(ver))) {
                fver = atof(StringValuePtr(ver));
                version = ver;
                typelib = tlib;
            }
            RegCloseKey(hversion);
        }
    }
    RegCloseKey(hguid);
    RegCloseKey(htypelib);
    if (typelib != Qnil) {
        hr = oletypelib_from_guid(guid, version, &pTypeLib);
        if (SUCCEEDED(hr)) {
            found = Qtrue;
            oletypelib_set_member(self, pTypeLib);
        }
    }
    return found;
}
Ejemplo n.º 3
0
std::string const& Lib_info::version() {
   static const std::string s = make_version_str();
   return s;
}
Ejemplo n.º 4
0
/*
 * Given a component, display its relevant version(s)
 */
static void show_mca_version(const mca_base_component_t* component,
                             const char *scope, const char *ver_type)
{
    bool printed;
    bool want_mca = false;
    bool want_type = false;
    bool want_component = false;
    char *message, *content;
    char *mca_version;
    char *api_version;
    char *component_version;
    char *tmp;
    
    if (0 == strcmp(ver_type, ompi_info_ver_all) ||
        0 == strcmp(ver_type, ompi_info_ver_mca)) {
        want_mca = true;
    }
    
    if (0 == strcmp(ver_type, ompi_info_ver_all) ||
        0 == strcmp(ver_type, ompi_info_ver_type)) {
        want_type = true;
    }
    
    if (0 == strcmp(ver_type, ompi_info_ver_all) ||
        0 == strcmp(ver_type, ompi_info_ver_component)) {
        want_component = true;
    }
    
    mca_version = make_version_str(scope, component->mca_major_version,
                                   component->mca_minor_version,
                                   component->mca_release_version, "",
                                   false, "");
    api_version = make_version_str(scope, component->mca_type_major_version,
                                   component->mca_type_minor_version,
                                   component->mca_type_release_version, "",
                                   false, "");
    component_version = make_version_str(scope, component->mca_component_major_version,
                                         component->mca_component_minor_version,
                                         component->mca_component_release_version, 
                                         "", false, "");
    
    if (ompi_info_pretty) {
        asprintf(&message, "MCA %s", component->mca_type_name);
        printed = false;
        asprintf(&content, "%s (", component->mca_component_name);
        
        if (want_mca) {
            asprintf(&tmp, "%sMCA v%s", content, mca_version);
            free(content);
            content = tmp;
            printed = true;
        }

        if (want_type) {
            if (printed) {
                asprintf(&tmp, "%s, ", content);
                free(content);
                content = tmp;
            }
            asprintf(&tmp, "%sAPI v%s", content, api_version);
            free(content);
            content = tmp;
            printed = true;
        }

        if (want_component) {
            if (printed) {
                asprintf(&tmp, "%s, ", content);
                free(content);
                content = tmp;
            }
            asprintf(&tmp, "%sComponent v%s", content, component_version);
            free(content);
            content = tmp;
            printed = true;
        }
        if (NULL != content) {
            asprintf(&tmp, "%s)", content);
            free(content);
        } else {
            tmp = NULL;
        }
        
        ompi_info_out(message, NULL, tmp);
        free(message);
        if (NULL != tmp) {
            free(tmp);
        }
        
    } else {
        asprintf(&message, "mca:%s:%s:version", component->mca_type_name, component->mca_component_name);
        if (want_mca) {
            asprintf(&tmp, "mca:%s", mca_version);
            ompi_info_out(NULL, message, tmp);
            free(tmp);
        }
        if (want_type) {
            asprintf(&tmp, "api:%s", api_version);
            ompi_info_out(NULL, message, tmp);
            free(tmp);
        }
        if (want_component) {
            asprintf(&tmp, "component:%s", component_version);
            ompi_info_out(NULL, message, tmp);
            free(tmp);
        }
        free(message);
    }
}