bugGNU Octave - Bugs: bug #41241, octave forge package 'database...

 
 

bug #41241: octave forge package 'database 2.3.0' fails to install in mxe-octave.

Submitter:  John Donoghue <lostbard>
Submitted:  Wed 15 Jan 2014 07:13:27 PM UTC
   
 
Category:  Octave Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Build Failure
Status:  Fixed Assigned to:  None
Originator Name:  John D Open/Closed:  * Closed
Release:  * 3.8.0 Operating System:  * Microsoft Windows
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Wed 28 Jan 2015 02:46:53 PM UTC, comment #16: 

2.3.1 released, compiled and run on mxe-octave 3.8.2.
Closing report

John Donoghue <lostbard>
Group Member
Fri 23 Jan 2015 06:41:06 PM UTC, comment #15: 

Sounds good to me.

I just tried with a win version of 4.1.0+ and it compiled and ran the test, failing to connect to a local database as expected.

John Donoghue <lostbard>
Group Member
Fri 23 Jan 2015 07:57:31 AM UTC, comment #14: 

Do you think I should prepare a bug fix release 2.3.1? Since there weren't changes for a year, new reasons for a release seem unlikely in the near future. Olaf

Olaf Till <i7tiol>
Group Member
Thu 22 Jan 2015 07:56:30 PM UTC, comment #13: 

I just cross compiled postgresql 9.4.0 and tried with mxe-octave:

Running the tests:



>> test pq_connect
  ***** test
 conn = pq_connect (setdbopts ("dbname", "test"));
 assert (islogical (t = pq_exec_params (conn, "select ($1);", {true}).data{1}) && t == true);
 assert (strcmp (typeinfo (t = pq_exec_params (conn, "select ($1);", {uint32(3)}).data{1}), "uint32 scalar") && t == 3);
 assert (strcmp (typeinfo (t = pq_exec_params (conn, "select ($1);", {.5}).data{1}), "scalar") && t == .5);
 assert (strcmp (typeinfo (t = pq_exec_params (conn, "select ($1);", {single(.5)}).data{1}), "float scalar") && t == .5);
 assert ((strcmp (ti = typeinfo (t = pq_exec_params (conn, "select ($1);", {"abc"}).data{1}), "string") || strcmp (ti, "sq
_string")) && strcmp (t, "abc"));
 assert (strcmp (typeinfo (t = pq_exec_params (conn, "select ($1);", {uint8([2, 3])}).data{1}), "uint8 matrix") && isequal
 (t, [2; 3]));
 assert (strcmp (typeinfo (t = pq_exec_params (conn, "select ($1);", {int16(-2)}).data{1}), "int16 scalar") && t == int16
(-2));
 assert (strcmp (typeinfo (t = pq_exec_params (conn, "select ($1);", {int32(-2)}).data{1}), "int32 scalar") && t == int32
(-2));
 assert (strcmp (typeinfo (t = pq_exec_params (conn, "select ($1);", {int64(-2)}).data{1}), "int64 scalar") && t == int64
(-2));
 pq_close (conn);
!!!!! test failed
could not connect to server: Connection refused (0x0000274D/10061)
        Is the server running on host "localhost" (::1) and accepting
        TCP/IP connections on port 5432?
could not connect to server: Connection refused (0x0000274D/10061)
        Is the server running on host "localhost" (127.0.0.1) and accepting
        TCP/IP connections on port 5432?

>>




Which is what I would expect given there is no server running locally.
So looks like the patches database works now in Windows, using 9.4.0.

John Donoghue <lostbard>
Group Member
Sun 13 Jul 2014 08:19:29 PM UTC, comment #12: 

And if I copy just the libpq.dll built on my native mingw distribution to the cross built octave install, the database package runs as expected with the failure to connect.

John Donoghue <lostbard>
Group Member
Sat 12 Jul 2014 06:01:49 PM UTC, comment #11: 

A slight update with the modified tarball.

On my native mingw built version of octave 3.8.2-rc2 (and postgresql etc) I can run the demo and test.

Both fail as they do not connect to the database (Expected given one isn't there)

So there is something not correct with the cross built version of postgresql.

John Donoghue <lostbard>
Group Member
Sat 07 Jun 2014 01:45:18 AM UTC, comment #10: 

Untar the tarball, apply the patch and tar it back up.

There was still an issue with it loading something afterward when attempting to run any of the functions that I hadnt resolved yet, and hadnt managed to get back to looking at it. (At least issues on my system - I dont know if anyone else had tried to install it in Windows )

John Donoghue <lostbard>
Group Member
Fri 06 Jun 2014 09:43:36 PM UTC, comment #9: 

Hi. How do you apply the database.patch to the database-2.3.0.tar.gz?

Than you.

I get this when trying to install:

In file included from converters.h:33:0,
                 from pq_connection.h:28,
                 from _pq_connect_.cc:22:
wrap_endian.h:35:20: fatal error: endian.h: No such file or directory
 #include <endian.h>
                    ^
compilation terminated.
make: * [__pq_connect__.o] Error 1
make: Leaving directory `/Tmp/oct-16/database-2.3.0/src'

pkg: error running `make' for the database package.
error: called from 'configure_make' in file C:\Octave\Octave-3.8.1\share\octave\3.8.
1\m\pkg\private\configure_make.m near line 82, column 9
error: called from:
error:   C:\Octave\Octave-3.8.1\share\octave\3.8.1\m\pkg\private\install.m at line 1
99, column 5
error:   C:\Octave\Octave-3.8.1\share\octave\3.8.1\m\pkg\pkg.m at line 394, column 9


Arturo <arthur10>
Mon 20 Jan 2014 07:57:35 PM UTC, comment #8: 

mingw/mxe-octave doesn't have a ldconfig command.
In windows, it does expect the dll to be in the path, which libpq.dll is in c:\Octave\Octave-3.8.0\bin, which is the main octave binaries path, and is in the PATH statement.

I did try setenv('LD_LIBRARY_PATH', 'c:\Octave\Octave-3.8.0\bin') just on the offchance it would help - not issue was the same.

NOTE that there is only the client libs installed, NOT the server, so I would expect the test to fail as there isn't any server with a test database available.

However the message indicates a problem loading the .oct file, not a problem attempting to connect.


John Donoghue <lostbard>
Group Member
Mon 20 Jan 2014 08:17:53 AM UTC, comment #7: 

Does it work with:


LD_LIBRARY_PATH=<\your\libpq-library\directory\> octave
octave:1> test pq_connect


?
What does:


ldconfig -p | grep libpq


say?

Olaf Till <i7tiol>
Group Member
Sun 19 Jan 2014 10:15:57 PM UTC, comment #6: 

I managed to write a simple app for using the postgres library and appears to work ok, so isn't a problem with the mingw compile of postgres at least.

John Donoghue <lostbard>
Group Member
Thu 16 Jan 2014 11:33:22 AM UTC, comment #5: 

No ldd in mingw.
I used objdump and didnt see anything missing that I could see.

It could be my postgresql install in mxeoctave - I will look at that next with a test program and work up from that.

John Donoghue <lostbard>
Group Member
Thu 16 Jan 2014 08:32:40 AM UTC, comment #4: 

Sorry, forgot to quote the command, I meant:


ldd C:\Octave\Octave-3.8.0\lib\octave\packages\database-2.3.0\i686-pc-mingw32-api-v49+\pq_interface.oct


Olaf Till <i7tiol>
Group Member
Thu 16 Jan 2014 08:26:39 AM UTC, comment #3: 

Maybe a shared library which interface.oct depends on is not found.

You could try

ldd C:\Octave\Octave-3.8.0\lib\octave\packages\database-2.3.0\i686-pc-mingw32-api-v49+\pq_interface.oct

(or whatever corresponds to ldd)

and check whether the listed shared libraries are present, especially libpq.so...

Actually configure should check for libpq.

Olaf Till <i7tiol>
Group Member
Wed 15 Jan 2014 09:28:03 PM UTC, comment #2: 

No - Not sure why though.


>> test pq_connect
  ***** test
 conn = pq_connect (setdbopts ("dbname", "test"));
 assert (islogical (t = pq_exec_params (conn, "select ($1);", {true}).data{1}) && t == true);
 assert (strcmp (typeinfo (t = pq_exec_params (conn, "select ($1);", {uint32(3)}).data{1}), "uint32 scalar") && t == 3);
 assert (strcmp (typeinfo (t = pq_exec_params (conn, "select ($1);", {.5}).data{1}), "scalar") && t == .5);
 assert (strcmp (typeinfo (t = pq_exec_params (conn, "select ($1);", {single(.5)}).data{1}), "float scalar") && t == .5);
 assert ((strcmp (ti = typeinfo (t = pq_exec_params (conn, "select ($1);", {"abc"}).data{1}), "string") || strcmp (ti, "sq_string")) && strcmp (t, "abc"));
 assert (strcmp (typeinfo (t = pq_exec_params (conn, "select ($1);", {uint8([2, 3])}).data{1}), "uint8 matrix") && isequal (t, [2; 3]));
 assert (strcmp (typeinfo (t = pq_exec_params (conn, "select ($1);", {int16(-2)}).data{1}), "int16 scalar") && t == int16 (-2));
 assert (strcmp (typeinfo (t = pq_exec_params (conn, "select ($1);", {int32(-2)}).data{1}), "int32 scalar") && t == int32 (-2));
 assert (strcmp (typeinfo (t = pq_exec_params (conn, "select ($1);", {int64(-2)}).data{1}), "int64 scalar") && t == int64 (-2));
 pq_close (conn);
!!!!! test failed
could not find library or dependents: C:\Octave\Octave-3.8.0\lib\octave\packages\database-2.3.0\i686-pc-mingw32-api-v49+\pq_interface.oct
>>


File is there though:

>> ls C:\Octave\Octave-3.8.0\lib\octave\packages\database-2.3.0\i686-pc-mingw32-api-v49+\
 Volume in drive C is OS
 Volume Serial Number is E267-C2FE

 Directory of C:\Octave\Octave-3.8.0\lib\octave\packages\database-2.3.0\i686-pc-mingw32-api-v49+

[.]                [..]               PKG_ADD            pq_interface.oct
               2 File(s)     10,657,951 bytes
               2 Dir(s)  76,924,043,264 bytes free
>>


John Donoghue <lostbard>
Group Member
Wed 15 Jan 2014 09:00:42 PM UTC, comment #1: 

Replaced the symlink and applied your patch, thanks. Do 'demo pq_connect' and 'test pq_connect' work?

Olaf Till <i7tiol>
Group Member
Wed 15 Jan 2014 07:13:27 PM UTC, original submission:  

On trying to install on mxe-octave (mingw) the package fails for a couple of reasons:
1) bootstrap is a symbolic link (unsupported on windows)
2) endian.h cant be found
3) cant find sys/socket.h

Patch attached provides definitions in wrap_endian.h for mingw endian handling (using winsock htonl etc), adds linking of ws2_32 in windows (for the dependancy), includes winsock2.h if in windows.

John Donoghue <lostbard>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #30281:  database.patch added by lostbard (2KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by arthur10 (Posted a comment)
  • -email is unavailable- added by i7tiol (Posted a comment)
  • -email is unavailable- added by lostbard (Submitted the item)
  • -email is unavailable- added by lostbard
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-01-28 lostbard StatusNone Fixed
        Open/ClosedOpen Closed
    2014-01-15 lostbard Attached File- Added database.patch, #30281
        Carbon-Copy- Added i7tiol

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code