Skip to content

Conversation

@abrown
Copy link
Contributor

@abrown abrown commented Jan 28, 2026

On my machine, the sleef library builds within a lib64 directory, not lib directory. Let's see if this causes any CI issues; if so, this will need to be more sophisticated.

On my machine, the sleef library builds within a `lib64` directory, not
`lib` directory. Let's see if this causes any CI issues; if so, this
will need to be more sophisticated.
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR changes the SLEEF library copy path from lib to lib64 to accommodate the author's build environment where SLEEF installs to lib64 instead of lib. However, the library installation directory is platform-dependent, and this hardcoded change will break builds on other platforms.

Changes:

  • Modified the SLEEF library copy path from lib to lib64 in the CMake ExternalProject configuration

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

CMakeLists.txt Outdated
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
COMMAND ${CMAKE_COMMAND} -E copy
${SLEEF_INSTALL_DIR}/lib/libsleef.a
${SLEEF_INSTALL_DIR}/lib64/libsleef.a
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hardcoding the library path to lib64 will break builds on platforms where SLEEF installs to lib instead of lib64. The library directory varies by platform: Linux distributions like RHEL/Fedora use lib64, while Ubuntu/Debian and macOS typically use lib.

Consider using conditional logic to check for the existence of the library in both locations. For example:

# Try lib64 first, fall back to lib
if(EXISTS ${SLEEF_INSTALL_DIR}/lib64/libsleef.a)
  set(SLEEF_LIB_PATH ${SLEEF_INSTALL_DIR}/lib64/libsleef.a)
else()
  set(SLEEF_LIB_PATH ${SLEEF_INSTALL_DIR}/lib/libsleef.a)
endif()

ExternalProject_Add_Step(sleef copy_lib
  COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
  COMMAND ${CMAKE_COMMAND} -E copy
          ${SLEEF_LIB_PATH}
          ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
  DEPENDEES install
  ALWAYS 1
)

Alternatively, you could pass -DCMAKE_INSTALL_LIBDIR=lib in the CMAKE_ARGS to force SLEEF to always install to lib, or use CMake's GNUInstallDirs module to determine the correct library directory based on the platform.

Copilot uses AI. Check for mistakes.
@abrown abrown marked this pull request as ready for review January 28, 2026 19:41
@abrown abrown enabled auto-merge (squash) January 28, 2026 19:41
@abrown abrown merged commit 28f9bc5 into kernelize-ai:main Jan 28, 2026
4 checks passed
@abrown abrown deleted the sleef-linking branch January 28, 2026 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants