Atomics not compiling - __sync_

19 posts / 0 new
Last post
Bruce Wheaton
Offline
Last seen: 3 weeks 1 day ago
Joined: 17 Aug 2006 - 01:43
Atomics not compiling - __sync_

It looks like the:

#elif JUCE_GCC to JUCE_LINUX

Change that happened when you changed iPhone atomics broke my Linux compile. I'm using Codeblocks and GCC, and I leave the arch blank for the compiler to work it out.

The __sync_ functions come up as undefined when I compile my final project. I tried to add -march=i486 or i686 as suggested on the web, but that didn't help. Do I need to change the juce project's makefile for that?

Edit - maybe not so simple. Changing that one define back didn't help. I just refreshed from the tip, about a 3 week old version. Nothing changed on the Linux machine since I had working compiles. Could it be something in the makefile?

Edit - jucedemo won't compile here either.

Bruce

jules
Online
Last seen: 6 min 2 sec ago
Joined: 29 Apr 2013 - 18:37
Re: Atomics not compiling - __sync_

It should work on mingw - assuming that you've not got JUCE_LINUX defined, no inline atomic should be defined at all, and it'll use the win32 ones specially for mingw in juce_win32_Threads.cpp.

Bruce Wheaton
Offline
Last seen: 3 weeks 1 day ago
Joined: 17 Aug 2006 - 01:43
Re: Atomics not compiling - __sync_

Sorry, I didn't say, but this thread is in the Linux forum! I'm on Arch Linux, a system that has always been fine compiling Juce.

Bruce

jules
Online
Last seen: 6 min 2 sec ago
Joined: 29 Apr 2013 - 18:37
Re: Atomics not compiling - __sync_

Doh, sorry! It all compiles fine on my linux installation - you're not still on gcc3, are you?

Bruce Wheaton
Offline
Last seen: 3 weeks 1 day ago
Joined: 17 Aug 2006 - 01:43
Re: Atomics not compiling - __sync_

Nope, 4.4.2. --with-tune is 'generic' and there's no default arch though. Can you please do a GCC -v and see if there's a default architecture set?

I've been messing around with adding ARCH="i486" to the make command, which seems to be the right syntax, but no joy.

I've tried with the packaged and remade Make files.

My linux GIT client doesn't show when I merged, so it's hard to tell when I last would have clean built, but I looked back and I didn't do any updates on the computer since it was last building. Any changes to Linux build settings maybe?

I don't suppose you weren't using some of the atomics then added use recently? And they maybe didn't work at all on my system?

Bruce

jules
Online
Last seen: 6 min 2 sec ago
Joined: 29 Apr 2013 - 18:37
Re: Atomics not compiling - __sync_

I did change it to use those intrinsic atomic ops recently, but they're supposed to be standard in gcc. Maybe there's a header file for them on some systems?

(And doing a gcc -v doesn't show a setting for -arch on my machine)

Bruce Wheaton
Offline
Last seen: 3 weeks 1 day ago
Joined: 17 Aug 2006 - 01:43
Re: Atomics not compiling - __sync_

Not able to get to my Linux machine right now, but I did some reading. They are not linked from libs, but compiler provided. If the build isn't for the correct CPU, then the compiler doesn't generate them and it fails at a weird point - not compiler, not really linker.

I tried to change the arch on my builds, but no luck. All I can assume is some random Linux BS did a configure action and 'broke' my compiler setup. There's some real disadvantages to having to build apps yourself using whatever odd build/configure environment that particular Linux group decided is the one and only true way.

As far as I can tell, Apple has one Steve Jobs, but Linux has thousands of them, each of whom knows better than all the others.

I guess it's GCC re-install time, or something similarly asinine. Unless someone else is seeing this problem?

Bruce

jules
Online
Last seen: 6 min 2 sec ago
Joined: 29 Apr 2013 - 18:37
Re: Atomics not compiling - __sync_

Yes, the fragmentation of linux is my main headache with it. That's really frustrating - have you tried grepping your include path to see if there's a header file with them somewhere?

Bruce Wheaton
Offline
Last seen: 3 weeks 1 day ago
Joined: 17 Aug 2006 - 01:43
Re: Atomics not compiling - __sync_

Ok, some sort of light. My reading said that the atomics were generated by the compiler for you, and they are. It turns out that right now, on my dev system, TARGET_ARCH is blank, so nothing special builds i.e. no atomics.

I set -march in my code, but had trouble setting it in the juce build - apparently both are required. Unable to feel certain I could force Make to use an arch, I hacked the jucedemo makefile with:

DEPFLAGS += "-march=i486"

And got the demo to build again.

So, if nothing else, it looks like the juce makefiles should detect a CPU of at least 486 - now they allow nothing (probably i386).

No-one else hitting this, really? Anyone know what/how I should set my default architecture? I'm on Arch Linux.

Bruce

jules
Online
Last seen: 6 min 2 sec ago
Joined: 29 Apr 2013 - 18:37
Re: Atomics not compiling - __sync_

Have you tried the newest demo makefile? I changed the way it's generated last week.

Bruce Wheaton
Offline
Last seen: 3 weeks 1 day ago
Joined: 17 Aug 2006 - 01:43
Re: Atomics not compiling - __sync_

I got the tip a few hours ago. I added an echo to see what depflags was, and it was just md, or something. Adding i486 let it build.

The problem is probably in my system, but the answers not evident. A GCC reinstall didn't help.

Anyway, the new Atomics mean Linux builds must be 486 and later. I hope that doesn't make ARM Impossible.

Bruce

Pages