Hello,
I'm trying to compile Crafty 25 with Profile Guide Optimisation under Ubuntu x64. The command line is : make profile.
The Makefile specifies to "edit Makefile to make the profile option use the right compiler". So I have replaced all "CC=clang CXX=clang++" with "CC=gcc CXX=g++".
I get the following error messages :
gcc: error: unrecognized command line option ‘-fprofile-instr-generate’
I wonder what to change.
Thank you.
Compiling Crafty 25 PGO
Moderators: hgm, Rebel, chrisw
-
- Posts: 12540
- Joined: Wed Mar 08, 2006 8:57 pm
- Location: Redmond, WA USA
Re: Compiling Crafty 25 PGO
What is your exact version of gcc?
Taking ideas is not a vice, it is a virtue. We have another word for this. It is called learning.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.
-
- Posts: 125
- Joined: Tue Jan 17, 2012 8:08 pm
Re: Compiling Crafty 25 PGO
gcc (Ubuntu 4.8.4-2ubuntu1~14.04) 4.8.4
Copyright (C) 2013
Copyright (C) 2013
-
- Posts: 6442
- Joined: Tue Jan 09, 2007 12:31 am
- Location: PA USA
- Full name: Louis Zulli
Re: Compiling Crafty 25 PGO
Edit this portion:Canoike wrote:Hello,
I'm trying to compile Crafty 25 with Profile Guide Optimisation under Ubuntu x64. The command line is : make profile.
The Makefile specifies to "edit Makefile to make the profile option use the right compiler". So I have replaced all "CC=clang CXX=clang++" with "CC=gcc CXX=g++".
I get the following error messages :
gcc: error: unrecognized command line option ‘-fprofile-instr-generate’
I wonder what to change.
Thank you.
Code: Select all
profile:
@rm -rf *.o
@rm -rf log.*
@rm -rf game.*
@rm -rf prof
@rm -rf *.gcda
@mkdir prof
@touch *.c *.cpp *.h
$(MAKE) -j unix-clang-profile
@echo "#!/bin/csh" > runprof
@echo "./crafty <<EOF" >>runprof
@echo "pgo -1" >>runprof
@echo "mt=0" >>runprof
@echo "quit" >>runprof
@echo "EOF" >>runprof
@chmod +x runprof
@./runprof
@rm runprof
@touch *.c *.cpp *.h
$(MAKE) -j unix-clang
Last edited by zullil on Fri Jan 22, 2016 11:43 pm, edited 1 time in total.
-
- Posts: 151
- Joined: Thu Nov 12, 2009 6:31 pm
-
- Posts: 6442
- Joined: Tue Jan 09, 2007 12:31 am
- Location: PA USA
- Full name: Louis Zulli
Re: Compiling Crafty 25 PGO
Already there. He needs to modify the profile target.abulmo wrote:-fprofile-generate
or
-fprofile-arcs,
and then -fprofile-use
Code: Select all
unix-gcc:
$(MAKE) -j target=UNIX \
CC=gcc CXX=g++ \
opt='-DTEST -DINLINEASM -DPOPCNT -DCPUS=4' \
CFLAGS='-Wall -Wno-array-bounds -pipe -O3 -fprofile-use \
-fprofile-correction -pthread' \
CXFLAGS='-Wall -Wno-array-bounds -pipe -O3 -fprofile-use \
-fprofile-correction -pthread' \
LDFLAGS='$(LDFLAGS) -fprofile-use -pthread -lstdc++' \
crafty-make
unix-gcc-profile:
$(MAKE) -j target=UNIX \
CC=gcc CXX=g++ \
opt='-DTEST -DINLINEASM -DPOPCNT -DCPUS=4' \
CFLAGS='-Wall -Wno-array-bounds -pipe -O3 -fprofile-arcs \
-pthread' \
CXFLAGS='-Wall -Wno-array-bounds -pipe -O3 -fprofile-arcs \
-pthread' \
LDFLAGS='$(LDFLAGS) -fprofile-arcs -pthread -lstdc++ ' \
crafty-make
-
- Posts: 125
- Joined: Tue Jan 17, 2012 8:08 pm
Re: Compiling Crafty 25 PGO
Louis,zullil wrote:Edit this portion:Canoike wrote:Hello,
I'm trying to compile Crafty 25 with Profile Guide Optimisation under Ubuntu x64. The command line is : make profile.
The Makefile specifies to "edit Makefile to make the profile option use the right compiler". So I have replaced all "CC=clang CXX=clang++" with "CC=gcc CXX=g++".
I get the following error messages :
gcc: error: unrecognized command line option ‘-fprofile-instr-generate’
I wonder what to change.
Thank you.Might also need to change csh to sh above.Code: Select all
profile: @rm -rf *.o @rm -rf log.* @rm -rf game.* @rm -rf prof @rm -rf *.gcda @mkdir prof @touch *.c *.cpp *.h $(MAKE) -j unix-clang-profile @echo "#!/bin/csh" > runprof @echo "./crafty <<EOF" >>runprof @echo "pgo -1" >>runprof @echo "mt=0" >>runprof @echo "quit" >>runprof @echo "EOF" >>runprof @chmod +x runprof @./runprof @rm runprof @touch *.c *.cpp *.h $(MAKE) -j unix-clang
I have found out which lines to modify.
Line 8 :
$(MAKE) -j unix-clang-profile * changed to : $(MAKE) -j unix-gcc-profile
Last line :
$(MAKE) -j unix-clang * changed to : unix-gcc-profile (Raw nodes per second: 4752629)
or
$(MAKE) -j unix-clang * changed to : unix-gcc (makes a smaller and faster executable (Raw nodes per second: 5616690))
Changed csh to sh
-
- Posts: 6442
- Joined: Tue Jan 09, 2007 12:31 am
- Location: PA USA
- Full name: Louis Zulli
Re: Compiling Crafty 25 PGO
Right, except don't use unix-gcc-profile for the last line. Use unix-gcc to take advantage of the profiling that was done in line 8.Canoike wrote:Louis,zullil wrote:Edit this portion:Canoike wrote:Hello,
I'm trying to compile Crafty 25 with Profile Guide Optimisation under Ubuntu x64. The command line is : make profile.
The Makefile specifies to "edit Makefile to make the profile option use the right compiler". So I have replaced all "CC=clang CXX=clang++" with "CC=gcc CXX=g++".
I get the following error messages :
gcc: error: unrecognized command line option ‘-fprofile-instr-generate’
I wonder what to change.
Thank you.Might also need to change csh to sh above.Code: Select all
profile: @rm -rf *.o @rm -rf log.* @rm -rf game.* @rm -rf prof @rm -rf *.gcda @mkdir prof @touch *.c *.cpp *.h $(MAKE) -j unix-clang-profile @echo "#!/bin/csh" > runprof @echo "./crafty <<EOF" >>runprof @echo "pgo -1" >>runprof @echo "mt=0" >>runprof @echo "quit" >>runprof @echo "EOF" >>runprof @chmod +x runprof @./runprof @rm runprof @touch *.c *.cpp *.h $(MAKE) -j unix-clang
I have found out which lines to modify.
Line 8 :
$(MAKE) -j unix-clang-profile * changed to : $(MAKE) -j unix-gcc-profile
Last line :
$(MAKE) -j unix-clang * changed to : unix-gcc-profile (Raw nodes per second: 4752629)
or
$(MAKE) -j unix-clang * changed to : unix-gcc (makes a smaller and faster executable (Raw nodes per second: 5616690))
Changed csh to sh