Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get "specified file is not a MathLink executable" in example notebook #2

Closed
GoogleCodeExporter opened this issue Apr 13, 2015 · 6 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Download Pythonika binary for MacOS and Python 2.6
2. Download Pythonika.nb example notebook
3. Adjust the path, execute first line

Get "LinkOpen::linke: ""Specified file is not a MathLink executable ""

Original issue reported on code.google.com by yarosla...@gmail.com on 2 Mar 2011 at 12:33

@GoogleCodeExporter
Copy link
Author

I got this working and here were the additional steps (Mathematica 8.0 and 
MacOS 10.6.6 -- install Python 2.7, copy 
/Applications/Mathematica.app/SystemFiles/Links/MathLink/DeveloperKit/CompilerAd
ditions/mathlink.framework to /Library/Frameworks, add "-framework 
CoreFoundation" to list of libraries in Makefile

Original comment by yarosla...@gmail.com on 2 Mar 2011 at 1:14

@GoogleCodeExporter
Copy link
Author

I tried what  yarosla said (copy mlink framework and add -framework 
CoreFoundation in the makefile) with Python 2.6, Mathematica 8.0 and MacOS 
10.5.8.
I still can't compile Pythonilka -first of all, I don't have any libML.a in 
${CADDSDIR}, I have instead a libMLi3.a so I modified the makefile accordingly. 
But I get have a lot of Undefined Symbols during the compilation:
Undefined symbols:
  "std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char)", referenced from:
      MLNetwork::MLAddress::WriteAddress(std::basic_ostream<char, std::char_traits<char> >&) constin libMLi3.a(mladdress.cpp.o)
      MLNumerics::MLBigInteger::printcore(std::basic_ostream<char, std::char_traits<char> >&) constin libMLi3.a(mlbiginteger.cpp.o)

 [SNIP]

ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [Pythonika] Error 1

Any suggestions?

Original comment by a.leon.b...@gmail.com on 5 Mar 2011 at 3:31

@GoogleCodeExporter
Copy link
Author

I couldn't compile with Python 2.6 because it had a different architecture from 
Mathlink library ("file 
/Applications/Mathematica.app/SystemFiles/Links/MathLink/DeveloperKit/CompilerAd
ditions/mathlink.framework/mathlink says "x86_64", but "file <pythonbinary>" 
didn't mention this architecture). Upgrading to Python 2.7 fixed it. However, 
you don't have "wrong archecture message", perhaps you should add "-lstdc++" 
flag in addition to "-frameworks CoreFoundation", as suggested at 
http://stackoverflow.com/questions/5161006/compiling-pythonika-on-macos. Note, 
I upgraded Python through official package rather than MacPorts, MacPorts puts 
it into different location which doesn't get found by default.

Original comment by yarosla...@gmail.com on 5 Mar 2011 at 3:47

@GoogleCodeExporter
Copy link
Author

@yarosla: Thank's it worked on this machine. Actually both archs for mathlink 
and `which python` match, but i'll keep in mind since i'll be compiling it on 
other machines.
Thanks for the help.  

[OT]: i was wandering: why Pythonika's sources aren't available in the Download 
page?

Original comment by a.leon.b...@gmail.com on 5 Mar 2011 at 4:03

@GoogleCodeExporter
Copy link
Author

The thread in Stackoverflow already gives the solution to compiling the 
Pythonika for Mathematica 8. I've added the "-framework CoreFoundation" to the 
Makefile.osx so it should build as expected.

Regarding the availability of Pythonika's sources, they've always been in the 
Google Code's subversion:

http://code.google.com/p/pythonika/source/browse/#svn%2Ftrunk

Original comment by ero.carr...@gmail.com on 10 Apr 2011 at 4:58

  • Changed state: Done

@GoogleCodeExporter
Copy link
Author

Dear All, I would love to use Pythonika for Mathematica 8 on my Mac but I have 
very little experience compiling things  This thread is rather intimidating.  
When I attempt to install "Pythonika-Mathematica8-Python2.6" on my Mac I get 
the following error message: LinkOpen::linke: Specified file is not a MathLink 
executable.  As I understand it, the problem can be cured by recompiling 
Pythonika with certain flags.  That's great, but might it be possible for 
someone to post a pre-compiled version that will actually run on Mathematica 8. 
 I loved Pythonika on earlier versions of Mathematica and would like to use 
Natural Language Toolkit again from within Mathematica, but unless I summon up 
the courage to do some compilation, I will be blocked.  Can someone post a 
working executable for OSX 10.7  and Mathematica 8 Version 8.0.1 or above.  
Thanks so much. SJC

Original comment by chandler...@gmail.com on 4 Jan 2012 at 4:14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant