Message Boards Message Boards

6 Replies
0 Total Likes
View groups...
Share this post:

External package compilation with Mathematica 10 on Os X fails


I'm using the Cuba Integration Library ( with Mathematica on OS X for a while, but since I installed Mathematica 10 it doesn't work properly. It worked fine with Mathematica 9, but with Mathematica 10 I can't compile a working package. The compilation ends as it should, but when I try to Install the package in Mathematica, it just gets stuck with the evaluation forever. I uninstalled Mathematica 10, reinstalled Mathematica 9 and the compilation worked fine, and I could use the package with Mathematica 9 and 10 as well. However after I installed Mathematica 10 again and compiled the package, I encountered the same problem as mentioned above. Do you know any reason or change in Mathematica 10, that can cause this problem with the compiled packages?

Thanks in advance!

6 Replies

Hi Kirill

Did you find the answer? I have same question.

Posted 8 years ago

How exactly did you copy the mathlink.framework? I cannot find this file at all.

POSTED BY: Kirill Tuchin

Thank you!

Copying the mathlink.framework to the ~/Library/Frameworks solved my problem (also the other way with the statically linked executables worked).

However, do I have to do this every time I update to a new Mathematica version?

If linking dynamically with the mathlink.framework bundle, a copy should be placed where the system can find it, for example in ~/Library/Frameworks.

Alternatively, configure Cuba with MCFLAGS=-st for statically linked executables.

POSTED BY: Ilian Gachevski

Thanks for your reply!

If I try the routines in the command line the error is the following:

dyld: Library not loaded: @executable_path/../Frameworks/mathlink.framework/Versions/4.25/mathlink
  Referenced from: /Users/IMSzecsenyi/Cuba-4.2/./Vegas
  Reason: image not found
Trace/BPT trap: 5

If I try with the routines compiled while only Mathematica 9 was installed the outcome is what I supposed should be:

Create link: 

(Also with the Cuba version 4.2 the Divonne and Suave routines stuck during the compilation for me:

make: *** No rule to make target `src/suave/', needed by `Suave'.  Stop.


Seems to work fine for me.

In[1]:= Install["Vegas"]

Out[1]= LinkObject['/Test/Cuba-4.2/Vegas', 63, 1]

In[2]:= Vegas[Exp[x + y], {x, 0, 1}, {y, 0, 1}]

Iteration 1:  1000 integrand evaluations so far
[1] 2.95067 +- 0.0385019  	chisq 0 (0 df)

Iteration 2:  2500 integrand evaluations so far
[1] 2.95268 +- 0.0120591  	chisq 0.00303856 (1 df)

Iteration 3:  4500 integrand evaluations so far
[1] 2.95262 +- 0.00424643  	chisq 0.00306927 (2 df)

Iteration 4:  7000 integrand evaluations so far
[1] 2.95313 +- 0.0015912  	chisq 0.0198108 (3 df)

Vegas::success: Needed 7000 function evaluations.

Out[2]= {{2.95313, 0.0015912, 0.000737209}}

In[3]:= $Version

Out[3]= 10.0 for Mac OS X x86 (64-bit) (December 4, 2014)

What happens if you try to launch one of the MathLink executables from the command line, e.g.

$ cd /Test/Cuba-4.2
$ ./Vegas
POSTED BY: Ilian Gachevski
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract