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

check cpu architecture and OS for gnparser binary (close #31) #32

Merged
merged 1 commit into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
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
Binary file added ext/gnparser-arm-linux
Binary file not shown.
Binary file renamed ext/gnparser-linux → ext/gnparser-arm-mac
Binary file not shown.
Binary file renamed ext/gnparser-mac → ext/gnparser-arm-win.exe
Binary file not shown.
Binary file renamed ext/gnparser-win.exe → ext/gnparser-x86-linux
Binary file not shown.
Binary file added ext/gnparser-x86-mac
Binary file not shown.
Binary file added ext/gnparser-x86-win.exe
Binary file not shown.
14 changes: 13 additions & 1 deletion lib/biodiversity/parser/gnparser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,20 @@ def start_gnparser
else
raise "Unsupported platform: #{Gem.platforms[1].os}"
end

target_cpu = RbConfig::CONFIG['target_cpu']
cpu_arch =
case target_cpu
when /x86|x64/
'x86'
when /aarch|arm/
'arm'
else
raise "Unsupported CPU Architecture: #{target_cpu}"
end

path = File.join(__dir__, '..', '..', '..',
'ext', "gnparser-#{platform_suffix}")
'ext', "gnparser-#{cpu_arch}-#{platform_suffix}")

@stdin, @stdout = Open3.popen2(
"#{path} --format #{format} --details --quiet --stream --jobs 1 #{@extra_settings}"
Expand Down
4 changes: 2 additions & 2 deletions lib/biodiversity/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

# Biodiversity module provides a namespace for scientific name parser.
module Biodiversity
VERSION = '6.0.0'
GNPARSER_VERSION = 'GNparser 1.10.1'
VERSION = '6.0.1'
GNPARSER_VERSION = 'GNparser 1.10.3'

def self.version
VERSION
Expand Down