joshua655 / v8cgi

Automatically exported from code.google.com/p/v8cgi
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Building on OS X failed #84

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.

$ fink apropos v8
Information about 9654 packages read in 0 seconds.
     libv8-2.1.2-dev         2.1.2-1           V8 JavaScript Engine
     libv8-2.1.2-shlibs      2.1.2-1           V8 JavaScript Engine
     libv8-2.4.2-dev         2.4.2-1           V8 JavaScript Engine
     libv8-2.4.2-shlibs      2.4.2-1           V8 JavaScript Engine
     libv80-dev              2.0.3-1           V8 JavaScript Engine
     libv80-shlibs           2.0.3-1           V8 JavaScript Engine

$ fink install libv8-2.4.2-dev
Password:
Information about 9654 packages read in 0 seconds.
The following package will be installed or updated:
 libv8-2.4.2-dev
The following 2 additional packages will be installed:
 libv8-2.4.2-shlibs scons
The following package might be temporarily removed:
 libv8-2.4.2-dev
Do you want to continue? [Y/n] 
...
.... (the build output of above packages) .....
...
Selecting previously deselected package libv8-2.4.2-dev.
(Reading database ... 159489 files and directories currently installed.)
Unpacking libv8-2.4.2-dev (from .../libv8-2.4.2-dev_2.4.2-1_darwin-x86_64.deb) 
...
Selecting previously deselected package libv8-2.4.2-shlibs.
Unpacking libv8-2.4.2-shlibs (from 
.../libv8-2.4.2-shlibs_2.4.2-1_darwin-x86_64.deb) ...
Setting up libv8-2.4.2-shlibs (2.4.2-1) ...

Setting up libv8-2.4.2-dev (2.4.2-1) ...

Updating the list of locally available binary packages.
Scanning dists/unstable/main/binary-darwin-x86_64
New package: 
dists/unstable/main/binary-darwin-x86_64/devel/libv8-2.4.2-dev_2.4.2-1_darwin-x8
6_64.deb
New package: 
dists/unstable/main/binary-darwin-x86_64/devel/libv8-2.4.2-shlibs_2.4.2-1_darwin
-x86_64.deb
New package: 
dists/unstable/main/binary-darwin-x86_64/devel/scons_1.2.0-2_darwin-x86_64.deb

2.

$ tar zxvf ../../Downloads/v8cgi-0.9.0-src.tar.gz
$ cd v8cgi-0.9.0-src/

#I want to use the system installed libs
$ mv v8 nothere 

$ cd v8cgi/

3.

# Build system seems to not recognise fink, must give paths...
# http://finkproject.org/

$ scons mysql=1 sqlite=1 fcgi=1 gd=1 reuse_context=1 v8_path=/sw/lib 
cpppath=/sw/include\ libpath=/sw/lib 
config_file=/Users/jandling/Local/etc/v8cgi.conf mysql_path=/sw/include/mysql/ 
gl_path=/sw/include/GL/

What is the expected output? What do you see instead?

Expected complete build.

Saw:

scons: Reading SConscript files ...
Checking for C header file sys/mman.h... (cached) yes
Checking for C function sleep()... (cached) yes
Checking for C library v8... (cached) yes
scons: done reading SConscript files.
scons: Building targets ...
g++ -o src/lib/binary/binary.os -c -Wall -O3 -fPIC -DHAVE_MMAN_H -DHAVE_SLEEP 
-DCONFIG_PATH=/Users/jandling/Local/etc/v8cgi.conf -DVERSION=0.9.0 -Ddarwin 
-DDSO_EXT=dylib -DREUSE_CONTEXT -Isrc -I/sw/lib/include -I/sw/include 
-I/Users/jandling/Local/include src/lib/binary/binary.cc
g++ -o src/lib/binary/bytestorage.os -c -Wall -O3 -fPIC -DHAVE_MMAN_H 
-DHAVE_SLEEP -DCONFIG_PATH=/Users/jandling/Local/etc/v8cgi.conf -DVERSION=0.9.0 
-Ddarwin -DDSO_EXT=dylib -DREUSE_CONTEXT -DFASTCGI -Isrc -I/sw/lib/include 
-I/sw/include -I/Users/jandling/Local/include -Isrc/fcgi/include 
src/lib/binary/bytestorage.cc
g++ -o lib/binary.dylib -dynamiclib src/lib/binary/binary.os 
src/lib/binary/bytestorage.os -L/sw/lib -L/sw/lib -L/Users/jandling/Local/lib 
-lv8 -lv8 -liconv
g++ -o src/lib/fibers/fibers.os -c -Wall -O3 -fPIC -DHAVE_MMAN_H -DHAVE_SLEEP 
-DCONFIG_PATH=/Users/jandling/Local/etc/v8cgi.conf -DVERSION=0.9.0 -Ddarwin 
-DDSO_EXT=dylib -DREUSE_CONTEXT -Isrc -I/sw/lib/include -I/sw/include 
-I/Users/jandling/Local/include src/lib/fibers/fibers.cc
g++ -o lib/fibers.dylib -dynamiclib src/lib/fibers/fibers.os -L/sw/lib 
-L/sw/lib -L/Users/jandling/Local/lib -lv8 -lv8
g++ -o src/lib/fs/fs.os -c -Wall -O3 -fPIC -DHAVE_MMAN_H -DHAVE_SLEEP 
-DCONFIG_PATH=/Users/jandling/Local/etc/v8cgi.conf -DVERSION=0.9.0 -Ddarwin 
-DDSO_EXT=dylib -DREUSE_CONTEXT -Isrc -I/sw/lib/include -I/sw/include 
-I/Users/jandling/Local/include src/lib/fs/fs.cc
g++ -o src/common.os -c -Wall -O3 -fPIC -DHAVE_MMAN_H -DHAVE_SLEEP 
-DCONFIG_PATH=/Users/jandling/Local/etc/v8cgi.conf -DVERSION=0.9.0 -Ddarwin 
-DDSO_EXT=dylib -DREUSE_CONTEXT -DFASTCGI -Isrc -I/sw/lib/include -I/sw/include 
-I/Users/jandling/Local/include -Isrc/fcgi/include src/common.cc
g++ -o src/app.os -c -Wall -O3 -fPIC -DHAVE_MMAN_H -DHAVE_SLEEP 
-DCONFIG_PATH=/Users/jandling/Local/etc/v8cgi.conf -DVERSION=0.9.0 -Ddarwin 
-DDSO_EXT=dylib -DREUSE_CONTEXT -DFASTCGI -Isrc -I/sw/lib/include -I/sw/include 
-I/Users/jandling/Local/include -Isrc/fcgi/include src/app.cc
g++ -o src/path.os -c -Wall -O3 -fPIC -DHAVE_MMAN_H -DHAVE_SLEEP 
-DCONFIG_PATH=/Users/jandling/Local/etc/v8cgi.conf -DVERSION=0.9.0 -Ddarwin 
-DDSO_EXT=dylib -DREUSE_CONTEXT -DFASTCGI -Isrc -I/sw/lib/include -I/sw/include 
-I/Users/jandling/Local/include -Isrc/fcgi/include src/path.cc
g++ -o src/cache.os -c -Wall -O3 -fPIC -DHAVE_MMAN_H -DHAVE_SLEEP 
-DCONFIG_PATH=/Users/jandling/Local/etc/v8cgi.conf -DVERSION=0.9.0 -Ddarwin 
-DDSO_EXT=dylib -DREUSE_CONTEXT -DFASTCGI -Isrc -I/sw/lib/include -I/sw/include 
-I/Users/jandling/Local/include -Isrc/fcgi/include src/cache.cc
g++ -o lib/fs.dylib -dynamiclib src/lib/fs/fs.os src/common.os src/app.os 
src/path.os src/cache.os src/lib/binary/bytestorage.os -L/sw/lib -L/sw/lib 
-L/Users/jandling/Local/lib -lv8 -lv8
Undefined symbols:
  "vtable for GC", referenced from:
      v8cgi_App::~v8cgi_App()in app.os
      v8cgi_App::~v8cgi_App()in app.os
  "setup_system(v8::Handle<v8::Object>, char**, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >)", referenced from:
      v8cgi_App::prepare(char**) in app.os
  "_libiconv_close", referenced from:
      ByteStorage::transcode(char const*, char const*)in bytestorage.os
      ByteStorage::transcode(char const*, char const*)in bytestorage.os
      ByteStorage::transcode(char const*, char const*)in bytestorage.os
      ByteStorage::transcode(char const*, char const*)in bytestorage.os
  "_libiconv", referenced from:
      ByteStorage::transcode(char const*, char const*)in bytestorage.os
  "_libiconv_open", referenced from:
      ByteStorage::transcode(char const*, char const*)in bytestorage.os
  "GC::finish()", referenced from:
      v8cgi_App::finish()     in app.os
ld: symbol(s) not found
collect2: ld returned 1 exit status
scons: *** [lib/fs.dylib] Error 1
scons: building terminated because of errors.

What version of the product are you using? On what operating system?

OS X 10.6.6
Fink 0.29.19
V8 2.4.2-1

Please provide any additional information below.

Forum/Googlegroup is closed/members only. There appears to be no mailing list, 
nor IRC channel. How are people supposed to discuss issues (such as this) 
without resorting to a bug report?

Regards,

Thorben

Original issue reported on code.google.com by tj.treve...@gmail.com on 19 Jan 2011 at 12:56

GoogleCodeExporter commented 9 years ago
Hi there,

thanks for a bugreport. People usually join the Google groups in order to 
discuss stuff; you can also meet me on #commonjs on freenode. I will mention 
this somewhere in the docs.

Can you please try changing line #9 in SConstruct (if e["os"] == "windows":) by 
substituting "windows" with "darwin"? I believe that this might solve your 
compilation problems...

Original comment by ondrej.zara on 19 Jan 2011 at 1:19

GoogleCodeExporter commented 9 years ago
Thanks, that helped.

Now I have a problem with memcache. The log was too long for a comment, so I 
attached in a text file.

memcache is installed, but there is no libmemcached/memcached.h
This is what is there:

$ ls /sw/include/memcache*
/sw/include/memcache.h

/sw/include/memcache:
_buffer.h   buffer.h

scons -h has no memcache settings listed.

Regards,

Thorben

Original comment by tj.treve...@gmail.com on 19 Jan 2011 at 4:30

Attachments:

GoogleCodeExporter commented 9 years ago
If you do not wish to compile the memcached module, just add "memcached=0" to 
the scons line.

Original comment by ondrej.zara on 19 Jan 2011 at 5:14

GoogleCodeExporter commented 9 years ago
I do wish to have it.

But from my interpretation, v8cgi is trying to #include 
<libmemcached/libmemcached.h> when it should #include <memcached.h>, which does 
exist on my system.

Or are these two different memcached libraries?

Original comment by tj.treve...@gmail.com on 20 Jan 2011 at 8:09

GoogleCodeExporter commented 9 years ago
More info..

$ fink apropos memcached
Information about 9654 packages read in 1 seconds.
 i   libmemcache          1.4.0.rc2-1     C API for building memcached clients
 i   libmemcache-shlibs   1.4.0.rc2-1     Library for building memcached clients
 i   memcached            1.2.8-1         High-performance object caching system

$ find /sw/include/ -iname \*memcache\*
/sw/include//apache2/apr_memcache.h
/sw/include//memcache
/sw/include//memcache.h

Are these not the correct packages?

Thanks for the help.

Thorben

Original comment by tj.treve...@gmail.com on 20 Jan 2011 at 8:18

GoogleCodeExporter commented 9 years ago
Hm, hard to say. The memcached module is a contributed code; I am not familiar 
with it. On my debian/ubuntu box, installing "libmemcached-dev" was sufficient. 
I do not own a mac box, so this module was not tested on mac osx.

Prehaps you can try adjusting the appropriate #include line in 
src/lib/memcached/memcached.cc to better reflect your paths, but I strongly 
believe that you are missing the correct package.

Original comment by ondrej.zara on 20 Jan 2011 at 11:50

GoogleCodeExporter commented 9 years ago
Ok,

I turned memcached off, just to get further through.

I number of things failed to build due to incov, or src/gc and src/system being 
missing from the build config. I have attached my SConstruct so you can see the 
changes.

I want the fcgi module and not the apache module. Now I am stuck at this error:

scons mysql=1 sqlite=1 fcgi=1 gd=1 reuse_context=1 v8_path=/sw/lib 
cpppath=/sw/include\;/Users/jandling/Local/include 
libpath=/sw/lib\;/Users/jandling/Local/lib/ 
config_file=/Users/jandling/Local/etc/v8cgi.conf mysql_path=/sw/include/mysql/ 
gl_path=/sw/include/GL/ memcached=0 module=0 
scons: Reading SConscript files ...
Checking for C header file sys/mman.h... (cached) yes
Checking for C function sleep()... (cached) yes
Checking for C library v8... (cached) yes
scons: done reading SConscript files.
scons: Building targets ...
g++ -o v8cgi src/common.os src/system.os src/cache.os src/gc.os src/app.os 
src/path.os src/lib/binary/bytestorage.os src/v8cgi.o -L/sw/lib -L/sw/lib 
-L/Users/jandling/Local/lib -lv8 -lv8 -lfcgi -liconv
Undefined symbols:
  "v8::Debug::EnableAgent(char const*, int, bool)", referenced from:
      v8cgi_CGI::process_args(int, char**)in v8cgi.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
scons: *** [v8cgi] Error 1
scons: building terminated because of errors.

Original comment by tj.treve...@gmail.com on 20 Jan 2011 at 12:44

Attachments:

GoogleCodeExporter commented 9 years ago
I should say, that I tried with explicit debug=0 and verbose=0

Original comment by tj.treve...@gmail.com on 20 Jan 2011 at 12:48

GoogleCodeExporter commented 9 years ago
The "v8::Debug::EnableAgent" is defined in v8/include/v8-debug.h (this is not 
affected by the "debug=0" scons option, which handles v8cgi debugging options; 
this is a standard v8 feature). It looks like your v8 library is missing this 
symbol... it might be easier for you to compile v8 yourself.

Alternatively, scan the packaged v8 library for this symbol; if you do not 
succeed, report it as a bug to library packager.

Original comment by ondrej.zara on 20 Jan 2011 at 2:41

GoogleCodeExporter commented 9 years ago
@Thorben You need libmemcached, not memcached!

Original comment by christ...@christophdorn.com on 28 Sep 2011 at 7:35

GoogleCodeExporter commented 9 years ago
I am getting the following error using OSX Lion:

g++ -o v8cgi src/common.os src/system.os src/cache.os src/gc.os src/app.os 
src/path.os src/lib/binary/bytestorage.os src/v8cgi.o 
-L/pinf/workspaces/github.com/pinf/loader-js/demos/V8CGI/v8cgi-0.9.1-src/v8 
-lv8 -lv8
Undefined symbols for architecture x86_64:
  "_iconv_open", referenced from:
      ByteStorage::transcode(char const*, char const*)in bytestorage.os
  "_iconv_close", referenced from:
      ByteStorage::transcode(char const*, char const*)in bytestorage.os
  "_iconv", referenced from:
      ByteStorage::transcode(char const*, char const*)in bytestorage.os
ld: symbol(s) not found for architecture x86_64

Looks like it needs a different iconv that what ships with OSX Lion.

Original comment by christ...@christophdorn.com on 28 Sep 2011 at 7:44

GoogleCodeExporter commented 9 years ago
The iconv-related issue seems to be caused by bad SConstruct definition; will 
be hopefully fixed soon.

Original comment by ondrej.zara on 28 Sep 2011 at 8:39

GoogleCodeExporter commented 9 years ago
To fix this (Comment 11) I did:

  brew install libiconv

Edit SConstruct line 242 by adding 'or env["os"] == "darwin"'

Then run:

  scons libpath=/usr/local/Cellar/libiconv/1.13.1/include 

The SConstruct fix should be comitted soon.

Original comment by christ...@christophdorn.com on 28 Sep 2011 at 8:42

GoogleCodeExporter commented 9 years ago
Commited in r922.

Original comment by ondrej.zara on 28 Sep 2011 at 8:44

GoogleCodeExporter commented 9 years ago
Probably fixed :)

Original comment by ondrej.zara on 14 Dec 2011 at 1:27