Skip to content

Problem building the atomic gem  #43

Open

Description

@slanand

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

Activity

  1. chdiza commented on Mar 18, 2014

    @chdiza

    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.

  2. headius commented on Mar 18, 2014

    @headius
    Owner

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

  3. slanand commented on Mar 18, 2014

    @slanand
    Author

    Thank you!

  4. Iteratix commented on Mar 20, 2014

    @Iteratix

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

  5. richardcalahan commented on Mar 20, 2014

    @richardcalahan

    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.

  6. chdiza commented on Mar 20, 2014

    @chdiza

    @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.

  7. richardcalahan commented on Mar 20, 2014

    @richardcalahan

    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
    
  8. richardcalahan commented on Mar 20, 2014

    @richardcalahan

    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.

  9. dpehrson commented on Mar 21, 2014

    @dpehrson

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

  10. Iteratix commented on Mar 26, 2014

    @Iteratix

    +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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions