oneapi-src / oneCCL

oneAPI Collective Communications Library (oneCCL)
https://oneapi-src.github.io/oneCCL
Other
191 stars 67 forks source link

CMake configuration writes directly to installation directory #82

Closed sogartar closed 1 year ago

sogartar commented 1 year ago

Here cmake writes to the install directory which usually is owned by root. Usually building is not done by root. This causes a write failure.

if (BUILD_CONFIG)
    configure_file("cmake/templates/oneCCLConfig.cmake.in"
                   "${CCL_INSTALL_LIB}/cmake/oneCCL/oneCCLConfig.cmake"
                   COPYONLY)
    configure_file("cmake/templates/oneCCLConfigVersion.cmake.in"
                   "${CCL_INSTALL_LIB}/cmake/oneCCL/oneCCLConfigVersion.cmake"
                   @ONLY)
endif()

This does not manifest under default conditions because of this dubious change of CMAKE_INSTALL_PREFIX.

nikitaxgusev commented 1 year ago

Hello @sogartar, can you, please, provide the steps how you get the hit of this issue?

sogartar commented 1 year ago

To get the error you should use for example

cmake -DCMAKE_INSTALL_PREFIX=/usr ...
ksenyako commented 1 year ago

Hi @sogartar I was able to reproduce the issue with -DCMAKE_INSTALL_PREFIX=/usr partly, on make step I got the error which you are talking about. After some reworking CMakeLists.txt I got permission issue on make install step because /usr folder is owned by root. I suppose the fix will be useful, but can you please provide detailed step by step reproducer for verification purposes?

ksenyako commented 1 year ago

Hi @sogartar, the fix was merged, could you please try updated oneCCL?