Skip Menu |

This queue is for tickets about the Set-IntervalTree CPAN distribution.

Report information
The Basics
Id: 64761
Status: resolved
Priority: 0/
Queue: Set-IntervalTree

People
Owner: Nobody in particular
Requestors: daniel.standage [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: (no value)
Fixed in: (no value)



Subject: Installation Errors
I was very happy today to find an implementation of interval trees in Perl. It sped up my program considerably. I was able to get it to install fine with cpan on Ubuntu 10.10, but I have not been able to get it the installation to work on Red Hat 5.4 (perl 5.12.2) or Mac OS 10.6.6 (perl 5.10.0). It creates tons of error messages when it tries to compile (I have attached). I would like to use this package in some software I am going to distribute, but it's not good if it will only compile on less than half of the user's machines. Do you know what may be causing the compiler errors? Are there any workarounds that I might be able to share in my software package? Thanks!
From: jason.ni.py [...] gmail.com

Message body is not shown because it is too large.

From: jason.ni.py [...] gmail.com
在 2011-一月-13 23:13:08 星期四 时,https://www.google.com/accounts/o8 /id?id=AItOawmUIkXo-GQLxdvXtES8-x59mIITsOeE7kw 写到: Show quoted text
> I was very happy today to find an implementation of interval trees in > Perl. It sped up my program considerably. I was able to get it to > install fine with cpan on Ubuntu 10.10, but I have not been able to get > it the installation to work on Red Hat 5.4 (perl 5.12.2) or Mac OS > 10.6.6 (perl 5.10.0). It creates tons of error messages when it tries to > compile (I have attached). I would like to use this package in some > software I am going to distribute, but it's not good if it will only > compile on less than half of the user's machines. > > Do you know what may be causing the compiler errors? Are there any > workarounds that I might be able to share in my software package? > > Thanks!
I find those bugs! 1. There is a clash of perl symbols do_close(Perl_do_close) and do_open (Perl_do_open) in perl source's doio.c with c++ library. Add these two lines in IntervalTree.xs: #define do_open Perl_do_open #define do_close Perl_do_close See also: http://www.nntp.perl.org/group/perl.xs/2008/09/msg2494.html 2. It seems that old (not too old) version g++ can not handle this kind of syntax in interval_tree.h: line 95: std::vector<IntervalTree<T,N>::it_recursion_node> line 135: root = new IntervalTree<T,N>::Node(); and many other place like line 135. I don't know how to describe this syntax. I checked template usage on the web and didn't find code written like that. So I guess it does not need to use full namespace to reference a member in a class. After getting rid of those strings 'IntervalTree<T,N>::' in lines reported in the compile error output, I can make successfully.
From: Daniel
On Sun Jan 30 22:00:26 2011, jason.ni wrote: Show quoted text
> 在 2011-一月-13 23:13:08 星期四 时,https://www.google.com/accounts/o8 > /id?id=AItOawmUIkXo-GQLxdvXtES8-x59mIITsOeE7kw 写到:
> > I was very happy today to find an implementation of interval trees in > > Perl. It sped up my program considerably. I was able to get it to > > install fine with cpan on Ubuntu 10.10, but I have not been able to get > > it the installation to work on Red Hat 5.4 (perl 5.12.2) or Mac OS > > 10.6.6 (perl 5.10.0). It creates tons of error messages when it tries to > > compile (I have attached). I would like to use this package in some > > software I am going to distribute, but it's not good if it will only > > compile on less than half of the user's machines. > > > > Do you know what may be causing the compiler errors? Are there any > > workarounds that I might be able to share in my software package? > > > > Thanks!
> I find those bugs! > > 1. There is a clash of perl symbols do_close(Perl_do_close) and do_open > (Perl_do_open) in perl source's doio.c with c++ library. > Add these two lines in IntervalTree.xs: > #define do_open Perl_do_open > #define do_close Perl_do_close > > See also: http://www.nntp.perl.org/group/perl.xs/2008/09/msg2494.html > > 2. It seems that old (not too old) version g++ can not handle this kind > of syntax in interval_tree.h: > line 95: std::vector<IntervalTree<T,N>::it_recursion_node> > line 135: root = new IntervalTree<T,N>::Node(); > and many other place like line 135. > > I don't know how to describe this syntax. I checked template usage on > the web and didn't find code written like that. So I guess it does not > need to use full namespace to reference a member in a class. After > getting rid of those strings 'IntervalTree<T,N>::' in lines reported in > the compile error output, I can make successfully.
Thanks for following up on this. Unfortunately your proposed fixes don't work for Mac OS X. It says that do_close and do_open are redefined, and the complains about type disagreements.
From: Razvan
I found an easy fix for RedHat/CentOS 5.5. It's a matter of using the newer gcc/g++ version (4.4) instead of the default 4.1.2 1. Make sure you have the gcc44 and gcc44-c++ packages yum install gcc44 gcc44-c++ 2. Edit Makefile.PL, changing line#4 from: $CC = 'g++'; to: $CC = 'g++44'; make install Voila! Razvan
From: Daniel Standage
On Wed Feb 16 14:22:19 2011, http://www.google.com/profiles/Razvan.Sultana wrote: Show quoted text
> I found an easy fix for RedHat/CentOS 5.5. > It's a matter of using the newer gcc/g++ version (4.4) instead of the > default 4.1.2 > > 1. Make sure you have the gcc44 and gcc44-c++ packages > yum install gcc44 gcc44-c++ > > 2. Edit Makefile.PL, changing line#4 from: > $CC = 'g++'; > to: > $CC = 'g++44'; > > make install > > Voila! > Razvan
Great! I tried the same approach on my MacBook. sudo port install perl5.10 sudo port install gcc44 vi Makefile.pl # change $CC I'm still getting errors, but they are different this time. Any ideas? $ perl Makefile.PL Checking if your kit is complete... Looks good Writing Makefile for Set::IntervalTree $ make cp lib/Set/IntervalTree.pm blib/lib/Set/IntervalTree.pm AutoSplitting blib/lib/Set/IntervalTree.pm (blib/lib/auto/Set/IntervalTree) /opt/local/bin/perl /opt/local/lib/perl5/vendor_perl/5.8.9/ExtUtils/xsubpp -C++ -typemap /opt/local/lib/perl5/5.10.1/ExtUtils/typemap -typemap perlobject.map -typemap typemap IntervalTree.xs > IntervalTree.xsc && mv IntervalTree.xsc IntervalTree.c g++-mp-4.4 -c -Isrc -pipe -O2 -arch i386 -fno-common -DPERL_DARWIN -I/opt/local/include -no-cpp-precomp -fno-strict-aliasing -fstack-protector -I/opt/local/include -g -O0 -DVERSION=\"0.01\" -DXS_VERSION=\"0.01\" "-I/opt/local/lib/perl5/5.10.1/darwin-multi-2level/CORE" -Isrc IntervalTree.c g++-mp-4.4: unrecognized option '-no-cpp-precomp' cc1plus: error: unrecognized command line option "-arch" make: *** [IntervalTree.o] Error 1
I feel kind of bad finally responding to this ticket after 2 years of neglect. In any case, I've fixed the compile errors on Mac OS and Linux. But I'm still requiring a c++11 capable compiler for this module. The only reason for this is that I need to use a shared pointer to help me keep track of the refcounts for the stored SV. So I've updated the module to use the - std=c++11 flag. I'll make a note of this in the documentation. On Tue Mar 01 15:05:23 2011, https://www.google.com/accounts/o8/id?id=AItOawmUIkXo- GQLxdvXtES8-x59mIITsOeE7kw wrote: Show quoted text
> On Wed Feb 16 14:22:19 2011, > http://www.google.com/profiles/Razvan.Sultana wrote:
> > I found an easy fix for RedHat/CentOS 5.5. > > It's a matter of using the newer gcc/g++ version (4.4) instead of the > > default 4.1.2 > > > > 1. Make sure you have the gcc44 and gcc44-c++ packages > > yum install gcc44 gcc44-c++ > > > > 2. Edit Makefile.PL, changing line#4 from: > > $CC = 'g++'; > > to: > > $CC = 'g++44'; > > > > make install > > > > Voila! > > Razvan
> > Great! > > I tried the same approach on my MacBook. > > sudo port install perl5.10 > sudo port install gcc44 > vi Makefile.pl # change $CC > > > I'm still getting errors, but they are different this time. Any ideas? > > $ perl Makefile.PL > Checking if your kit is complete... > Looks good > Writing Makefile for Set::IntervalTree > $ make > cp lib/Set/IntervalTree.pm blib/lib/Set/IntervalTree.pm > AutoSplitting blib/lib/Set/IntervalTree.pm (blib/lib/auto/Set/IntervalTree) > /opt/local/bin/perl > /opt/local/lib/perl5/vendor_perl/5.8.9/ExtUtils/xsubpp -C++ -typemap > /opt/local/lib/perl5/5.10.1/ExtUtils/typemap -typemap perlobject.map > -typemap typemap IntervalTree.xs > IntervalTree.xsc && mv > IntervalTree.xsc IntervalTree.c > g++-mp-4.4 -c -Isrc -pipe -O2 -arch i386 -fno-common -DPERL_DARWIN > -I/opt/local/include -no-cpp-precomp -fno-strict-aliasing > -fstack-protector -I/opt/local/include -g -O0 -DVERSION=\"0.01\" > -DXS_VERSION=\"0.01\" > "-I/opt/local/lib/perl5/5.10.1/darwin-multi-2level/CORE" -Isrc > IntervalTree.c > g++-mp-4.4: unrecognized option '-no-cpp-precomp' > cc1plus: error: unrecognized command line option "-arch" > make: *** [IntervalTree.o] Error 1