OS X

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

OS X

Post by bob »

If you download the new Xcode 7.3 update you might end up with a problem. It will compile Crafty normally, but a profile-guided optimization crashes and burns during the first compile stage. I have submitted all the info to Apple. As of right now, on my MacBook, I can no longer do a PGO compile..
User avatar
MikeB
Posts: 4889
Joined: Thu Mar 09, 2006 6:34 am
Location: Pen Argyl, Pennsylvania

Re: OS X

Post by MikeB »

bob wrote:If you download the new Xcode 7.3 update you might end up with a problem. It will compile Crafty normally, but a profile-guided optimization crashes and burns during the first compile stage. I have submitted all the info to Apple. As of right now, on my MacBook, I can no longer do a PGO compile..
Saw this just in time. If this true with gcc as well or does it include both clang and gcc?
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: OS X

Post by bob »

MikeB wrote:
bob wrote:If you download the new Xcode 7.3 update you might end up with a problem. It will compile Crafty normally, but a profile-guided optimization crashes and burns during the first compile stage. I have submitted all the info to Apple. As of right now, on my MacBook, I can no longer do a PGO compile..
Saw this just in time. If this true with gcc as well or does it include both clang and gcc?
Just clang. gcc is an independent compiler, which I would assume you have installed via macports?
User avatar
MikeB
Posts: 4889
Joined: Thu Mar 09, 2006 6:34 am
Location: Pen Argyl, Pennsylvania

Re: OS X

Post by MikeB »

bob wrote:
MikeB wrote:
bob wrote:If you download the new Xcode 7.3 update you might end up with a problem. It will compile Crafty normally, but a profile-guided optimization crashes and burns during the first compile stage. I have submitted all the info to Apple. As of right now, on my MacBook, I can no longer do a PGO compile..
Saw this just in time. If this true with gcc as well or does it include both clang and gcc?
Just clang. gcc is an independent compiler, which I would assume you have installed via macports?
Correct.. 4.8
mvk
Posts: 589
Joined: Tue Jun 04, 2013 10:15 pm

Re: OS X

Post by mvk »

bob wrote:If you download the new Xcode 7.3 update you might end up with a problem. It will compile Crafty normally, but a profile-guided optimization crashes and burns during the first compile stage. I have submitted all the info to Apple. As of right now, on my MacBook, I can no longer do a PGO compile..
For info, I upgraded XCode last night and tested PGO (native clang, not gcc). Works ok here.

Code: Select all

floyd-pgo1: $(wildcard Source/*) Makefile versions.json
        $(CC) $(CFLAGS) -DNDEBUG -o $@ $(uciSources) $(LDFLAGS) -fprofile-instr-generate
        echo 'bench movetime 500 bestof 1' | ./$@ | grep result

floyd-pgo2: $(wildcard Source/*) Makefile versions.json floyd-pgo1
        xcrun llvm-profdata show default.profraw
        xcrun llvm-profdata merge -output=code.profdata default.profraw
        $(CC) $(CFLAGS) -DNDEBUG -o $@ $(uciSources) $(LDFLAGS) -fprofile-instr-use=code.profdata
[Account deleted]
User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

Xcode bloat

Post by sje »

I don't use Xcode's PGO, and it's a wonder that it ever did work as Apple has little interest in optimization.

If Apple did have an interest in optimization, then it wouldn't have included gigabytes of crap in its Xcode distribution for its watches, phones, TV boxes, tablets, etc. I was watching the files being installed over the hour or so it took to update; included were things like different sized icons for Seattle area public transit stations.
User avatar
MikeB
Posts: 4889
Joined: Thu Mar 09, 2006 6:34 am
Location: Pen Argyl, Pennsylvania

Re: Xcode bloat

Post by MikeB »

sje wrote:I don't use Xcode's PGO, and it's a wonder that it ever did work as Apple has little interest in optimization.

If Apple did have an interest in optimization, then it wouldn't have included gigabytes of crap in its Xcode distribution for its watches, phones, TV boxes, tablets, etc. I was watching the files being installed over the hour or so it took to update; included were things like different sized icons for Seattle area public transit stations.
LOL that is ridiculous ..
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: OS X

Post by bob »

mvk wrote:
bob wrote:If you download the new Xcode 7.3 update you might end up with a problem. It will compile Crafty normally, but a profile-guided optimization crashes and burns during the first compile stage. I have submitted all the info to Apple. As of right now, on my MacBook, I can no longer do a PGO compile..
For info, I upgraded XCode last night and tested PGO (native clang, not gcc). Works ok here.

Code: Select all

floyd-pgo1: $(wildcard Source/*) Makefile versions.json
        $(CC) $(CFLAGS) -DNDEBUG -o $@ $(uciSources) $(LDFLAGS) -fprofile-instr-generate
        echo 'bench movetime 500 bestof 1' | ./$@ | grep result

floyd-pgo2: $(wildcard Source/*) Makefile versions.json floyd-pgo1
        xcrun llvm-profdata show default.profraw
        xcrun llvm-profdata merge -output=code.profdata default.profraw
        $(CC) $(CFLAGS) -DNDEBUG -o $@ $(uciSources) $(LDFLAGS) -fprofile-instr-use=code.profdata
I now have about a half-dozen codes that cause the compiler itself to segfault, yet they compile just fine on Xcode 7.2. I have narrowed the problems down by compiling each source file of Crafty separately. Xcode 7.3 crashes when compiling either movgen.c or evaluate.c when using the profiler.

There are other issues with things like crt0.o and such. Yet another example of Apple's SQA or lack thereof.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Xcode bloat

Post by bob »

MikeB wrote:
sje wrote:I don't use Xcode's PGO, and it's a wonder that it ever did work as Apple has little interest in optimization.

If Apple did have an interest in optimization, then it wouldn't have included gigabytes of crap in its Xcode distribution for its watches, phones, TV boxes, tablets, etc. I was watching the files being installed over the hour or so it took to update; included were things like different sized icons for Seattle area public transit stations.
LOL that is ridiculous ..
I think I am giving up on Xcode and removing it. gcc works perfectly for me, produces faster/cleaner code, and doesn't try to support everything from frying pans to flyswatters...
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Xcode bloat

Post by bob »

bob wrote:
MikeB wrote:
sje wrote:I don't use Xcode's PGO, and it's a wonder that it ever did work as Apple has little interest in optimization.

If Apple did have an interest in optimization, then it wouldn't have included gigabytes of crap in its Xcode distribution for its watches, phones, TV boxes, tablets, etc. I was watching the files being installed over the hour or so it took to update; included were things like different sized icons for Seattle area public transit stations.
LOL that is ridiculous ..
I think I am giving up on Xcode and removing it. gcc works perfectly for me, produces faster/cleaner code, and doesn't try to support everything from frying pans to flyswatters...
I've installed gcc 5.3 and it seems to work really well speed-wise. Significantly faster executable than that which clang produced, so I am back in business. Xcode is dead and buried here...