[#57574] [ruby-trunk - Feature #8976][Open] file-scope freeze_string directive — "akr (Akira Tanaka)" <akr@...>

70 messages 2013/10/02

[#57579] [ruby-trunk - Feature #8977][Open] String#frozen that takes advantage of the deduping — "sam.saffron (Sam Saffron)" <sam.saffron@...>

25 messages 2013/10/02

[#57679] [ruby-trunk - Feature #8987][Open] map/collect extension which handles arguments — "sowieso (So Wieso)" <sowieso@...>

16 messages 2013/10/05

[#57705] [ruby-trunk - Feature #8992][Open] Use String#freeze and compiler tricks to replace "str"f suffix — "headius (Charles Nutter)" <headius@...>

43 messages 2013/10/07

[#57727] [ruby-trunk - Feature #8998][Open] string keys for hash literals should use fstrings — "normalperson (Eric Wong)" <normalperson@...>

17 messages 2013/10/08

[#57771] [ruby-trunk - Bug #9008][Open] TestProcess#test_clock_getres_constants and TestProcess#test_clock_gettime_constants fails on ARM — "vo.x (Vit Ondruch)" <v.ondruch@...>

15 messages 2013/10/09

[#57888] [ruby-trunk - Feature #9025][Open] Clarify the error message when calling a method with the wrong number of arguments — Nerian (Gonzalo Rodríguez) <siotopo@...>

11 messages 2013/10/15

[#57993] [ruby-trunk - Feature #9047][Open] Alternate hash key syntax for symbols — "jamonholmgren (Jamon Holmgren)" <jamon@...>

13 messages 2013/10/23

[#58007] [ruby-trunk - Feature #9049][Open] Shorthands (a:b, *) for inclusive indexing — "mohawkjohn (John Woods)" <john.o.woods@...>

25 messages 2013/10/24

[#58033] [ruby-trunk - Bug #9053][Open] SSL Issue with Ruby 2.0.0 — "tisba (Sebastian Cohnen)" <ruby-lang@...>

16 messages 2013/10/25

[#58080] [ruby-trunk - Feature #9064][Open] Add support for packages, like in Java — "rosenfeld (Rodrigo Rosenfeld Rosas)" <rr.rosas@...>

23 messages 2013/10/30

[ruby-core:57918] Re: cxxflags for C++ library bindings not working for Ruby 1.9.x and 2.0?

From: Stefan Salewski <mail@...>
Date: 2013-10-17 14:34:47 UTC
List: ruby-core #57918
On Thu, 2013-10-17 at 22:34 +0900, Nobuyoshi Nakada wrote:
> (13/10/17 22:03), Stefan Salewski wrote:
> > My feeling is, that there is some problem in the handling of CXXFLAGS
> > used for the C++ compiler.
> > 
> > CGAL code need the flag -frounding-math.
> > For Ruby 1.9.3 I gave
> > $CFLAGS += " -frounding-math"
> > 
> > in extconfig.rb, and "ruby extconfig.rb; make" was working fine.
> > For Ruby 2.0 this was not working any more -- I found
> > $CPPLAGS += " -frounding-math"
> > working as entry in extconfig.rb. (But CPPLAGS are for preprocessor.)
> 
> Could you show the generated Makefile?
> 

I put my whole current project to

http://www.ssalewski.de/tmp/Ruby/

That makefile is generated with Ruby 2.0 this way

stefan@AMD64X2 ~/RAPOLLONIUS $ ruby extconf.rb 
checking for main() in -lCGAL... yes
checking for main() in -lCGAL_Core... yes
checking for main() in -lgmp... yes
creating Makefile
stefan@AMD64X2 ~/RAPOLLONIUS $ make
compiling rcgal_apollonius.cpp
linking shared-object rcgal_apollonius.so
stefan@AMD64X2 ~/RAPOLLONIUS $ ruby test.rb 
--
Bye
Hallo
--
Up
Down
###
Up
Down
xxx
Up
Down

yyy
["Up", "Down"]

That way works, but the strange line
$CPPFLAGS += " -frounding-math -std=c++11"
in exconfig.rb is needed.

With line 
$CXXFLAGS += " -frounding-math -std=c++11"
I get

stefan@AMD64X2 ~/RAPOLLONIUS $ ruby extconf.rb 
checking for main() in -lCGAL... yes
checking for main() in -lCGAL_Core... yes
checking for main() in -lgmp... yes
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.
You may
need configuration options.

Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib64
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/bin/ruby20
--with-CGALlib
--without-CGALlib
--with-CGAL_Corelib
--without-CGAL_Corelib
--with-gmplib
--without-gmplib
extconf.rb:6:in `<main>': undefined method `+' for nil:NilClass
(NoMethodError)

Without the line
$CPPFLAGS += " -frounding-math -std=c++11"
I get this Makefile
http://www.ssalewski.de/tmp/Ruby/Makefile2
and have to call make with
stefan@AMD64X2 ~/RAPOLLONIUS $ make cxxflags+=-frounding-math cxxflags
+=-std=c++0x
compiling rcgal_apollonius.cpp
rcgal_apollonius.cpp: In function ‘VALUE ag_alloc(VALUE)’:
rcgal_apollonius.cpp:59:13: error: ‘nullptr’ was not declared in this
scope
make: *** [rcgal_apollonius.o] Error 1
stefan@AMD64X2 ~/RAPOLLONIUS $ make cppflags+=-frounding-math cppflags
+=-std=c++0x
compiling rcgal_apollonius.cpp
linking shared-object rcgal_apollonius.so
stefan@AMD64X2 ~/RAPOLLONIUS $ ruby test.rb 
--
Bye
Hallo
--
Up
Down
###
Up
Down
xxx
Up
Down

yyy
["Up", "Down"]


In This Thread