CoolProp / CoolProp.jl

A Julia wrapper for CoolProp, offering access to thermodynamic properties for fluids and mixtures.
http://www.coolprop.org
Other
32 stars 15 forks source link

Does not work on Julia 1.8? #20

Closed jtravs closed 2 years ago

jtravs commented 2 years ago

On Julia 1.8 on an m1 mac I get the following error

   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.8.0 (2022-08-17)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> using CoolProp
[ Info: Precompiling CoolProp [e084ae63-2819-5025-826e-f8e611a84251]
ERROR: LoadError: UndefVarError: libcoolprop not defined
Stacktrace:
 [1] get_global_param_string(key::String)
   @ CoolProp ~/.julia/packages/CoolProp/nFTC5/src/CoolProp.jl:448
 [2] top-level scope
   @ ~/.julia/packages/CoolProp/nFTC5/src/CoolProp.jl:612
 [3] include
   @ ./Base.jl:419 [inlined]
 [4] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::Nothing)
   @ Base ./loading.jl:1554
 [5] top-level scope
   @ stdin:1
in expression starting at /Users/jt52/.julia/packages/CoolProp/nFTC5/src/CoolProp.jl:2
in expression starting at stdin:1
ERROR: Failed to precompile CoolProp [e084ae63-2819-5025-826e-f8e611a84251] to /Users/jt52/.julia/compiled/v1.8/CoolProp/jl_O6gkfS.
Stacktrace:
 [1] error(s::String)
   @ Base ./error.jl:35
 [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, keep_loaded_modules::Bool)
   @ Base ./loading.jl:1705
 [3] compilecache
   @ ./loading.jl:1649 [inlined]
 [4] _require(pkg::Base.PkgId)
   @ Base ./loading.jl:1337
 [5] _require_prelocked(uuidkey::Base.PkgId)
   @ Base ./loading.jl:1200
 [6] macro expansion
   @ ./loading.jl:1180 [inlined]
 [7] macro expansion
   @ ./lock.jl:223 [inlined]
 [8] require(into::Module, mod::Symbol)
   @ Base ./loading.jl:1144

My versioninfo is

julia> versioninfo()
Julia Version 1.8.0
Commit 5544a0fab76 (2022-08-17 13:38 UTC)
Platform Info:
  OS: macOS (arm64-apple-darwin21.3.0)
  CPU: 10 × Apple M1 Pro
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-13.0.1 (ORCJIT, apple-m1)
  Threads: 1 on 8 virtual cores

It works fine on Julia 1.7 on the same system.

longemen3000 commented 2 years ago

this is probably because julia 1.7 was running in rosseta mode, where 1.8 can run natively on M1

barche commented 2 years ago

This should work now, CoolProp.jl will choose CoolProp_jll version 6.4.1 on Julia < 1.6, and version 6.4.2 (which is still the same 6.4.1 binary, but with artifacts for M1) on Julia 1.6 and later. This is because of the compat of the JLL, so no changes to CoolProp.jl are needed.