Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nmslib: fix missing glibc symbols on newer systems #20273

Merged
merged 1 commit into from
Oct 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions recipes/nmslib/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from conan import ConanFile
from conan.errors import ConanInvalidConfiguration
from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout
from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get
from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file
from conan.tools.microsoft import is_msvc, check_min_vs

required_conan_version = ">=1.53.0"
Expand Down Expand Up @@ -62,8 +62,15 @@ def generate(self):
tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW"
tc.generate()

def build(self):
def _patch_sources(self):
apply_conandata_patches(self)
# The finite-math-only optimization has no effect and can cause linking errors
# when linked against glibc >= 2.31
replace_in_file(self, os.path.join(self.source_folder, "similarity_search", "CMakeLists.txt"),
"-Ofast", "-Ofast -fno-finite-math-only")

def build(self):
self._patch_sources()
cmake = CMake(self)
cmake.configure(build_script_folder=os.path.join(self.source_folder, "similarity_search"))
cmake.build()
Expand Down