[Pkg-octave-devel] Building semidef_prog with GCC 4.3

Rafael Laboissiere rafael at debian.org
Sun Feb 24 10:03:39 UTC 2008


Hi Stephen and Lieven,

This may be of interest to you: In the process of updating the Debian
semidef-oct package, based on your semidef_prog software, we applied the two
patches attached below in order to build it against the GCC 4.3 suite, which
will eventually become the official version in Debian for the development of
packages.

Cheers,

-- 
Rafael Laboissiere

-------------- next part --------------
#! /bin/sh /usr/share/dpatch/dpatch-run
## 50_strstream-namespace-std.dpatch by Rafael Laboissiere <rafael at debian.org>
##
## DP: 1) Include <strstream> instead of <strstream.h>, since the later is 
## DP:    not found by g++ v3.3.5
## DP: 2) Use ostrstream in std namespace

@DPATCH@

--- semidef-oct-2003.orig/SRC/get_matrix.cc
+++ semidef-oct-2003/SRC/get_matrix.cc
@@ -17,7 +17,7 @@
   if( !( arg.is_numeric_type() 
 	&& (arg.is_matrix_type() || arg.is_scalar_type ())) )
   {
-    ostrstream errmesg;
+    std::ostrstream errmesg;
     errmesg << caller << "expecting real matrix for argument" 
 	<< argnum << ends;
     error(errmesg.str());
--- semidef-oct-2003.orig/SRC/get_real_scalar.cc
+++ semidef-oct-2003/SRC/get_real_scalar.cc
@@ -11,7 +11,7 @@
 	int argnum, int signflg, int& errflg)
 {
   double retval = 0;
-  ostrstream errmesg;
+  std::ostrstream errmesg;
   
   if ( !( arg.is_real_type() && arg.is_scalar_type() ) )
   {
--- semidef-oct-2003.orig/SRC/get_vector.cc
+++ semidef-oct-2003/SRC/get_vector.cc
@@ -15,7 +15,7 @@
        << argnum << ", errflg=" << errflg << endl;
   #endif
   ColumnVector retval(0);
-  ostrstream errmesg;
+  std::ostrstream errmesg;
 
   if(arg.is_empty() )
     return retval;
--- semidef-oct-2003.orig/SRC/ocst.h
+++ semidef-oct-2003/SRC/ocst.h
@@ -8,7 +8,7 @@
 #include <iostream.h>
 #include <math.h>
 #include <string.h>
-#include <strstream.h>
+#include <strstream>
 #include <utils.h>
 
 #include <octave/defun-dld.h>
--- semidef-oct-2003.orig/SRC/sp.cc
+++ semidef-oct-2003/SRC/sp.cc
@@ -10,7 +10,7 @@
 #include <iostream.h>
 #include <math.h>
 #include <string.h>
-#include <strstream.h>
+#include <strstream>
 #include <utils.h>
 
 #include <octave/defun-dld.h>
@@ -417,7 +417,7 @@
   }
 
   // information string output
-  ostrstream infostr;
+  std::ostrstream infostr;
   switch (info) 
   {
   case 1:
-------------- next part --------------
#! /bin/sh /usr/share/dpatch/dpatch-run
## 60_iostream-g++-4.3.dpatch by Rafael Labossiere <rafael at debian.org>
##
## DP: Include iostream instead of iostream.h and use namespace std:: for
## DP: ends and ostream.  This makes the package buid correctly with GCC 4.3

@DPATCH@

--- semidef-oct-2003.orig/SRC/sp.cc
+++ semidef-oct-2003/SRC/sp.cc
@@ -7,7 +7,7 @@
 //#define DEBUG_INPUT_PARAMETERS
 
 #include <octave/config.h>
-#include <iostream.h>
+#include <iostream>
 #include <math.h>
 #include <string.h>
 #include <strstream.h>
@@ -440,7 +440,7 @@
     #endif
     infostr << "error occurred in sp"; 
   }
-  infostr << ends;
+  infostr << std::ends;
 
   // time
   ColumnVector time_data(3);
--- semidef-oct-2003.orig/SRC/get_real_scalar.cc
+++ semidef-oct-2003/SRC/get_real_scalar.cc
@@ -16,7 +16,7 @@
   if ( !( arg.is_real_type() && arg.is_scalar_type() ) )
   {
     errmesg << caller  << "argument " << argnum 
-	<< " must be a real scalar" << ends;
+	<< " must be a real scalar" << std::ends;
     error(errmesg.str());
     errflg = 1;
     return retval;
@@ -29,7 +29,7 @@
     {
       errmesg << caller  << "argument " << argnum
 	<< " = " << retval 
-        << " must be a nonnegative real scalar" << ends;
+        << " must be a nonnegative real scalar" << std::ends;
       error(errmesg.str());
       errflg = 1;
     }
@@ -39,7 +39,7 @@
     {
       errmesg << caller  << "argument " << argnum
 	<< " = " << retval 
-        << " must be a positive real scalar" << ends;
+        << " must be a positive real scalar" << std::ends;
       error(errmesg.str());
       errflg = 1;
     }
--- semidef-oct-2003.orig/SRC/get_matrix.cc
+++ semidef-oct-2003/SRC/get_matrix.cc
@@ -19,7 +19,7 @@
   {
     ostrstream errmesg;
     errmesg << caller << "expecting real matrix for argument" 
-	<< argnum << ends;
+            << argnum << std::ends;
     error(errmesg.str());
     errflg = 1;
     return retval;
--- semidef-oct-2003.orig/SRC/get_vector.cc
+++ semidef-oct-2003/SRC/get_vector.cc
@@ -30,7 +30,7 @@
   )
   {
     errmesg << caller << "expecting real vector for argument " 
-	<< argnum << ends;
+	<< argnum << std::ends;
     error(errmesg.str());
     errflg = 1;
     return retval;
@@ -39,7 +39,7 @@
   {
     errmesg << caller << "argument " << argnum << " (" 
 	<< arg.rows() << "x" << arg.columns() << ") must be a vector" 
-	<< ends;
+	<< std::ends;
     error(errmesg.str());
     errflg = 1;
     return retval;
--- semidef-oct-2003.orig/SRC/ocst.h
+++ semidef-oct-2003/SRC/ocst.h
@@ -5,7 +5,7 @@
 
 #include <octave/config.h>
 
-#include <iostream.h>
+#include <iostream>
 #include <math.h>
 #include <string.h>
 #include <strstream.h>
@@ -66,7 +66,7 @@
 {
   return (mat.rows() == mat.columns()) ? true : false;
 }
-ostream& operator<<(ostream&,const string_vector&);
+std::ostream& operator<<(std::ostream&,const string_vector&);
 Octave_map pack(const ColumnVector&, const string_vector&, const string_vector&,
 	double tsam=1);						//FIR
 Octave_map pack(const Matrix&, const Matrix&, const Matrix&, const Matrix&,


More information about the Pkg-octave-devel mailing list