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

Problem building the atomic gem #43

Open
slanand opened this issue Mar 17, 2014 · 10 comments
Open

Problem building the atomic gem #43

slanand opened this issue Mar 17, 2014 · 10 comments

Comments

@slanand
Copy link

slanand commented Mar 17, 2014

I'm getting this error message when trying to get the atomic gem -- looks like it might be a problem with GCC (which was part of the last pull request). Any ideas how to fix this?

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb

checking for libkern/OSAtomic.h... yes
creating Makefile

make "DESTDIR="
compiling atomic_reference.c
atomic_reference.c:57:59: warning: incompatible pointer types passing 'void *' to parameter of type 'volatile int64_t *' (aka 'volatile long long *') [-Wincompatible-pointer-types]
if (OSAtomicCompareAndSwap64(expect_value, new_value, &DATA_PTR(self))) {
^~~~~~~~~~~~~~~
/usr/include/libkern/OSAtomic.h:507:93: note: passing argument to parameter '__theValue' here
bool OSAtomicCompareAndSwap64( int64_t __oldValue, int64_t __newValue, volatile int64_t *__theValue );
^
1 warning generated.
linking shared-object atomic_reference.bundle
clang: error: unknown argument: '-multiply_definedsuppress' [-Wunused-command-line-argument-hard-error-in-future]
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future
make: *
* [atomic_reference.bundle] Error 1

@chdiza
Copy link

chdiza commented Mar 18, 2014

I get this too; it's the fault of the latest clang that comes with Xcode 5.1.

But I have no idea what to do about it.

@headius
Copy link
Owner

headius commented Mar 18, 2014

I have an xcode 5.1 update in process...will try to reproduce on my end once that happens.

@slanand
Copy link
Author

slanand commented Mar 18, 2014

Thank you!

@Iteratix
Copy link

+1 for this, unable to build on latest Mavericks with latest Xcode.

@richardcalahan
Copy link

This is a red flag:

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb

When you run bundle install bundler is using your system ruby to create the makefile for atomic, which is most likely very old. I use rbenv to manage my rubies, so the following corrected the issue for me:

# ensure correct ruby is set
$ rbenv global 2.1.1 
$ gem install bundler
$ rbenv rehash
$ bundle install

Now bunder uses the correct gem binary, which doesn't pass unknown arguments to clang.

@chdiza
Copy link

chdiza commented Mar 20, 2014

@richardcalahan I didn't run bundle install (it was gem install), and the system ruby on OSX 10.9.2 is not "very old" (2.0.0).

Also, I got this error wtih system ruby and with 2.1.

@richardcalahan
Copy link

Here's a comparison of the output from gem env. The first using the system ruby, which yielded the error, and the second with Ruby 2.1.1, which works fine for me. Using bundler and gem install.

Clang Error

- RUBYGEMS VERSION: 2.0.3
- RUBY VERSION: 2.0.0 (2013-06-27 patchlevel 247) [universal.x86_64-darwin13]
- INSTALLATION DIRECTORY: /Library/Ruby/Gems/2.0.0
- RUBY EXECUTABLE: /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
- EXECUTABLE DIRECTORY: /usr/bin
- RUBYGEMS PLATFORMS:
  - ruby
  - universal-darwin-13
- GEM PATHS:
   - /Library/Ruby/Gems/2.0.0
   - /Users/richardcalahan/.gem/ruby/2.0.0
   - /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/gems/2.0.0
- GEM CONFIGURATION:
   - :update_sources => true
   - :verbose => true
   - :backtrace => false
   - :bulk_threshold => 1000
- REMOTE SOURCES:
   - https://rubygems.org/

No Clang Error

- RUBYGEMS VERSION: 2.2.2
- RUBY VERSION: 2.1.1 (2014-02-24 patchlevel 76) [x86_64-darwin13.0]
- INSTALLATION DIRECTORY: /Users/richardcalahan/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0
- RUBY EXECUTABLE: /Users/richardcalahan/.rbenv/versions/2.1.1/bin/ruby
- EXECUTABLE DIRECTORY: /Users/richardcalahan/.rbenv/versions/2.1.1/bin
- SPEC CACHE DIRECTORY: /Users/richardcalahan/.gem/specs
- RUBYGEMS PLATFORMS:
  - ruby
  - x86_64-darwin-13
- GEM PATHS:
   - /Users/richardcalahan/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0
   - /Users/richardcalahan/.gem/ruby/2.1.0
- GEM CONFIGURATION:
   - :update_sources => true
   - :verbose => true
   - :backtrace => false
   - :bulk_threshold => 1000
- REMOTE SOURCES:
   - https://rubygems.org/
- SHELL PATH:
   - /Users/richardcalahan/.rbenv/versions/2.1.1/bin
   - /usr/local/Cellar/rbenv/0.4.0/libexec
   - /Users/richardcalahan/.rbenv/shims
   - /usr/local/sbin
   - /usr/local/bin
   - /usr/bin
   - /bin
   - /usr/sbin
   - /sbin
   - /usr/local/bin
   - /opt/X11/bin

@richardcalahan
Copy link

Also, using the system ruby, the error was originating from: /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/universal-darwin13/rbconfig.rb

Removing the references to the clang flag multiply_definedsuppress on lines 82 and 125 fixed the issue as well.

No, it might not be very old, but ruby 2.0.x does use deprecated flags.

@dpehrson
Copy link

The solution offered by @richardcalahan is the only one that actually worked for me.

@Iteratix
Copy link

+1 for the solution by @richardcalahan. Odd though when I use bundler, it uses system Ruby to compile vs the one I compiled in ~/.rubies. I'm using chruby.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants