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

set WITH_ARB to false when WITH_FLINT is false #795

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
3 participants
@CodeMaxx
Copy link
Contributor

CodeMaxx commented Feb 6, 2016

@isuruf

This comment has been minimized.

Copy link
Member

isuruf commented Feb 7, 2016

This won't work. If a user only sets WITH_ARB=yes and doesn't set WITH_FLINT this will make WITH_ARB=no

@CodeMaxx

This comment has been minimized.

Copy link
Contributor

CodeMaxx commented Feb 7, 2016

Yeah I had thought of that ... but how do I detect if the user sets WITH_FLINT=no or hasn't set it at all?

@rwst

This comment has been minimized.

Copy link
Contributor

rwst commented Feb 7, 2016

If the user doesn't give -DWITH_FLINT= it is set to the previously used value. If that is unknown I think the default is No. Note however that the previous value may be Yes although Flint may no longer be installed on the system. So setting -DWITH_FLINT=yes is not more than giving an intention with the final value depending on installation status.

@CodeMaxx

This comment has been minimized.

Copy link
Contributor

CodeMaxx commented Feb 7, 2016

Isn't WITH_FLINT set to no here even if the previously used value was yes ?

@rwst

This comment has been minimized.

Copy link
Contributor

rwst commented Feb 7, 2016

That was really easy to answer: https://cmake.org/cmake/help/v3.3/command/set.html#set-cache-entry
"Set the given cache (cache entry). Since cache entries are meant to provide user-settable values this does not overwrite existing cache entries by default. Use the FORCE option to overwrite existing entries."

@CodeMaxx

This comment has been minimized.

Copy link
Contributor

CodeMaxx commented Feb 7, 2016

@isuruf @rwst this is what we are aiming for right?

Flint_yes Flint_no Flint_x
ARB_yes yes no yes
ARB_no Flint_yes ARB_no No No
ARB_x Flint_yes ARB_no No No

yes implies both are yes. x implies user has not set this option.

@rwst

This comment has been minimized.

Copy link
Contributor

rwst commented Feb 7, 2016

Yes that's right.

On Sun, Feb 7, 2016, 18:37 Akash Trehan notifications@github.com wrote:

@isuruf https://github.com/isuruf @rwst https://github.com/rwst this
is what we are aiming for right?
Flint_yes Flint_no Flint_x
ARB_yes yes no yes
ARB_no Flint_yes ARB_no No No
ARB_x Flint_yes ARB_no No No

yes implies both are yes. x implies user has not set this option.


Reply to this email directly or view it on GitHub
#795 (comment).

@CodeMaxx

This comment has been minimized.

Copy link
Contributor

CodeMaxx commented Feb 7, 2016

I still don't understand how to I detect the difference between WITH_FLINT set to no and WITH_FLINT not set at all(previously set value was no)? We need different configurations for these two scenarios according the table in my prev comment.

@rwst

This comment has been minimized.

Copy link
Contributor

rwst commented Feb 8, 2016

You mean reading the cache before using the set command?

On Mon, Feb 8, 2016, 00:05 Akash Trehan notifications@github.com wrote:

I still don't understand how to I detect the difference between WITH_FLINT
set to no and WITH_FLINT not set at all(previously set value was no)? We
need different configurations for these two scenarios according the table
in my prev comment.


Reply to this email directly or view it on GitHub
#795 (comment).

@CodeMaxx

This comment has been minimized.

Copy link
Contributor

CodeMaxx commented Feb 8, 2016

No. My question is that if in case WITH_ARB=yes but WITH_FLINT is not specified by the user, then the final configuration will depend on the value of WITH_FLINT from the cache(which is the value the user specified in a previous run) i.e.

flint_prev_no flint_prev_yes
arb_yes arb_no flint_no arb_yes flint_yes

So what I want to know is if the user has set the value of WITH_FLINT or not....This is with reference to @isuruf's comment above.

@rwst

This comment has been minimized.

Copy link
Contributor

rwst commented Feb 8, 2016

Actually, if the user sets WITH_ARB=yes cmake should check again if flint is installed as well and set WITH_FLINT accordingly.

@isuruf

This comment has been minimized.

Copy link
Member

isuruf commented Feb 8, 2016

@rwst, problem is that you cannot make the distinction of the first run or a subsequent run.
When WITH_ARB=yes is set by the user at first. WITH_FLINT=no is there because it is the default. Then since WITH_ARB=yes, WITH_FLINT=yes is set.

When the user sets WITH_FLINT=no on the command line this is the same as the first case, so you cannot differentiate between the two

@rwst

This comment has been minimized.

Copy link
Contributor

rwst commented Feb 9, 2016

I see. I think a solution would be to set the default to Maybe---I just confirmed this is possible. What do you think?

@CodeMaxx

This comment has been minimized.

Copy link
Contributor

CodeMaxx commented Feb 10, 2016

@rwst Can you give a reference to the source of the information.... What does Maybe actually mean in this case. Also what is the syntax to detect it.. if(WITH_FLINT=Maybe) or something else?

@CodeMaxx

This comment has been minimized.

Copy link
Contributor

CodeMaxx commented Feb 10, 2016

Also I tried this

set(WITH_FLINT Maybe
    CACHE BOOL "Build with Flint" FORCE)
set(HAVE_SYMENGINE_FLINT False)

It treats Maybe are true

@rwst

This comment has been minimized.

Copy link
Contributor

rwst commented Feb 10, 2016

Of course you need STRING instead of BOOL in the SET, see the cmake doc link above.

@CodeMaxx

This comment has been minimized.

Copy link
Contributor

CodeMaxx commented Feb 10, 2016

The Maybe solution doesn't work.
The cache is set to Maybe only on the first run... otherwise the variable retains the value of the previous run.
if I use FORCE then the cache remains Maybe no matter what the user specifies.

I tried to search for alternate methods but couldn't find any. Just this something from stackexchange but I guess thats not the solution we are looking for.

@rwst

This comment has been minimized.

Copy link
Contributor

rwst commented Feb 10, 2016

That nails it. Many thanks for your efforts. The issue can be considered
invalid.

On Wed, Feb 10, 2016, 20:06 Akash Trehan notifications@github.com wrote:

The Maybe solution doesn't work.
The cache is set to Maybe only on the first run... otherwise the variable
retains the value of the previous run.
if I use FORCE then the cache remains Maybe no matter what the user
specifies.

I tried to search for alternate methods but couldn't find any. Just this
something
http://stackoverflow.com/questions/27350560/how-to-tell-whether-cmake-used-initial-value-for-an-option
from stackexchange but I guess thats not the solution we are looking for.


Reply to this email directly or view it on GitHub
#795 (comment).

@CodeMaxx

This comment has been minimized.

Copy link
Contributor

CodeMaxx commented Feb 10, 2016

Cool...closing the PR then.

@CodeMaxx CodeMaxx closed this Feb 10, 2016

@CodeMaxx

This comment has been minimized.

Copy link
Contributor

CodeMaxx commented Feb 10, 2016

@rwst Shouldn't we atleast turn off ARB when FLINT is off?

@CodeMaxx CodeMaxx reopened this Feb 10, 2016

@isuruf

This comment has been minimized.

Copy link
Member

isuruf commented Feb 11, 2016

@CodeMaxx, that's what you were trying to do and realized you cannot right?

@CodeMaxx

This comment has been minimized.

Copy link
Contributor

CodeMaxx commented Feb 11, 2016

We can do that when user specifies Arb=yes and Flint=no... But if user gives only Arb=yes and doesn't specify Flint,then whether Arb is used or not will depend on the value of Flint from the previous run.

@CodeMaxx

This comment has been minimized.

Copy link
Contributor

CodeMaxx commented Feb 12, 2016

@isuruf @rwst What is the final decision then?

@rwst

This comment has been minimized.

Copy link
Contributor

rwst commented Feb 12, 2016

The original problem in #788 was that I gave Flint=No and expected Arb to be set to No from it, as well. Would this be distinguishable from Flint=No cached and the user sets Arb=yes? If so, please reopen #788

@CodeMaxx

This comment has been minimized.

Copy link
Contributor

CodeMaxx commented Feb 12, 2016

No, it won't be distinguishable..... so should I close this PR?

@rwst

This comment has been minimized.

Copy link
Contributor

rwst commented Feb 12, 2016

Yes, I think so.

@CodeMaxx CodeMaxx closed this Feb 12, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment