rpp icon indicating copy to clipboard operation
rpp copied to clipboard

Improve finding half.hpp

Open trixirt opened this issue 1 year ago • 1 comments

On Fedora half.hpp is installed to the system dir /usr/include. There is no cmake package, so finding the half cmake package will always fail. The source looks for half with #include <half/half.h> The use of half/ makes it impossible to find and use the system location.

So look for the half.hpp path and add add that to the include_directories.

Use this sed script to programatically change the uses of #include <half/half.h>

for f in find . -type f -name '*.hpp' -o -name '*.cpp' ; do sed -i -e 's@#include <half/half.hpp>@#include <half.hpp>@' $f done

This covers this issue https://github.com/ROCm/rpp/issues/292

trixirt avatar Aug 02 '24 12:08 trixirt

@trixirt -- changes failing all CI builds

CMake Error in src/modules/CMakeLists.txt:
  Found relative path while evaluating include directories of "modules":

    "HALF_INCLUDE_DIR-NOTFOUND"



CMake Error in addkernels/CMakeLists.txt:
  Found relative path while evaluating include directories of "addkernels":

    "HALF_INCLUDE_DIR-NOTFOUND"



-- Generating done (0.0s)
CMake Warning:
  Manually-specified variables were not used by the project:

    HALF_INCLUDE_DIRS


CMake Generate step failed.  Build files cannot be regenerated correctly.

##[error]The process '/usr/local/bin/cmake' failed with exit code 1
##[error]CMake failed with error: The process '/usr/local/bin/cmake' failed with exit code 1

kiritigowda avatar Aug 20 '24 18:08 kiritigowda

PR #459 - adds this fix

kiritigowda avatar Oct 08 '24 17:10 kiritigowda