Code Monkey home page Code Monkey logo

findmathematica's People

Contributors

sakra avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

findmathematica's Issues

Linking failue when libuuid is installed in a non-default directory

Dear Sascha Kratky,

a student reported an issue to me when building a LibraryLink library with FindMathematica.cmake. He uses the following configuration:

Distributor ID: Ubuntu
Description: Ubuntu 16.04.5 LTS
Release: 16.04
Codename: xenial
Mathematica version: 10.3

When building a LibraryLink library (Himalaya_LibraryLink.so), FindMathematica.cmake links libuuid to the shared library like so:

/usr/bin/c++ -fPIC -O3 -DNDEBUG  -shared  -o Himalaya_LibraryLink.so CMakeFiles/Himalaya_LibraryLink.dir/source/LibraryLink/Himalaya_LibraryLink.cpp.o -Wl,-rpath,/home/thomas/Promotion/Himalaya/Himalaya-master/build:/home/thomas/Dokumente/Mathematica10.3/SystemFiles/Links/MathLink/DeveloperKit/Linux-x86-64/CompilerAdditions libHimalaya.so /home/thomas/Dokumente/Mathematica10.3/SystemFiles/Links/MathLink/DeveloperKit/Linux-x86-64/CompilerAdditions/libML64i4.so -lstdc++ -lm -lpthread -lrt -ldl -luuid libDSZ.so
/usr/bin/ld: cannot find -luuid
collect2: error: ld returned 1 exit status

This linking command fails and I believe it is because on this Ubuntu version libuuid is installed in the non-standard directories

/lib/x86_64-linux-gnu/libuuid.so.1
/lib/x86_64-linux-gnu/libuuid.so.1.3.0
/lib/i386-linux-gnu/libuuid.so.1
/lib/i386-linux-gnu/libuuid.so.1.3.0

This issue can be fixed by creating a symlink in /usr/lib/:

cd /usr/lib/
sudo ln -s /lib/x86_64-linux-gnu/libuuid.so.1.3.0 libuuid.so

But I believe a better solution would be to let FindMathematica.cmake search for libuuid and add its proper path to the linking command.

With best regards,
Alexander Voigt

Error with Mathematica 12.3.1 Apple ARM version

Hello,
I think 12.3.1 was the first macOS Mathematica version with native ARM/Silicon support, and after upgrading to it I get the following error in a program that uses FindMathematica in its cmake-list:

"could NOT find Mathematica_WolframLibrary (missing: Mathematica_WolframLibrary_LIBRARY) (found version "6")
-- Could NOT find Mathematica (missing: Mathematica_WolframLibrary_LIBRARY) (found version "12.3.1")"

After looking in the cmakeCACHE file, I found that it did not find the Wolfram Runtime Library (correct path: "/Applications/Mathematica.app/Contents/SystemFiles/Libraries/MacOSX-ARM64/libWolframRTL.dylib" ),

and the cache file contains the entry
//Last value of Mathematica_SYSTEM_IDS.
Mathematica_SYSTEM_IDS_LAST:INTERNAL=MacOSX-x86-64

which I guess could be problematic. It seems like in most other relevant paths it correctly replaced MacOSX-x86-64 by /MacOSX-ARM64. I will try to fix it by myself, but if you could make FindMathematica compatible with the 12.3.1 version in a clean way, I guess it would be greatly appreciated by many.

Support for Wolfram Engine

Dear Sascha Kratky,

I'm wondering whether FindMathematica could also support the "Free Wolfram Engine"?

Personally, for license reason I can currently not use Mathematica and so I'm stuck to the "Free Wolfram Engine".

Interestingly, the "Free Wolfram Engine" provides

  • a math kernel
  • the mcc compiler
  • MathLink
  • LibraryLink

and many more. However, it does not provide the classic Mathematica notebook executable.

Anyway, I guess a support for "Free Wolfram Engine" would in principle be possible and I guess also very useful in general. :)

Best regards
Alexander Voigt

Link failure of MathLink executable on Fedora when libuuid is not installed

Dear Sascha Kratky,

we are using your FindMathematica module in to build a MathLink executable for GM2Calc. This works very nicely for all platforms, except Fedora: On Fedora we get a linker error when the MathLink executable (gm2calc.mx) is created and libuuid is not installed:

/usr/bin/c++  -O2 -DNDEBUG  -rdynamic CMakeFiles/gm2calc.mx.dir/gm2calc.tm.c.o  -o ../bin/gm2calc.mx -Wl,-rpath,/usr/local/Wolfram/Mathematica/11.1/SystemFiles/Links/MathLink/DeveloperKit/Linux-x86-64/CompilerAdditions /usr/local/Wolfram/Mathematica/11.1/SystemFiles/Links/MathLink/DeveloperKit/Linux-x86-64/CompilerAdditions/libML64i4.so -lstdc++ -lm -lpthread -lrt -ldl -luuid ../lib/libgm2calc.a
/usr/bin/ld: cannot find -luuid

It seems, that FindMathematica does not check that libuuid is installed on the system, although it links libuuid to the MathLInk executable.

Probably this can be fixed within FindMathematica by requiring that libuuid is installed on the system.

Best regards,
Alexander Voigt

Wrong mathlink library selection in Mathematica 10.3

When using ${Mathematica_MathLink_LIBRARIES} cmake selects the following mathlink library /Applications/Mathematica.app/Contents/SystemFiles/Links/MathLink/DeveloperKit/MacOSX-x86-64/CompilerAdditions/AlternativeLibraries/mathlink.framework/mathlink in Mathematica 10.3. Unfortunately this library is linked against a non existing library /Volumes/Jenkins/workspace/MathLink.MacOSX-x86-64.release/scratch/CMake.build/lib/mathlink-libc++.framework/Versions/4.25/mathlink-libc++, which subsequently leads to a error when using the compiled executable.
A solution could be to use the library under /Applications/Mathematica.app//Contents/Frameworks/mathlink.framework/mathlink.

Variable Mathematica_uuid_LIBRARY is not checked

Dear @sakra ,

a colleague of mine stumbled upon the issue with missing libuuid again.

He has an Ubuntu machine with Mathematica 12. On this machine the package uuid-dev is not installed, so libuuid is not installed on the system.

When he calls find_package(Mathematica COMPONENTS MathLink), he gets an error message of the form:

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.

Please set them or make sure they are set and tested correctly in the CMake files:
Mathematica_uuid_LIBRARY (ADVANCED)
    linked by target "gm2calc.mx" in directory /home/pathron/software/GM2Calc/src 

If I interpret the error message correctly, it seems that the command

find_library (Mathematica_uuid_LIBRARY uuid)

inside FindMathematica.cmake fails to find libuuid on his system. In this case the variable Mathematica_uuid_LIBRARY is set to NOTFOUND. However, the script just continues without checking if libuuid has been found.

If my interpretation is correct, then a possible fix would be to raise an error if libuuid has not been found.

Many thanks in advance and best regards,
Alexander Voigt

P.S.: This issue has been found when running cmake in https://github.com/GM2Calc/GM2Calc

Linking to libMLi3.a versus libMLi4.a on Mac OS X.

On Mac OS X with Mathematica 10 I'd like to statically link my code to libMLi3.a instead of libMLi4.a because libMLi4.a requires also linking to CoreFoundation and seems to introduce a weird performance penalty on startup and shutdown. Setting Mathematica_USE_STATIC_LIBRARIES to TRUE seems to always find libMLi4.a. Is there a way to specifically select libMLi3.a instead?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.