Skip to content
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

Fix a compilation issue on mac OS #403

Merged

Conversation

alexopenu
Copy link
Collaborator

@alexopenu alexopenu commented Nov 9, 2020

This pr addresses a similar compilation error on a mac to the one that was fixed in #294.

Like before, including cmath solves the ambiguity issue of the call to abs(). @guykatzz, do you think it would make more sense to include it in a different header, more globally (e.g., FloatUtils)?

@guykatzz
Copy link
Collaborator

guykatzz commented Nov 9, 2020

Hi Alex,
Thanks for the PR. Yes, we can just put it in FloatUtils.

@guykatzz guykatzz self-requested a review November 9, 2020 08:04
@alexopenu
Copy link
Collaborator Author

Hi Alex,
Thanks for the PR. Yes, we can just put it in FloatUtils.

Hi Guy,

Now that I moved to FloatUtils, travis build fails... However, it builds perfectly well both on my OS and on the linux distribution in my office. Any ideas? We can, of course, always move the include back to SignConstraint...

@guykatzz
Copy link
Collaborator

guykatzz commented Nov 11, 2020 via email

@alexopenu
Copy link
Collaborator Author

Hi Alex, I think we should debug this. Are you using the exact same flags as Travis? Did you try with both the gcc and clang compilers? Did you Google the errors? From a quick look, you're including both and <math.h>; I think the former is the "c++ variant" of the latter, and I'm not sure whether including them both can cause strange behaviors.

On Wed, 11 Nov 2020 at 18:14, alexopenu @.***> wrote: Hi Alex, Thanks for the PR. Yes, we can just put it in FloatUtils. Hi Guy, Now that I moved to FloatUtils, travis build fails... However, it builds perfectly well both on my OS and on the linux distribution in my office. Any ideas? We can, of course, always move the include back to SignConstraint... — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#403 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADSTPXJIRN3GNIFH2RQR2N3SPKZ5HANCNFSM4TO33XWA .

@alexopenu alexopenu closed this Nov 12, 2020
@alexopenu alexopenu reopened this Nov 12, 2020
@alexopenu
Copy link
Collaborator Author

Sure, I just wasn't sure whether you preferred making a bigger change, given that it had worked fine with math.h except for one problem that could be solved locally; but I agree that it is better to solve the issue globally. I think it is fine now, all tests pass, so if you are happy, I will merge it.

(sorry, accidentally closed and reopened the pr earlier)

Hi Alex, I think we should debug this. Are you using the exact same flags as Travis? Did you try with both the gcc and clang compilers? Did you Google the errors? From a quick look, you're including both and <math.h>; I think the former is the "c++ variant" of the latter, and I'm not sure whether including them both can cause strange behaviors.

On Wed, 11 Nov 2020 at 18:14, alexopenu @.***> wrote: Hi Alex, Thanks for the PR. Yes, we can just put it in FloatUtils. Hi Guy, Now that I moved to FloatUtils, travis build fails... However, it builds perfectly well both on my OS and on the linux distribution in my office. Any ideas? We can, of course, always move the include back to SignConstraint... — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#403 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADSTPXJIRN3GNIFH2RQR2N3SPKZ5HANCNFSM4TO33XWA .

@guykatzz
Copy link
Collaborator

guykatzz commented Nov 12, 2020 via email

@alexopenu alexopenu merged commit 15f2b31 into NeuralNetworkVerification:master Nov 12, 2020
matanost pushed a commit that referenced this pull request Nov 2, 2021
* Include cstdlib.

* Include cmath instead.

* Remove cstdlib.

* Include cmath globally in FloatUtils instead of locally.

* Trigger

* Attempt to fix the cmath vs math.h incompatibility issue.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants