Skip to content

Commit c76099d

Browse files
authored
Merge pull request #45 from yoshoku/fix-xcode14
Add dynamic_lookup linker option for macOS and Ruby 3.1
2 parents 1d950a2 + 945d6d6 commit c76099d

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

ext/numo/linalg/blas/extconf.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@
2828
end
2929
end
3030

31+
if RUBY_PLATFORM.match?(/darwin/) && Gem::Version.new('3.1.0') <= Gem::Version.new(RUBY_VERSION)
32+
if try_link('int main(void){return 0;}', '-Wl,-undefined,dynamic_lookup')
33+
$LDFLAGS << ' -Wl,-undefined,dynamic_lookup'
34+
end
35+
end
36+
3137
if have_header("dlfcn.h")
3238
exit(1) unless have_library("dl")
3339
exit(1) unless have_func("dlopen")

ext/numo/linalg/lapack/extconf.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@
2929
end
3030
end
3131

32+
if RUBY_PLATFORM.match?(/darwin/) && Gem::Version.new('3.1.0') <= Gem::Version.new(RUBY_VERSION)
33+
if try_link('int main(void){return 0;}', '-Wl,-undefined,dynamic_lookup')
34+
$LDFLAGS << ' -Wl,-undefined,dynamic_lookup'
35+
end
36+
end
37+
3238
if have_header("dlfcn.h")
3339
exit(1) unless have_library("dl")
3440
exit(1) unless have_func("dlopen")

0 commit comments

Comments
 (0)