On 01/23/2013 08:31 AM, Stijn De Weirdt wrote:
import platform
print platform.dist()
it is in 2.3.
But it's deprecated in 2.6 in favor of platform.linux_distribution, see
http://stackoverflow.com/questions/2756737/check-linux-distro-name and
http://stackoverflow.com/questions/2756873/linux-distro-name-parsing .
So, we probably needs to try platform.linux_distribution first, and fall
back to platform.dist if that is not available?
This might get messy (surprise, surprise)...
Let's try and organize this a little better, see
https://github.com/hpcugent/easybuild/wiki/OS_flavor_name_version .
Please copy-paste the script there in a Python interpreter, and send
back the output. I'll update the wiki page, so we can get a nice
overview without having to browse through this mail thread again...
Any system you have access to that is not listed there yet is welcome. :)
K.
on my fc17, it gives
dist(distname='', version='', id='', supported_dists=('SuSE',
'debian', 'fedora', 'redhat', 'centos', 'mandrake', 'mandriva',
'rocks', 'slackware', 'yellowdog', 'gentoo', 'UnitedLinux',
'turbolinux'))
Tries to determine the name of the Linux OS distribution name.
The function first looks for a distribution release file in
/etc and then reverts to _dist_try_harder() in case no
suitable files are found.
Returns a tuple (distname,version,id) which default to the
args given as parameters.
so no ubuntu ? (or is that debian)
maybe people should try it and send back the output for different OSes?
on SL6.2 it gives
python -c 'import platform;print platform.dist()'
('redhat', '6.2', 'Carbon')
but at least it's a start.
stijn
On 01/23/2013 08:12 AM, Kenneth Hoste wrote:
On 23 Jan 2013, at 07:55, Stijn De Weirdt <[email protected]>
wrote:
however, you will need it for the easyconfig file. the 4.2.9 for
rhel and 4.2.9 for ubuntu are probably not the same eb config.
this is also not 100% true, the easyconfig or block could have a
mapping function between the OS name and the suffix for the source.
this is probably on of the few cases where true OS-dependencies are
required (ie it depends on the OS, not on some software the OS
provides).
maybe it is time easybuild starts providing fixed OS names and a
mechanism to detect them? it will be a major manual work unless
someone finds something that already exists. for rhel flavour,
reading and interpreting /etc/redhat-release comes to mind, but on
need to distinguish between flavours (RHEL, centos, SL, SLC
,SLF,...). also such a harcoded mapping will mean that new OSes will
either not work fully or we need to keep the mapping up to date.
I agree with Stijn, this is by far the most elegant solution.
Question is if (Python) code that spits out the OS name (and also
version) is available somewhere. Maybe this is a good question for
StackOverflow...
K.
stijn
On 01/22/2013 11:57 PM, Fotis Georgatos wrote:
Hi Ken, all,
On 22 Jan, 2013, at 16:33, Kenneth Hoste wrote:
Usually, you handle something like this with a version suffix in
the CUDA easyconfig file, and hence you'll end up with a CUDA
module like "CUDA/4.2.9-ubuntu10.04" .
OK, it seems the enlightenment arrives to me approximately near
midnight! :-)
There is an elegant workaround which should get things going for a
while,
until we understand what is the bigger picture in this family of
issues.
One potential solution which does the job for us for now is, an
easyconfig
which implements the dependency 4.2.9 -> 4.2.9-ubuntu10.04;
Samewise, for RHEL.
ie. will can provide 2 easyconfigs that produce the *same* module
name target,
which in turn is used as the dependency (same trick can be done for
customizing
the openmpi stack in a particular HPC site and address many other
things).
Once you provide CUDA/4.2.9, then it's easybuild business as usual.
Would you like hosting in the easyconfigs tree such firework
solutions?
tia,
Fotis