Newsgroups: comp.parallel.pvm
From: eddemain@neumann.uwaterloo.ca (Erik Demaine)
Subject: Re: ScaLAPACK & C
Organization: University of Waterloo
Date: Thu, 30 May 1996 12:19:46 GMT
Message-ID: <Ds7wwy.FB5@undergrad.math.uwaterloo.ca>

Martin Bernreuther (kea9@stat15.bauingenieure.uni-stuttgart.de) wrote:
: Here on the HPPA workstations this works fine with the cc C-compiler.
: But I didn't have success with the CC C++-compiler. The function calls
: get changed! (something like __xxxx is added) This is what the error message
: tells me... (I think this compiler transforms the C++ code internally to
: C-code) So the same small test program (calling a C interface function of
: BLACS) worked with cc but didn't with CC!

This is to be expected, as noted by your responser.  You'll need have
prototypes like this:

	extern "C" {
	   void scalapack_foo (...);
	}

(Actually, it'll probably work with just the ...'s.  Do make sure that the
return values are in fact void.)

: Did anyone have the same Problems? (How about using the gcc GNU compiler?)

An alternative is to call everything from a C program and have the C++
program call the C program (of course, you will still need extern "C"
declarations).  You should have the same problem with g++.

Good luck,
Erik
--
Erik Demaine                 \/  e-mail: eddemain@neumann.uwaterloo.ca
Dept. of Computer Science    /\  URL   : http://barrow.uwaterloo.ca/~eddemain/
University of Waterloo       \/  Most jugglers do poorly while drunk, especially
Waterloo, ON Canada N2L 3G1  /\  in a large wavelength gravity field.

