easybuild icon indicating copy to clipboard operation
easybuild copied to clipboard

provide access to architecture type via easyconfig constants

Open dominikborkowski opened this issue 10 years ago • 4 comments

A lot of python based software ends up installed with paths including both platform and architecture. Currently there are two ways that easyconfigs deal sanity_check_paths for those items:

  • omit checking for the resulting files/eggs/dirs
  • hardcode platform and architecture in the path, for example:

sanity_check_paths = { 'files': [], 'dirs': [('%s-%%(version)s-py%s.egg' % (pylibdir, pyshortver), '%s-%%(version)s-py%s-linux-x86_64.egg' % (pylibdir, pyshortver))], }

EB provides some constants, including OS_TYPE. It would be great to have an additional constant for the architecture, eg: x86_64, so we could avoid hardcoding the paths or having incomplete checks.

Thanks!

dominikborkowski avatar Aug 12 '15 16:08 dominikborkowski

have a look at platform keyword over here: https://github.com/hpcugent/easybuild-framework/blob/master/easybuild/tools/systemtools.py

More broadly, I can see the use-case where the arch type spils out towards INSTALLPATH, rpm names etc etc; it might be handy to have this calculated from inside easybuild as opposed to fed from the outside.

On 12 August 2015 at 17:59, Dominik L. Borkowski [email protected] wrote:

A lot of python based software ends up installed with paths including both platform and architecture. Currently there are two ways that easyconfigs deal sanity_check_paths for those items:

  • omit checking for the resulting files/eggs/dirs
  • hardcode platform and architecture in the path, for example:

sanity_check_paths = { 'files': [], 'dirs': [('%s-%%(version)s-py%s.egg' % (pylibdir, pyshortver), '%s-%%(version)s-py%s-linux-x86_64.egg' % (pylibdir, pyshortver))], }

EB provides some constants, including OS_TYPE. It would be great to have an additional constant for the architecture, eg: x86_64, so we could avoid hardcoding the paths or having incomplete checks.

Thanks!

— Reply to this email directly or view it on GitHub https://github.com/hpcugent/easybuild/issues/144.

echo "sysadmin know better bash than english"|sed s/min/mins/
| sed 's/better bash/bash better/' # signal detected in a CERN forum

fgeorgatos avatar Aug 13 '15 02:08 fgeorgatos

We should probably just add get_system_architecture (which just returns what platform.machine() returns, see https://docs.python.org/2/library/platform.html#platform.machine) in tools.systemtools, and define a new constant named SYS_ARCH that matches it.

That's almost trivial to do.

Thoughts @dominikborkowski?

boegel avatar Aug 13 '15 06:08 boegel

Having SYS_ARCH would work. While like most installations we run on Linux and x86_64, we are entertaining the possibility of using Power architecture for some things. This would provide a cleaner way of dealing with those pesky python results, rather than having to hardcode them.

Thanks!

dominikborkowski avatar Aug 13 '15 13:08 dominikborkowski

adding get_system_architecture was done, among other things, in https://github.com/easybuilders/easybuild-framework/pull/1953, and the easyblocks do often leverage this, but as far as I can tell an easyconfig constant was never defined https://easybuild.readthedocs.io/en/latest/version-specific/easyconfig_constants.html

It would indeed be trivial to add it, but maybe there is a reason to keep this at the level of easyblocks?

migueldiascosta avatar Dec 17 '20 08:12 migueldiascosta