cocoa-xu / evision

Evision: An OpenCV-Erlang/Elixir binding
https://evision.app
Apache License 2.0
323 stars 22 forks source link

Could not compile dependency :complex, "mix compile" failed. #178

Closed smadhogaria closed 1 year ago

smadhogaria commented 1 year ago

I am trying to add Evision dependency to my project which requires complex. castore 0.1.22 cc_precompiler 0.1.5 complex 0.4.3 dll_loader_helper 0.1.10 elixir_make 0.7.3 evision 0.1.28 nx 0.4.2

However, I cannot get to the stage of compiling Evision as it fails already on the dependency :complex. I am running Elixir v1.9.1

Here is the error: = Compilation error in file lib/complex.ex == ** (CompileError) lib/complex.ex:1938: undefined function is_struct/2 (elixir) src/elixir_locals.erl:108: :elixir_locals."-ensure_no_undefined_local/3-lc$^0/1-0-"/2 (elixir) src/elixir_locals.erl:109: anonymous fn/3 in :elixir_locals.ensure_no_undefined_local/3 (stdlib) erl_eval.erl:680: :erl_eval.do_apply/6

cocoa-xu commented 1 year ago

Hi @smadhogaria, AFAIK, complex requires Elixir >= 1.12. https://github.com/elixir-nx/complex/blob/main/mix.exs#L10

smadhogaria commented 1 year ago

Hi @cocoa-xu , thanks a lot for the response. I tried running with 1.12 but then nx dependency throws compile error. First it gives a warning that nx requires Elixir >= 1.13 and then the following error - == Compilation error in file lib/nx.ex == * (SyntaxError) lib/nx.ex:12067:14: syntax error before: '' (elixir 1.12.3) lib/kernel/parallel_compiler.ex:319: anonymous fn/4 in Kernel.ParallelCompiler.spawn_workers/7

How to resolve this? Any suggestions?

cocoa-xu commented 1 year ago

Hi @smadhogaria, given that the warning said that nx requires Elixir >= 1.13, your best bet is to use Elixir >= v1.13.

cocoa-xu commented 1 year ago

Btw, the latest Elixir version is v1.14.3; https://github.com/elixir-lang/elixir/releases/tag/v1.14.3

And if there are no other reasons for you to use an older version of Elixir, you can follow the installation guide on elixir-lang.org to install the latest version.

cocoa-xu commented 1 year ago

Last but not least, perhaps you'd like to visit Elixir Forum at https://elixirforum.com/, where there are more people and developers/maintainers of other Elixir libraries (e.g., complex and nx) who can help you when you have any related issues. :)

smadhogaria commented 1 year ago

Thanks, it is working with 1.13. I only wanted to mention here as these are all automatically installed dependencies for Evision. I am only interested in getting my Opencv with elixir running. :)