Having trouble compiling node 0.1.2

21 views
Skip to first unread message

chris

unread,
Aug 2, 2009, 11:18:16 AM8/2/09
to nodejs
Hi!

I managed to compile node 0.1.0 just fine, but 0.1.2 is not compiling
on my 32 AMD Ubuntu.

It could totally be my system, but I can't really figure out what the
pchrislem could be. Does anyone have an idea? My ./configure and make
outputs are pasted below.

********** ./configure seems to work just fine:

[chris@ubuntu:~/packages/node-0.1.2] $ ./configure
Checking for WAF : /home/chris/packages/
node-0.1.2/tools/waf
Checking for program g++ : ok /usr/bin/g++
Checking for program cpp : ok /usr/bin/cpp
Checking for program ar : ok /usr/bin/ar
Checking for program ranlib : ok /usr/bin/ranlib
Checking for g++ : ok
Checking for program gcc : ok /usr/bin/gcc
Checking for gcc : ok
--- libeio ---
Checking for function pthread_create : ok
Checking for futimes(2) : ok
Checking for readahead(2) : ok
Checking for fdatasync(2) : ok
Checking for pread(2) and pwrite(2) : ok
Checking for sendfile(2) : ok
Checking for sync_file_range(2) : fail
--- libev ---
Checking for header sys/inotify.h : ok
Checking for header sys/epoll.h : ok
Checking for header sys/event.h : not found
Checking for header sys/queue.h : ok
Checking for header port.h : not found
Checking for header poll.h : ok
Checking for header sys/select.h : ok
Checking for header sys/eventfd.h : ok
Checking for function inotify_init : ok
Checking for function epoll_ctl : ok
Checking for function kqueue : not found
Checking for function port_create : not found
Checking for function poll : ok
Checking for function select : ok
Checking for function eventfd : ok
Checking for SYS_clock_gettime : ok
Checking for function clock_gettime : ok
Checking for function nanosleep : ok
Checking for function ceil : ok
---- deps/udns ----
configure... udns package
checking for C compiler... gcc
checking whenever C compiler (gcc) is GNU CC... yes
checking whenever the C compiler (gcc -Wall -W -O2 -pipe)
can produce executables... yes
checking for ranlib... ranlib
checking for getopt()... yes
checking for inet_pton() && inet_ntop()... yes
checking for socklen_t... yes
checking for libraries needed for socket and connect... ok (none
needed)
checking for IPv6... yes
checking for poll()... yes
creating config.h... unchanged
creating Makefile... ok
creating config.status... ok
all done.
---- deps/v8 ----
'configure' finished successfully (5.141s)


********** make breaks:

make
Waf: Entering directory `/home/chris/packages/node-0.1.2/build'
[ 1/21] deps/v8/libv8.a: -> build/default/deps/v8/libv8.a
g++ -o obj/release/platform-linux.o -c -Wall -Werror -W -Wno-unused-
parameter -pedantic -m32 -O3 -fomit-frame-pointer -fdata-sections -
ffunction-sections -ansi -fno-rtti -fno-exceptions -Wall -Werror -W -
Wno-unused-parameter -pedantic -m32 -O3 -fomit-frame-pointer -fdata-
sections -ffunction-sections -ansi -DV8_TARGET_ARCH_IA32 -
DV8_NATIVE_REGEXP -DENABLE_LOGGING_AND_PROFILING -Isrc src/platform-
linux.cc
cc1plus: warnings being treated as errors
src/platform-linux.cc: In static member function 'static void
v8::internal::OS::LogSharedLibraryAddresses()':
src/platform-linux.cc:238: error: suggest a space before ';' or
explicit braces around empty body in 'while' statement
src/platform-linux.cc:253: error: suggest a space before ';' or
explicit braces around empty body in 'while' statement
scons: *** [obj/release/platform-linux.o] Error 1
Waf: Leaving directory `/home/chris/packages/node-0.1.2/build'
Build failed
-> task failed (err #2):
{task: deps/v8/libv8.a -> libv8.a}
make: *** [all] Error 1




Any ideas what this could be?
Thanks!
Best,
Chris

chris

unread,
Aug 2, 2009, 11:23:00 AM8/2/09
to nodejs
Ok, I actually found my problem reproduced here. It's V8 that's giving
the trouble:
http://www.travisswicegood.com/index.php/2009/07/11/compiling-node-js-on-ubuntu-9-04

I'll update this thread once I am able to fix it.

chris

unread,
Aug 2, 2009, 11:33:01 AM8/2/09
to nodejs
Ok, fixed.

V8 failed to compile, and it was a known V8 error. It has been fixed
in V8 bleeding edge:
http://code.google.com/p/v8/issues/detail?id=414

The way I fixed it was to just simply follow the instructions in the
make output:
src/platform-linux.cc:238: error: suggest a space before ';' or
explicit braces around empty body in 'while' statement
src/platform-linux.cc:253: error: suggest a space before ';' or
explicit braces around empty body in 'while' statement

I put a space before two ';' and then it worked!


Best,
Chris

On Aug 2, 9:23 am, chris <rob...@gmail.com> wrote:
> Ok, I actually found my problem reproduced here. It's V8 that's giving
> the trouble:http://www.travisswicegood.com/index.php/2009/07/11/compiling-node-js...

Felix Geisendörfer

unread,
Aug 2, 2009, 2:09:16 PM8/2/09
to nodejs
We actually just ran into the build issue you linked to (
http://www.travisswicegood.com/index.php/2009/07/11/compiling-node-js-on-ubuntu-9-04
) ourselves.

It seems like v0.1.2 does not compile well from scratch at this point.
However, we were able to do this:

$ git checkout v0.0.6
$ ./configure && make && make install
$ git checkout v0.1.2
$ make && make install

My intuition says that this works because "make" does not realize v8
was updated and we are actually building against an older v8 version.

Ryan, could you try to look into building v0.1.2 from scratch? If the
current build is indeed broken right out of the box that would totally
keep new users from joining : /.

-- Felix Geisendörfer aka the_undefined

ryan dahl

unread,
Aug 3, 2009, 5:37:36 AM8/3/09
to nod...@googlegroups.com
Oh no!
It builds for me on Ubuntu, Mac, and FreeBSD (I forget what versions)
- so at least some are able to compile it.

I'll do a new release tomorrow or the next day. Hopefully they'll
release a new V8 version in the mean time, otherwise I'll just apply
that patch.
thanks

Felix Geisendörfer

unread,
Aug 3, 2009, 8:19:44 AM8/3/09
to nodejs
I think the issue referred to in travis blog is unrelated to the bug
chris linked to.

But I'll try again on a fresh machine that never had node installed
before when the new release comes out to see if it helps/

-- Felix Geisendörfer aka the_undefined

Joshaven Potter

unread,
Aug 3, 2009, 11:03:42 AM8/3/09
to nod...@googlegroups.com
I am no Leopard and cannot build it... I haven't tried very hard though, I have been running fine with 0.1.1 for what I currently need.

make test
Waf: Entering directory `/Users/joshaven/Downloads/node-0.1.2/node-0.1.2/build'
[ 7/21] deps/udns/libudns.a:  -> build/default/deps/udns/libudns.a
gcc -Wall -W -O2 -pipe -o dnsget dnsget.o -L. -ludns
ld: in ./libudns.a, archive has no table of contents
collect2: ld returned 1 exit status
make[1]: *** [dnsget] Error 1
Waf: Leaving directory `/Users/joshaven/Downloads/node-0.1.2/node-0.1.2/build'

Build failed
 -> task failed (err #2):
        {task: deps/udns/libudns.a  -> libudns.a}
--
Sincerely,
Joshaven Potter

"No man making a profession of faith ought to sin, nor one possessed of love to hate his brother. For He that said, “Thou shalt love the Lord thy God,”  said also, “and thy neighbor as thyself.”  Those that profess themselves to be Christ’s are known not only by what they say, but by what they practice. “For the tree is known by its fruit.”" -- Ignatius

ryan dahl

unread,
Aug 4, 2009, 5:57:15 AM8/4/09
to nod...@googlegroups.com
This appears to be a separate issue. If you "make distclean" does it work?

ryan dahl

unread,
Aug 4, 2009, 6:43:57 AM8/4/09
to nod...@googlegroups.com
I applied the patch for this v8 bug in 2312ff4b232a5931adcf01b4b9fec0f3ecc4f706.

Joshaven Potter

unread,
Aug 4, 2009, 11:19:38 AM8/4/09
to nod...@googlegroups.com
doesn't help... thanks though.

I did:
make distclean
./configure
make test  << which yields:


Build failed
 -> task failed (err #2):
        {task: deps/udns/libudns.a  -> libudns.a}
make: *** [all] Error 1



At this point, I am not that concerned.  I will on the other hand be concerned if I cannot upgrade to future updates.  

Here is some information that may be of help:
Checking for WAF                        :  /Users/joshaven/Downloads/node-0.1.2/node-0.1.2/tools/waf

Checking for program g++                 : ok /usr/bin/g++
Checking for program cpp                 : ok /usr/bin/cpp
Checking for program ar                  : ok /usr/bin/ar
Checking for program ranlib              : ok /usr/bin/ranlib
Checking for g++                         : ok 
Checking for program gcc                 : ok /usr/bin/gcc
Checking for gcc                         : ok 
--- libeio ---
Checking for function pthread_create     : ok
Checking for futimes(2)                  : ok
Checking for readahead(2)                : fail
Checking for fdatasync(2)                : fail
Checking for pread(2) and pwrite(2)      : ok
Checking for sendfile(2)                 : fail
Checking for sync_file_range(2)          : fail
--- libev ---
Checking for header sys/inotify.h        : not found
Checking for header sys/epoll.h          : not found
Checking for header sys/event.h          : ok
Checking for header sys/queue.h          : ok
Checking for header port.h               : not found
Checking for header poll.h               : ok
Checking for header sys/select.h         : ok
Checking for header sys/eventfd.h        : not found
Checking for function inotify_init       : not found
Checking for function epoll_ctl          : not found
Checking for function kqueue             : not found
Checking for function port_create        : not found
Checking for function poll               : ok
Checking for function select             : ok
Checking for function eventfd            : not found
Checking for SYS_clock_gettime           : fail
Checking for function clock_gettime      : not found
Checking for function nanosleep          : not found
Checking for function ceil               : ok

r...@tinyclouds.org

unread,
Aug 5, 2009, 5:20:28 AM8/5/09
to nod...@googlegroups.com
On Tue, Aug 4, 2009 at 5:19 PM, Joshaven Potter<your...@gmail.com> wrote:
> doesn't help... thanks though.

Can you try to build udns alone? Do you get the same error? This might
be a problem with the udns library.

cd deps/udns
./configure
make

Urban Hafner

unread,
Aug 5, 2009, 6:05:16 AM8/5/09
to nod...@googlegroups.com

uh@uh:~/me/ujh-node/deps/udns$ ./configure


configure... udns package
checking for C compiler... gcc
checking whenever C compiler (gcc) is GNU CC... yes
checking whenever the C compiler (gcc -Wall -W -O2 -pipe)
can produce executables... yes
checking for ranlib... ranlib
checking for getopt()... yes
checking for inet_pton() && inet_ntop()... yes
checking for socklen_t... yes
checking for libraries needed for socket and connect... ok (none needed)
checking for IPv6... yes
checking for poll()... yes

creating config.h... ok


creating Makefile... ok
creating config.status... ok
all done.

uh@uh:~/me/ujh-node/deps/udns$ make
gcc -Wall -W -O2 -pipe -DHAVE_CONFIG_H -c udns_dn.c
gcc -Wall -W -O2 -pipe -DHAVE_CONFIG_H -c udns_dntosp.c
gcc -Wall -W -O2 -pipe -DHAVE_CONFIG_H -c udns_parse.c
gcc -Wall -W -O2 -pipe -DHAVE_CONFIG_H -c udns_resolver.c
gcc -Wall -W -O2 -pipe -DHAVE_CONFIG_H -c udns_init.c
gcc -Wall -W -O2 -pipe -DHAVE_CONFIG_H -c udns_misc.c
gcc -Wall -W -O2 -pipe -DHAVE_CONFIG_H -c udns_XtoX.c
gcc -Wall -W -O2 -pipe -DHAVE_CONFIG_H -c udns_rr_a.c
gcc -Wall -W -O2 -pipe -DHAVE_CONFIG_H -c udns_rr_ptr.c
gcc -Wall -W -O2 -pipe -DHAVE_CONFIG_H -c udns_rr_mx.c
gcc -Wall -W -O2 -pipe -DHAVE_CONFIG_H -c udns_rr_txt.c
gcc -Wall -W -O2 -pipe -DHAVE_CONFIG_H -c udns_bl.c
gcc -Wall -W -O2 -pipe -DHAVE_CONFIG_H -c udns_rr_srv.c
gcc -Wall -W -O2 -pipe -DHAVE_CONFIG_H -c udns_rr_naptr.c
Generating udns_codes.c
gcc -Wall -W -O2 -pipe -DHAVE_CONFIG_H -c udns_codes.c
rm -f libudns.a
ar rv libudns.a udns_dn.o udns_dntosp.o udns_parse.o udns_resolver.o
udns_init.o udns_misc.o udns_XtoX.o udns_rr_a.o udns_rr_ptr.o
udns_rr_mx.o udns_rr_txt.o udns_bl.o udns_rr_srv.o udns_rr_naptr.o
udns_codes.o
ar: creating archive libudns.a
a - udns_dn.o
a - udns_dntosp.o
a - udns_parse.o
a - udns_resolver.o
a - udns_init.o
a - udns_misc.o
a - udns_XtoX.o
a - udns_rr_a.o
a - udns_rr_ptr.o
a - udns_rr_mx.o
a - udns_rr_txt.o
a - udns_bl.o
a - udns_rr_srv.o
a - udns_rr_naptr.o
a - udns_codes.o
gcc -Wall -W -O2 -pipe -DHAVE_CONFIG_H -c dnsget.c
dnsget.c: In function 'dbgcb':
dnsget.c:404: warning: unused parameter 'unused_q'
dnsget.c:404: warning: unused parameter 'unused_data'


gcc -Wall -W -O2 -pipe -o dnsget dnsget.o -L. -ludns
ld: in ./libudns.a, archive has no table of contents
collect2: ld returned 1 exit status

make: *** [dnsget] Error 1

However, I was able to manually fix it. Running "ranlib libudns.a"
generated the table of contents and the running make again worked.
Though, I wasn't able to compile node itself afterwards.

Urban

ryan dahl

unread,
Aug 5, 2009, 9:39:09 AM8/5/09
to nod...@googlegroups.com
Urban,

Thanks.

Can you please apply this patch (which just adds ranlib to the udns
build script) and check that you can rebuild node from scratch:

make distclean && ./configure && make

Hopefully that fixes the issue?

ry

0001-Add-ranlib-to-udns-Makefile.patch

Urban Hafner

unread,
Aug 5, 2009, 9:55:23 AM8/5/09
to nod...@googlegroups.com

Yes, that fixes it for me.

Urban

Joshaven Potter

unread,
Aug 5, 2009, 12:37:42 PM8/5/09
to nod...@googlegroups.com
Excellent, thanks Urban! 

After trying to compile udns and failing just like your post... I ran "ranlib libudns.a" and then I could make without error...  I then backed up to the node and tried building and it built fine.
Reply all
Reply to author
Forward
0 new messages