Message Boards Message Boards

0
|
1607 Views
|
2 Replies
|
1 Total Likes
View groups...
Share
Share this post:

Compile and/or run C++ code from within Mathematica

Posted 9 months ago

I am trying to access a code written in C++ (can be downloaded here https://github.com/CoolProp/IF97#coolprop-if97) from within Mathematica. I was trying to follow the suggestions under LibraryLink and other guidance I found outside the Wolfram documentation, but was not able to make much progress.

If anyone could suggest a place where I can find directions that work for this situation, I would appreciate it. I was able to compile the code outside of Mathematica. I have no particular preference as far as whether to compile the code from Mathematica or compile it externally. The code defines a set of functions (physical properties of water and steam) that I need to be able to use in a Mathematica notebook. I know there are other such tables, including Mathematica's ThermodynamicData function, but I need to use this specific set of tables (IAPWS-IF97).

By the way, this library is also available for R (iapws package), but there I am having similar issues with RLink. For example, in my version of Mathematica (12) RLink does not have some of the options that are described in the instructions I found online (like JRINativeLibraryLocation).

There is also a python version of that library (iapws), and I could run it from Mathematica using ExternalEvaluate, but that seemed too slow. I was hoping C++ would be faster.

Thanks in advance.

POSTED BY: Otto Linsuain
2 Replies
Posted 9 months ago

Thanks a lot Piotr, I will give this a try. Sorry if this seemed kind of a trivial question to post. I tried many things before posting. Hopefully this will be the one. Thanks! Otto

POSTED BY: Otto Linsuain
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract