Closed jacobherrington closed 4 years ago
Experiencing the same failure with Ruby 2.3.1 and cld3 3.1.3.
Did you confirm your C compiler works? That would be the first step to solve the issue.
@akihikodaki
gcc --version
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 10.0.0 (clang-1000.10.44.2)
Target: x86_64-apple-darwin17.7.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
#include<stdio.h>
int main(int argc, char* argv[]) {
printf("Hello World\n");
return 0;
}
Compiles with no issue.
@jacobherrington Do you have these warnings which were present in mkmf.log
? I forgot to ask to check the stdout.
ld: warning: text-based stub file /System/Library/Frameworks//Foundation.framework/Foundation.tbd and library file /System/Library/Frameworks//Foundation.framework/Foundation are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//CoreFoundation.framework/Versions/A/CoreFoundation.tbd and library file /System/Library/Frameworks//CoreFoundation.framework/Versions/A/CoreFoundation are out of sync. Falling back to library file for linking.
mkmf considers any warnings fatal, so it is important that it quietly compiles. You may check https://github.com/akihikodaki/cld3-ruby#openbsd. (But don't apply suggested change. It should be the last resort.)
By the way, I found a fix for the incovenient error detection is already applied on trunk: https://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/lib/mkmf.rb?r1=62007&r2=62006&pathrev=62007
It is not released yet but you may backport it if you cannot get rid of the warning (but you should try first, as I said earlier.)
For c file compile and run without issue
@jacobherrington Do you have these warnings which were present in
mkmf.log
? I forgot to ask to check the stdout.ld: warning: text-based stub file /System/Library/Frameworks//Foundation.framework/Foundation.tbd and library file /System/Library/Frameworks//Foundation.framework/Foundation are out of sync. Falling back to library file for linking. ld: warning: text-based stub file /System/Library/Frameworks//CoreFoundation.framework/Versions/A/CoreFoundation.tbd and library file /System/Library/Frameworks//CoreFoundation.framework/Versions/A/CoreFoundation are out of sync. Falling back to library file for linking.
mkmf considers any warnings fatal, so it is important that it quietly compiles. You may check https://github.com/akihikodaki/cld3-ruby#openbsd. (But don't apply suggested change. It should be the last resort.)
I did with out success. maybe I did on wrong file.
I changed this:
/MYUSERPATH/.rbenv/versions/2.5.1/lib/ruby/2.5.0/mkmf.rb
There are some other files:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb
/MYUSERPATH/.rbenv/versions/2.4.1/lib/ruby/2.4.0/mkmf.rb
/MYUSERPATH/.rbenv/versions/2.5.1/lib/ruby/2.5.0/mkmf.rb
/usr/local/Cellar/ruby/2.5.1/lib/ruby/2.5.0/mkmf.rb
/usr/local/lib/ruby/2.5.0/mkmf.rb
I ran into the same issues.
First, I had to manually add the path to protobuf's library to PKG_CONFIG_PATH (why doesn't brew install protobuf
do that???).
After doing that it would proceed to attempt to compile cld3 but fail because of compiler warnings as the original author points out.
I then replaced one line in /MYUSERPATH/.rbenv/versions/2.5.1/lib/ruby/2.5.0/mkmf.rb
(per https://github.com/akihikodaki/cld3-ruby#openbsd) and the library finally compiled and installed.
@mdf092 maybe this is not working for you because a different version of ruby is currently active in your environment? Try running ruby --version
and changing the mkmf.rb in the path for that version.
I'm wondering why a few people had the same issue recently. Did Xcode 10.0 do something bad on their toolchains?
As I noted, the warning should be fixed rather if it can be. I found reports saying reinstalling Xcode fixes similar warnings on the Web. Can anyone confirm this?
I set up a brand new development environment on osx a month and a half ago, so I assume I had the latest xcode installed
On Sat, Sep 22, 2018, 11:31 Akihiko Odaki notifications@github.com wrote:
I'm wondering why a few people had the same issue recently. Did Xcode 10.0 do something bad on their toolchains?
As I noted, the warning should be fixed rather if it can be. I found reports saying reinstalling Xcode fixes similar warnings on the Web. Can anyone confirm this?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/akihikodaki/cld3-ruby/issues/18#issuecomment-423752024, or mute the thread https://github.com/notifications/unsubscribe-auth/ABGqbRBFXCr1N9Qgf19n-17dPTQHDg6nks5udlfMgaJpZM4WyFPi .
-- Dmitry Pashkevich
I ran into the same issues.
First, I had to manually add the path to protobuf's library to PKG_CONFIG_PATH (why doesn't
brew install protobuf
do that???).After doing that it would proceed to attempt to compile cld3 but fail because of compiler warnings as the original author points out.
I then replaced one line in
/MYUSERPATH/.rbenv/versions/2.5.1/lib/ruby/2.5.0/mkmf.rb
(per https://github.com/akihikodaki/cld3-ruby#openbsd) and the library finally compiled and installed.@mdf092 maybe this is not working for you because a different version of ruby is currently active in your environment? Try running
ruby --version
and changing the mkmf.rb in the path for that version.
Thanks. I did as you said without any success :(
and @akihikodaki , I remove and install xcode for three times but didn't work.
it seems that protobuf
is working smoothly as I ran:
pkg-config --list-all | grep proto
and the output is:
protobuf-lite Protocol Buffers - Google's Data Interchange Format
protobuf Protocol Buffers - Google's Data Interchange Format
@dpashkevich
I set up a brand new development environment on osx a month and a half ago,
Thanks for that information. Xcode 10.0 was released "September 17, 2018", according to Wikipedia, s you may not have the version. You may update your Xcode but I wonder if it breaks cld3-ruby again. :(
@mdf092
and @akihikodaki , I remove and install xcode for three times but didn't work.
mkmf.rb
of the appropriate version to workaround the issue.Your reports are very appreciated since I don't own Mac. I hope you can get cld3-ruby work soon.
@dpashkevich
I set up a brand new development environment on osx a month and a half ago,
Thanks for that information. Xcode 10.0 was released "September 17, 2018", according to Wikipedia, s you may not have the version. You may update your Xcode but I wonder if it breaks cld3-ruby again. :(
@mdf092
and @akihikodaki , I remove and install xcode for three times but didn't work.
- Please tell me your Xcode version.
- Check the Ruby version you currently use. You seem to have a few Ruby versions and you have to edit
mkmf.rb
of the appropriate version to workaround the issue.Your reports are very appreciated since I don't own Mac. I hope you can get cld3-ruby work soon.
Thanks in advance for your help.
the xcode versin is: Version 9.4.1 (9F2000)
xcode-select version 2349
command line tools:
package-id: com.apple.pkg.CLTools_Executables
version: 10.0.0.0.1.1535735448
volume: /
location: /
install-time: 1537369053
groups: com.apple.FindSystemFiles.pkg-group
$ gcc -v
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 9.1.0 (clang-902.0.39.2)
Target: x86_64-apple-darwin17.7.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
$ ruby --version
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin17]
And this is the path of mkmf.rb:
/MYUSERPATH/.rbenv/versions/2.5.1/lib/ruby/2.5.0/mkmf.rb
@mdf092 So you use (probably) latest command line tools and Ruby 2.5.1?
I wonder why mkmf.rb
hack doesn't work for you. What about adding Kernel.#p
call and see its output? Old-good printf debug.
I had to install pkg-config
brew install pkg-config
I had the same error on Arch Linux for
gem install cld3 -v '3.2.3' --source 'https://rubygems.org/'
The solution was to install
pacman -S protobuf
I encountered the same error while installing cld3 -v 3.2.4
on macOS Mojave (10.14.5)
gem install cld3 -v '3.2.4' --source 'https://rubygems.org/'
Installing protobuf got it working
brew install protobuf
macOS Catalina 10.15.2 (19C57) Ruby 2.6.5
trying to install Mastodon dependencies with bundle inistall
brew install protobuf
helped me
Now I can confirm it works on macOS Catalina 10.15.3.
@mdf092 just referenced this issue on #10 about 5 hours ago. Opening a new issue now that I am also experiencing it.
Behavior: Running
gem install cld3 -v '3.2.2' --source 'https://rubygems.org/'
fails with the following output:cat /Users/jacobherrington/.asdf/installs/ruby/2.5.1/lib/ruby/gems/2.5.0/extensions/x86_64-darwin-17/2.5.0-static/cld3-3.2.2/mkmf.log
outputs:For the sake of sanity,
protoc --version
outputs:libprotoc 3.6.1
.Environment: MacOS High Sierra 10.13.6, fish shell, Ruby 2.5.1, using asdf.