I get the following message when cross compiling Opus 1.2.1 for android with clang in a standalone build. CC src/opus_decoder.lo src/opus_decoder.c:37:10: warning: You appear to be compiling without optimization, if so opus will be very slow. [-W#pragma-messages] # pragma message "You appear to be compiling without optimization, if so opus will be very slow." Looking at the lines in question I see: #if defined(__GNUC__) && (__GNUC__ >= 2) && !defined(__OPTIMIZE__) && !defined(OPUS_WILL_BE_SLOW) # pragma message "You appear to be compiling without optimization, if so opus will be very slow." #endif A quick find/grep, however, shows no place where __OPTIMIZE__ or OPUS_WILL_BE_SLOW are actually defined--so presumably I would have to pass them in. And the only place __OPTIMIZE__ is *used* is in x86cpu.h, so why isn't the warning over in that file? What am I missing? Presumably I can ignore that warning? Thanks, -a
I'm also interested in this warning as I have received it when compiling libopus for WebAssembly using Emscripten and have an open ticket (just saw that you responded to it, thanks for that!) https://stackoverflow.com/questions/49537429/building-compiling-opus-libopus-in-emscripten-with-optimization/ -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.xiph.org/pipermail/opus/attachments/20180508/18ef408a/attachment.html>
Chris McGowan wrote:> I'm also interested in this warning as I have received it when compiling > libopus for WebAssembly using Emscripten and have an open ticket (just > saw that you responded to it, thanks for that!)This happens when you compile without -O2 or any other optimization setting above -O0. This just controls general compiler optimizations, and the check is not specific to x86. The warning is there because people often create their own build system (which is fine), but don't manage to get their CFLAGS set correctly and then complain that Opus is slow (which is less fine). If your compiler is pretending to be gcc but doesn't define __OPTIMIZE__ when you enable optimizations, please file a bug against that compiler. In the mean time, if you are sure you are passing the proper optimization flags, feel free to silence the warning with a -D option.
Seemingly Similar Threads
- Where to send emails with questions about WebAssembly?
- Wasm, start function, and default globals
- Compile R to WebAssembly / Emscripten?
- (wasm-ld) Any fundamental problems with linking a shared wasm library statically?
- Compiling opus with emscripten: malloc_hook