ejolson
Posts: 6043
Joined: Tue Mar 18, 2014 11:47 am

Cannot open CCodeGenerator

Tue Mar 18, 2014 2:32 pm

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.

User avatar
DeeJay
Posts: 2027
Joined: Tue Jan 01, 2013 9:33 pm
Location: East Midlands, UK

Re: Cannot open CCodeGenerator

Tue Mar 18, 2014 10:10 pm

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?
How To Ask Questions The Smart Way: http://www.catb.org/~esr/faqs/smart-questions.html
How to Report Bugs Effectively: http://www.chiark.greenend.org.uk/~sgtatham/bugs.html

dennisw
Posts: 18
Joined: Fri Nov 22, 2013 7:06 am

Re: Cannot open CCodeGenerator

Wed Mar 19, 2014 3:29 am

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.
raspberrypi.stackexchange.com --- mathematica.stackexchange.com

ejolson
Posts: 6043
Joined: Tue Mar 18, 2014 11:47 am

Re: Cannot open CCodeGenerator

Wed Mar 19, 2014 7:56 pm

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?

alexatwri
Posts: 12
Joined: Fri Nov 29, 2013 1:59 am

Re: Cannot open CCodeGenerator

Tue Mar 25, 2014 8:45 pm

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.

mob-i-l
Posts: 327
Joined: Sat Dec 29, 2012 2:45 am
Location: Lund, Skåne/Scania, Sweden
Contact: Website Facebook Twitter YouTube

Re: Cannot open CCodeGenerator

Thu Mar 27, 2014 10:11 pm

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.
Have Pi0&1A&1B&1B+&2B&3B&4B w/ Raspbian. Started w/ BASIC on ABC80&ZX81 then Forth, Z80… https://scratch.mit.edu/users/mobluse/ https://github.com/mobluse/ https://twitter.com/mobluse/ https://YouTube.com/MOBiL4u/

ejolson
Posts: 6043
Joined: Tue Mar 18, 2014 11:47 am

Re: Cannot open CCodeGenerator

Sat Mar 29, 2014 11:22 am

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.

dennisw
Posts: 18
Joined: Fri Nov 22, 2013 7:06 am

Re: Cannot open CCodeGenerator

Sun Mar 30, 2014 1:03 am

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/
raspberrypi.stackexchange.com --- mathematica.stackexchange.com

ejolson
Posts: 6043
Joined: Tue Mar 18, 2014 11:47 am

Re: Cannot open CCodeGenerator

Sun Mar 30, 2014 9:41 am

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.

ejolson
Posts: 6043
Joined: Tue Mar 18, 2014 11:47 am

Re: Cannot open CCodeGenerator

Wed Jun 11, 2014 4:47 pm

Is there any news on a version of Mathematica for the Pi with CCodeGenerator?

alexatwri
Posts: 12
Joined: Fri Nov 29, 2013 1:59 am

Re: Cannot open CCodeGenerator

Mon Jul 21, 2014 5:36 pm

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.

ejolson
Posts: 6043
Joined: Tue Mar 18, 2014 11:47 am

Re: Cannot open CCodeGenerator

Sun Jul 27, 2014 3:54 am

Dear Alexa,

This is great news. Thanks for the update.

All the best,
Eric

jardino
Posts: 131
Joined: Wed Aug 08, 2012 9:03 am
Location: Aberdeenshire, Scotland

Re: Cannot open CCodeGenerator

Tue Jul 29, 2014 9:43 am

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.
IT Background: Honeywell H2000 ... CA Naked Mini ... Sinclair QL ... WinTel ... Linux ... Raspberry Pi.

User avatar
emgi
Posts: 357
Joined: Thu Nov 07, 2013 4:08 pm
Location: NL

Re: Cannot open CCodeGenerator

Fri Aug 01, 2014 3:22 pm

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.

tvoverbeek
Posts: 101
Joined: Mon Feb 04, 2013 9:50 am
Location: Fieberbrunn, Austria

Re: Cannot open CCodeGenerator

Mon Aug 04, 2014 12:18 pm

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.

jardino
Posts: 131
Joined: Wed Aug 08, 2012 9:03 am
Location: Aberdeenshire, Scotland

Re: Cannot open CCodeGenerator

Tue Aug 05, 2014 9:28 am

"DictionaryLookup" seems to be implemented in this latest release also.

I'll do more testing.

Alan.
IT Background: Honeywell H2000 ... CA Naked Mini ... Sinclair QL ... WinTel ... Linux ... Raspberry Pi.

Return to “Mathematica”