yjh0502 / erl-brotli

Brotli encoder NIF for Erlang
Other
29 stars 17 forks source link

module :brotli_nif is not available #14

Closed tomciopp closed 2 years ago

tomciopp commented 2 years ago

Running into an issue with OTP 24.3/elixir 1.13.3 and brotli on an M1 Mac air.

:brotli.encode("brotli\n=====\n\nAn OTP library\n\nBuild\n-----\n\n")

[warning] 23:21:47.608 The on_load function for module brotli_nif returned:
{:error,
 {:bad_lib,
  'Failed to find library init function: \'dlsym(0x20506ac60, _nif_init): symbol not found\''}}

** (UndefinedFunctionError) function :brotli_nif.encoder_create/0 is undefined (module :brotli_nif is not available)
    (brotli 0.3.0) :brotli_nif.encoder_create()
    (brotli 0.3.0) /Users/Me/deps/brotli/src/brotli_encoder.erl:58: :brotli_encoder.new/1
    (brotli 0.3.0) /Users/Me/deps/brotli/src/brotli.erl:60: :brotli.encode/2

If I try to compile version 0.3.1 I get the following compile error message.

Undefined symbols for architecture arm64:
  "_enif_alloc", referenced from:
      _brotli_alloc in brotli_nif.o
  "_enif_alloc_binary", referenced from:
      _brotli_encoder_take_output in brotli_nif.o
      _brotli_decoder_take_output in brotli_nif.o
  "_enif_alloc_resource", referenced from:
      _brotli_encoder_create in brotli_nif.o
      _brotli_decoder_create in brotli_nif.o
  "_enif_compare", referenced from:
      _brotli_encoder_set_parameter in brotli_nif.o
      _brotli_encoder_compress_stream in brotli_nif.o
  "_enif_free", referenced from:
      _brotli_free in brotli_nif.o
  "_enif_get_resource", referenced from:
      _brotli_encoder_set_parameter in brotli_nif.o
      _brotli_encoder_has_more_output in brotli_nif.o
      _brotli_encoder_is_finished in brotli_nif.o
      _brotli_encoder_compress_stream in brotli_nif.o
      _brotli_encoder_take_output in brotli_nif.o
      _brotli_decoder_has_more_output in brotli_nif.o
      _brotli_decoder_is_finished in brotli_nif.o
      ...
  "_enif_get_uint", referenced from:
      _brotli_encoder_set_parameter in brotli_nif.o
  "_enif_get_ulong", referenced from:
      _brotli_max_compressed_size in brotli_nif.o
  "_enif_inspect_iolist_as_binary", referenced from:
      _brotli_encoder_compress_stream in brotli_nif.o
      _brotli_decoder_decompress_stream in brotli_nif.o
  "_enif_make_atom", referenced from:
      _brotli_init in brotli_nif.o
  "_enif_make_badarg", referenced from:
      _brotli_encoder_create in brotli_nif.o
      _brotli_encoder_set_parameter in brotli_nif.o
      _brotli_encoder_has_more_output in brotli_nif.o
      _brotli_encoder_is_finished in brotli_nif.o
      _brotli_encoder_compress_stream in brotli_nif.o
      _brotli_encoder_take_output in brotli_nif.o
      _brotli_decoder_create in brotli_nif.o
      ...
  "_enif_make_binary", referenced from:
      _brotli_encoder_take_output in brotli_nif.o
      _brotli_decoder_take_output in brotli_nif.o
  "_enif_make_int", referenced from:
      _brotli_version in brotli_nif.o
  "_enif_make_resource", referenced from:
      _brotli_encoder_create in brotli_nif.o
      _brotli_decoder_create in brotli_nif.o
  "_enif_make_string", referenced from:
      _brotli_decoder_error_description in brotli_nif.o
  "_enif_make_tuple", referenced from:
      _brotli_version in brotli_nif.o
  "_enif_make_ulong", referenced from:
      _brotli_max_compressed_size in brotli_nif.o
  "_enif_open_resource_type", referenced from:
      _brotli_init in brotli_nif.o
  "_enif_release_resource", referenced from:
      _brotli_encoder_create in brotli_nif.o
      _brotli_decoder_create in brotli_nif.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [/Users/ME/deps/brotli/priv/brotli.so] Error 1
===> Hook for compile failed!
hauleth commented 2 years ago

Unfortunately I do not have currently M1 so I cannot test that. PR welcomed, but I cannot do much on my own there at the time.

tomciopp commented 2 years ago

I'm not sure if this is limited to the M1, will test on intel mac later.

yjh0502 commented 2 years ago

Hi, I tried but failed to reproduce the problem. Here's what I did to reproduce the problem.

Here's an output from my local environment:

erl-brotli % rebar3 shell       
===> Fetching covertool v2.0.4
===> Analyzing applications...
===> Compiling covertool
===> Fetching erlfmt v1.0.0
===> Analyzing applications...
===> Compiling erlfmt
===> Fetching rebar3_proper v0.12.1
===> Analyzing applications...
===> Compiling rebar3_proper
===> Fetching rebar3_ex_doc v0.2.8
===> Analyzing applications...
===> Compiling rebar3_ex_doc
===> Verifying dependencies...
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /opt/homebrew/Cellar/erlang/24.3/lib/erlang/erts-12.3/include/ -I ./include/  -c brotli_nif.c -o brotli_nif.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /opt/homebrew/Cellar/erlang/24.3/lib/erlang/erts-12.3/include/ -I ./include/  -c common/constants.c -o common/constants.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /opt/homebrew/Cellar/erlang/24.3/lib/erlang/erts-12.3/include/ -I ./include/  -c common/context.c -o common/context.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /opt/homebrew/Cellar/erlang/24.3/lib/erlang/erts-12.3/include/ -I ./include/  -c common/dictionary.c -o common/dictionary.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /opt/homebrew/Cellar/erlang/24.3/lib/erlang/erts-12.3/include/ -I ./include/  -c common/platform.c -o common/platform.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /opt/homebrew/Cellar/erlang/24.3/lib/erlang/erts-12.3/include/ -I ./include/  -c common/transform.c -o common/transform.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /opt/homebrew/Cellar/erlang/24.3/lib/erlang/erts-12.3/include/ -I ./include/  -c dec/bit_reader.c -o dec/bit_reader.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /opt/homebrew/Cellar/erlang/24.3/lib/erlang/erts-12.3/include/ -I ./include/  -c dec/decode.c -o dec/decode.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /opt/homebrew/Cellar/erlang/24.3/lib/erlang/erts-12.3/include/ -I ./include/  -c dec/huffman.c -o dec/huffman.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /opt/homebrew/Cellar/erlang/24.3/lib/erlang/erts-12.3/include/ -I ./include/  -c dec/state.c -o dec/state.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /opt/homebrew/Cellar/erlang/24.3/lib/erlang/erts-12.3/include/ -I ./include/  -c enc/backward_references.c -o enc/backward_references.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /opt/homebrew/Cellar/erlang/24.3/lib/erlang/erts-12.3/include/ -I ./include/  -c enc/backward_references_hq.c -o enc/backward_references_hq.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /opt/homebrew/Cellar/erlang/24.3/lib/erlang/erts-12.3/include/ -I ./include/  -c enc/bit_cost.c -o enc/bit_cost.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /opt/homebrew/Cellar/erlang/24.3/lib/erlang/erts-12.3/include/ -I ./include/  -c enc/block_splitter.c -o enc/block_splitter.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /opt/homebrew/Cellar/erlang/24.3/lib/erlang/erts-12.3/include/ -I ./include/  -c enc/brotli_bit_stream.c -o enc/brotli_bit_stream.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /opt/homebrew/Cellar/erlang/24.3/lib/erlang/erts-12.3/include/ -I ./include/  -c enc/cluster.c -o enc/cluster.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /opt/homebrew/Cellar/erlang/24.3/lib/erlang/erts-12.3/include/ -I ./include/  -c enc/command.c -o enc/command.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /opt/homebrew/Cellar/erlang/24.3/lib/erlang/erts-12.3/include/ -I ./include/  -c enc/compress_fragment.c -o enc/compress_fragment.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /opt/homebrew/Cellar/erlang/24.3/lib/erlang/erts-12.3/include/ -I ./include/  -c enc/compress_fragment_two_pass.c -o enc/compress_fragment_two_pass.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /opt/homebrew/Cellar/erlang/24.3/lib/erlang/erts-12.3/include/ -I ./include/  -c enc/dictionary_hash.c -o enc/dictionary_hash.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /opt/homebrew/Cellar/erlang/24.3/lib/erlang/erts-12.3/include/ -I ./include/  -c enc/encode.c -o enc/encode.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /opt/homebrew/Cellar/erlang/24.3/lib/erlang/erts-12.3/include/ -I ./include/  -c enc/encoder_dict.c -o enc/encoder_dict.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /opt/homebrew/Cellar/erlang/24.3/lib/erlang/erts-12.3/include/ -I ./include/  -c enc/entropy_encode.c -o enc/entropy_encode.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /opt/homebrew/Cellar/erlang/24.3/lib/erlang/erts-12.3/include/ -I ./include/  -c enc/fast_log.c -o enc/fast_log.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /opt/homebrew/Cellar/erlang/24.3/lib/erlang/erts-12.3/include/ -I ./include/  -c enc/histogram.c -o enc/histogram.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /opt/homebrew/Cellar/erlang/24.3/lib/erlang/erts-12.3/include/ -I ./include/  -c enc/literal_cost.c -o enc/literal_cost.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /opt/homebrew/Cellar/erlang/24.3/lib/erlang/erts-12.3/include/ -I ./include/  -c enc/memory.c -o enc/memory.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /opt/homebrew/Cellar/erlang/24.3/lib/erlang/erts-12.3/include/ -I ./include/  -c enc/metablock.c -o enc/metablock.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /opt/homebrew/Cellar/erlang/24.3/lib/erlang/erts-12.3/include/ -I ./include/  -c enc/static_dict.c -o enc/static_dict.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /opt/homebrew/Cellar/erlang/24.3/lib/erlang/erts-12.3/include/ -I ./include/  -c enc/utf8_util.c -o enc/utf8_util.o
cc brotli_nif.o common/constants.o common/context.o common/dictionary.o common/platform.o common/transform.o dec/bit_reader.o dec/decode.o dec/huffman.o dec/state.o enc/backward_references.o enc/backward_references_hq.o enc/bit_cost.o enc/block_splitter.o enc/brotli_bit_stream.o enc/cluster.o enc/command.o enc/compress_fragment.o enc/compress_fragment_two_pass.o enc/dictionary_hash.o enc/encode.o enc/encoder_dict.o enc/entropy_encode.o enc/fast_log.o enc/histogram.o enc/literal_cost.o enc/memory.o enc/metablock.o enc/static_dict.o enc/utf8_util.o -flat_namespace -undefined suppress -shared -rdynamic  -o /Users/jihyun/r/g/erl-brotli/priv/brotli.so
===> Analyzing applications...
===> Compiling brotli
Erlang/OTP 24 [erts-12.3] [source] [64-bit] [smp:10:10] [ds:10:10:10] [async-threads:1] [dtrace]

Eshell V12.3  (abort with ^G)
1> brotli:encode(<<"hello world">>).
{ok,<<11,5,128,104,101,108,108,111,32,119,111,114,108,
      100,3>>}

Could you check if you could reproduce the problem with Erlang & rebar3 shell? If so, could you share your console output?

tomciopp commented 2 years ago
rebar3 shell
===> Fetching covertool v2.0.4
===> Analyzing applications...
===> Compiling covertool
===> Fetching erlfmt v1.0.0
===> Analyzing applications...
===> Compiling erlfmt
===> Fetching rebar3_proper v0.12.1
===> Analyzing applications...
===> Compiling rebar3_proper
===> Fetching rebar3_ex_doc v0.2.8
===> Analyzing applications...
===> Compiling rebar3_ex_doc
===> Verifying dependencies...
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /Users/thomascioppettini/.asdf/installs/erlang/24.1/erts-12.1/include/ -I ./include/ -I/opt/homebrew/opt/openssl@1.1/include -c brotli_nif.c -o brotli_nif.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /Users/thomascioppettini/.asdf/installs/erlang/24.1/erts-12.1/include/ -I ./include/ -I/opt/homebrew/opt/openssl@1.1/include -c common/constants.c -o common/constants.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /Users/thomascioppettini/.asdf/installs/erlang/24.1/erts-12.1/include/ -I ./include/ -I/opt/homebrew/opt/openssl@1.1/include -c common/context.c -o common/context.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /Users/thomascioppettini/.asdf/installs/erlang/24.1/erts-12.1/include/ -I ./include/ -I/opt/homebrew/opt/openssl@1.1/include -c common/dictionary.c -o common/dictionary.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /Users/thomascioppettini/.asdf/installs/erlang/24.1/erts-12.1/include/ -I ./include/ -I/opt/homebrew/opt/openssl@1.1/include -c common/platform.c -o common/platform.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /Users/thomascioppettini/.asdf/installs/erlang/24.1/erts-12.1/include/ -I ./include/ -I/opt/homebrew/opt/openssl@1.1/include -c common/transform.c -o common/transform.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /Users/thomascioppettini/.asdf/installs/erlang/24.1/erts-12.1/include/ -I ./include/ -I/opt/homebrew/opt/openssl@1.1/include -c dec/bit_reader.c -o dec/bit_reader.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /Users/thomascioppettini/.asdf/installs/erlang/24.1/erts-12.1/include/ -I ./include/ -I/opt/homebrew/opt/openssl@1.1/include -c dec/decode.c -o dec/decode.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /Users/thomascioppettini/.asdf/installs/erlang/24.1/erts-12.1/include/ -I ./include/ -I/opt/homebrew/opt/openssl@1.1/include -c dec/huffman.c -o dec/huffman.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /Users/thomascioppettini/.asdf/installs/erlang/24.1/erts-12.1/include/ -I ./include/ -I/opt/homebrew/opt/openssl@1.1/include -c dec/state.c -o dec/state.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /Users/thomascioppettini/.asdf/installs/erlang/24.1/erts-12.1/include/ -I ./include/ -I/opt/homebrew/opt/openssl@1.1/include -c enc/backward_references.c -o enc/backward_references.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /Users/thomascioppettini/.asdf/installs/erlang/24.1/erts-12.1/include/ -I ./include/ -I/opt/homebrew/opt/openssl@1.1/include -c enc/backward_references_hq.c -o enc/backward_references_hq.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /Users/thomascioppettini/.asdf/installs/erlang/24.1/erts-12.1/include/ -I ./include/ -I/opt/homebrew/opt/openssl@1.1/include -c enc/bit_cost.c -o enc/bit_cost.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /Users/thomascioppettini/.asdf/installs/erlang/24.1/erts-12.1/include/ -I ./include/ -I/opt/homebrew/opt/openssl@1.1/include -c enc/block_splitter.c -o enc/block_splitter.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /Users/thomascioppettini/.asdf/installs/erlang/24.1/erts-12.1/include/ -I ./include/ -I/opt/homebrew/opt/openssl@1.1/include -c enc/brotli_bit_stream.c -o enc/brotli_bit_stream.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /Users/thomascioppettini/.asdf/installs/erlang/24.1/erts-12.1/include/ -I ./include/ -I/opt/homebrew/opt/openssl@1.1/include -c enc/cluster.c -o enc/cluster.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /Users/thomascioppettini/.asdf/installs/erlang/24.1/erts-12.1/include/ -I ./include/ -I/opt/homebrew/opt/openssl@1.1/include -c enc/command.c -o enc/command.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /Users/thomascioppettini/.asdf/installs/erlang/24.1/erts-12.1/include/ -I ./include/ -I/opt/homebrew/opt/openssl@1.1/include -c enc/compress_fragment.c -o enc/compress_fragment.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /Users/thomascioppettini/.asdf/installs/erlang/24.1/erts-12.1/include/ -I ./include/ -I/opt/homebrew/opt/openssl@1.1/include -c enc/compress_fragment_two_pass.c -o enc/compress_fragment_two_pass.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /Users/thomascioppettini/.asdf/installs/erlang/24.1/erts-12.1/include/ -I ./include/ -I/opt/homebrew/opt/openssl@1.1/include -c enc/dictionary_hash.c -o enc/dictionary_hash.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /Users/thomascioppettini/.asdf/installs/erlang/24.1/erts-12.1/include/ -I ./include/ -I/opt/homebrew/opt/openssl@1.1/include -c enc/encode.c -o enc/encode.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /Users/thomascioppettini/.asdf/installs/erlang/24.1/erts-12.1/include/ -I ./include/ -I/opt/homebrew/opt/openssl@1.1/include -c enc/encoder_dict.c -o enc/encoder_dict.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /Users/thomascioppettini/.asdf/installs/erlang/24.1/erts-12.1/include/ -I ./include/ -I/opt/homebrew/opt/openssl@1.1/include -c enc/entropy_encode.c -o enc/entropy_encode.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /Users/thomascioppettini/.asdf/installs/erlang/24.1/erts-12.1/include/ -I ./include/ -I/opt/homebrew/opt/openssl@1.1/include -c enc/fast_log.c -o enc/fast_log.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /Users/thomascioppettini/.asdf/installs/erlang/24.1/erts-12.1/include/ -I ./include/ -I/opt/homebrew/opt/openssl@1.1/include -c enc/histogram.c -o enc/histogram.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /Users/thomascioppettini/.asdf/installs/erlang/24.1/erts-12.1/include/ -I ./include/ -I/opt/homebrew/opt/openssl@1.1/include -c enc/literal_cost.c -o enc/literal_cost.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /Users/thomascioppettini/.asdf/installs/erlang/24.1/erts-12.1/include/ -I ./include/ -I/opt/homebrew/opt/openssl@1.1/include -c enc/memory.c -o enc/memory.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /Users/thomascioppettini/.asdf/installs/erlang/24.1/erts-12.1/include/ -I ./include/ -I/opt/homebrew/opt/openssl@1.1/include -c enc/metablock.c -o enc/metablock.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /Users/thomascioppettini/.asdf/installs/erlang/24.1/erts-12.1/include/ -I ./include/ -I/opt/homebrew/opt/openssl@1.1/include -c enc/static_dict.c -o enc/static_dict.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /Users/thomascioppettini/.asdf/installs/erlang/24.1/erts-12.1/include/ -I ./include/ -I/opt/homebrew/opt/openssl@1.1/include -c enc/utf8_util.c -o enc/utf8_util.o
cc brotli_nif.o common/constants.o common/context.o common/dictionary.o common/platform.o common/transform.o dec/bit_reader.o dec/decode.o dec/huffman.o dec/state.o enc/backward_references.o enc/backward_references_hq.o enc/bit_cost.o enc/block_splitter.o enc/brotli_bit_stream.o enc/cluster.o enc/command.o enc/compress_fragment.o enc/compress_fragment_two_pass.o enc/dictionary_hash.o enc/encode.o enc/encoder_dict.o enc/entropy_encode.o enc/fast_log.o enc/histogram.o enc/literal_cost.o enc/memory.o enc/metablock.o enc/static_dict.o enc/utf8_util.o -L/opt/homebrew/opt/openssl@1.1/lib -shared -rdynamic  -o /Users/thomascioppettini/oss/erl-brotli/priv/brotli.so
Undefined symbols for architecture arm64:
  "_enif_alloc", referenced from:
      _brotli_alloc in brotli_nif.o
  "_enif_alloc_binary", referenced from:
      _brotli_encoder_take_output in brotli_nif.o
      _brotli_decoder_take_output in brotli_nif.o
  "_enif_alloc_resource", referenced from:
      _brotli_encoder_create in brotli_nif.o
      _brotli_decoder_create in brotli_nif.o
  "_enif_compare", referenced from:
      _brotli_encoder_set_parameter in brotli_nif.o
      _brotli_encoder_compress_stream in brotli_nif.o
  "_enif_free", referenced from:
      _brotli_free in brotli_nif.o
  "_enif_get_resource", referenced from:
      _brotli_encoder_set_parameter in brotli_nif.o
      _brotli_encoder_has_more_output in brotli_nif.o
      _brotli_encoder_is_finished in brotli_nif.o
      _brotli_encoder_compress_stream in brotli_nif.o
      _brotli_encoder_take_output in brotli_nif.o
      _brotli_decoder_has_more_output in brotli_nif.o
      _brotli_decoder_is_finished in brotli_nif.o
      ...
  "_enif_get_uint", referenced from:
      _brotli_encoder_set_parameter in brotli_nif.o
  "_enif_get_ulong", referenced from:
      _brotli_max_compressed_size in brotli_nif.o
  "_enif_inspect_iolist_as_binary", referenced from:
      _brotli_encoder_compress_stream in brotli_nif.o
      _brotli_decoder_decompress_stream in brotli_nif.o
  "_enif_make_atom", referenced from:
      _brotli_init in brotli_nif.o
  "_enif_make_badarg", referenced from:
      _brotli_encoder_create in brotli_nif.o
      _brotli_encoder_set_parameter in brotli_nif.o
      _brotli_encoder_has_more_output in brotli_nif.o
      _brotli_encoder_is_finished in brotli_nif.o
      _brotli_encoder_compress_stream in brotli_nif.o
      _brotli_encoder_take_output in brotli_nif.o
      _brotli_decoder_create in brotli_nif.o
      ...
  "_enif_make_binary", referenced from:
      _brotli_encoder_take_output in brotli_nif.o
      _brotli_decoder_take_output in brotli_nif.o
  "_enif_make_int", referenced from:
      _brotli_version in brotli_nif.o
  "_enif_make_resource", referenced from:
      _brotli_encoder_create in brotli_nif.o
      _brotli_decoder_create in brotli_nif.o
  "_enif_make_string", referenced from:
      _brotli_decoder_error_description in brotli_nif.o
  "_enif_make_tuple", referenced from:
      _brotli_version in brotli_nif.o
  "_enif_make_ulong", referenced from:
      _brotli_max_compressed_size in brotli_nif.o
  "_enif_open_resource_type", referenced from:
      _brotli_init in brotli_nif.o
  "_enif_release_resource", referenced from:
      _brotli_encoder_create in brotli_nif.o
      _brotli_decoder_create in brotli_nif.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [/Users/thomascioppettini/oss/erl-brotli/priv/brotli.so] Error 1
yjh0502 commented 2 years ago

@tomciopp It seems that $LDFLAGS is defined in your environment. Could you share an output from following command?

env | grep LDFLAGS

Could you retry it after un-setting LDFLAGS? You could do it by unset LDFLAGS.

tomciopp commented 2 years ago

@yjh0502 Yep that was it, thanks a million

vanderhoop commented 2 years ago

hey @yjh0502 (and possibly @hauleth, as I'm using this package via Phoenix Bakery), I'm running into a similar issue as I try to upgrade our app, hosted on Gigalixir, from elixir 1.10.2/otp 22.1.6—where these packages have been working perfectly—to elixir 1.13.4/otp 24.3.4. (Note: this upgrade is currently somewhat aggressive due to constraints on the elixir/otp version tuples in CircleCi's convenience images, but the next step on our end is to isolate whether the issue is the erlang upgrade or the elixir upgrade).

The Gigalixir containers are running Ubuntu 20.04.3 LTS. I should also note that phx.digest package is working fine on my local env (Mac OS 10.12/Intel i7) with these upgrades.

compilation outout for brotli (seemingly successful):

make: Entering directory '/tmp/build/deps/brotli/c_src'
       cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /app/.platform_tools/erlang/erts-12.3.2/include/ -I ./include/  -c brotli_nif.c -o brotli_nif.o
       cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /app/.platform_tools/erlang/erts-12.3.2/include/ -I ./include/  -c common/platform.c -o common/platform.o
       cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /app/.platform_tools/erlang/erts-12.3.2/include/ -I ./include/  -c common/transform.c -o common/transform.o
       cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /app/.platform_tools/erlang/erts-12.3.2/include/ -I ./include/  -c common/constants.c -o common/constants.o
       cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /app/.platform_tools/erlang/erts-12.3.2/include/ -I ./include/  -c common/context.c -o common/context.o
       cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /app/.platform_tools/erlang/erts-12.3.2/include/ -I ./include/  -c common/dictionary.c -o common/dictionary.o
       cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /app/.platform_tools/erlang/erts-12.3.2/include/ -I ./include/  -c dec/state.c -o dec/state.o
       cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /app/.platform_tools/erlang/erts-12.3.2/include/ -I ./include/  -c dec/huffman.c -o dec/huffman.o
       cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /app/.platform_tools/erlang/erts-12.3.2/include/ -I ./include/  -c dec/decode.c -o dec/decode.o
       cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /app/.platform_tools/erlang/erts-12.3.2/include/ -I ./include/  -c dec/bit_reader.c -o dec/bit_reader.o
       cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /app/.platform_tools/erlang/erts-12.3.2/include/ -I ./include/  -c enc/literal_cost.c -o enc/literal_cost.o
       cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /app/.platform_tools/erlang/erts-12.3.2/include/ -I ./include/  -c enc/compress_fragment.c -o enc/compress_fragment.o
       cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /app/.platform_tools/erlang/erts-12.3.2/include/ -I ./include/  -c enc/brotli_bit_stream.c -o enc/brotli_bit_stream.o
       cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /app/.platform_tools/erlang/erts-12.3.2/include/ -I ./include/  -c enc/fast_log.c -o enc/fast_log.o
       cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /app/.platform_tools/erlang/erts-12.3.2/include/ -I ./include/  -c enc/utf8_util.c -o enc/utf8_util.o
       cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /app/.platform_tools/erlang/erts-12.3.2/include/ -I ./include/  -c enc/histogram.c -o enc/histogram.o
       cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /app/.platform_tools/erlang/erts-12.3.2/include/ -I ./include/  -c enc/bit_cost.c -o enc/bit_cost.o
       cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /app/.platform_tools/erlang/erts-12.3.2/include/ -I ./include/  -c enc/cluster.c -o enc/cluster.o
       cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /app/.platform_tools/erlang/erts-12.3.2/include/ -I ./include/  -c enc/backward_references.c -o enc/backward_references.o
       cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /app/.platform_tools/erlang/erts-12.3.2/include/ -I ./include/  -c enc/encode.c -o enc/encode.o
       cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /app/.platform_tools/erlang/erts-12.3.2/include/ -I ./include/  -c enc/entropy_encode.c -o enc/entropy_encode.o
       cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /app/.platform_tools/erlang/erts-12.3.2/include/ -I ./include/  -c enc/encoder_dict.c -o enc/encoder_dict.o
       cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /app/.platform_tools/erlang/erts-12.3.2/include/ -I ./include/  -c enc/static_dict.c -o enc/static_dict.o
       cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /app/.platform_tools/erlang/erts-12.3.2/include/ -I ./include/  -c enc/metablock.c -o enc/metablock.o
       cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /app/.platform_tools/erlang/erts-12.3.2/include/ -I ./include/  -c enc/block_splitter.c -o enc/block_splitter.o
       cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /app/.platform_tools/erlang/erts-12.3.2/include/ -I ./include/  -c enc/memory.c -o enc/memory.o
       cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /app/.platform_tools/erlang/erts-12.3.2/include/ -I ./include/  -c enc/command.c -o enc/command.o
       cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /app/.platform_tools/erlang/erts-12.3.2/include/ -I ./include/  -c enc/compress_fragment_two_pass.c -o enc/compress_fragment_two_pass.o
       cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /app/.platform_tools/erlang/erts-12.3.2/include/ -I ./include/  -c enc/backward_references_hq.c -o enc/backward_references_hq.o
       cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /app/.platform_tools/erlang/erts-12.3.2/include/ -I ./include/  -c enc/dictionary_hash.c -o enc/dictionary_hash.o
       cc brotli_nif.o common/platform.o common/transform.o common/constants.o common/context.o common/dictionary.o dec/state.o dec/huffman.o dec/decode.o dec/bit_reader.o enc/literal_cost.o enc/compress_fragment.o enc/brotli_bit_stream.o enc/fast_log.o enc/utf8_util.o enc/histogram.o enc/bit_cost.o enc/cluster.o enc/backward_references.o enc/encode.o enc/entropy_encode.o enc/encoder_dict.o enc/static_dict.o enc/metablock.o enc/block_splitter.o enc/memory.o enc/command.o enc/compress_fragment_two_pass.o enc/backward_references_hq.o enc/dictionary_hash.o -shared -rdynamic  -o /tmp/build/deps/brotli/priv/brotli.so
       make: Leaving directory '/tmp/build/deps/brotli/c_src'

phx.digest barfing:

[warning] The on_load function for module brotli_nif returned:
       {:error,
       {:load_failed,
       'Failed to load NIF library: '/tmp/build/_build/prod/lib/brotli/priv/brotli.so: cannot open shared object file: No such file or directory''}}

       ** (UndefinedFunctionError) function :brotli_nif.encoder_create/0 is undefined (module :brotli_nif is not available)
       (brotli 0.3.1) :brotli_nif.encoder_create()
       (brotli 0.3.1) /tmp/build/deps/brotli/src/brotli_encoder.erl:58: :brotli_encoder.new/1
       (brotli 0.3.1) /tmp/build/deps/brotli/src/brotli.erl:60: :brotli.encode/2
       (phoenix_bakery 0.1.1) lib/phoenix_bakery/brotli.ex:32: PhoenixBakery.Brotli.compress/1
       (phoenix 1.6.8) lib/phoenix/digester.ex:170: anonymous fn/3 in Phoenix.Digester.write_to_disk/2
       (elixir 1.13.4) lib/enum.ex:937: Enum."-each/2-lists^foreach/1-0-"/2
       (phoenix 1.6.8) lib/phoenix/digester.ex:166: Phoenix.Digester.write_to_disk/2
       (elixir 1.13.4) lib/enum.ex:937: Enum."-each/2-lists^foreach/1-0-"/2

I've SSH'ed into the container to see if the LDFLAGS env var is set, but it isn't.

Any ideas what this might be?

hauleth commented 2 years ago

Will look into it when I will have moment to spare. The problem is that RN I do not have M1 so it is hard for me to test against it, but will do my best.

vanderhoop commented 2 years ago

hey @hauleth, thank you! Just a heads up that the problematic env is (Dockerized) Ubuntu 20.04.3! Additional notes on env are included in the comment above.

amitchaudhary140 commented 1 year ago

Hi, for me it is still not working. I have unset flags but then also the issue persists. I am using Mac M1 Pro Max with MacOS 13.

yjh0502 commented 1 year ago

@amitchaudhary140 I tried to reproduce the issue you mentioned on my m1, MacBook Air, but failed. Here's my local environment

% uname -a
Darwin air.local 22.2.0 Darwin Kernel Version 22.2.0: Fri Nov 11 02:04:44 PST 2022; root:xnu-8792.61.2~4/RELEASE_ARM64_T8103 arm64
% xcodebuild -version
Xcode 14.1
Build version 14B47b
% erl
Erlang/OTP 25 [erts-13.1.1] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit] [dtrace]
% rebar3 -v
rebar 3.20.0 on Erlang/OTP 25 Erts 13.1.1
% git rev-parse --short HEAD
75edc24
% rebar3 compile
===> Fetching covertool v2.0.4
===> Analyzing applications...
===> Compiling covertool
===> Fetching erlfmt v1.1.0
===> Analyzing applications...
===> Compiling erlfmt
===> Fetching rebar3_proper v0.12.1
===> Analyzing applications...
===> Compiling rebar3_proper
===> Fetching rebar3_ex_doc v0.2.14
===> Analyzing applications...
===> Compiling rebar3_ex_doc
===> Verifying dependencies...
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /opt/homebrew/Cellar/erlang/25.1.1/lib/erlang/erts-13.1.1/include/ -I ./include/  -c brotli_nif.c -o brotli_nif.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /opt/homebrew/Cellar/erlang/25.1.1/lib/erlang/erts-13.1.1/include/ -I ./include/  -c common/constants.c -o common/constants.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /opt/homebrew/Cellar/erlang/25.1.1/lib/erlang/erts-13.1.1/include/ -I ./include/  -c common/context.c -o common/context.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /opt/homebrew/Cellar/erlang/25.1.1/lib/erlang/erts-13.1.1/include/ -I ./include/  -c common/dictionary.c -o common/dictionary.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /opt/homebrew/Cellar/erlang/25.1.1/lib/erlang/erts-13.1.1/include/ -I ./include/  -c common/platform.c -o common/platform.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /opt/homebrew/Cellar/erlang/25.1.1/lib/erlang/erts-13.1.1/include/ -I ./include/  -c common/transform.c -o common/transform.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /opt/homebrew/Cellar/erlang/25.1.1/lib/erlang/erts-13.1.1/include/ -I ./include/  -c dec/bit_reader.c -o dec/bit_reader.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /opt/homebrew/Cellar/erlang/25.1.1/lib/erlang/erts-13.1.1/include/ -I ./include/  -c dec/decode.c -o dec/decode.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /opt/homebrew/Cellar/erlang/25.1.1/lib/erlang/erts-13.1.1/include/ -I ./include/  -c dec/huffman.c -o dec/huffman.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /opt/homebrew/Cellar/erlang/25.1.1/lib/erlang/erts-13.1.1/include/ -I ./include/  -c dec/state.c -o dec/state.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /opt/homebrew/Cellar/erlang/25.1.1/lib/erlang/erts-13.1.1/include/ -I ./include/  -c enc/backward_references.c -o enc/backward_references.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /opt/homebrew/Cellar/erlang/25.1.1/lib/erlang/erts-13.1.1/include/ -I ./include/  -c enc/backward_references_hq.c -o enc/backward_references_hq.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /opt/homebrew/Cellar/erlang/25.1.1/lib/erlang/erts-13.1.1/include/ -I ./include/  -c enc/bit_cost.c -o enc/bit_cost.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /opt/homebrew/Cellar/erlang/25.1.1/lib/erlang/erts-13.1.1/include/ -I ./include/  -c enc/block_splitter.c -o enc/block_splitter.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /opt/homebrew/Cellar/erlang/25.1.1/lib/erlang/erts-13.1.1/include/ -I ./include/  -c enc/brotli_bit_stream.c -o enc/brotli_bit_stream.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /opt/homebrew/Cellar/erlang/25.1.1/lib/erlang/erts-13.1.1/include/ -I ./include/  -c enc/cluster.c -o enc/cluster.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /opt/homebrew/Cellar/erlang/25.1.1/lib/erlang/erts-13.1.1/include/ -I ./include/  -c enc/command.c -o enc/command.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /opt/homebrew/Cellar/erlang/25.1.1/lib/erlang/erts-13.1.1/include/ -I ./include/  -c enc/compress_fragment.c -o enc/compress_fragment.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /opt/homebrew/Cellar/erlang/25.1.1/lib/erlang/erts-13.1.1/include/ -I ./include/  -c enc/compress_fragment_two_pass.c -o enc/compress_fragment_two_pass.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /opt/homebrew/Cellar/erlang/25.1.1/lib/erlang/erts-13.1.1/include/ -I ./include/  -c enc/dictionary_hash.c -o enc/dictionary_hash.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /opt/homebrew/Cellar/erlang/25.1.1/lib/erlang/erts-13.1.1/include/ -I ./include/  -c enc/encode.c -o enc/encode.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /opt/homebrew/Cellar/erlang/25.1.1/lib/erlang/erts-13.1.1/include/ -I ./include/  -c enc/encoder_dict.c -o enc/encoder_dict.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /opt/homebrew/Cellar/erlang/25.1.1/lib/erlang/erts-13.1.1/include/ -I ./include/  -c enc/entropy_encode.c -o enc/entropy_encode.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /opt/homebrew/Cellar/erlang/25.1.1/lib/erlang/erts-13.1.1/include/ -I ./include/  -c enc/fast_log.c -o enc/fast_log.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /opt/homebrew/Cellar/erlang/25.1.1/lib/erlang/erts-13.1.1/include/ -I ./include/  -c enc/histogram.c -o enc/histogram.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /opt/homebrew/Cellar/erlang/25.1.1/lib/erlang/erts-13.1.1/include/ -I ./include/  -c enc/literal_cost.c -o enc/literal_cost.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /opt/homebrew/Cellar/erlang/25.1.1/lib/erlang/erts-13.1.1/include/ -I ./include/  -c enc/memory.c -o enc/memory.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /opt/homebrew/Cellar/erlang/25.1.1/lib/erlang/erts-13.1.1/include/ -I ./include/  -c enc/metablock.c -o enc/metablock.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /opt/homebrew/Cellar/erlang/25.1.1/lib/erlang/erts-13.1.1/include/ -I ./include/  -c enc/static_dict.c -o enc/static_dict.o
cc -O3 -std=c99 -finline-functions -Wall -fPIC -I /opt/homebrew/Cellar/erlang/25.1.1/lib/erlang/erts-13.1.1/include/ -I ./include/  -c enc/utf8_util.c -o enc/utf8_util.o
cc brotli_nif.o common/constants.o common/context.o common/dictionary.o common/platform.o common/transform.o dec/bit_reader.o dec/decode.o dec/huffman.o dec/state.o enc/backward_references.o enc/backward_references_hq.o enc/bit_cost.o enc/block_splitter.o enc/brotli_bit_stream.o enc/cluster.o enc/command.o enc/compress_fragment.o enc/compress_fragment_two_pass.o enc/dictionary_hash.o enc/encode.o enc/encoder_dict.o enc/entropy_encode.o enc/fast_log.o enc/histogram.o enc/literal_cost.o enc/memory.o enc/metablock.o enc/static_dict.o enc/utf8_util.o -flat_namespace -undefined suppress -shared -rdynamic  -o /Users/jihyun/r/g/erl-brotli/priv/brotli.so
===> Analyzing applications...
===> Compiling brotli

Could you share an error outputs, local toolchain versions and environment variables (from env command) so that I could dig into the issue? Thanks.

amitchaudhary140 commented 1 year ago

@yjh0502

Error

image

Versions: I installed them via asdf.

image

I also tried with below version combination:

erlang 25.0 elixir 1.13.4

Env Variables

image

I also tried using Rosetta Terminal where I downloaded deps again.

image

By the way, I don't see any LDFLAGS set from the beginning.

It would be great help as I am unable to start my work due to just this error.

yjh0502 commented 1 year ago

@amitchaudhary140 Could you share a full output and from a command, including a command you used, as a text? Thanks.

amitchaudhary140 commented 1 year ago

@yjh0502

Below is the text:

amitchaudhary@Amits-MacBook-Pro-2 platform % ./platform.sh run Erlang/OTP 24 [erts-12.2.1] [source] [64-bit] [smp:10:10] [ds:10:10:10] [async-threads:1]

Makefile:48: target /Users/amitchaudhary/Desktop/D' given more than once in the same rule. Makefile:55: warning: overriding commands for target/Users/amitchaudhary/Desktop/D' Makefile:49: warning: ignoring old commands for target /Users/amitchaudhary/Desktop/D' Makefile:54: target/Users/amitchaudhary/Desktop/D' given more than once in the same rule. cc common/constants.o common/context.o common/dictionary.o common/platform.o common/transform.o dec/bit_reader.o dec/decode.o dec/huffman.o dec/state.o enc/backward_references.o enc/backward_references_hq.o enc/bit_cost.o enc/block_splitter.o enc/brotli_bit_stream.o enc/cluster.o enc/command.o enc/compress_fragment.o enc/compress_fragment_two_pass.o enc/dictionary_hash.o enc/encode.o enc/encoder_dict.o enc/entropy_encode.o enc/fast_log.o enc/histogram.o enc/literal_cost.o enc/memory.o enc/metablock.o enc/static_dict.o enc/utf8_util.o tools/brotli.o brotli_nif.o -lm -o /Users/amitchaudhary/Desktop/D Undefined symbols for architecture arm64: "_enif_alloc", referenced from: _brotli_alloc in brotli_nif.o "_enif_alloc_binary", referenced from: _brotli_encoder_take_output in brotli_nif.o _brotli_decoder_take_output in brotli_nif.o "_enif_alloc_resource", referenced from: _brotli_encoder_create in brotli_nif.o _brotli_decoder_create in brotli_nif.o "_enif_compare", referenced from: _brotli_encoder_set_parameter in brotli_nif.o _brotli_encoder_compress_stream in brotli_nif.o "_enif_free", referenced from: _brotli_free in brotli_nif.o "_enif_get_resource", referenced from: _brotli_encoder_set_parameter in brotli_nif.o _brotli_encoder_has_more_output in brotli_nif.o _brotli_encoder_is_finished in brotli_nif.o _brotli_encoder_compress_stream in brotli_nif.o _brotli_encoder_take_output in brotli_nif.o _brotli_decoder_has_more_output in brotli_nif.o _brotli_decoder_is_finished in brotli_nif.o ... "_enif_get_uint", referenced from: _brotli_encoder_set_parameter in brotli_nif.o "_enif_get_ulong", referenced from: _brotli_max_compressed_size in brotli_nif.o "_enif_inspect_iolist_as_binary", referenced from: _brotli_encoder_compress_stream in brotli_nif.o _brotli_decoder_decompress_stream in brotli_nif.o "_enif_make_atom", referenced from: _brotli_init in brotli_nif.o "_enif_make_badarg", referenced from: _brotli_encoder_create in brotli_nif.o _brotli_encoder_set_parameter in brotli_nif.o _brotli_encoder_has_more_output in brotli_nif.o _brotli_encoder_is_finished in brotli_nif.o _brotli_encoder_compress_stream in brotli_nif.o _brotli_encoder_take_output in brotli_nif.o _brotli_decoder_create in brotli_nif.o ... "_enif_make_binary", referenced from: _brotli_encoder_take_output in brotli_nif.o _brotli_decoder_take_output in brotli_nif.o "_enif_make_int", referenced from: _brotli_version in brotli_nif.o "_enif_make_resource", referenced from: _brotli_encoder_create in brotli_nif.o _brotli_decoder_create in brotli_nif.o "_enif_make_string", referenced from: _brotli_decoder_error_description in brotli_nif.o "_enif_make_tuple", referenced from: _brotli_version in brotli_nif.o "_enif_make_ulong", referenced from: _brotli_max_compressed_size in brotli_nif.o "_enif_open_resource_type", referenced from: _brotli_init in brotli_nif.o "_enif_release_resource", referenced from: _brotli_encoder_create in brotli_nif.o _brotli_decoder_create in brotli_nif.o ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [/Users/amitchaudhary/Desktop/D] Error 1 ===> Hook for compile failed!

* (Mix) Could not compile dependency :brotli, "/Users/amitchaudhary/.asdf/installs/elixir/1.13.3/.mix/rebar3 bare compile --paths /Users/amitchaudhary/Desktop/D Drive/Projects//platform_new/platform/_build/dev/lib//ebin" command failed. Errors may have been logged above. You can recompile this dependency with "mix deps.compile brotli", update it with "mix deps.update brotli" or clean it with "mix deps.clean brotli" amitchaudhary@Amits-MacBook-Pro-2 platform %

Note: The platform.sh is a batch file to just run all apps together.

yjh0502 commented 1 year ago

@amitchaudhary140 It seems that makefile, which is used to build c source code of this project, does not support whitespace on pathname. You could workaround the issue by removing whitespace D Drive from the path.

amitchaudhary140 commented 1 year ago

@yjh0502 Let me try that. Request you to be online for sometime.

amitchaudhary140 commented 1 year ago

@yjh0502 Yes, that was the issue so far. Thank you very much for your time.