halide / Halide

a language for fast, portable data-parallel computation
https://halide-lang.org
Other
5.88k stars 1.07k forks source link

#define user_error conflicts with boost #1995

Open edubois opened 7 years ago

edubois commented 7 years ago

In Halide.h +1942,

Is it possible to upper case user_error user_warning defines so that it doesn't conflicts with: boost_1_61_0\boost/math/policies/error_handling.hpp

Many thanks,

abadams commented 7 years ago

Halide.h (should) undefine those macros at the end of Halide.h. Maybe boost is leaking its? Try including Halide.h before boost.

On Wed, Apr 12, 2017 at 4:15 PM, Du Bois Eloi notifications@github.com wrote:

In Halide.h +1942,

Is it possible to upper case user_error user_warning defines so that it doesn't conflicts with: boost_1_61_0\boost/math/policies/error_handling.hpp

Many thanks,

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/halide/Halide/issues/1995, or mute the thread https://github.com/notifications/unsubscribe-auth/AAfdRt6VyrrgR8YkTi_sM3xLazAkkiMrks5rvVsggaJpZM4M8FME .

zvookin commented 7 years ago

You can probably solve this by including Halide.h first as we do undef the macros at the end of the file.

We should consider prefixing the following names in Error.h with "halide_": internal_error user_error user_warning internal_assert user_assert

abadams commented 7 years ago

Does this sort of nonsense work with the preprocessor?

ifndef user_error

define old_user_error user_error

undef user_error

endif

define user_error ...

...

undef user_error

ifdef old_user_error

define user_error old_user_error

endif

On Wed, Apr 12, 2017 at 4:59 PM, Zalman Stern notifications@github.com wrote:

You can probably solve this by including Halide.h first as we do undef the macros at the end of the file.

We should consider prefixing the following names in Error.h with "halide_": internal_error user_error user_warning internal_assert user_assert

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/halide/Halide/issues/1995#issuecomment-293739916, or mute the thread https://github.com/notifications/unsubscribe-auth/AAfdRihVynyeD80CTByyUJAmBHg-yIC4ks5rvWVhgaJpZM4M8FME .

zvookin commented 7 years ago

Per conversation with Andrew, there's also a gcc mechanism that might let us use functions instead of macros for this, at least on that compiler.

edubois commented 7 years ago

Not sure I like the idea of including Halide.h first, it's not very clean.

I will see how I can solve this, right now I renamed the define on the entire Halide project.

https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=icon Virus-free. www.avast.com https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=link <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

2017-04-12 19:06 GMT-05:00 Zalman Stern notifications@github.com:

Per conversation with Andrew, there's also a gcc mechanism that might let us use functions instead of macros for this, at least on that compiler.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/halide/Halide/issues/1995#issuecomment-293740973, or mute the thread https://github.com/notifications/unsubscribe-auth/AANG6ZdolwbWycCWUoHFPboWqbjUFHMgks5rvWcZgaJpZM4M8FME .

zvookin commented 7 years ago

Nothing involving C preprocessor macros will ever be "clean." We will endeavor to fix the issue, but for now, including Halide.h first is a possible workaround.

-Z-

On Wed, Apr 12, 2017 at 5:40 PM, Du Bois Eloi notifications@github.com wrote:

Not sure I like the idea of including Halide.h first, it's not very clean.

I will see how I can solve this, right now I renamed the define on the entire Halide project.

https://www.avast.com/sig-email?utm_medium=email&utm_ source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=icon Virus-free. www.avast.com https://www.avast.com/sig-email?utm_medium=email&utm_ source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=link <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

2017-04-12 19:06 GMT-05:00 Zalman Stern notifications@github.com:

Per conversation with Andrew, there's also a gcc mechanism that might let us use functions instead of macros for this, at least on that compiler.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/halide/Halide/issues/1995#issuecomment-293740973, or mute the thread https://github.com/notifications/unsubscribe-auth/ AANG6ZdolwbWycCWUoHFPboWqbjUFHMgks5rvWcZgaJpZM4M8FME .

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/halide/Halide/issues/1995#issuecomment-293745448, or mute the thread https://github.com/notifications/unsubscribe-auth/ABbqFAaGoiSajzd4rSXQKSZVZ-90yMGHks5rvW78gaJpZM4M8FME .

edubois commented 7 years ago

Yes, true, I understand thanks!

On Apr 12, 2017 7:47 PM, "Zalman Stern" notifications@github.com wrote:

Nothing involving C preprocessor macros will ever be "clean." We will endeavor to fix the issue, but for now, including Halide.h first is a possible workaround.

-Z-

On Wed, Apr 12, 2017 at 5:40 PM, Du Bois Eloi notifications@github.com wrote:

Not sure I like the idea of including Halide.h first, it's not very clean.

I will see how I can solve this, right now I renamed the define on the entire Halide project.

https://www.avast.com/sig-email?utm_medium=email&utm_ source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=icon Virus-free. www.avast.com https://www.avast.com/sig-email?utm_medium=email&utm_ source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=link <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

2017-04-12 19:06 GMT-05:00 Zalman Stern notifications@github.com:

Per conversation with Andrew, there's also a gcc mechanism that might let us use functions instead of macros for this, at least on that compiler.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/halide/Halide/issues/1995#issuecomment-293740973, or mute the thread https://github.com/notifications/unsubscribe-auth/ AANG6ZdolwbWycCWUoHFPboWqbjUFHMgks5rvWcZgaJpZM4M8FME .

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/halide/Halide/issues/1995#issuecomment-293745448, or mute the thread https://github.com/notifications/unsubscribe-auth/ ABbqFAaGoiSajzd4rSXQKSZVZ-90yMGHks5rvW78gaJpZM4M8FME .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/halide/Halide/issues/1995#issuecomment-293746302, or mute the thread https://github.com/notifications/unsubscribe-auth/AANG6SsiAdzdkKJMfKIcJ3VElm5__bTXks5rvXCXgaJpZM4M8FME .