https://github.com/intel/clDNN/blob/master/CMakeLists.txt#L104 causes an issue where systems will compile a binary with avx2 and another binary with avx512. Because CMAKE_BINARY_DIR is not used, whichever binary that was compiled last will override the former. When compiling with different instruction sets or optimizations, distros will create build_avx2 or build_avx512 directories and set CMAKE_BINARY_DIR to one of those. This way different build types do not conflict.
The solution here is NOT to reinvent the wheel by setting binary output to places other than CMAKE_BINARY_DIR.
https://github.com/intel/clDNN/blob/master/CMakeLists.txt#L104 causes an issue where systems will compile a binary with avx2 and another binary with avx512. Because CMAKE_BINARY_DIR is not used, whichever binary that was compiled last will override the former. When compiling with different instruction sets or optimizations, distros will create build_avx2 or build_avx512 directories and set CMAKE_BINARY_DIR to one of those. This way different build types do not conflict.
The solution here is NOT to reinvent the wheel by setting binary output to places other than CMAKE_BINARY_DIR.