I am building octave-forge on FreeBSD. There are some build problems, which I would like to start to articulate, one or two problems per email.

FreeBSD uses the very latest version of gcc-4.3.x for any program requiring fortran. It seems that this gcc is getting fussier and fussier, and so picks up many more errors. Also, I am building using the cutting edge FreeBSD-CURRENT, which creates even more problems, but problems which will eventually catch up to mainstream users.

I am the maintainer of the FreeBSD-port of octave-forge.

A lot of the problems will arise because FreeBSD defaults to octave-3.0.5. Octave-3.1.55 is available, but I can see users not wanting to use it.



Problem 1. Building octave-forge-engine. This has its own getline function, which seems to conflict with a built in definition of getline. I suggest renaming the function getline. The enclosed patch renames it to local_getline, but you could call it something else.

--- src/engGetFull.c.bak        2008-08-24 16:13:55.000000000 +0000
+++ src/engGetFull.c    2009-05-04 01:44:43.000000000 +0000
@@ -30,7 +30,7 @@
     flushjunk();
     sprintf( buf, "exist(\"%s\")\n", name );
     putline( buf );
-    getline( buf );
+    local_getline( buf );
     flushprompt( 0 );
     sscanf( buf, " ans = %d", &i );
 
@@ -39,20 +39,20 @@
       sprintf( buf, "save -ascii \"-\" %s\n", name );
       putline( buf );
 
-      getline( buf );
+      local_getline( buf );
       sscanf( buf, "%c %s %s", &comm, str1, str2 );
       if( comm != '#' )
        return retval;
       if( !strcmp( "Created", str1 ) )  /* New in Octave 2.0.14 */
       {
-       getline( buf );
+       local_getline( buf );
        sscanf( buf, "%c %s %s", &comm, str1, str2 );
       }
       if( strcmp( "name:", str1 ) )
        return retval;
       if( strcmp( name, str2 ) )
        return retval;
-      getline( buf );
+      local_getline( buf );
       sscanf( buf, "%c %s %s %s", &comm, str1, str2, str3 );
       if( comm != '#' )
        return retval;
@@ -66,18 +66,18 @@
          *n = 1;
          *pr = mxCalloc( 1, sizeof( **pr ) );
          *pi = mxCalloc( 1, sizeof( **pi ) );
-         getline( buf );
+         local_getline( buf );
          sscanf( buf, "(%lf,%lf)", &pr[0][0], &pi[0][0] );
        }
        else
        {
          if( !strcmp( "matrix", str3 ) )
          {
-           getline( buf );
+           local_getline( buf );
            sscanf( buf, "%c %s %d", &comm, str1, m );
            if( strcmp( "rows:", str1 ) )
              return retval;
-           getline( buf );
+           local_getline( buf );
            sscanf( buf, "%c %s %d", &comm, str1, n );
            if( strcmp( "columns:", str1 ) )
              return retval;
@@ -85,7 +85,7 @@
            *pi = mxCalloc( (*m)*(*n), sizeof( **pi ) );
            for( i=0; i<*m; i++ )
            {
-             getline( buf );
+             local_getline( buf );
              ptr = strtok( buf, " " );
              for( j=0; j<*n; j++ )
              {
@@ -106,18 +106,18 @@
          *n = 1;
          *pr = mxCalloc( 1, sizeof( **pr ) );
          *pi = NULL;
-         getline( buf );
+         local_getline( buf );
          sscanf( buf, "%lf", &pr[0][0] );
        }
        else
        {
          if( !strcmp( "matrix", str2 ) )
          {
-           getline( buf );
+           local_getline( buf );
            sscanf( buf, "%c %s %d", &comm, str1, m );
            if( strcmp( "rows:", str1 ) )
              return retval;
-           getline( buf );
+           local_getline( buf );
            sscanf( buf, "%c %s %d", &comm, str1, n );
            if( strcmp( "columns:", str1 ) )
              return retval;
@@ -125,7 +125,7 @@
            *pi = NULL;
            for( i=0; i<*m; i++ )
            {
-             getline( buf );
+             local_getline( buf );
              ptr = strtok( buf, " " );
              for( j=0; j<*n; j++ )
              {
--- src/engif.c.bak     2008-08-24 16:13:55.000000000 +0000
+++ src/engif.c 2009-05-04 01:44:43.000000000 +0000
@@ -78,7 +78,7 @@
 }
 
 
-int getline( char* buf )
+int local_getline( char* buf )
 {
   int i;
 
@@ -95,7 +95,7 @@
   buf[i] = '\0';
 
 #ifdef DEBUGAPI
-  printf( "getline: %s", buf );
+  printf( "local_getline: %s", buf );
 #endif
 
   return 0;
--- src/engif.h.bak     2008-08-24 16:13:55.000000000 +0000
+++ src/engif.h 2009-05-04 01:44:43.000000000 +0000
@@ -1,6 +1,6 @@
 int flushprompt( int outkey );
 int flushjunk( void );
-int getline( char* buf );
+int local_getline( char* buf );
 int putline( char* buf );
 int openpipes( void );
 int closepipes( void );
------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
Octave-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/octave-dev

Reply via email to