easybuilders / easybuild-framework

EasyBuild is a software installation framework in Python that allows you to install software in a structured and robust way.
https://easybuild.io
GNU General Public License v2.0
152 stars 202 forks source link

Auto-generated documentation for `SYSTEM` compiler is incorrect #4584

Open ocaisa opened 3 months ago

ocaisa commented 3 months ago

The docs at https://docs.easybuild.io/version-specific/toolchain-opts/#system claim that SYSTEM supports toolchainopts but it actually doesn't

ocaisa commented 3 months ago

I imagine that if the SYSTEM compiler is not intended to support this then it should override 'COMPILER_SHARED_OPTS' and 'COMPILER_UNIQUE_OPTS' in https://github.com/easybuilders/easybuild-framework/blob/develop/easybuild/toolchains/system.py

Micket commented 3 months ago

Is there any compelling reason why it shouldn't support toolchainopts? Is it because we don't expect it to necessarily be GCC? I think we do expect that, implicitly, so why not let it set things like debug or lowopt etc.?

ocaisa commented 3 months ago

We don't know what version it is, so behaviour would not be easy to determine. I'll open a PR to remove the toolchainopts and we can discuss there if there are some that should be supported

branfosj commented 3 months ago

It is not just the documentation:

== Temporary log file in case of crash /dev/shm/branfosj/tmp-up-EL8/eb-wkdpvqyb/easybuild-79o4m74_.log
ERROR: Failed to process easyconfig /rds/projects/2017/branfosj-rse/easybuild/src/easybuild-easyconfigs/easybuild/easyconfigs/zlib-1.3.1.eb: Undefined toolchain option extra_flags specified (known options: cciscxx,pic,ieee,noopt,lowopt,defaultopt,opt,optarch,strict,precise,defaultprec,loose,veryloose,verbose,debug,i8,r8,unroll,cstd,shared,static,openmp,vectorize,packed-linker-options,rpath,extra_cflags,extra_cxxflags,extra_fflags,extra_fcflags,extra_f90flags)

This was working with zlib-1.3.1.eb with items added into toolchainopts.

branfosj commented 3 months ago

And I now understand my confusion. In zlib-1.3.1.eb we have

toolchainopts = {'pic': True}

But then have

# need to take care of $CFLAGS ourselves with SYSTEM toolchain
# we need to add -fPIC, but should also include -O* option to avoid
# compiling with -O0 (default for GCC)
buildopts = 'CFLAGS="-O2 -fPIC"'