IANW-Projects / toolkitICL

toolkitICL: An open source tool for automated OpenCL kernel execution and profiling.
8 stars 3 forks source link

fix getOS on Debian #11

Closed ranocha closed 5 years ago

ranocha commented 5 years ago

The order of the lines in /etc/os-release does not seem to be the same across all linux distributions. On Debian, toolkitICL failed because of that, since the line getOS wants to read os not long enough:

$ cat /etc/os-release 
PRETTY_NAME="Debian GNU/Linux 9 (stretch)"
NAME="Debian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

I've fixed that. Now, all tests pass again on Debian.

ranocha commented 5 years ago

Having an alternative if /etc/os-release doesn't exist might be good. I don't know whether it exists in all linux distributions (and OS X?). Do you have an idea for the alternative?

philipheinisch commented 5 years ago

It should probably exist on most recent Linux distros (http://0pointer.de/blog/projects/os-release). But OS X is a good point. Do we want to officially support that? Maybe if the file doesn't exist, we could output something like 'Unknown Distribution' followed by the uname kernel info?

ranocha commented 5 years ago

That's a good idea. Could you add that part, please?

ranocha commented 5 years ago

Thanks! You can (squash-) merge if the tests pass.