Menu

#778 Ruby Makefile doesn't generate property

2.3.x
open
5
2012-10-23
2012-03-01
No

Ruby Makefile doesn't generate properly:
The "-flat_namespace" is added even on non-darwin platform and causes the build to fail. See [1] for the build output and search for "flat_namespace" (tested on Fedora 17 and Rawhide).

Openbabel version: 2.3.1
Ruby version: 1.9.3.p0
Fedora 17/Rawhide, both x86_64 and i386
GCC 4.7.0

Regards and thanks for your help!
Bohuslav "Slavek" Kabrda.

[1] http://koji.fedoraproject.org/koji/getfile?taskID=3837717&name=build.log

Discussion

  • Noel O'Boyle

    Noel O'Boyle - 2012-09-04

    Can you try the development version? The build system was changed for the bindings. We are coming up to the 2.3.2 release so your input at this point would be much appreciated.

     
  • Christoph Willing

    This problem still exists in 2.3.2 and is due to the extconf.rb used to generate the Makefile during the build. Use of the Darwin-only flat-namespace option can be fixed with the following patch:

    --- openbabel-2.3.2.orig/scripts/ruby/extconf.rb 2011-01-12 00:53:32.000000000 +1000
    +++ openbabel-2.3.2/scripts/ruby/extconf.rb 2012-10-18 08:14:30.587949186 +1000
    @@ -8,6 +8,9 @@
    when "i386" then '-arch i386'
    when "ppc" then '-arch ppc'
    end
    + isDarwin = true
    +else
    + isDarwin = false
    end

    require 'mkmf'
    @@ -36,9 +39,15 @@
    end

    if have_library('openbabel')
    - with_ldflags("#$LDFLAGS -dynamic -flat_namespace") do #Enables cc to handle linking better.
    - create_makefile('openbabel')
    -end
    + if isDarwin
    + with_ldflags("#$LDFLAGS -dynamic --flat-namespace") do #Enables cc to handle linking better.
    + create_makefile('openbabel')
    + end
    + else
    + with_ldflags("#$LDFLAGS -dynamic") do #Enables cc to handle linking better.
    + create_makefile('openbabel')
    + end
    + end
    else
    puts "Install Open Babel first. If you've already compiled and installed Open Babel, you may need to run ldconfig."
    end

     
  • Christoph Willing

    Formatting of patch in previous comment is no good - have resubmitted it as a patch (ID 3577928)