FW: [S] Compiling Rpart - Visual C++

Suzanne Cashman (scashman@empnet.com)
Tue, 19 May 1998 14:10:00 -0700


In response to my query for why rpart would not compile in Visual C++, Prof
Brian Ripley [SMTP:ripley@stats.ox.ac.uk] responded that there is a problem
with one of the variable names. The variable "complex" should be renamed
"complx". In addition, the %SHOME%\lib\Sqpe.lib library must be included
to link the dll. In addition, Matt Calder [calder@stat.colostate.edu]
shared that the C++ compilers are much pickier than C compilers. Perhaps
the numerous warnings are due to these higher standards.
Thank you both for your help!
-Suzanne

-----Original Message-----
From: Prof Brian Ripley [SMTP:ripley@stats.ox.ac.uk]
Sent: Thursday, May 14, 1998 2:43 PM
To: Suzanne Cashman
Cc: therneau@mayo.edu
Subject: Re: [S] Compiling Rpart - Visual C++

I have just tried with Visual C++ 4.2, using the source in my Windows
version of rpart:
D:\RP\rp8\RPART\src>set SHOME=C:\packages\splus4
D:\RP\rp8\RPART\src>cl /MT /Ox /D "WIN32" /I%SHOME%\include /c rpart.c
Microsoft (r) 32-bit C/C++ Optimizing Compiler Version 10.20.6166 for 80x86
Copyright (c) Microsoft Corp 1984-1996. All rights reserved.
rpart.c
rpart.c(1991) : error C2039: '_complex' : is not a member of '__unnamed'
rpart.c(2068) : error C2039: '_complex' : is not a member of '__unnamed'
rpart.c(2200) : warning C4142: benign redefinition of type
rpart.c(2590) : error C2039: '_complex' : is not a member of '__unnamed'
Alter complex to complx, repeat
D:\RP\rp8\RPART\src>link /dll /out:rpart.dll rpart.obj
%SHOME%\lib\Sqpe.lib
This seems to work, although I did very little testing.
[Terry: using complex as a variable name seems not a good idea.]
The present version of rpart relies essentially on S: writing a C main
seems a fairly major undertaking to me. I just insert code in the C
routines to print out a lot of details.

--
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

On Thu, 14 May 1998, Suzanne Cashman wrote: > I am trying to make a few adjustments to Rpart & then create a dll to > reference from S+. So far - I haven't tried to make any changes, but am > just trying to compile rpart using MS Visual C++. In compiling, I received > many errors to the effect that it didn't understand the S references (ie > S_alloc etc.) So I added S.h to the include list & a path to it in the > include directories. This helped with a few of the errors, but left > others. Almost all of the warnings are "conversion from 'double' to 'int'" > and there is an error for redefining malloc(). Has anyone else tried to > use rpart with MS Visual C++. What changes did you have to make to get it > to compile? > > Once this program is compiled. Is there a way to run it in C, by simply > creating a main() which calls rpart()? What S+ libraries will I have to > link to add to allow it to run? I would like to be able to walk through > the program interactively so that I can test my changes. >

----------------------------------------------------------------------- This message was distributed by s-news@wubios.wustl.edu. To unsubscribe send e-mail to s-news-request@wubios.wustl.edu with the BODY of the message: unsubscribe s-news