MathGroup Archive 1997

[Date Index] [Thread Index] [Author Index]

Search the Archive

SUMMARY re:linking C-program with Mathematica

  • To: mathgroup at smc.vnet.net
  • Subject: [mg9503] SUMMARY re:[mg9389] linking C-program with Mathematica
  • From: "P.J. Hinton" <paulh>
  • Date: Sat, 8 Nov 1997 23:04:34 -0500
  • Organization: Wolfram Research, Inc.
  • Sender: owner-wri-mathgroup at wolfram.com

We tracked down Dominique Schreurs' MathLink problem, and I think 
Dominique has found a solution.

If you recall the orginal problem statement:

> > I would like to call own-developed C-programs from within  Mathematica.
> > Can anyone give me a simple example ? Since I'm a relatively new user
> > of Mathematica, the explanation in the manual is not sufficiently clear
> > to me.

When I asked the user for additional information, I found out that the
user was trying to build the addtwo example that comes with the
MathLink Developer's Kit on an HP PA-RISC machine running HP-UX 10.20.
The compiler in use was the standard HP cc compiler, version A.03.00. 
The following error messages resulted:

(Bundled) cc: "/imec/asp/schreurs/CompilerAdditions/mathlink.h", line
448: warning 5: "const" will become a keyword. (Bundled) cc:
"/imec/asp/schreurs/CompilerAdditions/mathlink.h", line 448: error
1000: Unexpected symbol: "unsigned". (Bundled) cc:
"/imec/asp/schreurs/CompilerAdditions/mathlink.h", line 449: warning 5:
"const" will become a keyword. (Bundled) cc:
"/imec/asp/schreurs/CompilerAdditions/mathlink.h", line 449: error
1000: Unexpected symbol: "unsigned".

The problem appeared to be that the neither the Makefile nor the user
was passing the appropriate flags to the C compiler to make it
recognize ANSI C. 

Rather than dealing with figuring out which flags needed to be used, the
user has switched over to using the GNU compiler, which he says seems
to work okay.

This ties in with my original advice:

> 1) Make sure you know how your compiler works...

The Developer Kit system notes give some general guidelines about what
to do in the case that you are not using an ANSI compiler, but
ultimately, the user will have to double check that the correct flags
are being passed.

--
P.J. Hinton	
Mathematica Programming Group           paulh at wolfram.com Wolfram
Research, Inc.                  http://www.wolfram.com/~paulh/
Disclaimer: Opinions expressed herein are those of the author alone.


  • Prev by Date: Re: Book recommendation for
  • Next by Date: Re: Lie symmetry package in mathematica
  • Previous by thread: Re: Frontend bug
  • Next by thread: The option AxesOrigin