scenic icon indicating copy to clipboard operation
scenic copied to clipboard

Scenic.Driver.Glfw can't be found when run mix scenic.run

Open ray-sh opened this issue 5 years ago • 5 comments

Versions and Environment

elixir -v Erlang/OTP 21 [erts-10.3] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [hipe] [dtrace]

Elixir 1.8.1 (compiled with Erlang/OTP 21)


Scenic:

mix deps | grep scenic
* scenic_sensor 0.7.0 (Hex package) (mix)
  locked at 0.7.0 (scenic_sensor) a12aed75
* scenic 0.10.2 (Hex package) (mix)
  locked at 0.10.2 (scenic) f4f0a00e
* scenic_clock 0.10.0 (Hex package) (mix)
  locked at 0.10.0 (scenic_clock) 5be4a87e

OS:
Mac OS 10.13.4 (17E199)

### Steps to reproduce
https://github.com/boydm/scenic_new

### Actual Behavior

mix deps.get
Resolving Hex dependencies...
Dependency resolution completed:
New:
  elixir_make 0.6.0
  font_metrics 0.3.1
  msgpax 2.2.3
  scenic 0.10.2
  scenic_clock 0.10.0
  scenic_driver_glfw 0.10.0
  scenic_sensor 0.7.0
* Getting scenic (Hex package)
* Getting scenic_driver_glfw (Hex package)
* Getting scenic_sensor (Hex package)
* Getting scenic_clock (Hex package)
* Getting elixir_make (Hex package)
* Getting font_metrics (Hex package)
* Getting msgpax (Hex package)

mix scenic.run
==> msgpax
Compiling 8 files (.ex)
Generated msgpax app
==> font_metrics
Compiling 2 files (.ex)
Generated font_metrics app
==> scenic_sensor
Compiling 1 file (.ex)
Generated scenic_sensor app
==> elixir_make
Compiling 1 file (.ex)
Generated elixir_make app
==> scenic
mkdir -p /Users/xman/elixir-learning/my_app/_build/rpi3_dev/lib/scenic/ebin/../priv
cp -rf static /Users/xman/elixir-learning/my_app/_build/rpi3_dev/lib/scenic/ebin/../priv/static
mkdir -p /Users/xman/elixir-learning/my_app/_build/rpi3_dev/lib/scenic/ebin/../obj
cc -c -I/usr/local/Cellar/erlang/21.3/lib/erlang/usr/include -fPIC -O2 -Wall -Wextra -Wno-unused-parameter -std=c99 -o /Users/xman/elixir-learning/my_app/_build/rpi3_dev/lib/scenic/ebin/../obj/line.o c_src/line.c
cc /Users/xman/elixir-learning/my_app/_build/rpi3_dev/lib/scenic/ebin/../obj/line.o -L/usr/local/Cellar/erlang/21.3/lib/erlang/usr/lib -fPIC -shared  -dynamiclib -undefined dynamic_lookup -o /Users/xman/elixir-learning/my_app/_build/rpi3_dev/lib/scenic/ebin/../priv/line.so
cc -c -I/usr/local/Cellar/erlang/21.3/lib/erlang/usr/include -fPIC -O2 -Wall -Wextra -Wno-unused-parameter -std=c99 -o /Users/xman/elixir-learning/my_app/_build/rpi3_dev/lib/scenic/ebin/../obj/matrix.o c_src/matrix.c
cc /Users/xman/elixir-learning/my_app/_build/rpi3_dev/lib/scenic/ebin/../obj/matrix.o -L/usr/local/Cellar/erlang/21.3/lib/erlang/usr/lib -fPIC -shared  -dynamiclib -undefined dynamic_lookup -o /Users/xman/elixir-learning/my_app/_build/rpi3_dev/lib/scenic/ebin/../priv/matrix.so
cc -c -I/usr/local/Cellar/erlang/21.3/lib/erlang/usr/include -fPIC -O2 -Wall -Wextra -Wno-unused-parameter -std=c99 -o /Users/xman/elixir-learning/my_app/_build/rpi3_dev/lib/scenic/ebin/../obj/texture.o c_src/texture.c
cc /Users/xman/elixir-learning/my_app/_build/rpi3_dev/lib/scenic/ebin/../obj/texture.o -L/usr/local/Cellar/erlang/21.3/lib/erlang/usr/lib -fPIC -shared  -dynamiclib -undefined dynamic_lookup -o /Users/xman/elixir-learning/my_app/_build/rpi3_dev/lib/scenic/ebin/../priv/texture.so
Compiling 91 files (.ex)
Generated scenic app
==> scenic_clock
Compiling 3 files (.ex)
Generated scenic_clock app
==> my_app
Compiling 11 files (.ex)
Generated my_app app
** (Mix) Could not start application my_app: MyApp.start(:normal, []) returned an error: shutdown: failed to start child: Scenic
    ** (EXIT) shutdown: failed to start child: Scenic.ViewPort.SupervisorTop
        ** (EXIT) shutdown: failed to start child: :main_viewport
            ** (EXIT) shutdown: failed to start child: Scenic.ViewPort.Driver.Supervisor
                ** (EXIT) an exception was raised:
                    ** (ArgumentError) The module Scenic.Driver.Glfw was given as a child to a supervisor but it does not exist.
                        (elixir) lib/supervisor.ex:629: Supervisor.init_child/1
                        (elixir) lib/enum.ex:1327: Enum."-map/2-lists^map/1-0-"/2
                        (elixir) lib/supervisor.ex:615: Supervisor.init/2
                        (stdlib) supervisor.erl:295: :supervisor.init/1
                        (stdlib) gen_server.erl:374: :gen_server.init_it/2
                        (stdlib) gen_server.erl:342: :gen_server.init_it/6
                        (stdlib) proc_lib.erl:249: :proc_lib.init_p_do_apply/3

ray-sh avatar Jun 28 '19 02:06 ray-sh

This seems related to another discussion. possibly being built into the wrong place. Looking into it.

boydm avatar Jul 08 '19 23:07 boydm

@ray-sh Can you recheck with scenic_driver_glfw 0.10.1 and scenci_new 0.10.3? I'd expect it to work with those versions.

axelson avatar Aug 16 '19 18:08 axelson

To others that may have this kind of error: check if you have a MIX_TARGET set to for example rpi3. I blanked my MIX_TARGET. That solved it

smedegaard avatar Sep 27 '19 12:09 smedegaard

I fixed this by installing glfw3 and compiling scenic_driver_glfw manually:

brew update
brew install glfw3 glew pkg-config

mix deps.compile scenic_driver_glfw
mix do deps.get, scenic.run

wilsonsilva avatar May 31 '20 12:05 wilsonsilva

I just had the same issue with the initial code delivered by mix scenic.new.

I could start my app, bypassing this issue, by setting MIX_TARGET=host, or removing targets: :host from scenic_driver_glfw dependency, which is default on the starter code.

I think the Getting Started documentation should be changed to include this, or remove targets: :host as default config for scenic_driver_glfw.

GPrimola avatar Oct 28 '21 12:10 GPrimola