amd/aocl-libm-ose

Make ALM_VERSION_STRING or alm_get_version symbols public (or an equivalent macro)

blackwer opened this issue · 0 comments

I'm making a benchmarking utility that catalogs various elementary/special function performance characteristics. I'd like to use the binary distribution and get the version for the current binary in use. I notice that the two symbols mentioned in the issue title are present in the binary, but they're both private. Currently I'm hacking up the version reader like so:

std::string get_alm_version() {
    std::string offset_str = "0x" + exec("objdump -t ../extern/amd-libm/lib/libalm.so --section=.rodata | grep -m1 "
                                         "ALM_VERSION_STRING | cut -d' ' -f 1");
    size_t offset = strtol(offset_str.c_str(), NULL, 0);
    FILE *obj = fopen("../extern/amd-libm/lib/libalm.so", "r");
    fseek(obj, offset, 0);
    char buf[16];
    fread(buf, sizeof(char), 16, obj);
    fclose(obj);
    return buf;
}

which... is messy and fragile.