Comments (15)
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.
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.
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.
[deleted comment]
from plv8.
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.
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.
Ah, never mind. It's already there.
Original comment by [email protected]
on 14 Sep 2012 at 8:32
from plv8.
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.
...and installcheck still fails.
Original comment by [email protected]
on 14 Sep 2012 at 8:45
from plv8.
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.
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.
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.
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.
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.
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)
- A question HOT 1
- simple variables in template literals HOT 2
- Compatibility with Postgres 16 HOT 2
- Build error plv8 - using the `make` command HOT 8
- Upgrade from 2.3.12 to 2.3.15 failed in Postgresql v11.18 HOT 1
- Excited to Start working with 3.2alpha Branch HOT 2
- Invalid Discord link? HOT 2
- r3.2 Rocks HOT 2
- Many warnings when building v3.2.0 HOT 2
- /usr/bin/ld: cannot find -lv8_base_with_compiler: No such file or directory HOT 4
- Support for pg16 HOT 4
- plv8_info() causes segmentation fault HOT 2
- Unable to access transition tables declared in trigger HOT 1
- add functions setTimeout and setInterval HOT 11
- Async function call in trigger HOT 4
- Use of Promise HOT 2
- PGXN Build Fails
- undefined symbol: _ZTIN2v84base6ThreadE HOT 11
- Getting Error '-fexcess-precision=standard' is not supported when trying to compile PLV8 with EDB16 HOT 1
- Can't get access to things defined using start_proc HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from plv8.