bugGNU Octave - Bugs: bug #38098, package database-1.0.4 compiling...

 
 

bug #38098: package database-1.0.4 compiling issues with mkoctave

Submitter:  None
Submitted:  Tue 15 Jan 2013 09:33:29 PM UTC
   
 
Category:  Octave Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  Invalid / Not an Octave Bug Assigned to:  None
Originator Name:  richard Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 3.6.3
Operating System:  * GNU/Linux Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 13 Feb 2013 10:10:19 AM UTC, comment #5: 


> It may be prudent to record all this as four separate bugs:
> 1) Keeping code for postgres, mysql, sqlite, and odbc in one package called "database" may result in something that is fragile and sub-optimal. Would development of separate packages for each, and possibly renaming "database" as SqUIint exclusively to use as a sandpit be a good way forward?


Considering the way that Octave Forge is currently organized, that would be too much fragmentation.

2) a problem in liboctave-dev_3.6.3-2 gets recorded as a bug

That's the lack of oct-types.h. right? That's not a bug, it's the code in the database package that was out of date.

3) a problem with sqlite3 gets recorded as a bug

This has been removed from the database package.

4) I have tried mysql - it fails - record this as a bug too.

This has been removed from the database package.

If my understanding is correct, the current opinion is that we shouldn't count on SWIG to do this, as it easily breaks with new versions.

The whole database package was removed and a new version has been released with a different API but currently only works for postgreSQL. Would be great if you could join in the development of the new package for whatever database system you prefer.

Carnë Draug <carandraug>
Group Member
Mon 21 Jan 2013 08:25:40 PM UTC, comment #4: 

A note on progress :
The problem with liboctave-dev was traced to the file oct-types.h
Current practice dictates that this code be included in the database API. To allow the present code to proceed with mysql, postgres, and sqlite3 as a workaround, the oct-types.h file was
included in the octave headers directory.
(bug #38106 was referred back to here)

Running make now compiles the postgres and sqlite3 code, but mysql fails with errors -see attached file.
A brief investigation suggests that changes to mysql code and to
swig are the source of the problems.


(file #27307)

Anonymous
Thu 17 Jan 2013 06:57:26 AM UTC, comment #3: 

It may be prudent to record all this as four separate bugs:
1) Keeping code for postgres, mysql, sqlite, and odbc in one package called "database" may result in something that is fragile
and sub-optimal. Would development of separate packages for each,
and possibly renaming "database" as SqUIint exclusively to use as a sandpit be a good way forward?
2) a problem in liboctave-dev_3.6.3-2 gets recorded as a bug
3) a problem with sqlite3 gets recorded as a bug
4) I have tried mysql - it fails - record this as a bug too.

I will post these as separate bugs unless I hear of a better way  to progress.

Anonymous
Wed 16 Jan 2013 08:11:27 PM UTC, comment #2: 

It seems to be workable, with one bug outstanding on sqlite3 than can be
worked around. There may be a more serious bug in liboctave-dev_3.6.3-2
(it seems to rely on some old code from 3.2.4 to be present to compile,
possibly something to do with /configure)

I ran some tests with my version of octave, results are as follows:
Postgres - 'empty' lists the commands, 'basic' tests run, and results seem good.
sqlite3 - 'empty' lists the commands, no other tests run because the needed
database tables, user, and passwords are not yet set up.
mysql - configure fails to detect my installation (see below)
odbc - configure fails to detect my installation - that may be correct.

I doubt I have the skills to support the package, but at least the option
of installing and running this package is there. I guess it is bad timing on
my part if "database" is ditched.

###############

> development version

That code may make mysql useable.  I have not yet downloaded the development
version. I may do that in the next day or two.

I'd need to give some further thought to planning development. Until now,
I merely wanted to see how useful a database interface via octave could be.
I'd see my priorities as follows:
a) compare operation of some existing programs using octave, perl and postgres.
b) resolve the bug? in liboctave-dev_3.6.3-2
c) test database-1.0.4 with sqlite3, mysql, and odbc to 'basic' level
d) resolve bug with sqlite3

I've listed priorities for information. If you think I can do some simple tasks that may help, please ask.

Anonymous
Wed 16 Jan 2013 06:22:14 PM UTC, comment #1: 

Hi

thank you for your bug report. We have actually just yesterday ditch the whole database package because no one was working on it and there's someone working on a new implementation for postgreQSL only that won't require SWIG.

But if you manage to get it compiling, the old code can be brought back, it just happens that it wasn't even installing.

When you tried to fix things on the database package, did you try to get the development version? The package was released back in the start of 2009 and had the two following changes since:


r6233 | xavier98 | 2009-09-09 07:33:16 +0100 (Wed, 09 Sep 2009) | 1 line
Changed paths:
   M /trunk/octave-forge/main/database/src/mysql.i
   M /trunk/octave-forge/main/database/src/mysql_wrap.cpp

add port to database connection (thanks to Wim Crols)
------------------------------------------------------------------------
r6115 | xavier98 | 2009-08-19 06:01:22 +0100 (Wed, 19 Aug 2009) | 1 line
Changed paths:
   M /trunk/octave-forge/main/database/src/Makeconf.in
   M /trunk/octave-forge/main/database/src/Makefile
   M /trunk/octave-forge/main/database/src/configure.base

fix database/mysql support on Fedora and CentOS (thanks to Wim Crols)


You can checkout the latest release before the removal with:


svn checkout http://svn.code.sf.net/p/octave/code/trunk/octave-forge/main/database@11578


Carnë

Carnë Draug <carandraug>
Group Member
Tue 15 Jan 2013 09:33:29 PM UTC, original submission:  

Initially, it was not possible to compile database-1.0.4
I was running Debian|Wheezy packages, but see later text.

I still have some problems, and have not yet tested whether
the package as compiled works with octave pkg, so this is still a
work in progress.

I have mysql on this system, the report says mysql.h is not found,
so that is on my ToDo list.

I also have postgresql and sqlite3 - these get compiled into the
package. the work needed is described below.


patch sqlite3_filtered.h
-int sqlite3_auto_extension(void *xEntryPoint);
+int sqlite3_auto_extension(void (*xEntryPoint)(void));


Then, in /database-1.0.4/src run

swig -c++ -octave sqlite3.i
swig -c++ -octave postgres.i
mv postgres_wrap.cxx postgres_wrap.cpp
mv sqlite3_wrap.cxx sqlite3_wrap.cpp


patch postgres_wrap.cpp and sqlite3_wrap.cpp with this

 #define SWIG_OCT_SEGF_HACK_ATEXIT_FCN(NAME) _SWIG_OCT_SEGF_HACK_ATEXIT_FCN(NAME)
+#include <cstdlib>
 void SWIG_OCT_SEGF_HACK_ATEXIT_FCN(SWIG_name)(void) {
-  _exit(exit_status);
+  _Exit(exit_status);
 }
 #endif


I need a workaround because of this error

sqlite3_wrap.cpp: In function ‘octave_value_list _wrap_sqlite3_vmprintf(const octave_value_list&, int)’:
sqlite3_wrap.cpp:2943:34: error: invalid array assignment


I do not sqlite3 at this time so comment out the problem

      /*      arg2 = *((va_list *)(argp2));    # fixme - ral */


To get this to compile, I had to install
liboctave-3.2.4 - it was the nearest I had to the version of
the database package.

./autogen.sh
./configure
 make


I had earlier tried liboctave-dev_3.6.2-2_amd64.deb but it
failed with this error:

In file included from /usr/include/octave-3.6.2/octave/../octave/oct.h:31:0,
                 from postgres_wrap.cpp:153:
/usr/include/octave-3.6.2/octave/../octave/config.h:3052:25: error: multiple types in one declaration
/usr/include/octave-3.6.2/octave/../octave/config.h:3052:25: error: declaration does not declare anything [-fpermissive]


To try to determine the cause of the error, I replaced
the /octave-3.6.2/octave directory with that from
octave-3.2.4/octave, confirmed that that compiled, and began
replacing the old files with new. When all the files were
copied across, the package again compiled.

When I revert back to /octave-3.6.2/octave, the error returns.

I attach two gzipped files :
octave - this is the vanilla /octave-3.6.2/octave it fails.
octave.one - this is the /octave-3.6.2/octave with some old files. it compiles.

ToDo - test the compiled package with octave and pkg ;-)

Anonymous

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #27307:  temp.make-mysql.txt added by None (44KiB - text/plain)
file #27277:  octave.one.tar.gz added by None (492KiB - application/gzip)
file #27276:  octave.tar.gz added by None (574KiB - application/gzip)

 

Depends on the following items: None found

Digest:
   bug dependencies.

 

Carbon-Copy List
  • -email is unavailable- added by None (Submitted the item)
  •  

    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 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-02-13 carandraug StatusNone Invalid / Not an Octave Bug
        Open/ClosedOpen Closed
    2013-01-21 None Attached File- Added temp.make-mysql.txt, #27307
    2013-01-17 rik5 Carbon-CopyRemoved 72865 -
    2013-01-17 rik5 CategoryLibraries Octave Package
    2013-01-17 jordigh Dependencies- bugs #38106 is dependent
    2013-01-15 None Attached File- Added octave.tar.gz, #27276
        Attached File- Added octave.one.tar.gz, #27277

    Back to the top

    Powered by Savane 3.13-3230.
    Corresponding source code