Git Product home page Git Product logo

Comments (15)

GoogleCodeExporter avatar GoogleCodeExporter commented on July 2, 2024
Hmm, I don't have FreeBSD... I wish I had some environment to reproduce it...

Original comment by [email protected] on 5 Sep 2012 at 7:33

from plv8.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 2, 2024
I can give you temporary shell access to a FreeBSD box .. could you send me 
your public key? => tobias dot oberstein at tavendo dot de
Alternatively, I can prepare a virtual appliance that you can import into 
VirtualBox and run on your desktop.

Original comment by [email protected] on 5 Sep 2012 at 1:03

from plv8.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 2, 2024
The same exact thing happens for me:

- FreeBSD 9.0-STABLE (AMD64)
- V8 3.12.10
- PostgreSQL 9.1, 9.2dev, and 9.2 release.
- gcc/g++ v4.2.1
- plv8js 2012-07-19 snapshot

I've ktraced the PostgreSQL child running the query to define the 'to_jsontext' 
function on the home page after plv8 is loaded, if that helps at all.


Original comment by [email protected] on 12 Sep 2012 at 9:39

from plv8.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 2, 2024
[deleted comment]

from plv8.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 2, 2024
Even such a simple UDF fails in the FreeBSD box.

extern "C" {
#include "postgres.h"
#include "fmgr.h"

PG_MODULE_MAGIC;

PG_FUNCTION_INFO_V1(miniv8);
Datum miniv8(PG_FUNCTION_ARGS);
}

#include "v8.h"

using namespace v8;

Datum
miniv8(PG_FUNCTION_ARGS)
{
    {
        HandleScope scope;

        Handle<ObjectTemplate> obj = ObjectTemplate::New();
    }

    PG_RETURN_BOOL(true);
}

Still I don't understand what is happening.

Original comment by [email protected] on 14 Sep 2012 at 7:49

Attachments:

from plv8.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 2, 2024
Is this related...?

https://github.com/cowboyd/therubyracer/issues/145

Can you try adding -fPIC in SConstruct and rebuild libv8.so?

Original comment by [email protected] on 14 Sep 2012 at 8:28

from plv8.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 2, 2024
Ah, never mind.  It's already there.

Original comment by [email protected] on 14 Sep 2012 at 8:32

from plv8.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 2, 2024
Oh, ok.  You need to build postgresql with -pthread.  Try:
./configure --prefix=$HOME/local CFLAGS='-pthread'

Note: don't forget -O2 in CFLAGS for your production.

Original comment by [email protected] on 14 Sep 2012 at 8:42

from plv8.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 2, 2024
...and installcheck still fails.

Original comment by [email protected] on 14 Sep 2012 at 8:45

from plv8.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 2, 2024
Well, no.  I was just messing up the source.  It works fine with -pthread.

Original comment by [email protected] on 14 Sep 2012 at 8:46

from plv8.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 2, 2024
I'll try with PG build with above option.

FWIW: the FreeBSD port for V8 does this patching:

/usr/ports/lang/v8/files
webmqpgdev# cat patch-SConstruct
--- SConstruct.orig     2012-02-08 09:38:50.000000000 +0800
+++ SConstruct  2012-02-08 09:50:13.000000000 +0800
@@ -115,7 +115,7 @@ LIBRARY_FLAGS = {
       'CPPPATH' : [src_dir, '/usr/local/include'],
       'LIBPATH' : ['/usr/local/lib'],
       'CCFLAGS':      ['-ansi'],
-      'LIBS': ['execinfo']
+      'LIBS': ['pthread', 'execinfo']
     },
     'os:openbsd': {
       'CPPPATH' : [src_dir, '/usr/local/include'],
webmqpgdev# cat patch-gyp_common.py
--- build/gyp/pylib/gyp/common.py.orig  2012-05-14 16:25:53.000000000 +0800
+++ build/gyp/pylib/gyp/common.py       2012-05-14 16:26:03.000000000 +0800
@@ -355,6 +355,8 @@ def GetFlavor(params):
     'sunos5': 'solaris',
     'freebsd7': 'freebsd',
     'freebsd8': 'freebsd',
+    'freebsd9': 'freebsd',
+    'freebsd10': 'freebsd',
   }
   flavor = flavors.get(sys.platform, 'linux')
   return params.get('flavor', flavor)
webmqpgdev#

Original comment by [email protected] on 14 Sep 2012 at 8:47

from plv8.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 2, 2024
Cool! I'll try in a moment. On success, I document the steps for building on 
FBSD in detail .. maybe that would be worth a page on the PLV8 wiki?

Original comment by [email protected] on 14 Sep 2012 at 8:49

from plv8.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 2, 2024
To be honest, PLV8 wiki page's V8 install instruction is out of date at all.  
I'll work on that soon.

Original comment by [email protected] on 14 Sep 2012 at 9:08

from plv8.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 2, 2024
Ok, confirmed that adding "-pthread" during PG build did the trick! Works for 
me now .. thanks alot for helping!

Build PostgreSQL
================

cd ~/build
tar xvjf ../tarballs/postgresql-9.2.0.tar.bz2
cd postgresql-9.2.0
./configure --prefix=$HOME/local CFLAGS='-O2 -pthread'
gmake
gmake install


Build Google V8
===============

cd ~/build
svn checkout http://v8.googlecode.com/svn/trunk/ v8
cd v8
export GYPFLAGS="-D OS=freebsd"
gmake dependencies
gmake native.check -j 4 library=shared strictaliasing=off console=readline
cp ./include/* ~/local/include/
cp ./out/native/lib.target/libv8.so ~/local/lib/
cp ./out/native/d8 ~/local/bin/


Build PLV8
==========

cd ~/build
git clone https://code.google.com/p/plv8js/
cd plv8js

Edit `Makefile` for

    V8DIR = ${HOME}/local

gmake
gmake install


Test PLV8
=========

To test, open a first shell and do

initdb -D $HOME/pgdata
postgres -D $HOME/pgdata
..

and in a 2nd shell do:

gmake installcheck

If you run PG on non-standard port (or have multiple PGs running),
adjust the Makefile, i.e.

REGRESS = --port 5433 --host 127.0.0.1 init-extension plv8 inline json 
startup_pre startup varparam

Original comment by [email protected] on 14 Sep 2012 at 9:44

from plv8.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 2, 2024
Updated a little of Wiki.

Original comment by [email protected] on 19 Sep 2012 at 4:43

  • Changed state: Fixed

from plv8.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.