[Top][All Lists]

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

Re: Compiling octave with MSVC

From: John W. Eaton
Subject: Re: Compiling octave with MSVC
Date: Tue, 10 Oct 2006 16:10:12 -0400

On 10-Oct-2006, Michael Goffioul wrote:

| The problem is more about auconf, which (I guess) cannot cope with MSVC 
| (object suffix,
| compiler flags...).

What about using something like cccl (http://cccl.sourceforge.net) as
a wrapper script to translate gcc-like compiler flags to MSVC options?

| For instance, in mx-op-defs.h, I had to rewrite the NDS_CMP_OP macros as 
| the following:
| #define NDS_CMP_OP2(F, OP, ND, NDC, S, SC, SPEC1, SPEC2) \
|   boolNDArray \
|   F (const ND& m, const S& s) \
|   { \
|     boolNDArray r; \
|  \
|     int len = m.length (); \
|  \
|     r.resize (m.dims ()); \
|  \
|     for (int i = 0; i < len; i++) \
|       r.elem(i) = operator OP <SPEC1,SPEC2> (NDC (m.elem(i)), SC (s)); \
|  \
|     return r; \
|   }

OK, what are SPEC1 and SPEC2 defined to be?  The types of the
operands?  Although it seems much more natural to write

  x OP y

instead of 

  operator OP <T1, T1> (x, y)

it is not horrible, especially since it is buried in a macro.  Please
go ahead and submit the patches for this change separately from the
rest of the changes.

| One possible solution is to prefix exported functions with EXTERN macro 
| that you can define
| to "extern" under UNIX and "__declspec(dllexport/dllimport)" under 
| Win32. For classes, it's
| a little bit tricky as the modifier must be located after the "class" 
| keyword, and you can't put
| "extern" there.

Please post an example of one (or two) header file(s) that you have
modified so I can see precisely what it is that you need to do for
MSVC.  It would be helpful if the code you post has examples for both
functions and classes that need to be exported.



reply via email to

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