juce on amd64 X2

For Linux specific issues

status for juce-1.40

Postby patrickkidd » Wed Jan 31, 2007 2:53 am

I still get the seg fault in 1.40. Can I still use that patch on 1.40?
patrickkidd
JUCE Geek
 
Posts: 34
Joined: Mon Aug 21, 2006 7:45 am

Postby jules » Wed Jan 31, 2007 10:45 am

You should also try kraken's code that he posted in this thread:
juceforum/viewtopic.php?t=1312
User avatar
jules
Fearless Leader
 
Posts: 17364
Joined: Mon Sep 06, 2004 9:03 am
Location: London, UK

Postby patrickkidd » Wed Jan 31, 2007 8:48 pm

Looks like the patch first posted in this thread works ok - the one you just linked doesn'
t even compile!

Code: Select all
../../src/juce_core/basics/juce_Atomic.h: In function 'int juce::atomicDecrementAndReturn(int&)':
../../src/juce_core/basics/juce_Atomic.h:111: error: can't find a register in class 'AREG' while reloading 'asm'
../../src/juce_core/text/../basics/juce_Atomic.h: In function 'int juce::atomicDecrementAndReturn(int&)':
../../src/juce_core/text/../basics/juce_Atomic.h:111: error: can't find a register in class 'AREG' while reloading 'asm'


So if I am getting as far as my soundcard problem I assume the atomic stuff is working with the first patch. I think I will look further into it and create a new thread about it.
patrickkidd
JUCE Geek
 
Posts: 34
Joined: Mon Aug 21, 2006 7:45 am

Postby kraken » Wed Jan 31, 2007 9:25 pm

patrickkidd wrote:Looks like the patch first posted in this thread works ok - the one you just linked doesn'
t even compile!

Code: Select all
../../src/juce_core/basics/juce_Atomic.h: In function 'int juce::atomicDecrementAndReturn(int&)':
../../src/juce_core/basics/juce_Atomic.h:111: error: can't find a register in class 'AREG' while reloading 'asm'
../../src/juce_core/text/../basics/juce_Atomic.h: In function 'int juce::atomicDecrementAndReturn(int&)':
../../src/juce_core/text/../basics/juce_Atomic.h:111: error: can't find a register in class 'AREG' while reloading 'asm'


So if I am getting as far as my soundcard problem I assume the atomic stuff is working with the first patch. I think I will look further into it and create a new thread about it.


what compiler are you using ? just to know as i've tested them on x86_32 with gcc 4.1 and 3.4.6 and is working nicely...
Image
User avatar
kraken
JUCE UberWeenie
 
Posts: 1063
Joined: Wed Feb 09, 2005 10:31 am
Location: Venice, Italy

Postby patrickkidd » Fri Feb 02, 2007 12:58 am

Code: Select all
tulkas ~ # gcc -v
Using built-in specs.
Target: x86_64-pc-linux-gnu
Configured with: /var/tmp/portage/gcc-4.1.1-r1/work/gcc-4.1.1/configure --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.1.1 --includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.1/include --datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.1.1 --mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.1.1/man --infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.1.1/info --with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.1/include/g++-v4 --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --disable-altivec --enable-nls --without-included-gettext --with-system-zlib --disable-checking --disable-werror --disable-libunwind-exceptions --enable-multilib --disable-libmudflap --disable-libssp --disable-libgcj --enable-languages=c,c++,fortran --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu
Thread model: posix
gcc version 4.1.1 (Gentoo 4.1.1-r1)

tulkas ~ # uname -a
Linux tulkas 2.6.17-gentoo-r7 #3 SMP PREEMPT Thu Nov 16 13:12:06 AKST 2006 x86_64 AMD Athlon(tm) 64 X2 Dual Core Processor 4200+ AuthenticAMD GNU/Linux
patrickkidd
JUCE Geek
 
Posts: 34
Joined: Mon Aug 21, 2006 7:45 am

Postby kraken » Fri Feb 02, 2007 9:25 am

probably is related to gcc handling registers differently from 32/64 bit... but could be wrong. probably the best is to have a #ifdef JUCE_64BIT with the old code...
Image
User avatar
kraken
JUCE UberWeenie
 
Posts: 1063
Joined: Wed Feb 09, 2005 10:31 am
Location: Venice, Italy

Postby jules » Wed Feb 07, 2007 12:28 pm

Right, I'm trying to finalise a release here, and have completely lost track of what works on which platforms and why...

Could you guys with strange platforms and compilers do me a favour and post the versions you're currently using so I can try to fit it all together to work on all platforms!

What I've currently got is this:

Code: Select all
#elif JUCE_GCC
    //==============================================================================
  #if JUCE_WIN64
    forcedinline void atomicIncrement (int& variable) throw()           { __sync_add_and_fetch (&variable, 1); }
    forcedinline int atomicIncrementAndReturn (int& variable) throw()   { return __sync_add_and_fetch (&variable, 1); }
    forcedinline void atomicDecrement (int& variable) throw()           { __sync_add_and_fetch (&variable, -1); }
    forcedinline int atomicDecrementAndReturn (int& variable) throw()   { return __sync_add_and_fetch (&variable, -1); }
  #else
    //==============================================================================
    /** Increments an integer in a thread-safe way. */
    forcedinline void atomicIncrement (int& variable) throw()
    {
        __asm__ __volatile__ (
            "lock incl %0"
            : "=m" (variable)
            : "m" (variable));
    }

    /** Increments an integer in a thread-safe way and returns the incremented value. */
    forcedinline int atomicIncrementAndReturn (int& variable) throw()
    {
        int result;

        __asm__ __volatile__ (
            "lock xaddl %%eax, (%%ecx) \n\
             incl %%eax"
            : "=a" (result)
            : "c" (&variable), "a" (1)
            : "memory");

        return result;
    }

    /** Decrememts an integer in a thread-safe way. */
    forcedinline void atomicDecrement (int& variable) throw()
    {
        __asm__ __volatile__ (
            "lock decl %0"
            : "=m" (variable)
            : "m" (variable));
    }

    /** Decrememts an integer in a thread-safe way and returns the incremented value. */
    forcedinline int atomicDecrementAndReturn (int& variable) throw()
    {
        int result;

        __asm__ __volatile__ (
            "lock xaddl %%eax, (%%ecx) \n\
             decl %%eax"
            : "=a" (result)
            : "c" (&variable), "a" (-1)
            : "memory");

        return result;
    }
  #endif


It'd be great if you could try it and see if it's ok..
User avatar
jules
Fearless Leader
 
Posts: 17364
Joined: Mon Sep 06, 2004 9:03 am
Location: London, UK

Postby kraken » Wed Feb 07, 2007 2:59 pm

ok compiles fine here: i386 32bit - GCC 3.4.6 / 4.1 on Linux.
remember to check the other changes to gcc assembler in SystemStats and Graphics classes...
Image
User avatar
kraken
JUCE UberWeenie
 
Posts: 1063
Joined: Wed Feb 09, 2005 10:31 am
Location: Venice, Italy

Postby proppy » Wed Feb 07, 2007 7:21 pm

On:
Linux ubuntu 2.6.17-10-generic #2 SMP Fri Oct 13 15:34:39 UTC 2006 x86_64 GNU/Linux
After merging the changes you've mentionned to juce_Atomic.h 1.40,
_and_ applying:
http://farm.aminche.com/juce64.diff

It compiles and runs jucedemo fine.
proppy
JUCE Geek
 
Posts: 29
Joined: Fri Nov 17, 2006 7:56 pm

Postby jules » Wed Feb 07, 2007 7:37 pm

Sorry, could you just post the code you're actually using? I don't have diff, and am starting from a modified file anyway..
User avatar
jules
Fearless Leader
 
Posts: 17364
Joined: Mon Sep 06, 2004 9:03 am
Location: London, UK

Postby proppy » Wed Feb 07, 2007 7:42 pm

proppy
JUCE Geek
 
Posts: 29
Joined: Fri Nov 17, 2006 7:56 pm

Postby jules » Wed Feb 07, 2007 8:17 pm

Ok, cheers.
User avatar
jules
Fearless Leader
 
Posts: 17364
Joined: Mon Sep 06, 2004 9:03 am
Location: London, UK

Postby davephillips » Sat Feb 17, 2007 7:10 pm

Greetings:

I'm trying to compile JUCE 1.41 on AMD64, Debian Etch with GCC 4.1.2. I receive this error:

juce_linux_SystemStats.cpp
/tmp/cc097byJ.s: Assembler messages:
/tmp/cc097byJ.s:34: Error: suffix or operands invalid for `push'
/tmp/cc097byJ.s:34: Error: suffix or operands invalid for `pop'
make[1]: *** [../../bin/intermediate_linux/Debug/juce_linux_SystemStats.o] Error 1
make: *** [JUCE] Error 2

I'm a little confused about the state of JUCE + x86_64, hopefully someone can steer me in the right direction. I'd like to compile Kjetil's latest version of Mammut, I need libjuce to do it.
davephillips
JUCE Weenie
 
Posts: 9
Joined: Sat Feb 17, 2007 6:54 pm
Location: Findlay OH USA

Postby kjetil » Mon Feb 19, 2007 5:57 pm

davephillips wrote:Greetings:

I'm trying to compile JUCE 1.41 on AMD64, Debian Etch with GCC 4.1.2. I receive this error:

juce_linux_SystemStats.cpp
/tmp/cc097byJ.s: Assembler messages:
/tmp/cc097byJ.s:34: Error: suffix or operands invalid for `push'
/tmp/cc097byJ.s:34: Error: suffix or operands invalid for `pop'
make[1]: *** [../../bin/intermediate_linux/Debug/juce_linux_SystemStats.o] Error 1
make: *** [JUCE] Error 2

I'm a little confused about the state of JUCE + x86_64, hopefully someone can steer me in the right direction. I'd like to compile Kjetil's latest version of Mammut, I need libjuce to do it.


That's weird. As far as I see, the only defined push and pop are functions(?) available via pragmas when using microsofts compiler.

Are there any other warnings or errors before theses errors?

Also, do you have an earlier version of of gcc to try? (gcc32 for example)
kjetil
JUCE Obsessive
 
Posts: 67
Joined: Wed Sep 13, 2006 4:46 pm

Postby davephillips » Mon Feb 19, 2007 6:20 pm

kjetil wrote: As far as I see, the only defined push and pop are functions(?) available via pragmas when using microsofts compiler.


They occur in src/juce_core/basics/juce_Atomic.h for JUCE_64BIT.

Are there any other warnings or errors before theses errors?


None. The build rolls along smoothly until it tries to compile juce_linux_SystemStats.

Also, do you have an earlier version of of gcc to try? (gcc32 for example)


Not at this time. I have a pile of parts to assemble for a 32-bit machine, but until then I'm 64-bits all the way here. :)
davephillips
JUCE Weenie
 
Posts: 9
Joined: Sat Feb 17, 2007 6:54 pm
Location: Findlay OH USA

PreviousNext

Return to Linux

Who is online

Users browsing this forum: No registered users and 0 guests