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

Can't load old CoolProp Mathematica on Apple M1 Max, can't compile with Mathematica module #2140

Closed
webelcomau opened this issue Jun 27, 2022 · 4 comments · Fixed by #2146
Closed

Comments

@webelcomau
Copy link

webelcomau commented Jun 27, 2022

Description

I am having trouble running or compiling CoolProp with its (apparently no longer supported) Mathematica module on a new M1 Max MacBook Pro. There is an old wrapper for CoolProp 5.1.1 for Mathematica that works on my other machines but not on M1 Max

Steps to Reproduce

  1. Clone latest CoolProp nightly build
  2. Compile using CMake with Mathematica module flag on:
git clone https://github.com/CoolProp/CoolProp --recursive
mkdir -p CoolProp/build && cd CoolProp/build
cmake .. -DCOOLPROP_MATHEMATICA_MODULE=ON -DCMAKE_VERBOSE_MAKEFILE=ON
cmake --build .

Expected behavior:

Compile dylib without error

Actual behavior:

ERROR on compile:

CMake Error at externals/FindMathematica/CMake/Mathematica/FindMathematica.cmake:641 (message):
  Unsupported host platform Darwin
Call Stack (most recent call first):
  externals/FindMathematica/CMake/Mathematica/FindMathematica.cmake:1248 (_get_host_system_IDs)
  externals/FindMathematica/CMake/Mathematica/FindMathematica.cmake:2786 (_setup_mathematica_systemIDs)
  CMakeLists.txt:1834 (find_package)

Versions

CoolProp Version: Nightly build: 2022-06-24

Operating System and Version: macOS 12.3 Monterey, Apple M1 Max chip

Access Method: To be loaded into Mathematica using LibraryFunctionLoad, but don't get that far (because dylib not built). The same methods works fine on other machines with old CoolProp 5.1.1 wrapper for Mathematica, but that won't load on the M1 Max.

@henningjp
Copy link
Contributor

Your error is coming from FindMathematica, which is an external submodule that searches for your system architecture (Darwin + specific chip architecture) and the location of your Mathematica version on that OS/architecture. The version in the latest nightly build is about four years old (2018) and there are newer updates that support some OSX specific patches as well as support for finding Mathematica 12.x and 13.x versions. As a suggestion, you might try updating that submodule in your externals directory and see if that provides better support for your hardware/OS version.

I had to update mine to get support for Mathematica 13. It should have no impact on the compilation other than being able to find the Mathematica files that CMake needs to complete the compile. This submodule version should probably be bumped up in the CoolProp nightly build (there is development in the works #2085 that should bump this up) as the current version used definitely does not support up to Mathematica 13. It may actually be sending you a red herring architecture error because of this.

@webelcomau
Copy link
Author

It worked! Thank you! I don't know whether I've even been more grateful for issue help, you just saved my client's project.

Shall I also post this solution (quote you) on this CoolProp group posting?

https://groups.google.com/g/coolprop-users/c/J7DXfHHoe0c

@henningjp
Copy link
Contributor

Sure.

Close this issue with a PR that bumps the version of FindMathematica, or leave it open and I’ll do it if your not sure how to do that. It’s been on my TO DO list.

@webelcomau
Copy link
Author

webelcomau commented Jun 27, 2022 via email

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

Successfully merging a pull request may close this issue.

3 participants