mix new example_errorcd example_error- Edit
lib/example_error.ex iex -S mix- Enter the following command:
try do
raise ExampleError
rescue
| #!/bin/bash | |
| dir="$HOME/.erl" | |
| mkdir -p dir | |
| if [ $# -lt 1 ]; then | |
| echo "Usage: $0 [latest|version]" | |
| exit 0 | |
| fi |
mix new example_errorcd example_errorlib/example_error.exiex -S mixtry do
raise ExampleError
rescue
| System.put_env("EVISION_PREFER_PRECOMPILED", "true") # Remove if you use a platform on which Evision does not provide a pre-compiled library. | |
| System.put_env("EVISION_PRECOMPILED_CACHE_DIR", "#{System.user_home!()}/.cache") | |
| Mix.install( | |
| [ | |
| {:nx, "~> 0.3"}, | |
| {:exla, "~> 0.3"}, | |
| {:evision, "~> 0.1.2", github: "cocoa-xu/evision", tag: "v0.1.2"} | |
| ], |
| System.put_env("EVISION_PREFER_PRECOMPILED", "true") # Remove if you use a platform on which Evision does not provide a pre-compiled library. | |
| System.put_env("EVISION_PRECOMPILED_CACHE_DIR", "#{System.user_home!()}/.cache") | |
| Mix.install( | |
| [ | |
| {:nx, "~> 0.3"}, | |
| {:exla, "~> 0.3"}, | |
| {:evision, "~> 0.1.2", github: "cocoa-xu/evision", tag: "v0.1.2"}, | |
| {:flow, "~> 1.2"} # Add Flow |
| System.put_env("EVISION_PREFER_PRECOMPILED", "true") # Remove if you use a platform on which Evision does not provide a pre-compiled library. | |
| System.put_env("EVISION_PRECOMPILED_CACHE_DIR", "#{System.user_home!()}/.cache") | |
| Mix.install( | |
| [ | |
| {:nx, "~> 0.3"}, | |
| {:exla, "~> 0.3"}, | |
| {:evision, "~> 0.1.2", github: "cocoa-xu/evision", tag: "v0.1.2"} | |
| ], |
| System.put_env("EVISION_PREFER_PRECOMPILED", "true") # Remove if you use a platform on which Evision does not provide a pre-compiled library. | |
| System.put_env("EVISION_PRECOMPILED_CACHE_DIR", "#{System.user_home!()}/.cache") | |
| Mix.install( | |
| [ | |
| {:nx, "~> 0.3"}, | |
| {:exla, "~> 0.3"}, | |
| {:evision, "~> 0.1.2", github: "cocoa-xu/evision", tag: "v0.1.2"} | |
| ], |
| # Setting for Evision to use precompiled version | |
| System.put_env("EVISION_PREFER_PRECOMPILED", "true") # Remove if you use a platform on which Evision does not provide a pre-compiled library. | |
| System.put_env("EVISION_PRECOMPILED_CACHE_DIR", "#{System.user_home!()}/.cache") | |
| # Setting integration of Nx, EXLA and Evision | |
| Mix.install( | |
| [ |
| .phony: all clean | |
| PRIV = $(MIX_APP_PATH)/priv | |
| BUILD = $(MIX_APP_PATH)/obj | |
| NIF = $(PRIV)/libnif.so | |
| ifeq ($(CROSSCOMPILE),) | |
| ifeq ($(shell uname -s),Linux) | |
| LDFLAGS += -fPIC -shared | |
| CFLAFGS += -fPIC |
| .phony: all clean | |
| PRIV = $(MIX_APP_PATH)/priv | |
| BUILD = $(MIX_APP_PATH)/obj | |
| NIF = $(PRIV)/libnif.so | |
| ifeq ($(CROSSCOMPILE),) | |
| ifeq ($(shell uname -s),Linux) | |
| LDFLAGS += -fPIC -shared | |
| CFLAFGS += -fPIC |