raindrops RubyGem user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
* Build failed on FreeBSD
@ 2011-04-13 22:56 Troex Nevelin
  2011-04-14  0:30 ` Eric Wong
  0 siblings, 1 reply; 6+ messages in thread
From: Troex Nevelin @ 2011-04-13 22:56 UTC (permalink / raw)
  To: raindrops

Hello,

I know raindrops uses some linux-specific features, but as I understand
it can work on any unix. I have some project that have couple backend
server and these servers are running different OSes. So I'm using one
copy of my software (via NFS) to run on both and I want it to run
platform indeptended, but raindrops fails to build on FreeBSD:

[root@billing-local ~]# gem install raindrops
Building native extensions.  This could take a while...
ERROR:  Error installing raindrops:
	ERROR: Failed to build gem native extension.

         /usr/local/bin/ruby18 extconf.rb
checking for mmap() in sys/mman.h... yes
checking for munmap() in sys/mman.h... yes
checking for mremap() in sys/mman.h... no
checking for getpagesize() in unistd.h... yes
checking for rb_thread_blocking_region()... no
checking for rb_thread_io_blocking_region()... no
checking for GCC 4+ atomic builtins... yes
creating Makefile

make
cc -I. -I. -I/usr/local/lib/ruby/1.8/i386-freebsd8 -I. -DHAVE_MMAP 
-DHAVE_MUNMAP -DHAVE_GETPAGESIZE -DHAVE_GCC_ATOMIC_BUILTINS 
-D_GNU_SOURCE  -D_BSD_SOURCE -D_XOPEN_SOURCE=600 -fPIC -O2 -pipe 
-fno-strict-aliasing  -fPIC  -march=i486 -c linux_inet_diag.c
cc -I. -I. -I/usr/local/lib/ruby/1.8/i386-freebsd8 -I. -DHAVE_MMAP 
-DHAVE_MUNMAP -DHAVE_GETPAGESIZE -DHAVE_GCC_ATOMIC_BUILTINS 
-D_GNU_SOURCE  -D_BSD_SOURCE -D_XOPEN_SOURCE=600 -fPIC -O2 -pipe 
-fno-strict-aliasing  -fPIC  -march=i486 -c linux_tcp_info.c
cc -I. -I. -I/usr/local/lib/ruby/1.8/i386-freebsd8 -I. -DHAVE_MMAP 
-DHAVE_MUNMAP -DHAVE_GETPAGESIZE -DHAVE_GCC_ATOMIC_BUILTINS 
-D_GNU_SOURCE  -D_BSD_SOURCE -D_XOPEN_SOURCE=600 -fPIC -O2 -pipe 
-fno-strict-aliasing  -fPIC  -march=i486 -c raindrops.c
raindrops.c: In function 'init':
raindrops.c:105: error: 'MAP_ANON' undeclared (first use in this function)
raindrops.c:105: error: (Each undeclared identifier is reported only once
raindrops.c:105: error: for each function it appears in.)
*** Error code 1

Stop in /usr/local/lib/ruby/gems/1.8/gems/raindrops-0.6.1/ext/raindrops.


Gem files will remain installed in 
/usr/local/lib/ruby/gems/1.8/gems/raindrops-0.6.1 for inspection.
Results logged to 
/usr/local/lib/ruby/gems/1.8/gems/raindrops-0.6.1/ext/raindrops/gem_make.out
[root@billing-local ~]# ruby --version
ruby 1.8.7 (2009-04-08 patchlevel 160) [i386-freebsd8]
[root@billing-local ~]# gem --version
1.6.2
[root@billing-local ~]# uname -a
FreeBSD billing-local 8.0-RELEASE-p4 FreeBSD 8.0-RELEASE-p4 #0: Mon Jul 
12 20:22:27 UTC 2010 
root@i386-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC  i386


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Build failed on FreeBSD
  2011-04-13 22:56 Build failed on FreeBSD Troex Nevelin
@ 2011-04-14  0:30 ` Eric Wong
  2011-06-23 14:08   ` Troex Nevelin
  0 siblings, 1 reply; 6+ messages in thread
From: Eric Wong @ 2011-04-14  0:30 UTC (permalink / raw)
  To: raindrops

Troex Nevelin <list@mrtech.ru> wrote:
> raindrops.c: In function 'init':
> raindrops.c:105: error: 'MAP_ANON' undeclared (first use in this function)
> raindrops.c:105: error: (Each undeclared identifier is reported only once
> raindrops.c:105: error: for each function it appears in.)
> *** Error code 1

Really?  Does replacing MAP_ANON with MAP_ANONYMOUS fix it?

I chose MAP_ANON because I thought it'd also work on *BSDs.  What a
strange turn of events...

MAP_ANON is actually deprecated in Linux and synonymous to MAP_ANONYMOUS

-- 
Eric Wong


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Build failed on FreeBSD
  2011-04-14  0:30 ` Eric Wong
@ 2011-06-23 14:08   ` Troex Nevelin
  2011-06-24  8:08     ` Eric Wong
  0 siblings, 1 reply; 6+ messages in thread
From: Troex Nevelin @ 2011-06-23 14:08 UTC (permalink / raw)
  To: raindrops

On 14/04/2011 03:30, Eric Wong wrote:
> Does replacing MAP_ANON with MAP_ANONYMOUS fix it?

Replacing MAP_ANON gives the same error but about MAP_ANONYMOUS. I'm not 
familiar with C

Maybe I'm missing some needed libs?

-- 
[root@billing-local 
/usr/local/lib/ruby/gems/1.8/gems/raindrops-0.6.1/ext/raindrops]# make
cc -I. -I. -I/usr/local/lib/ruby/1.8/i386-freebsd8 -I. -DHAVE_MMAP 
-DHAVE_MUNMAP -DHAVE_GETPAGESIZE -DHAVE_GCC_ATOMIC_BUILTINS 
-D_GNU_SOURCE  -D_BSD_SOURCE -D_XOPEN_SOURCE=600 -fPIC -O2 -pipe 
-fno-strict-aliasing  -fPIC  -march=i486 -c raindrops.c
raindrops.c: In function 'init':
raindrops.c:105: error: 'MAP_ANONYMOUS' undeclared (first use in this 
function)
raindrops.c:105: error: (Each undeclared identifier is reported only once
raindrops.c:105: error: for each function it appears in.)
*** Error code 1

Stop in /usr/local/lib/ruby/gems/1.8/gems/raindrops-0.6.1/ext/raindrops.
# cc --version
cc (GCC) 4.2.1 20070719  [FreeBSD]
...

# ruby --version
ruby 1.8.7 (2009-04-08 patchlevel 160) [i386-freebsd8]


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Build failed on FreeBSD
  2011-06-23 14:08   ` Troex Nevelin
@ 2011-06-24  8:08     ` Eric Wong
  2011-06-25  0:19       ` Eric Wong
  0 siblings, 1 reply; 6+ messages in thread
From: Eric Wong @ 2011-06-24  8:08 UTC (permalink / raw)
  To: raindrops

Troex Nevelin <list@mrtech.ru> wrote:
> On 14/04/2011 03:30, Eric Wong wrote:
> > Does replacing MAP_ANON with MAP_ANONYMOUS fix it?
> 
> Replacing MAP_ANON gives the same error but about MAP_ANONYMOUS. I'm not 
> familiar with C

Don't worry, diagnosing problems with build software contributed largely
to me learning C back in the day.

> Maybe I'm missing some needed libs?

You seem to have the needed libraries since mmap() and munmap()
are detected correctly.  Function checks (like the above) are
based on linking the library.  Headers are another issue...

> -- 
> [root@billing-local 
> /usr/local/lib/ruby/gems/1.8/gems/raindrops-0.6.1/ext/raindrops]# make
> cc -I. -I. -I/usr/local/lib/ruby/1.8/i386-freebsd8 -I. -DHAVE_MMAP 
> -DHAVE_MUNMAP -DHAVE_GETPAGESIZE -DHAVE_GCC_ATOMIC_BUILTINS 
> -D_GNU_SOURCE  -D_BSD_SOURCE -D_XOPEN_SOURCE=600 -fPIC -O2 -pipe 
> -fno-strict-aliasing  -fPIC  -march=i486 -c raindrops.c
> raindrops.c: In function 'init':
> raindrops.c:105: error: 'MAP_ANONYMOUS' undeclared (first use in this 
> function)

Can you show me the output of the following two commands?

  ruby -rmkmf -e 'have_macro("MAP_ANONYMOUS", "sys/mman.h")'
  ruby -rmkmf -e 'have_macro("MAP_ANON", "sys/mman.h")'

If at least one of them succeeds, then it could be somehow
the #include paths get mangled at some point afterwards.

Then can you show me your sys/mman.h file?  It's probably in
/usr/include/sys/mman.h, but maybe you have multiple copies of "mman.h".
Try searching your system for multiple copies and see if there are
differences...

Another thing you can try is changing the order of the #includes at the
top of ext/raindrops/raindrops.c, maybe try moving the
"#include <sys/mman.h>" line to the top of the file.  #includes for
standard header files are usually order-agnostic, but maybe there's a
special case...

-- 
Eric Wong


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Build failed on FreeBSD
  2011-06-24  8:08     ` Eric Wong
@ 2011-06-25  0:19       ` Eric Wong
  2011-06-27 10:00         ` Troex Nevelin
  0 siblings, 1 reply; 6+ messages in thread
From: Eric Wong @ 2011-06-25  0:19 UTC (permalink / raw)
  To: raindrops

It looks like Aleksandar was able to help on the unicorn list:

http://mid.gmane.org/BANLkTinV+8uE80CpubvzgJp_6-+RETSvRg@mail.gmail.com

I just pushed out a patch to raindrops.git that removes the
_XOPEN_SOURCE addition to CPPFLAGS:

  http://mid.gmane.org/20110625001534.GA18193@dcvr.yhbt.net

(You can just remove the "-D_XOPEN_SOURCE=600" in extconf.rb
if you don't have HTTP access)

Can you let me know if that fixes things for you?  Thanks!

-- 
Eric Wong


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Build failed on FreeBSD
  2011-06-25  0:19       ` Eric Wong
@ 2011-06-27 10:00         ` Troex Nevelin
  0 siblings, 0 replies; 6+ messages in thread
From: Troex Nevelin @ 2011-06-27 10:00 UTC (permalink / raw)
  To: raindrops

On 25/06/2011 03:19, Eric Wong wrote:
> Can you let me know if that fixes things for you?  Thanks!

Confirm! Build on FreeBSD 8.0-RELEASE-p4 (GENERIC) successful.

# gem install raindrops
Fetching: raindrops-0.7.0.gem (100%)
Building native extensions.  This could take a while...
Successfully installed raindrops-0.7.0
1 gem installed


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-06-27 10:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-13 22:56 Build failed on FreeBSD Troex Nevelin
2011-04-14  0:30 ` Eric Wong
2011-06-23 14:08   ` Troex Nevelin
2011-06-24  8:08     ` Eric Wong
2011-06-25  0:19       ` Eric Wong
2011-06-27 10:00         ` Troex Nevelin

Code repositories for project(s) associated with this public inbox

	https://yhbt.net/raindrops.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).