help-octave
[Top][All Lists]
Advanced

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

Re: compiling with Sun Studio


From: Jim Langston
Subject: Re: compiling with Sun Studio
Date: Thu, 30 Aug 2007 08:54:20 -0400
User-agent: Thunderbird 1.5.0.8 (X11/20061204)

The plotting problem is that with Open Solaris the version of gnuplot that comes
in /opt/sfw/bin is 3.7 , and needs to be a later release. I pulled and installed 4.2 from
Sunfreeware and plotting is now fine.

Jim

///////////////////////////////

Jim Langston wrote:
Thanks John, that did the job - you wouldn't know what this means when running the simple example:

bash-3.00$ octave
GNU Octave, version 2.9.13
Copyright (C) 2007 John W. Eaton and others.
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'.

Octave was configured for "i386-pc-solaris2.11".

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).

For information about changes from previous versions, type `news'.

octave:1> A = [ 1, 1, 2; 3, 5, 8; 13, 21, 34 ]
A =

    1    1    2
    3    5    8
   13   21   34

octave:2> B = rand (3, 2);
octave:3> B
B =

   0.57366   0.93030
   0.69102   0.30208
   0.34980   0.91603

octave:4> 2 * A
ans =

    2    2    4
    6   10   16
   26   42   68

octave:5> A * B
ans =

    1.9643    3.0644
    7.9745   11.6295
   33.8624   49.5826

octave:6> A' * A
ans =

    179    289    468
    289    467    756
    468    756   1224

octave:7> A \ B
warning: matrix singular to machine precision, rcond = 1.50423e-18
warning: attempting to find minimum norm solution
ans =

   0.86976   1.85329
  -0.73387  -1.56583
   0.13589   0.28746

octave:8> function xdot = f (x, t)
> r = 0.25;
> k = 1.4;
> a = 1.5;
> b = 0.16;
> c = 0.9;
> d = 0.8;
> xdot(1) = r*x(1)*(1 - x(1)/k) - a*x(1)*x(2)/(1 + b*x(1));
> xdot(2) = c*a*x(1)*x(2)/(1 + b*x(1)) - d*x(2);
> endfunction
octave:9>      x0 = [1; 2];

octave:10> octave:10> t = linspace (0, 50, 200)';
octave:11> x = lsode ("f", x0, t);
octave:12> plot (t, x)
         line 0: undefined variable: title

         Cannot open load file '--version'
         line 0: (No such file or directory)

error: Version numbers must be a single row
error: evaluating if command near line 73, column 3
error: called from `compare_versions' in file `/usr/local/share/octave/2.9.13/m/miscellaneous/compare_versions.m'
error: evaluating static command near line 35, column 5
error: evaluating if command near line 29, column 3
error: called from `__go_draw_axes__' in file `/usr/local/share/octave/2.9.13/m/plot/__go_draw_axes__.m'
error: evaluating switch command near line 57, column 4
error: evaluating for command near line 55, column 2
error: evaluating if command near line 37, column 7
error: evaluating if command near line 30, column 5
error: evaluating if command near line 29, column 3
error: called from `__go_draw_figure__' in file `/usr/local/share/octave/2.9.13/m/plot/__go_draw_figure__.m'
error: evaluating if command near line 61, column 6
error: evaluating if command near line 58, column 4
error: evaluating if command near line 56, column 2
error: evaluating for command near line 55, column 7
error: evaluating if command near line 38, column 5
error: called from `drawnow' in file `/usr/local/share/octave/2.9.13/m/plot/drawnow.m'
octave:13> exit


Anyway - off to look at this.

Thanks again.

Jim

////////////////////////

John W. Eaton wrote:
On 29-Aug-2007, Jim Langston wrote:

| Don't know exactly what I need to do, I have looked at re-writing
| the class, but before I do, I wanted to make sure no one has attempted
| to get octave compiled with the Sun Studio compilers.
| 
| stlport4 tells the Sun compiler to use STLport's implementation of the
| standard library, which seems to be ok with the cast as written.
| 
| I have tried this:
| 
| class pid_equal
| {
| public:
| 
|   pid_equal (pid_t v) : val (v) { }
| 
|   bool operator () (const octave_child& oc) const { return oc.pid == val; }
|   bool operator () (const pid_equal& pid) const { return pid == val ; }
| 
| private:
| 
|   pid_t val;
| };
| 
| but this generates:
| 
| "sighandlers.cc", line 892: Error: Overloading ambiguity between 
| "operator==(const octave_int<long long>&, const octave_int<unsigned>&)" 
| and "operator==(const octave_int<unsigned>&, const octave_int<char>&)".

I don't think a simple modification to the pid_equal class is going to
fix the problem you are seeing.

Earlier, you wrote

  It is in sighandlers.cc, and I get this error:

  "./base-list.h", line 45: Error: Cannot cast from pid_equal to 
  bool(*)(const octave_child&).

so it seems that the remove_if function in the default library is
expecting a function pointer rather than a predicate class.  I don't
think that's the standard definition of remove_if.

How about the following patch?

jwe


  

src/ChangeLog: 2007-08-29 John W. Eaton <address@hidden> * base-list.h (octave_base_list::remove): Implement our own remove_if function here. Index: src/base-list.h =================================================================== RCS file: /cvs/octave/src/base-list.h,v retrieving revision 1.3 diff -u -u -r1.3 base-list.h --- src/base-list.h 26 Apr 2005 19:24:32 -0000 1.3 +++ src/base-list.h 29 Aug 2007 17:25:54 -0000 @@ -42,7 +42,27 @@ iterator erase (iterator pos) { return lst.erase (pos); } template <class P> - void remove_if (P pred) { lst.remove_if (pred); } + void remove_if (P pred) + { + // We would like to simply call + // + // lst.remove_if (pred); + // + // but the Sun Studio compiler chokes on that. + // + // FIXME -- this kluge should be removed at some point. + + iterator b = lst.begin (); + iterator e = lst.end (); + while (b != e) + { + iterator n = b; + n++; + if (pred (*b)) + erase (b); + b = n; + } + } void clear (void) { lst.clear (); }


-- 
/////////////////////////////////////////////

Jim Langston
Sun Microsystems, Inc.

(877) 854-5583 (AccessLine)
AIM: jl9594
address@hidden
  


-- 
/////////////////////////////////////////////

Jim Langston
Sun Microsystems, Inc.

(877) 854-5583 (AccessLine)
AIM: jl9594
address@hidden

reply via email to

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