Skip to content

Conversation

igchor
Copy link
Member

@igchor igchor commented Jul 26, 2024

Description

Checklist

  • Code compiles without errors locally
  • All tests pass locally
  • CI workflows execute properly
  • CI workflows, not executed per PR (e.g. Nightly), execute properly
  • New tests added, especially if they will fail without my changes
  • Added/extended example(s) to cover this functionality
  • Extended the README/documentation
  • All newly added source files have a license
  • All newly added source files are referenced in CMake files
  • Logger (with debug/info/... messages) is used

@igchor igchor requested a review from a team as a code owner July 26, 2024 18:11
@igchor igchor force-pushed the hwloc_static branch 4 times, most recently from 290ffd6 to e62a2ea Compare July 26, 2024 19:25
@KFilipek
Copy link
Contributor

@igchor
Following change allows me to compile your case without any issue:

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0c3a5e8..cf86d13 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -146,7 +146,7 @@ else()
     add_custom_command(
         COMMAND
             ./configure --prefix=${hwloc_targ_BINARY_DIR} --enable-static=yes
-            --enable-shared=no --disable-libxml2 --disable-levelzero
+            --enable-shared=no --disable-libxml2 --disable-levelzero CFLAGS=-fPIC CXXFLAGS=-fPIC
         WORKING_DIRECTORY ${hwloc_targ_SOURCE_DIR}
         OUTPUT ${hwloc_targ_SOURCE_DIR}/Makefile
         DEPENDS ${hwloc_targ_SOURCE_DIR}/configure)

@igchor igchor changed the title Hwloc static Add option to link statically with hwloc on linux Jul 29, 2024
@igchor
Copy link
Member Author

igchor commented Jul 29, 2024

@igchor Following change allows me to compile your case without any issue:

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0c3a5e8..cf86d13 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -146,7 +146,7 @@ else()
     add_custom_command(
         COMMAND
             ./configure --prefix=${hwloc_targ_BINARY_DIR} --enable-static=yes
-            --enable-shared=no --disable-libxml2 --disable-levelzero
+            --enable-shared=no --disable-libxml2 --disable-levelzero CFLAGS=-fPIC CXXFLAGS=-fPIC
         WORKING_DIRECTORY ${hwloc_targ_SOURCE_DIR}
         OUTPUT ${hwloc_targ_SOURCE_DIR}/Makefile
         DEPENDS ${hwloc_targ_SOURCE_DIR}/configure)

Thanks, applied.

@igchor igchor force-pushed the hwloc_static branch 2 times, most recently from d435548 to f56cf10 Compare July 29, 2024 15:34
Copy link
Contributor

@lukaszstolarczuk lukaszstolarczuk left a comment

Choose a reason for hiding this comment

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

LGTM 👍

message(FATAL_ERROR "hwloc can be statically linked only on Windows")
endif()
# add PATH to DLL on Windows
set(DLL_PATH_LIST
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: this seems like a redundant code...?

@igchor igchor merged commit 148a837 into oneapi-src:main Jul 29, 2024
65 checks passed
@igchor igchor deleted the hwloc_static branch July 29, 2024 19:43
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.

7 participants