romanbsd / fast-stemmer

Fast Porter stemmer based on a C version of the algorithm
MIT License
102 stars 15 forks source link

clang: error: unknown argument: '-multiply_definedsuppress' [-Wunused-command-line-argument-hard-error-in-future] #9

Closed parkr closed 9 years ago

parkr commented 10 years ago

Compilation error on Mac OS X with Xcode 5.1 seems to be failing more than usual. Have you seen this? Full gem_make.out dumps in the issues below:

Ref: https://github.com/jekyll/jekyll/issues/2125 & related issues

romanbsd commented 10 years ago

No idea, actually. Works fine here.

parkr commented 10 years ago

Yeah it works fine for me, too. We've just seen about 8 or so people in the last week have this problem. Do you set a unused-command-line-argument-hard-error-in-future flag anywhere?

thepatrick commented 10 years ago
ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future gem install fast-stemmer

Works around this issue for now.

Blaisorblade commented 10 years ago

Do you set a unused-command-line-argument-hard-error-in-future flag anywhere?

That's a default — EDIT: for newer clang.

https://langui.sh/2014/03/10/wunused-command-line-argument-hard-error-in-future-is-a-harsh-mistress/

Blaisorblade commented 10 years ago

A pitfall in your workaround: installation requires sudo for me, on OS X (see 2. below), and the option must be specified "inside" sudo (see 1.), not outside (see 3.), because sudo removes environment variables by default for security reasons:

  1. Correct:

    sudo ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future gem install fast-stemmer

  2. Installation without sudo:

    ERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory.

  3. This fails with the same error:

    ARCHFLAGS="-Wno-error=unused-command-line-argument-hard-error-in-future" sudo gem install fast-stemmer

timothyekl commented 10 years ago

@Blaisorblade: try preserving the environment by passing the -E option to sudo, e.g.:

ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future sudo -E gem install fast-stemmer
Blaisorblade commented 10 years ago

That works, as well as my solution 1. But to clarify: my comment is for reference to other people finding this (if any), I already found a workaround. Thanks a lot anyway!

kommi10 commented 10 years ago

"try preserving the environment by passing the -E option to sudo, e.g.:"

That worked for me, thanks @lithium3141!

siegfang commented 10 years ago

Now, you can just update to OS X 10.9.3 to fix this problem!