[Top][All Lists]

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

Compiling Octave with something other than G++

From: John W. Eaton
Subject: Compiling Octave with something other than G++
Date: Fri, 24 Mar 2000 03:38:47 -0600

On 4-Feb-2000, I wrote:

| In the last few days, I've spent a lot of time compiling the
| bleeding-edge version of Octave with the Sun C++ compiler that I have
| access to.  With the following exceptions, I'm able to compile all of
| it. [...]

The list of exceptions is now just

  1. Formatted input using *scanf functions does not work.  It should
     not be too hard to fix, but someone who cares will have to do the
     work.  I refuse to waste my time working on it when a reasonable
     alternative like istream::scan exists in the GNU iostream library.

  2. To make dynamic linking work, it may be necessary to change the
     code in that looks for symbol names since it
     assumes G++-syle name mangling, which is likely different for
     other compilers.  A configure check would be nice.  I'm also not
     planning to work on this project, since I can just use G++.

Even so, I've been able to compile a working (except for the two
things above) binary on a Sun system using the Sun compilers.

There are a few things that have to be worked around by hand:

  * You have to run configure with

      CC=cc CXX=CC ./configure --with-f77

  * After running configure, you must change the compiler option for
    generating dependency information from -M to -xM.

  * The <climits> header file on the system I used was broken.  It
    needs a

      #ifdef __cplusplus
      extern "C" {

    at the top.

  * On the system I used, the C++ function

      const void *std::memchr ()

    was not defined.  I defined a dummy version in one of the source
    files and was able to finish linking.

  * Template instantiation is a hassle, since as far as I can tell,
    there is no compiler option to make it work the same as with G++.
    I used a combination of

      -instances=explicit  for files that really are for instantiating
                           templates (things like, etc.).

      -instances=static    for files that instantiate some template
                           functions but that don't need to export
                           them ( and some others).

    I determined which files needed which flags by trial and error.
    If someone has a better solution, let me know.

I thought I would post here since people on the list might be
interested in the progress, but I'd like to move future discussions
about this to the octave-maintainers list.

Now, I could also use someone who is willing to at least compile the
bleeding-edge sources on a regular basis with the Sun (or some other
nearly ANSI C++ compiler other than G++) so that we can keep the
sources close to conforming.



Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:
How to fund new projects:
Subscription information:

reply via email to

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