Re: Mathlink probs under Unix
- To: mathgroup at smc.vnet.net
- Subject: [mg26290] Re: [mg26246] Mathlink probs under Unix
- From: John Fultz <jfultz at wolfram.com>
- Date: Sun, 10 Dec 2000 00:20:01 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
Your compiler is complaining about an overly long string. This will
probably fix it...
In the file binary.tm, find something that looks like the following text:
:Evaluate:
resolveExistingFilename[s_String]:=Module[{first=First[Characters[s]],drive,os,fileinfo,thefile},
Switch[os=$OperatingSystem,
"Unix", (* a whole bunch of stuff here *),
"MacOS", (* a whole bunch of stuff here *),
"Windows"|"WINDOWS"|"WindowsNT", (*a whole bunch of stuff here *),
_, (* a whole bunch of stuff here *)]]
This is being turned into a C string by 'mprep', and apparently it's too
long for your compiler to swallow. We can make it simpler by just
splitting out the stuff that's irrelevant for Solaris:
:Evaluate:
resolveExistingFilename[s_String]:=Module[{first=First[Characters[s]],drive,os,fileinfo,thefile},
Switch[os=$OperatingSystem,
"Unix", (* a whole bunch of stuff here *),
_, (* a whole bunch of stuff here *)]]
which is to say, just delete all of the lines from the line beginning with
"MacOS" to the line immediately preceding the one beginning with '_'.
Or, you could rewrite your code in terms of Experimental`BinaryImport[] and
Experimental`BinaryExport[], which is somewhat faster than FastBinaryFiles
these days.
Sincerely,
John Fultz
jfultz at wolfram.com
User Interface Group
Wolfram Research, Inc.
At 01:16 AM 12/6/2000, number9 wrote:
>Hello, I have a Mathematica problem that perhaps someone has come across...
>
>I have a Sun box running Solaris8 with Mathematica 4.0 installed. I am
>trying to
>
>compile the "fastbinary" addon (binary.tm) for Mathematica. I have
>downloaded it
>
>from mathsource and I am having some problems compiling it. (I am using
>GNU gcc for my compiler). From what I have read, I can either use mcc to
>
>compile this (with the CC flag set to gcc) or use mprep and them compile
>
>by hand. Here is what is going on:
>
>Using mcc:
>
>$ mcc -o binary
>-l/usr/local/mathematica/AddOns/MathLink/DevelopersKits/Solaris/CompilerAdditions/
>binary.tm -lnsl -lsocket
>binary.tm:468: unterminated character constant
>
>Manually:
>
>$ mprep binary.tm -o binary..c
>$ gcc -o binary
>-l/usr/local/mathematica/AddOns/MathLink/DevelopersKits/Solaris/CompilerAdditions/
>binary.c -lnsl -lsocket
>binary.tm:468: unterminated character constant
>
>I can not seem to get around this. I have ftp'd the files to another
>solaris host w/Mathematica
>and I get slightly differing results (it complains with mcc about 4000
>errors and fails)
>
>I am probably doing something idiotic, as I have not compiled anything
>in years...
>but I would like to know what it is. I am trying to read in some large
>data sets
>and I have heard that this is the way to do it (w/fast binary)
>
>Thanks for the time.
>
>Bob