Closed c8ef closed 2 years ago
This is what clang does:
[30/55] Building CXX object src/autodiff/CMakeFiles/drjit-autodiff-scalar-f32.dir/autodiff.cpp.o
In file included from /tmp/drjit/src/autodiff/autodiff.cpp:58:
/tmp/drjit/include/drjit/math.h:660:13: warning: use of bitwise '&' with boolean operands [-Wbitwise-instead-of-logical]
IntMask(neq(x, zeros<Value>())) & neq(exponent_bits, exponent_mask);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
&&
/tmp/drjit/include/drjit/math.h:1437:25: note: in instantiation of function template specialization 'drjit::frexp<float>' requested here
auto [xm, xe] = frexp(xa);
^
/tmp/drjit/include/drjit/autodiff.h:475:27: note: in instantiation of function template specialization 'drjit::cbrt<float>' requested here
Type result = cbrt(m_value);
^
/tmp/drjit/include/drjit/math.h:660:13: note: cast one or both operands to int to silence this warning
IntMask(neq(x, zeros<Value>())) & neq(exponent_bits, exponent_mask);
^
1 warning generated.
[31/55] Building CXX object src/autodiff/CMakeFiles/drjit-autodiff-scalar-f64.dir/autodiff.cpp.o
In file included from /tmp/drjit/src/autodiff/autodiff.cpp:58:
/tmp/drjit/include/drjit/math.h:660:13: warning: use of bitwise '&' with boolean operands [-Wbitwise-instead-of-logical]
IntMask(neq(x, zeros<Value>())) & neq(exponent_bits, exponent_mask);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
&&
/tmp/drjit/include/drjit/math.h:1437:25: note: in instantiation of function template specialization 'drjit::frexp<double>' requested here
auto [xm, xe] = frexp(xa);
^
/tmp/drjit/include/drjit/autodiff.h:475:27: note: in instantiation of function template specialization 'drjit::cbrt<double>' requested here
Type result = cbrt(m_value);
^
/tmp/drjit/include/drjit/math.h:660:13: note: cast one or both operands to int to silence this warning
IntMask(neq(x, zeros<Value>())) & neq(exponent_bits, exponent_mask);
^
1 warning generated.
[55/55] Generating ../../drjit/__init__.pyi
By the way, I found this issue when building the mitsuba3 renderer.🤣
Hi @c8ef,
Could you please try cherry-picking the following patch and compile again? https://github.com/mitsuba-renderer/drjit/pull/55
@njroussel, if this works, I think we could merge that PR?
Hi, After cherry-picking this patch, the project can be successfully built on my laptop with both gcc and clang.👌🏻 (sorry for reporting the issue that someone else has already reported)
Thanks for reporting this for GCC 12 aswell @c8ef. This is now fixed with #55 (https://github.com/mitsuba-renderer/drjit/commit/942dfb5e7b56bfc86ec2a3a07a2535096ca7e87c).
My OS:
drjit version: dbdb578 My compiler version:
When building with GCC, I got error as follows:
It seems that gcc dislike some intrinsic header file. But when build with clang(I use
cmake .. -G Ninja -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
), there is no such error. Is there any ideas to fix this?