Page 1 of 1

Cannot open CCodeGenerator

Posted: Tue Mar 18, 2014 2:32 pm
by ejolson
I'm thinking about using Raspberry Pi to support a course on numerical analysis. Most programming would be done in C and Mathematica has C code generation facilities that would be useful.

http://reference.wolfram.com/mathematic ... #509267359

Specifically, I'm thinking of this example:

cFun = Compile[{{x}}, x^2 + Sin[x^2]];
Export[ "cFun.c", cFun, "C"]

However, I can't seem to get it to work. Instead I get the error

Get::noopen : Cannon open CCodeGenerator`.
Needs::nocont : Context CCodeGenerator` was not created when Needs was evaluated

So I am wondering, am I doing something wrong?

I'm using 2014-01-07-wheezy-raspbian.

If someone could verify whether this example works or not with their Pi I would greatly appreciate it.

Re: Cannot open CCodeGenerator

Posted: Tue Mar 18, 2014 10:10 pm
by DeeJay
Certainly not my area, but glancing at this page http://reference.wolfram.com/mathematic ... erate.html seems to suggest you might need

Code: Select all

Needs["CCodeGenerator`"]
first?

Re: Cannot open CCodeGenerator

Posted: Wed Mar 19, 2014 3:29 am
by dennisw
DeeJay wrote:Certainly not my area, but glancing at this page http://reference.wolfram.com/mathematic ... erate.html seems to suggest you might need

Code: Select all

Needs["CCodeGenerator`"]
first?
The Needs statement gives me the error messages reported by the OP.

Re: Cannot open CCodeGenerator

Posted: Wed Mar 19, 2014 7:56 pm
by ejolson
Ok, so this is confirmed. It appears a bug in the Raspberry Pi version of Mathematica that the CCodeGenerator package is missing. I've looked in

/opt/Wolfram/WolframEngine/10.0/SystemFiles

and there is no files that contain CCodeGenerator in them.

I wonder who the point of contact should be for reporting this bug?

Re: Cannot open CCodeGenerator

Posted: Tue Mar 25, 2014 8:45 pm
by alexatwri
ejolson wrote:Ok, so this is confirmed. It appears a bug in the Raspberry Pi version of Mathematica that the CCodeGenerator package is missing. I've looked in

/opt/Wolfram/WolframEngine/10.0/SystemFiles

and there is no files that contain CCodeGenerator in them.

I wonder who the point of contact should be for reporting this bug?
Mathematica on the Raspberry Pi is a subset of the desktop Mathematica product. There are many functions intentionally omitted at this time so they're not necessarily considered bugs but feature requests. Since this is a free distribution, we do not provide support on it, so the fastest way to get in touch with the team is to create a topic on the Wolfram Community Raspberry Pi group.

The CCodeGenerator is a relatively lightweight component, so it should be easy to add it in this case. We should be able to integrate it in a future update.

Re: Cannot open CCodeGenerator

Posted: Thu Mar 27, 2014 10:11 pm
by mob-i-l
alexatwri wrote:Mathematica on the Raspberry Pi is a subset of the desktop Mathematica product. There are many functions intentionally omitted at this time so they're not necessarily considered bugs but feature requests. Since this is a free distribution, we do not provide support on it, so the fastest way to get in touch with the team is to create a topic on the Wolfram Community Raspberry Pi group.
"And it’s the whole system. Nothing is left out. All 5000+ Wolfram Language functions. All capabilities of Mathematica and its notebook interface." http://blog.stephenwolfram.com/2013/11/ ... pberry-pi/

I believed this and told people this, but now I should contact a lot of people and say I was misinformed.

Re: Cannot open CCodeGenerator

Posted: Sat Mar 29, 2014 11:22 am
by ejolson
Ok. I have posted at Wolfram communities a feature request.

http://community.wolfram.com/groups/-/m ... h=MnluK0fd

I agree that it seems inconsistent to say nothing left out in the press release and then lots of things intentionally left out later.

For Mathematica to be useful on the Raspberry Pi for education at least what is left out needs to be clearly documented. Otherwise, like me, a student could become frustrated and discouraged because things don't work as the documentation suggests.

Re: Cannot open CCodeGenerator

Posted: Sun Mar 30, 2014 1:03 am
by dennisw
Something to keep in mind is that the current release of Mathematica for Raspberry Pi is referred to as a pilot release* and that this version (10) hasn't been released yet for other platforms. As such, I would consider it "beta" and not necessarily complete.

* in both
http://blog.wolfram.com/2013/11/21/putt ... pberry-pi/
and
http://www.wolfram.com/raspberry-pi/

Re: Cannot open CCodeGenerator

Posted: Sun Mar 30, 2014 9:41 am
by ejolson
The course targets computer science, mathematics and statistics students. Our goal is to learn how to develop efficient numerical codes that run in the Linux environment, which is standard on supercomputers. One technique we will explore is the use of a computer algebra system to generate error free C code. Preinstalled Mathematica and standard Linux programming tools in Raspbian make the Raspberry Pi look like a great resource to support the course. I sure hope this feature request gets sorted quickly.

Re: Cannot open CCodeGenerator

Posted: Wed Jun 11, 2014 4:47 pm
by ejolson
Is there any news on a version of Mathematica for the Pi with CCodeGenerator?

Re: Cannot open CCodeGenerator

Posted: Mon Jul 21, 2014 5:36 pm
by alexatwri
ejolson wrote:Is there any news on a version of Mathematica for the Pi with CCodeGenerator?
The update is currently going through QA and it includes CCodeGenerator. Should be out shortly.

Re: Cannot open CCodeGenerator

Posted: Sun Jul 27, 2014 3:54 am
by ejolson
Dear Alexa,

This is great news. Thanks for the update.

All the best,
Eric

Re: Cannot open CCodeGenerator

Posted: Tue Jul 29, 2014 9:43 am
by jardino
ejolson wrote:Ok. I have posted at Wolfram communities a feature request.

http://community.wolfram.com/groups/-/m ... h=MnluK0fd

I agree that it seems inconsistent to say nothing left out in the press release and then lots of things intentionally left out later.

For Mathematica to be useful on the Raspberry Pi for education at least what is left out needs to be clearly documented. Otherwise, like me, a student could become frustrated and discouraged because things don't work as the documentation suggests.
I thoroughly agree with that. It is acceptable that some features are omitted in this free version, but unreasonable that the omissions are not documented. I am self-studying Mathematica using the text by Roozbeh Hazrat that someone hereabouts recommended, but got stuck when I realised that

Code: Select all

DictionaryLookup[]
is not implemented. (More precisely, the dictionary files are not present.)

I understand that the dictionary files are probably large and have been elided to reduce the file size - but it would be nice to have been forewarned.

Alan.

Re: Cannot open CCodeGenerator

Posted: Fri Aug 01, 2014 3:22 pm
by emgi
In a headless server, only using cli I am tempted to do the following:
root@raspberrypi:/home/pi# apt-get purge wolfram-engine
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
wolfram-engine*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 454 MB disk space will be freed.
Do you want to continue [Y/n]?
Yes!!! :mrgreen:
Although disk space is not my primary concern, this is a lot to free up when you are never gonna use the program anyway.
Essentially i was triggered because my apt-get upgrade failed on the wolfram-engine.
For now I assume that failure to be due to my (cheap) flash card but it made me aware of the amount of space taken by this add-on.

Re: Cannot open CCodeGenerator

Posted: Mon Aug 04, 2014 12:18 pm
by tvoverbeek
alexatwri wrote:
ejolson wrote:Is there any news on a version of Mathematica for the Pi with CCodeGenerator?
The update is currently going through QA and it includes CCodeGenerator. Should be out shortly.
Confirming that CCodeGenerator is included in the latest version: 2014072903.
Example is working.

Re: Cannot open CCodeGenerator

Posted: Tue Aug 05, 2014 9:28 am
by jardino
"DictionaryLookup" seems to be implemented in this latest release also.

I'll do more testing.

Alan.