animetosho / ParPar

High performance PAR2 create client for NodeJS
190 stars 19 forks source link

macOS compile error #17

Closed samelie closed 4 years ago

samelie commented 4 years ago

Versions sw_vers

ProductName: Mac OS X ProductVersion: 10.13.6 BuildVersion: 17G65

node --version

v8.14.0

gcc --version

Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 Apple LLVM version 9.0.0 (clang-900.0.39.2) Target: x86_64-apple-darwin17.7.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

/usr/bin/xcodebuild -version

Xcode 9.2 Build version 9C40`

The error $ npm install -g @animetosho/parpar

clang: error: unsupported option '-fopenmp'`

I've just done basic novice searching and nothing has worked. Any help appreciated

animetosho commented 4 years ago

Thanks for the report!

It seems like the stock compiler on OSX doesn't have OpenMP support. You may need to install a version of GCC/Clang with OpenMP support. See issue #7

I've just made a change to try to detect lack of OpenMP support and continue regardless, although it doesn't seem to work in all cases. ParPar can run without OpenMP, however, it'll only run on one thread, so performance won't be as good.

samelie commented 4 years ago

Thanks for the reply and the pointers. I just tried following bgeet's notes and it started working: this was linked before, echo 'export PATH="/usr/local/opt/llvm/bin:$PATH"' >> ~/.zshrc , but maybe I needed a restart? I installed from source, except after the node-gyp rebuild, I did npm i -g Excellent work on this, you have great skill.

animetosho commented 4 years ago

Thanks for confirming that it works.

I think you need to restart the shell/terminal (or open a new one) for it to read and apply the RC file, assuming that's not what you did. You can also apply it to the current shell instantly by executing the command (export PATH="/usr/local/opt/llvm/bin:$PATH") directly.