atris / JDBC_FDW

FDW that wraps JDBC for PostgreSQL.It can be used to connect and fetch data from any data source that supports JDBC
Other
66 stars 38 forks source link

build fail on OSX. #1

Closed brunosimioni closed 11 years ago

brunosimioni commented 11 years ago

Environment

OSX 10.6.8

java -version java version "1.6.0_35" Java(TM) SE Runtime Environment (build 1.6.0_35-b10-428-10M3811) Java HotSpot(TM) 64-Bit Server VM (build 20.10-b01-428, mixed mode)

javac -version javac 1.6.0_35

Steps to reproduce.

  1. Clone git source.
  2. Make clean.
  3. postgresql-9.2.1/contrib/JDBC_FDW]$ sudo ln -s /System/Library/Frameworks/JavaVM.framework/Libraries/libserver.dylib /usr/lib/libjvm.dylib
  4. make install javac -d /Applications/PostgreSQL-9.2.1/lib/postgresql JDBCUtils.java JDBCDriverLoader.java gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -bundle -multiply_defined suppress -o jdbc_fdw.so jdbc_fdw.o -L../../src/port -Wl,-dead_strip_dylibs -ljvm -bundle_loader ../../src/backend/postgres ld: warning: in /usr/lib/libjvm.dylib, file was built for i386 which is not the architecture being linked (x86_64) Undefined symbols: "_JNI_CreateJavaVM", referenced from: _jdbcGetForeignPlan in jdbc_fdw.o ld: symbol(s) not found collect2: ld returned 1 exit status make: *\ [jdbc_fdw.so] Error 1
  5. Tried to replace libjvm to libserver.
  6. Make clean and Make install

javac -d /Applications/PostgreSQL-9.2.1/lib/postgresql JDBCUtils.java JDBCDriverLoader.java gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -D'PKG_LIB_DIR=/Applications/PostgreSQL-9.2.1/lib/postgresql' -I. -I. -I../../src/include -c -o jdbc_fdw.o jdbc_fdw.c gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -bundle -multiply_defined suppress -o jdbc_fdw.so jdbc_fdw.o -L../../src/port -Wl,-dead_strip_dylibs -ljvm -bundle_loader ../../src/backend/postgres Undefined symbols: "_JNI_CreateJavaVM", referenced from: _jdbcGetForeignPlan in jdbc_fdw.o ld: symbol(s) not found collect2: ld returned 1 exit status make: *\ [jdbc_fdw.so] Error 1

atris commented 11 years ago

I actually never tested on OSX.It would be great if you could help me with this!

Atri

On Wed, Sep 26, 2012 at 6:39 AM, brunosimioni notifications@github.comwrote:

Environment

OSX 10.6.8

java -version java version "1.6.0_35" Java(TM) SE Runtime Environment (build 1.6.0_35-b10-428-10M3811) Java HotSpot(TM) 64-Bit Server VM (build 20.10-b01-428, mixed mode)

javac -version javac 1.6.0_35

Steps to reproduce.

  1. Clone git source.
  2. Make clean.
  3. postgresql-9.2.1/contrib/JDBC_FDW]$ sudo ln -s /System/Library/Frameworks/JavaVM.framework/Libraries/libserver.dylib /usr/lib/libjvm.dylib 4.

    make install javac -d /Applications/PostgreSQL-9.2.1/lib/postgresql JDBCUtils.java JDBCDriverLoader.java gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -bundle -multiply_defined suppress -o jdbc_fdw.so jdbc_fdw.o -L../../src/port -Wl,-dead_strip_dylibs -ljvm -bundle_loader ../../src/backend/postgres ld: warning: in /usr/lib/libjvm.dylib, file was built for i386 which is not the architecture being linked (x86_64) Undefined symbols: "_JNI_CreateJavaVM", referenced from: _jdbcGetForeignPlan in jdbc_fdw.o ld: symbol(s) not found collect2: ld returned 1 exit status make: *\ [jdbc_fdw.so] Error 1 5.

    Tried to replace libjvm to libserver. 6.

    Make clean and Make install

javac -d /Applications/PostgreSQL-9.2.1/lib/postgresql JDBCUtils.java JDBCDriverLoader.java gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -D'PKG_LIB_DIR=/Applications/PostgreSQL-9.2.1/lib/postgresql' -I. -I. -I../../src/include -c -o jdbc_fdw.o jdbc_fdw.c gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -bundle -multiply_defined suppress -o jdbc_fdw.so jdbc_fdw.o -L../../src/port -Wl,-dead_strip_dylibs -ljvm -bundle_loader ../../src/backend/postgres Undefined symbols: "_JNI_CreateJavaVM", referenced from: _jdbcGetForeignPlan in jdbc_fdw.o ld: symbol(s) not found collect2: ld returned 1 exit status make: *\ [jdbc_fdw.so] Error 1

— Reply to this email directly or view it on GitHubhttps://github.com/atris/JDBC_FDW/issues/1.

Regards,

Atri l'apprenant

brunosimioni commented 11 years ago

For sure! This is a problem related with libjvm (dylib instead of .so). It's compiled for 32bit. Is there any directive that force 64bit binaries?

atris commented 11 years ago

AH! I thought so..

Yup,it is problem with loading the libjvm.

I will have to check the forcing of 64 bit binaries.I never had that issue(I manually set it to use the 64 bit binaries in Linux.)

Atri

On Wed, Sep 26, 2012 at 1:37 PM, brunosimioni notifications@github.comwrote:

For sure! This is a problem related with libjvm (dylib instead of .so). It's compiled for 32bit. Is there any directive that force 64bit binaries?

— Reply to this email directly or view it on GitHubhttps://github.com/atris/JDBC_FDW/issues/1#issuecomment-8898290.

Regards,

Atri l'apprenant

atris commented 11 years ago

I think Felipe's commit has solved the issue.Thanks to him and Ampliato for that and their constant support to the project.

mapmeld commented 10 years ago

For anyone else stuck here, trying to get this working on Mac, I just got it working: