help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Interfacing Octave to PostgresQL


From: koufalas
Subject: Interfacing Octave to PostgresQL
Date: Mon, 30 May 2005 11:53:09 +1000

G'day all,

I'm trying to interface Octave 2.1.64 to PostgresQL 7.2.1 using Dirk 
Eddelbuettel's code. It seems to compile and link okay, but at run time it 
crashes with undefined references to PgConnection. If I pass a -zdefs flag to 
the linker, it doesn't link, and shows up an undefined reference to typeinfo 
kind of error. I've tried passing -fno-rtti to the linker, but that didn't 
work. If anybody intimate with linkers is reading this, your advice would be 
much appreciated! I've included some information below: compiling and linking 
output, shared libraries linked to, and symbols in the pgtextdata.oct file. By 
the way, I'm no C/C++ programmer!

address@hidden:/usr/share/octave/site/m/postgresql# mkoctfile -v pgtextdata.cc 
-I/usr/include/postgresql -L/usr/lib -lpq -lpq++  
         
/usr/bin/g++ -c -fPIC -I/usr/include/octave-2.1.64 
-I/usr/include/octave-2.1.64/octave -mieee-fp -O2 -I/usr/include/postgresql 
pgtextdata.cc -o pgtextdata.o
In file included from /usr/include/postgresql/libpq++/pgconnection.h:25,
                 from /usr/include/postgresql/libpq++.H:27,
                 from pgtextdata.cc:27:
/usr/include/postgresql/pg_config.h:660:1: warning: "HAVE_POSIX_SIGNALS" 
redefined
In file included from pgtextdata.cc:22:
/usr/include/octave-2.1.64/octave/config.h:379:1: warning: this is the location 
of the previous definition

/usr/bin/g++ -shared -Wl,-Bsymbolic -o pgtextdata.oct pgtextdata.o -L/usr/lib 
-lpq -lpq++ -L/usr/lib/octave-2.1.64 -loctinterp -loctave -lcruft -s -llapack-3 
-lblas-3 -lfftw3 -lreadline -lncurses -ldl -lhdf5 -lz -lm 
-L/usr/lib/gcc-lib/i486-linux/3.3.5 
-L/usr/lib/gcc-lib/i486-linux/3.3.5/../../.. -lhdf5 -lz -lfrtbegin -lg2c -lm 
-lgcc_s

address@hidden:~$ octave
GNU Octave, version 2.1.64 (i386-pc-linux-gnu).
Copyright (C) 2004 John W. Eaton.
This is free software; see the source code for copying conditions.
There is ABSOLUTELY NO WARRANTY; not even for MERCHANTIBILITY or
FITNESS FOR A PARTICULAR PURPOSE.  For details, type `warranty'.

Additional information about Octave is available at http://www.octave.org.

Please contribute if you find this software useful.
For more information, visit http://www.octave.org/help-wanted.html

Report bugs to <address@hidden> (but first, please read
http://www.octave.org/bugs.html to learn how to write a helpful report).

octave:1> pgtextdata("test","SELECT * FROM test")
error: /usr/share/octave/site/m/postgresql/pgtextdata.oct: undefined symbol: 
_ZTI12PgConnection
error: `pgtextdata' undefined near line 1 column 1
octave:1>

address@hidden:/usr/share/octave/site/m/postgresql# ldd pgtextdata.oct 
                libpq.so.2 => /usr/lib/libpq.so.2 (0x40017000)
        libpq++.so.4 => /usr/lib/libpq++.so.4 (0x40029000)
        liboctinterp.so => /usr/lib/octave-2.1.64/liboctinterp.so (0x40035000)
        liboctave.so => /usr/lib/octave-2.1.64/liboctave.so (0x40847000)
        libcruft.so => /usr/lib/octave-2.1.64/libcruft.so (0x40e94000)
        liblapack.so.3 => /usr/lib/liblapack.so.3 (0x40ef1000)
        libblas.so.3 => /usr/lib/libblas.so.3 (0x4150f000)
        libfftw3.so.3 => /usr/lib/libfftw3.so.3 (0x41859000)
        libreadline.so.4 => /lib/libreadline.so.4 (0x41917000)
        libncurses.so.5 => /lib/libncurses.so.5 (0x41943000)
        libdl.so.2 => /lib/tls/libdl.so.2 (0x41982000)
        libhdf5-1.6.2.so.0 => /usr/lib/libhdf5-1.6.2.so.0 (0x41985000)
        libz.so.1 => /usr/lib/libz.so.1 (0x41a8f000)
        libg2c.so.0 => /usr/lib/libg2c.so.0 (0x41aa1000)
        libm.so.6 => /lib/tls/libm.so.6 (0x41abf000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x41ae2000)
        libstdc++.so.5 => /usr/lib/libstdc++.so.5 (0x41aeb000)
        libc.so.6 => /lib/tls/libc.so.6 (0x41ba5000)
        libssl.so.0.9.6 => /usr/lib/libssl.so.0.9.6 (0x41ce0000)
        libcrypto.so.0.9.6 => /usr/lib/libcrypto.so.0.9.6 (0x41d0e000)
        libcrypt.so.1 => /lib/tls/libcrypt.so.1 (0x41dce000)
        libresolv.so.2 => /lib/tls/libresolv.so.2 (0x41dfa000)
        libnsl.so.1 => /lib/tls/libnsl.so.1 (0x41e0c000)
        libstdc++-libc6.2-2.so.3 => /usr/lib/libstdc++-libc6.2-2.so.3 
(0x41e21000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)
        libpthread.so.0 => /lib/tls/libpthread.so.0 (0x41e6b000)

address@hidden:/usr/share/octave/site/m/postgresql# nm --demangle 
pgtextdata.oct | less

000043b8 d DW.ref.__gxx_personality_v0
00001e40 T FSpgtextdata_gnu_v3
000046f0 A _DYNAMIC
00004858 A _GLOBAL_OFFSET_TABLE_
00002cc0 t global constructors keyed to FSpgtextdata_gnu_v3
         w _Jv_RegisterClasses
         U _Unwind_Resume@@GCC_3.0
00002070 T Fpgtextdata(octave_value_list const&, int)
         U check_version(std::string const&, std::string const&)
         U install_dld_function(octave_value_list (*)(octave_value_list const&, 
int), std::string const&, octave_shlib const&, std::string const&, bool)
00002c00 t __static_initialization_and_destruction_0(int, int)
         U error(char const*, ...)
         U usage(char const*, ...)
00004980 V guard variable for octave_value_list::elem(int)::empty_matrix
00004950 V guard variable for dim_vector::nil_rep() const::nr
00004958 V guard variable for Array<std::string>::nil_rep() const::nr
00004970 V guard variable for Array<std::complex<double> >::nil_rep() const::nr
00004960 V guard variable for Array<bool>::nil_rep() const::nr
00004978 V guard variable for Array<char>::nil_rep() const::nr
00004968 V guard variable for Array<double>::nil_rep() const::nr
         U PgDatabase::Fields()
00002ea0 W PgDatabase::~PgDatabase()
00002e60 W PgDatabase::~PgDatabase()
         U PgConnection::ExecTuplesOk(char const*)
         U PgConnection::PgConnection(char const*)
         U PgConnection::~PgConnection()
         U octave_value::octave_value(string_vector const&)
         U octave_value::octave_value(Matrix const&)
         U octave_value::~octave_value()
00002da0 W string_vector::~string_vector()
00002d60 W string_vector::~string_vector()
         U octave_value_list::resize(int, octave_value const&)
         U Array<std::string>::~Array()
         U Array<std::string>::~Array()
         U Array<std::string>::~Array()
         U Array<double>::get_size(dim_vector const&)
         U Array<double>::~Array()
         U Array<double>::~Array()
         U Array<double>::~Array()
00002f20 W Array2<double>::~Array2()
00002ee0 W Array2<double>::~Array2()
00002de0 W Matrix::~Matrix()
00002e20 W Matrix::~Matrix()
         U PgDatabase::Tuples() const
         U PgDatabase::GetValue(int, int) const
         U PgConnection::ConnectionBad() const
         U _ZNSs20_S_empty_rep_storageE@@GLIBCPP_3.2
         U _ZNSs4_Rep10_M_destroyERKSaIcE@@GLIBCPP_3.2
         U _ZNSs4_Rep11_S_terminalE@@GLIBCPP_3.2
         U _ZNSs6appendERKSs@@GLIBCPP_3.2
         U _ZNSs6assignEPKcj@@GLIBCPP_3.2
         U _ZNSs6assignERKSs@@GLIBCPP_3.2
         U _ZNSsC1EPKcRKSaIcE@@GLIBCPP_3.2
         U _ZNSsC1ERKSs@@GLIBCPP_3.2
0000325c V std::basic_streambuf<char, std::char_traits<char> >::_S_pback_size
00003260 V std::basic_streambuf<wchar_t, std::char_traits<wchar_t> 
>::_S_pback_size
         U 
_ZNSt24__default_alloc_templateILb1ELi0EE10deallocateEPvj@@GLIBCPP_3.2
         U _ZNSt8ios_base4InitC1Ev@@GLIBCPP_3.2
         U _ZNSt8ios_base4InitD1Ev@@GLIBCPP_3.2
0000494c b std::__ioinit
00002ce0 W std::basic_string<char, std::char_traits<char>, std::allocator<char> 
> std::operator+<char, std::char_traits<char>, std::allocator<char> 
>(std::basic_string<char, std::char_traits<char>, std::allocator<char> > 
const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > 
const&)
00004380 V typeinfo for PgDatabase
         U typeinfo for PgConnection
00004360 V typeinfo for string_vector
00004358 V typeinfo for Array<std::string>
0000436c V typeinfo for Array<double>
000043a0 V typeinfo for Array2<double>
00004374 V typeinfo for Matrix
000043ac V typeinfo for MArray2<double>
00003220 V typeinfo name for PgDatabase
0000323f V typeinfo name for string_vector
0000324f V typeinfo name for Array<std::string>
00003235 V typeinfo name for Array<double>
00003270 V typeinfo name for Array2<double>
0000322d V typeinfo name for Matrix
00003264 V typeinfo name for MArray2<double>
00004308 V vtable for PgDatabase
         U vtable for octave_value
00004338 V vtable for string_vector
00004348 V vtable for Array<std::string>
00004328 V vtable for Array<double>
00004390 V vtable for Array2<double>
00004318 V vtable for Matrix
         U _ZTVN10__cxxabiv117__class_type_infoE@@GLIBCPP_3.2
         U _ZTVN10__cxxabiv120__si_class_type_infoE@@GLIBCPP_3.2
00004990 V octave_value_list::elem(int)::empty_matrix
0000498c V dim_vector::nil_rep() const::nr
00004988 V Array<std::string>::nil_rep() const::nr
         U _ZdaPv@@GLIBCPP_3.2
         U _ZdlPv@@GLIBCPP_3.2
         U _Znaj@@GLIBCPP_3.2
         U _Znwj@@GLIBCPP_3.2
00004848 d __CTOR_END__
00004840 d __CTOR_LIST__
00004850 d __DTOR_END__
0000484c d __DTOR_LIST__
000045e0 r __FRAME_END__
00004854 d __JCR_END__
00004854 d __JCR_LIST__
00004948 A __bss_start
         U __cxa_atexit@@GLIBC_2.1.3
         w __cxa_finalize@@GLIBC_2.1.3
00002f60 t __do_global_ctors_aux
00001d70 t __do_global_dtors_aux
00004300 d __dso_handle
         w __gmon_start__
         U __gxx_personality_v0@@CXXABI_1.2
00001e30 t __i686.get_pc_thunk.bx
00002c60 t __tcf_0
00002c90 t __tcf_1
00004948 A _edata
000049a4 A _end
00002fa0 T _fini
00001ad8 T _init
00001d40 t call_gmon_start
00004948 b completed.1
         U error_state
00001df0 t frame_dummy
00004304 d p.0
         U strlen@@GLIBC_2.0

This message was sent through MyMail http://www.mymail.com.au




-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]