Hello.
I’m making a login function in my server. I’d like to use argon2 for hashing password. After installing {:argon2_elixir, "~> 2.0"} by mix deps.get, I have tried to compile the phoenix project.
==> argon2_elixir
mkdir -p priv
clang -02 -g -Wno-error=implicit-function-declaration -pthread -O3 -Wall -g -Iargon2/include -Iargon2/src -Ic_src -I"/Users/kunosouichirou/.asdf/installs/erlang/23.0.4/erts-11.0.4/include/" -dynamiclib -undefined dynamic_lookup argon2/src/argon2.c argon2/src/core.c argon2/src/blake2/blake2b.c argon2/src/thread.c argon2/src/encoding.c argon2/src/ref.c c_src/argon2_nif.c -o priv/argon2_nif.so
clang: error: unknown argument: '-02'
make: *** [priv/argon2_nif.so] Error 1
could not compile dependency :argon2_elixir, "mix compile" failed. You can recompile this dependency with "mix deps.compile argon2_elixir", update it with "mix deps.update argon2_elixir" or clean it with "mix deps.clean argon2_elixir"
==> milk
** (Mix) Could not compile with "make" (exit status: 2).
You need to have gcc and make installed. Try running the
commands "gcc --version" and / or "make --version". If these programs
are not installed, you will be prompted to install them.
It stopped compiling at the process of argon2.
I guess it is a problem around my MacOS, but I have no clue to solve the problem.
make --version
GNU Make 3.81
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
This program built for i386-apple-darwin11.3.0
papillon@ ~/D/G/M/m/newman> gcc --version
gcc (Homebrew GCC 10.2.0) 10.2.0
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Based upon your message it would seem that the Makefile for argon 2 is incorrect in that it is specifying -02 when it should probably be -O2 as suggested by @ahamez
Two suggestions:
File a bug report on argon2_elixir
As a workaround, look in ./deps/argon2_elixir for a file called Makefile. In that file look for the line that includes clang -02 .... and change it to clang -O2 .... and then try mix deps.compile argon2_elixir