juce on amd64 X2

For Linux specific issues

Postby kjetil » Mon Feb 19, 2007 6:48 pm

davephillips wrote:
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.


Not really. :?
Have you applied any patches? What happens without those patches?
kjetil
JUCE Obsessive
 
Posts: 67
Joined: Wed Sep 13, 2006 4:46 pm

Postby davephillips » Mon Feb 19, 2007 7:37 pm

kjetil wrote:Not really. :?


You're right, sorry. I saw them in juce_linux_SystemStats.cpp.

Have you applied any patches? What happens without those patches?


No patches.
davephillips
JUCE Weenie
 
Posts: 9
Joined: Sat Feb 17, 2007 6:54 pm
Location: Findlay OH USA

Postby kjetil » Mon Feb 19, 2007 8:46 pm

davephillips wrote:
kjetil wrote:Not really. :?


You're right, sorry. I saw them in juce_linux_SystemStats.cpp.


Right, I'm sorry too. I looked at the 1.40 sources.

And according to this posting:
http://gcc.gnu.org/ml/gcc/2005-07/msg00532.html

The code in the 1.40 source found the cpuid the correct way. And thats the way its done in the windows version as well.

I don't know why it was changed, but perhaps changing the getCPUIDWord function back to the original version might help:

Code: Select all
static juce_noinline unsigned int getCPUIDWord (int* familyModel, int* extFeatures)
{
    unsigned int cpu = 0;
    unsigned int ext = 0;
    unsigned int family = 0;
    unsigned int dummy = 0;

    __asm__ ("cpuid" : "=a" (family), "=b" (ext), "=c" (dummy),"=d" (cpu) : "a" (1));

    if (familyModel != 0)
        *familyModel = family;

    if (extFeatures != 0)
        *extFeatures = ext;

    return cpu;
}
kjetil
JUCE Obsessive
 
Posts: 67
Joined: Wed Sep 13, 2006 4:46 pm

Postby davephillips » Mon Feb 19, 2007 11:52 pm

kjetil wrote:The code in the 1.40 source found the cpuid the correct way. And thats the way its done in the windows version as well.

I don't know why it was changed, but perhaps changing the getCPUIDWord function back to the original version might help:


Thanks a lot, Kjetil, that worked. I had to change some casts in juce_linux_Threads.cpp from int to long, then the library compiled without complaint.

I built Mammut 0.57 sucessfully, it's ultra-cool with the JUCE interface, but when I ran the Stretch transform I got this error message before the program crashed:

dlphilp@64studio:~/mammut-0.57/src$ ./mammut
JUCE v1.41
gakk gakk
I am drawing
GUI_init()
oggtell
Filename2: /home/dlphilp/soundfiles/wav/bunting.wav
Agakk gakk0!
gakk gakk1!
CH: 0/1
I am started! 0, 0, 1594
About top do something
I am drawing
gakk gakk3!
Assertion failure: ../../src/juce_appframework/gui/components/controls/juce_Slider.cpp, 427
Trace/breakpoint trap

Any suggestions ?

And is there a more appropriate channel for questions re: Mammut ?
davephillips
JUCE Weenie
 
Posts: 9
Joined: Sat Feb 17, 2007 6:54 pm
Location: Findlay OH USA

Postby davephillips » Tue Feb 20, 2007 12:02 am

A little more report:

The same error occurs with other transforms. The Zoom function works okay, but when I try to play a soundfile I receive another assertion error :

Assertion failure: ../../src/juce_appframework/gui/components/juce_Component.cpp, 1497
davephillips
JUCE Weenie
 
Posts: 9
Joined: Sat Feb 17, 2007 6:54 pm
Location: Findlay OH USA

Postby davephillips » Tue Feb 20, 2007 12:24 am

Okay, it works fine now. I recompiled libjuce with CONFIG=Release, then I rebuilt Mammut. All functions seem to be working correctly now. It's very cool, Kjetil, my compliments to you and the JUCE developers. I'd like to see some more JUCEd sound and music apps for Linux. Ceres or Mix might be good candidates. What do you think ?
davephillips
JUCE Weenie
 
Posts: 9
Joined: Sat Feb 17, 2007 6:54 pm
Location: Findlay OH USA

Postby kraken » Tue Feb 20, 2007 9:23 am

kjetil wrote:The code in the 1.40 source found the cpuid the correct way. And thats the way its done in the windows version as well.

I don't know why it was changed, but perhaps changing the getCPUIDWord function back to the original version might help:

Code: Select all
static juce_noinline unsigned int getCPUIDWord (int* familyModel, int* extFeatures)
{
    unsigned int cpu = 0;
    unsigned int ext = 0;
    unsigned int family = 0;
    unsigned int dummy = 0;

    __asm__ ("cpuid" : "=a" (family), "=b" (ext), "=c" (dummy),"=d" (cpu) : "a" (1));

    if (familyModel != 0)
        *familyModel = family;

    if (extFeatures != 0)
        *extFeatures = ext;

    return cpu;
}


this doesn't work when compiling juce as shared library. that's why was changed. but it seems that is breaking 64bit in elf mode, cause 32bit elf are compiling and running smoothly. it seems that we can't find a way to make it compiles for every target unless we do some #ifdef.

in fPIC shared library mode, gcc is complaining about the old code:
Code: Select all
../../../../juce/build/linux/platform_specific_code/juce_linux_SystemStats.cpp: In function `unsigned int juce::getCPUIDWord(int*, int*)':
../../../../juce/build/linux/platform_specific_code/juce_linux_SystemStats.cpp:72: error: can't find a register in class `BREG' while reloading `asm'
make[1]: *** [../../../../bin/intermediate/Debug/juce_linux_SystemStats.o] Error 1
make: *** [XSynth] Error 2
Image
User avatar
kraken
JUCE UberWeenie
 
Posts: 1063
Joined: Wed Feb 09, 2005 10:31 am
Location: Venice, Italy

Postby jules » Tue Feb 20, 2007 10:49 am

Aggh.. Everything I've tried seems to break someone else's build! I'm at a disadvantage here as I don't have a 64-bit system to try, so have been just taking advice from people.

But let me try to get this straight:

- is the cpuid code the only bit now that anybody's having trouble with? Is everyone happy with the new atomics code?
- does anyone have any idea what kind of #ifs are needed to differentiate the setups that you guys are using?
User avatar
jules
Fearless Leader
 
Posts: 17229
Joined: Mon Sep 06, 2004 9:03 am
Location: London, UK

Postby kraken » Tue Feb 20, 2007 12:16 pm

jules,
with 32bit intel cpus, the latest 1.41 assembler lines are compiling and running, both in executable and shared library compilation.
i don't know about 64 bit tho, i'm in the same situation as you (i've only got P4s!).
Image
User avatar
kraken
JUCE UberWeenie
 
Posts: 1063
Joined: Wed Feb 09, 2005 10:31 am
Location: Venice, Italy

Postby davephillips » Tue Feb 20, 2007 12:54 pm

jules wrote: is the cpuid code the only bit now that anybody's having trouble with? Is everyone happy with the new atomics code?


No, there are three (?) casts to int in juce_linux_Threads.cpp that should be changed to long for 64-bit builds. The build will fail otherwise.

The atomics code seems fine in 1.41.

does anyone have any idea what kind of #ifs are needed to differentiate the setups that you guys are using?


Sorry, Jules, I must defer to Kjetil's advice on that matter.
davephillips
JUCE Weenie
 
Posts: 9
Joined: Sat Feb 17, 2007 6:54 pm
Location: Findlay OH USA

Postby jules » Tue Feb 20, 2007 1:27 pm

Which 3 casts is it? I can see quite a few in there.
User avatar
jules
Fearless Leader
 
Posts: 17229
Joined: Mon Sep 06, 2004 9:03 am
Location: London, UK

Postby davephillips » Tue Feb 20, 2007 1:40 pm

jules wrote:Which 3 casts is it? I can see quite a few in there.


In juce_linux_Threads.cpp, lines 410, 424, and 446.
davephillips
JUCE Weenie
 
Posts: 9
Joined: Sat Feb 17, 2007 6:54 pm
Location: Findlay OH USA

Postby jules » Tue Feb 20, 2007 2:26 pm

So it's the flock() that's the problem - but according to my docs it takes an int, so that should be ok..? What fix did you use to get it to build?
User avatar
jules
Fearless Leader
 
Posts: 17229
Joined: Mon Sep 06, 2004 9:03 am
Location: London, UK

Postby davephillips » Tue Feb 20, 2007 3:02 pm

jules wrote:So it's the flock() that's the problem - but according to my docs it takes an int, so that should be ok..? What fix did you use to get it to build?


I changed the offending ints to longs.

This is all for the static lib, of course. I'm not trying to build a shared library yet.
davephillips
JUCE Weenie
 
Posts: 9
Joined: Sat Feb 17, 2007 6:54 pm
Location: Findlay OH USA

Postby kjetil » Tue Feb 20, 2007 4:22 pm

davephillips wrote:Okay, it works fine now. I recompiled libjuce with CONFIG=Release, then I rebuilt Mammut. All functions seem to be working correctly now. It's very cool, Kjetil, my compliments to you and the JUCE developers. I'd like to see some more JUCEd sound and music apps for Linux. Ceres or Mix might be good candidates. What do you think ?


Thanks for the debug build report. I haven't used the debug build in ages, because linking with juce_debug.a takes so much time. Seems like I should have ran at least once before releasing. Those crashes probably also explains the mysterious crashes I got in cygwin on windows using debug mode, since I can't get stdout/stderr to work there.
kjetil
JUCE Obsessive
 
Posts: 67
Joined: Wed Sep 13, 2006 4:46 pm

PreviousNext

Return to Linux

Who is online

Users browsing this forum: No registered users and 1 guest