Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Mix) Could not compile dependency hoedown #11

Open
dlcmh opened this issue Jul 2, 2015 · 3 comments
Open

(Mix) Could not compile dependency hoedown #11

dlcmh opened this issue Jul 2, 2015 · 3 comments

Comments

@dlcmh
Copy link

dlcmh commented Jul 2, 2015

Faced issue mentioned in the title - please help, thanks!

Machine is MacBook Air running Yosemite.

Elixir 1.0.5 & Erlang/OTP 18 installed.

Added {:markdown, github: "devinus/markdown"} to deps in mix.exs in a Phoenix project.

Ran mix deps.get -> no issues.

Ran mix phoenix.server and mix eps.compile hoedown several times -> here's what appeared:

mix phoenix.server
==> hoedown
cc -g -O3 -ansi -pedantic -Wall -Wextra -Wno-unused-parameter -Isrc -fPIC -c -o src/autolink.o src/autolink.c
cc -g -O3 -ansi -pedantic -Wall -Wextra -Wno-unused-parameter -Isrc -fPIC -c -o src/buffer.o src/buffer.c
cc -g -O3 -ansi -pedantic -Wall -Wextra -Wno-unused-parameter -Isrc -fPIC -c -o src/document.o src/document.c
cc -g -O3 -ansi -pedantic -Wall -Wextra -Wno-unused-parameter -Isrc -fPIC -c -o src/escape.o src/escape.c
cc -g -O3 -ansi -pedantic -Wall -Wextra -Wno-unused-parameter -Isrc -fPIC -c -o src/html.o src/html.c
cc -g -O3 -ansi -pedantic -Wall -Wextra -Wno-unused-parameter -Isrc -fPIC -Wno-static-in-inline -c -o src/html_blocks.o src/html_blocks.c
cc -g -O3 -ansi -pedantic -Wall -Wextra -Wno-unused-parameter -Isrc -fPIC -c -o src/html_smartypants.o src/html_smartypants.c
cc -g -O3 -ansi -pedantic -Wall -Wextra -Wno-unused-parameter -Isrc -fPIC -c -o src/stack.o src/stack.c
cc -g -O3 -ansi -pedantic -Wall -Wextra -Wno-unused-parameter -Isrc -fPIC -c -o src/version.o src/version.c
cc -Wl,-soname,libhoedown.so.3 -shared src/autolink.o src/buffer.o src/document.o src/escape.o src/html.o src/html_blocks.o src/html_smartypants.o src/stack.o src/version.o  -o libhoedown.so.3
ld: unknown option: -soname
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [libhoedown.so.3] Error 1
==> hello_phoenix
** (Mix) Could not compile dependency hoedown, make command failed. If you want to recompile this dependency, please run: mix deps.compile hoedown
mylaptop:hello_phoenix$ mix deps.compile hoedown
==> hoedown
cc -Wl,-soname,libhoedown.so.3 -shared src/autolink.o src/buffer.o src/document.o src/escape.o src/html.o src/html_blocks.o src/html_smartypants.o src/stack.o src/version.o  -o libhoedown.so.3
ld: unknown option: -soname
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [libhoedown.so.3] Error 1
==> hello_phoenix
** (Mix) Could not compile dependency hoedown, make command failed. If you want to recompile this dependency, please run: mix deps.compile hoedown
@josevalim
Copy link
Contributor

I think you need a more recent gcc version. Either install it via homebrew or install Xcode command line tools with xcode-select --install.

@devinus
Copy link
Owner

devinus commented Jul 3, 2015

@dlcmh Try locking hoedown to tag 3.0.2:

{:hoedown, github: "hoedown/hoedown", tag: "3.0.2", override: true}

and report back

@dlcmh
Copy link
Author

dlcmh commented Jul 3, 2015

@devinus -> same result, I think the issue is with the use of -soname on OS X, as highlighted by the error message ld: unknown option: -soname which I got when I ran mix phoenix.server.

Googling "mac gcc soname install_name" suggests that -install_name is the correct option to use for OS X, instead of -soname -> when I replace -soname in deps/hoedown/Makefile with -install_name and run mix reps.compile hoedown, I get the following warnings, but compilation is successful and I was then able to useMarkdown.to_html in Phoenix controllers:

...

bin/hoedown.c:446:10: warning: comparison of integers of different signs: 'clock_t' (aka 'unsigned long') and 'int' [-Wsign-compare]
                if (t1 == -1 || t2 == -1) {
                    ~~ ^  ~~
bin/hoedown.c:446:22: warning: comparison of integers of different signs: 'clock_t' (aka 'unsigned long') and 'int' [-Wsign-compare]
                if (t1 == -1 || t2 == -1) {
                                ~~ ^  ~~
2 warnings generated.

...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants