I'm trying to get Octave-3.6.4 working on Mavericks, but I wound up with the following (after tweaking the C++ options to get past an initial error):
libtool: compile: flag-sort -r g++ -std=c++11 -DHAVE_CONFIG_H -I. -I.. -I../libgnu -I../libgnu -I../libcruft/misc -I../liboctave -I../liboctave -I. -I. -I/sw/include -I/sw/include -O3 -MD -I/usr/X11/include -DHAVE_CONFIG_H -I/sw/include -I/sw/include/freetype2 -I/sw/include -I/sw/include -Wall -W -Wshadow -Wold-style-cast -Wformat -Wpointer-arith -Wwrite-strings -Wcast-align -Wcast-qual -O3 -MD -I/usr/X11/include -D_THREAD_SAFE -pthread -O3 -MD -I/usr/X11/include -MT liboctinterp_la-ls-mat4.lo -MD -MP -MF .deps/liboctinterp_la-ls-mat4.Tpo -c ls-mat4.cc -fno-common -DPIC -o .libs/liboctinterp_la-ls-mat4.o In file included from ls-mat4.cc:50: In file included from ./defun.h:30: In file included from ./defun-int.h:28: In file included from ./ov-builtin.h:28: In file included from ./ov-fcn.h:35: In file included from ./symtab.h:34: ../liboctave/regexp.h:90:3: warning: 'opts' defined as a struct here but previously declared as a class [-Wmismatched-tags] struct opts ^ ../liboctave/regexp.h:40:3: note: did you mean struct here? class opts; ^~~~~ struct In file included from ls-mat4.cc:56: In file included from ./ov-cell.h:39: ./ov-base-mat.h:95:8: warning: 'octave_base_matrix<Cell>::assign' hides overloaded virtual function [-Woverloaded-virtual] void assign (const octave_value_list& idx, const MT& rhs); ^ ./ov-cell.h:49:22: note: in instantiation of template class 'octave_base_matrix<Cell>' requested here octave_cell : public octave_base_matrix<Cell> ^ ./ov-base.h:277:16: note: hidden overloaded virtual function 'octave_base_value::assign' declared here virtual void assign (const std::string&, const octave_value&) { } ^ In file included from ls-mat4.cc:56: In file included from ./ov-cell.h:39: ./ov-base-mat.h:97:8: warning: 'octave_base_matrix<Cell>::assign' hides overloaded virtual function [-Woverloaded-virtual] void assign (const octave_value_list& idx, typename MT::element_type rhs); ^ ./ov-base.h:277:16: note: hidden overloaded virtual function 'octave_base_value::assign' declared here virtual void assign (const std::string&, const octave_value&) { } ^ ls-mat4.cc:608:10: error: no viable conversion from 'std::ostream' (aka 'basic_ostream<char>') to 'bool' return os; ^~ 3 warnings and 1 error generated. make[1]: *** [liboctinterp_la-ls-mat4.lo] Error 1 ############### The relevant bit of ls-mat4.cc is: // Save the data from TC along with the corresponding NAME on stream OS // in the MatLab version 4 binary format. bool save_mat_binary_data (std::ostream& os, const octave_value& tc, const std::string& name) { int32_t mopt = 0; mopt += tc.is_sparse_type () ? 2 : tc.is_string () ? 1 : 0; oct_mach_info::float_format flt_fmt = oct_mach_info::native_float_format ();; mopt += 1000 * float_format_to_mopt_digit (flt_fmt); os.write (reinterpret_cast<char *> (&mopt), 4); octave_idx_type len; int32_t nr = tc.rows (); int32_t nc = tc.columns (); if (tc.is_sparse_type ()) { len = tc.nnz (); uint32_t nnz = len + 1; os.write (reinterpret_cast<char *> (&nnz), 4); uint32_t iscmplx = tc.is_complex_type () ? 4 : 3; os.write (reinterpret_cast<char *> (&iscmplx), 4); uint32_t tmp = 0; os.write (reinterpret_cast<char *> (&tmp), 4); } else { os.write (reinterpret_cast<char *> (&nr), 4); os.write (reinterpret_cast<char *> (&nc), 4); int32_t imag = tc.is_complex_type () ? 1 : 0; os.write (reinterpret_cast<char *> (&imag), 4); len = nr * nc; } // LEN includes the terminating character, and the file is also // supposed to include it. int32_t name_len = name.length () + 1; os.write (reinterpret_cast<char *> (&name_len), 4); os << name << '\0'; if (tc.is_string ()) { unwind_protect frame; charMatrix chm = tc.char_matrix_value (); octave_idx_type nrow = chm.rows (); octave_idx_type ncol = chm.cols (); OCTAVE_LOCAL_BUFFER (double, buf, ncol*nrow); for (octave_idx_type i = 0; i < nrow; i++) { std::string tstr = chm.row_as_string (i); const char *s = tstr.data (); for (octave_idx_type j = 0; j < ncol; j++) buf[j*nrow+i] = static_cast<double> (*s++ & 0x00FF); } os.write (reinterpret_cast<char *> (buf), nrow*ncol*sizeof(double)); } else if (tc.is_range ()) { Range r = tc.range_value (); double base = r.base (); double inc = r.inc (); octave_idx_type nel = r.nelem (); for (octave_idx_type i = 0; i < nel; i++) { double x = base + i * inc; os.write (reinterpret_cast<char *> (&x), 8); } } else if (tc.is_real_scalar ()) { double tmp = tc.double_value (); os.write (reinterpret_cast<char *> (&tmp), 8); } else if (tc.is_sparse_type ()) { double ds; OCTAVE_LOCAL_BUFFER (double, dtmp, len); if (tc.is_complex_matrix ()) { SparseComplexMatrix m = tc.sparse_complex_matrix_value (); for (octave_idx_type i = 0; i < len; i++) dtmp [i] = m.ridx(i) + 1; os.write (reinterpret_cast<const char *> (dtmp), 8 * len); ds = nr; os.write (reinterpret_cast<const char *> (&ds), 8); octave_idx_type ii = 0; for (octave_idx_type j = 0; j < nc; j++) for (octave_idx_type i = m.cidx(j); i < m.cidx(j+1); i++) dtmp[ii++] = j + 1; os.write (reinterpret_cast<const char *> (dtmp), 8 * len); ds = nc; os.write (reinterpret_cast<const char *> (&ds), 8); for (octave_idx_type i = 0; i < len; i++) dtmp [i] = std::real (m.data(i)); os.write (reinterpret_cast<const char *> (dtmp), 8 * len); ds = 0.; os.write (reinterpret_cast<const char *> (&ds), 8); for (octave_idx_type i = 0; i < len; i++) dtmp [i] = std::imag (m.data(i)); os.write (reinterpret_cast<const char *> (dtmp), 8 * len); os.write (reinterpret_cast<const char *> (&ds), 8); } else { SparseMatrix m = tc.sparse_matrix_value (); for (octave_idx_type i = 0; i < len; i++) dtmp [i] = m.ridx(i) + 1; os.write (reinterpret_cast<const char *> (dtmp), 8 * len); ds = nr; os.write (reinterpret_cast<const char *> (&ds), 8); octave_idx_type ii = 0; for (octave_idx_type j = 0; j < nc; j++) for (octave_idx_type i = m.cidx(j); i < m.cidx(j+1); i++) dtmp[ii++] = j + 1; os.write (reinterpret_cast<const char *> (dtmp), 8 * len); ds = nc; os.write (reinterpret_cast<const char *> (&ds), 8); os.write (reinterpret_cast<const char *> (m.data ()), 8 * len); ds = 0.; os.write (reinterpret_cast<const char *> (&ds), 8); } } else if (tc.is_real_matrix ()) { Matrix m = tc.matrix_value (); os.write (reinterpret_cast<const char *> (m.data ()), 8 * len); } else if (tc.is_complex_scalar ()) { Complex tmp = tc.complex_value (); os.write (reinterpret_cast<char *> (&tmp), 16); } else if (tc.is_complex_matrix ()) { ComplexMatrix m_cmplx = tc.complex_matrix_value (); Matrix m = ::real (m_cmplx); os.write (reinterpret_cast<const char *> (m.data ()), 8 * len); m = ::imag (m_cmplx); os.write (reinterpret_cast<const char *> (m.data ()), 8 * len); } else gripe_wrong_type_arg ("save", tc, false); return os; } Any thoughts from C++ experts on how to coerce this? -- Alexander Hansen, Ph.D. Fink User Liaison My package updates: http://finkakh.wordpress.com/ ------------------------------------------------------------------------------ November Webinars for C, C++, Fortran Developers Accelerate application performance with scalable programming models. Explore techniques for threading, error checking, porting, and tuning. Get the most from the latest Intel processors and coprocessors. See abstracts and register http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk _______________________________________________ Fink-devel mailing list Fink-devel@lists.sourceforge.net List archive: http://news.gmane.org/gmane.os.apple.fink.devel Subscription management: https://lists.sourceforge.net/lists/listinfo/fink-devel