#15 patch to disable optimizations unless building with GCC

closed-wont-fix
nobody
None
5
2008-03-18
2008-03-09
No

This patch simply wraps the following define with #ifdef __GNUC__ as follows

#ifdef __GNUC__
#define ALLOW OPTIMIZATIONS 1
#endif

Since the optimizations only compile with the GCC compiler, this fix allows you to build audacity without optimizations when building with other compilers, such as Sun Studio.

Note the patch also removes all the ^M characters from lib-src/soundtouch/soundtouch/STTypes.h file.

At some future date it might be good to fix the optimization code so it also builds with Sun Studio (perhaps via using mediaLib), but that can be done later.

Discussion

  • Brian Cameron

    Brian Cameron - 2008-03-09

    patch so optimizations are only built when using GCC compiler

     
  • Richard Ash

    Richard Ash - 2008-03-16

    Logged In: YES
    user_id=950206
    Originator: NO

    So the majority of the patch is concerned with changing the DOS line ends in lib-src/soundtouch/soundtouch/STTypes.h to UNIX line ends (^M). Unless there is a need to do this (like some compiler that won't take DOS format files), I don't really want to do this, not least because it may affect other platforms / compilers.

    The first few lines seem plausible, but I'm wondering whether #ifndef sun might be better. It depends whether this works on BSD or not - as they will not have GNU libc, but would probably be building with gcc, so there is a chance it might work as it is, but not with the change in.

     
  • Brian Cameron

    Brian Cameron - 2008-03-16

    Logged In: YES
    user_id=689771
    Originator: YES

    If you don't want to change the ^M characters at the end of each line, then please ignore those aspects of the patch. Would you like me to provide an updated patch without these changes ^M changes?

    Using #ifndef sun is not a good solution because you can use the GCC compiler on Solaris. If building on Solaris x86 with GCC, then you probably want these optimizations to be included, no?

    I don't believe the existence (or not) of GNU libc makes a difference in regards to whether #ifdef __GCC__ is set. This should be set directly by the compiler. Remember you can link against GNU libc if not using the GCC compiler, and you can link against non-GNU libc if you are using the GCC compiler, and any other combinations you can imagine. Therefore, it would not make sense for a specific libc version to affect the setting of an #ifdef used to identify the
    compiler being used.

    If you want, you can also use these macros if you just want to disable this code for Sun Studio specifically:

    #ifdef SUNPRO_C /* Sun Studio C compiler */
    #ifdef SUNPRO_CC /* Sun Studio C++ compiler */

    However, it seems better to disable GCC-specific code when not using GCC rather than disabling it when using particular non-GCC compilers (like Sun Studio).

     
  • Brian Cameron

    Brian Cameron - 2008-03-18

    Logged In: YES
    user_id=689771
    Originator: YES

    Now that SoundTouch isn't included directly in audacity anymore, I will close this bug as "will not fix". I will take up this patch directly with the SoundTouch maintainer.

     
  • Brian Cameron

    Brian Cameron - 2008-03-18
    • status: open --> closed-wont-fix
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks