Results 1 to 6 of 6

Thread: [FIX] SVN compiling Error due #error "SSE2 instruction set not enabled" on gcc

  1. #1

    Default [FIX] SVN compiling Error due #error "SSE2 instruction set not enabled" on gcc

    This error occurs when the environment doesn't have automatic SSE2 instruction turned on. There is a simple test for this.

    Try and compile the file here.

    I found this is to occur specifically in the GDI section. This can be fixed with a simple one line patch to configure.ac.

    Code:
    Index: configure.ac
    ===================================================================
    --- configure.ac        (revision 3331)
    +++ configure.ac        (working copy)
    @@ -154,6 +154,7 @@
     fi
     extra_LIBS_clanSDL="-lSDL -lSDL_gfx"
     extra_LIBS_clanRegExp="-lpcre"
    +extra_CFLAGS_clanGUI="-msse2"
     
     dnl Store cflags for Setup/pkgconfig/clan*.in pkg-config files
     AC_SUBST(extra_CFLAGS_clanApp)
    This should be add with a if statement only for linux. I DO NOT KNOW HOW THIS WILL AFFECT OTHER PLATFORMS. (sorry for the caps).

    Also here is my gcc -v
    Code:
    Using built-in specs.
    Target: i486-linux-gnu
    Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.3.3-5ubuntu4' --with-bugurl=file:///usr/share/doc/gcc-4.3/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.3 --program-suffix=-4.3 --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-mpfr --enable-targets=all --with-tune=generic --enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu --target=i486-linux-gnu
    Thread model: posix
    gcc version 4.3.3 (Ubuntu 4.3.3-5ubuntu4)

  2. #2
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,824

    Default

    That's good

    Ideally, the configure app should try to compile (with the "-msse2" flag):
    Code:
    #include <emmintrin.h>
    
    int main(int argc, char* argv[])
    {
    	return 0;
    }
    Then enable / disable SSE2.

    ClanGUI has a #define to enable / disable it . (at the top of draw_image.cpp).

    I'll have a look next week

  3. #3
    ClanLib Developer
    Join Date
    Sep 2006
    Location
    Denmark
    Posts
    554

    Default

    My new CL_Rasterizer class does not have anything to disable SSE I'm afraid.

    This is one of the situations where I think its reasonable to ask people to upgrade their compiler if it is so old that it does not support something as SSE - especially since the performance gains are very significant.

  4. #4

    Default

    I did upgrade my compiler. SSE appears to be off for other reasons than just an old compiler. My compiler does have it enabled but it needs to be switched on.

  5. #5
    ClanLib Developer
    Join Date
    Sep 2006
    Location
    Denmark
    Posts
    554

    Default

    I should have been more specific. My comment was targeted to Rombust so he wouldn't spend time in the build system allowing to disable the SSE code, just to discover that I've written new code that totally cannot be switched off.

    Then I went on to rationalize why its reasonable to require people to upgrade their compilers (not yours, but those that do not support SEE at all) rather than spend a lot of time writing two code paths. There is one catch to this attitude though - clanGDI will only work on x86/x64 systems and not other CPU platforms. But I won't personally be the one that doubles the amount of work required to code on clanGDI to target platforms that do not interest me.

    Hope this makes it clearer what I meant.

  6. #6
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,824

    Default

    It should now be fixed in SVN

    The GDI target now compiles with the SSE2 flag (-msse2). If SSE2 is not available, then the GDI target is disabled.

Similar Threads

  1. Questin about "Tests : window1 project"
    By Eng C. Born in forum Official ClanLib SDK Forums
    Replies: 6
    Last Post: 05-12-2009, 06:46 PM
  2. Vista: "game.exe has stopped working"
    By Pleng in forum Novashell Game Creation System
    Replies: 5
    Last Post: 02-15-2009, 02:09 AM
  3. Multiple "keydown" signals on a single keystroke
    By zag in forum Official ClanLib SDK Forums
    Replies: 1
    Last Post: 10-19-2008, 11:04 PM
  4. undo on "replace selected" only does one at a time
    By whisperstorm in forum Novashell Game Creation System
    Replies: 1
    Last Post: 11-25-2006, 05:41 AM
  5. Di-Mart Guns -Explanation of the "Store Guy" event
    By rmcnew in forum Funeral Quest
    Replies: 2
    Last Post: 01-15-2004, 06:25 AM

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •