gonzalo

16 Reputation

2 Badges

13 years, 139 days

MaplePrimes Activity


These are replies submitted by gonzalo

Axel,

Forgive me the delay in answering, but I was waiting for authorization to purchase a Maple license to test it locally, with 'full control' over the license and installation.

I have just installed Maple locally, built the test code, and it works OK. So, definitely, there must be a problem with the license/installation details on the server we were using Maple from, which does not enable all of Maple's features.

If I get to know which is the cause of the problem, I'll follow up this posts with the details, just in case any other user happens to run into a similar problem, but for the time being, I have not been able to determine what exactly is happening.

Thanks for the time you dedicated to aid us, we really appreciate it!

gonzalo

Thanks, Axel, for your reply!

As far as the application I am concerned with does, it 'asks' Maple to redirect its output to stdout, so then it can 'capture' the output (in this case, the generated code).

In the meantime between my post and your reply, I have tried to build and run the example provided with Maple that does something similar to my application to acess Maple from C code. The source code for the example can be found at $MAPLE_ROOT/samples/OpenMaple/cmaple/omexample.c

This example provides a 'fake' Maple command prompt, and underneath, uses the EvalMapleStatement() function to ask the 'real' Maple to perform the command typed at the prompt, and return the result.

Here is the compile command line, output warnings (do not care for them) and sample session with the example program (I tried with and without -lm -lc -lgmp -lmaple within the switches, to try if there was any difference; there was not):

---------------------------------------

sancheg@mills:~/Projects/virtlab/svn/mapleclient/src$  gcc -g -Wall -Wchar-subscripts -Wpointer-arith -Wcast-align -Wsign-compare -Wno-switch -I./ -I/usr/local/maple11/extern/include -L./ -L/usr/local/maple11/bin.X86_64_LINUX -Xlinker -rpath -Xlinker /usr/local/maple11/bin.X86_64_LINUX -lmaplec -lc -lm -lgmp -lmaple omexample.c -o omexample
omexample.c: In function 'main':
omexample.c:115: warning: implicit declaration of function 'strlen'
omexample.c:115: warning: incompatible implicit declaration of built-in function 'strlen'
omexample.c:115: warning: implicit declaration of function 'isspace'

sancheg@mills:~/Projects/virtlab/svn/mapleclient/src$ ./omexample
    |\^/|     Maple (Example Program)
._|\|   |/|_. Copyright (c) Maplesoft, a division of Waterloo Maple Inc. 2004
 \OPENMAPLE/  All rights reserved. Maple and OpenMaple are trademarks of
 <____ ____>  Waterloo Maple Inc.
      |       Type ? for help.
> ?
> ?CodeGeneration
> 3*4;
12
> with(CodeGeneration);
with(CodeGeneration)
> CodeGeneration[C](2*x^3,resultname=y);
CodeGeneration[C](2*x^3,resultname = y)
> quit;
kilobytes used=45, alloc=31, time=0.00

---------------------------------------

As you see, the simple arithmetic operation is carried out, but any other function does not. Not even the '?' can trigger the help messages. And the output from Maple is effectively being 'captured' and displayed, which you can guess by the '12' answer for the '3*4;' command.

So it seems that it is not only the CodeGeneration[C]() command that does not work.

There must be some problem with Maple itself in the system I am running it -perhaps licensing issues- that the linking process for the application is not aware of, but that at runtime impedes the execution of some Maple toolboxes or modules or whatever (I have never used Maple before, as you will have already noticed). The same commands typed at the 'real' Maple command line work OK.

I will anyway check the possibiity that the output is being misdirected. The thing that stil bothers me is that the exact same code worked perfectly OK before, and I have found no differences in the commands between Maple v9.5 and Maple v.11..

Thanks,

gonzalo

Page 1 of 1