luikore / triez

fast, efficient, unicode aware HAT trie with prefix / suffix support for Ruby
MIT License
140 stars 9 forks source link

Failed to install libtries.a #6

Closed eeevanbbb closed 7 years ago

eeevanbbb commented 7 years ago

When I try to install triez via the following command:

sudo gem install triez -v '1.0.4',

I get the following error:

Building native extensions.  This could take a while...
ERROR:  Error installing triez:
    ERROR: Failed to build gem native extension.

    current directory: /Library/Ruby/Gems/2.0.0/gems/triez-1.0.4/ext
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby -r ./siteconf20161215-1269-om67es.rb extconf.rb
creating Makefile
xcrun clang -O3 -std=c99 -Wall -pedantic -fPIC -c -I.. ../hat-trie/ahtable.c ../hat-trie/hat-trie.c ../hat-trie/misc.c ../hat-trie/murmurhash3.c
ar -r libtries.a
ar: no archive members specified
usage:  ar -d [-TLsv] archive file ...
    ar -m [-TLsv] archive file ...
    ar -m [-abiTLsv] position archive file ...
    ar -p [-TLsv] archive [file ...]
    ar -q [-cTLsv] archive file ...
    ar -r [-cuTLsv] archive file ...
    ar -r [-abciuTLsv] position archive file ...
    ar -t [-TLsv] archive [file ...]
    ar -x [-ouTLsv] archive [file ...]

current directory: /Library/Ruby/Gems/2.0.0/gems/triez-1.0.4/ext
make "DESTDIR=" clean

current directory: /Library/Ruby/Gems/2.0.0/gems/triez-1.0.4/ext
make "DESTDIR="
compiling triez.cc
linking shared-object triez.bundle
ld: library not found for -ltries
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [triez.bundle] Error 1

make failed, exit code 2

Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/triez-1.0.4 for inspection.
Results logged to /Library/Ruby/Gems/2.0.0/extensions/universal-darwin-16/2.0.0/triez-1.0.4/gem_make.out

When I clone the repo and rake, I get the following:

ruby extconf.rb
creating Makefile
xcrun clang -O3 -std=c99 -Wall -pedantic -fPIC -c -I.. ../hat-trie/ahtable.c ../hat-trie/hat-trie.c ../hat-trie/misc.c ../hat-trie/murmurhash3.c
ar -r libtries.a
ar: no archive members specified
usage:  ar -d [-TLsv] archive file ...
    ar -m [-TLsv] archive file ...
    ar -m [-abiTLsv] position archive file ...
    ar -p [-TLsv] archive [file ...]
    ar -q [-cTLsv] archive file ...
    ar -r [-cuTLsv] archive file ...
    ar -r [-abciuTLsv] position archive file ...
    ar -t [-TLsv] archive [file ...]
    ar -x [-ouTLsv] archive [file ...]
make
linking shared-object triez.bundle
ld: library not found for -ltries
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [triez.bundle] Error 1
rake aborted!
Command failed with status (2): [make...]
/Users/Evan/programs/triez/rakefile:39:in `block (2 levels) in <top (required)>'
/Users/Evan/programs/triez/rakefile:37:in `chdir'
/Users/Evan/programs/triez/rakefile:37:in `block in <top (required)>'
Tasks: TOP => default => ext/triez.bundle
(See full trace by running task with --trace)

Any idea what could be the problem? (I am on MacOS 10.12.1 and I have the Xcode command-line tools installed.)

luikore commented 7 years ago

Seems the clang command doesn't generate the object files ... I will change how it compiles the required library.

eeevanbbb commented 7 years ago

ls -l ext/build returns with nothing.

luikore commented 7 years ago

Just released a new gem 1.0.5 to fix this problem. Please try the new one.

eeevanbbb commented 7 years ago

It worked, thanks so much!!