-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make XSDK_ENABLE_<LANG>
a user cache var?
#1
Comments
Optional languages are extremely common, especially Fortran. I could care less about the convoluted design of cmake or tribits; you need to support turning off/on optional languages with a simple option. |
It is not an issue of design so much as an issue of requirements. Does it make any sense for a CMake project (or an autotools project or a project using home-grown Python configure script for that matter) to provide a user option for optional language support if the language is required or not even supported? That is the issue. For example, would it make any sense for the PETSc Python configure to support the option So what are the answers to the following questions?
Those are requirements not design or implementation details and has nothing to do with CMake or TriBITS at all. |
It seems obvious to me. There are required languages that cannot be turned off optional languages that can be turned off, and irelevant languages. Different packages will have different required languages, different optional languages and different irrelevant languages. Autoconf has --enable- and --disable- For PETSc if you pass in --disable-c it will print a very useful error message. If you pass in --enable-COBOL it will be ignored. |
So PETSc configure will error out right away if the user passes in
Right. The same would happen with CMake as well, but at least CMake would warn the user that they set an a user cache variable that was ignored (which is a warning that you selected a nonsense option or misspelled an option name). What does PETSc configure do if the user passes in a misspelled option name? Does it just silently ignore it, like autotools configure scripts do (if my memory serves back to the Trilinos autotools days)? |
$ ./configure --disable-cc
TESTING: checkCCompiler from config.setCompilers(config/BuildSystem/config/setCompilers.py:553) ******************************************************************************* UNABLE to CONFIGURE with GIVEN OPTIONS (see configure.log for details):A functional C compiler is necessary for configure, cannot use --with-cc=0 We don't list unused options at the end, but it could be easily added. You could propose adding that to the xSDK standards and I won't have a rational reason to object. |
Nice! Okay, so, if a CMake project requires language But what if a CMake project does not support a known language like C++ or Fortran at all? What should happen then? Should it recognise the option
I think users would appreciate that. It certainly helped a lot for Trilinos after we paid Kitware to add that feature to CMake. It is especially bad with CMake because CMake cache variables are case sensitive. But since Kitware expected all users to use ccmake or the QT GUI, then never thought this was an issue (but given the problems with cache var mechanism in CMake, that was just not realistic, in my opinion). |
What should be the behavior? Here are the options (please vote for one):
So will it be '1', '2.a' or '2.b'? Again, these are requirements, not design or implementation details. |
From the perspective of a high-level system trying to build all the packages, it would certainly be convenient to be able to set In some sense a package without Fortan code does trivially comply with |
Excellent! Then that is what we will do. |
Next Action Status:
Waiting for feedback on requirements (i.e. existence and behavior of
XSDK_ENABLE_<LANG>
when<LANG>
is not supported by a CMake project) ...Description:
It seems that there is a desire for the vars
XSDK_ENABLE_<LANG>
to be settable by the cleint configuring a CMake project using the XSDKDefaults.cmake module (see TriBITSPub/TriBITS#121 and xiaoyeli/superlu_dist#3).When XSDKDefaults.cmake module was written, the assumption that was made was that the client CMake project would know what languages it needed and would set them with
SET(XSDK_ENABLE_<LANG> [TRUE|FALSE])
before including the module. If you look here, you can see that these vars are set usingSET_DEFAULT()
which does not create a CMake cache var so these would be invisible to the general user. That seems not to be what people expected so we need to change this; hence TriBITSPub/TriBITS#121.But what about CMake client projects where a given language is not optional? For example, does it make any sense for a client project to expose
XSDK_ENABLE_Fortran
as a cache var if Fortran is required in order to build anything? Clearly a client project like Trilinos or SuperLUDist could not build anything if the client disabled C and C++. So how is this handled?The requirements for the handling of optional language support and languages is not clear to me.
Tasks:
XSDK_ENABLE_<LANG>
for the use cases where the language<LANG>
is a) required, b) optional, and c) not supported<LANG>
is required, thenXSDK_ENABLE_<LANG>
is supported and if the user selectsXSDK_ENABLE_<LANG>=OFF
, then the configure should error out with a good error message (see below) [Done]<LANG>
is optional, then user can selectXSDK_ENABLE_<LANG>=[ON|OFF]
[Done]<LANG>
is not even supported: ... ToDo determine behavior (see below) ...XSDKDefaults.cmake
module and add macroXSDK_ENABLE_LANGAUGES()
. Add automated tests to define and protect this new behavior.XSDK_ENABLE_<LANG>
instead of just setting it based on${PROJECT_NAME}_ENABLE_<LANG>
TriBITSPub/TriBITS#121) and then snapshot into Trilinos and then make PR for SuperLU and SuperLUDist maint branches.The text was updated successfully, but these errors were encountered: