64bit compile

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

elcabesa
Posts: 855
Joined: Sun May 23, 2010 1:32 pm

Re: 64bit compile

Post by elcabesa »

wow, could you please try a match against vajolet-2.03?
elcabesa
Posts: 855
Joined: Sun May 23, 2010 1:32 pm

Re: 64bit compile

Post by elcabesa »

I compiled the 32 bit version with this command

g++ -O3 -msse4.1 -march=corei7 -fno-strict-aliasing -Wall -c -fmessage-length=0 -std=c++0x -o timer.o "..\\timer.cpp"
g++ -O3 -msse4.1 -march=corei7 -fno-strict-aliasing -Wall -c -fmessage-length=0 -std=c++0x -o hash.o "..\\hash.cpp"
g++ -O3 -msse4.1 -march=corei7 -fno-strict-aliasing -Wall -c -fmessage-length=0 -std=c++0x -o bitops.o "..\\bitops.cpp"
g++ -O3 -msse4.1 -march=corei7 -fno-strict-aliasing -Wall -c -fmessage-length=0 -std=c++0x -o transposition.o "..\\transposition.cpp"
g++ -O3 -msse4.1 -march=corei7 -fno-strict-aliasing -Wall -c -fmessage-length=0 -std=c++0x -o command.o "..\\command.cpp"
g++ -O3 -msse4.1 -march=corei7 -fno-strict-aliasing -Wall -c -fmessage-length=0 -std=c++0x -o data.o "..\\data.cpp"
g++ -O3 -msse4.1 -march=corei7 -fno-strict-aliasing -Wall -c -fmessage-length=0 -std=c++0x -o vajolet.o "..\\vajolet.cpp"
g++ -O3 -msse4.1 -march=corei7 -fno-strict-aliasing -Wall -c -fmessage-length=0 -std=c++0x -o see.o "..\\see.cpp"
g++ -O3 -msse4.1 -march=corei7 -fno-strict-aliasing -Wall -c -fmessage-length=0 -std=c++0x -o search.o "..\\search.cpp"
g++ -O3 -msse4.1 -march=corei7 -fno-strict-aliasing -Wall -c -fmessage-length=0 -std=c++0x -o book.o "..\\book.cpp"
g++ -O3 -msse4.1 -march=corei7 -fno-strict-aliasing -Wall -c -fmessage-length=0 -std=c++0x -o board.o "..\\board.cpp"
g++ -O3 -msse4.1 -march=corei7 -fno-strict-aliasing -Wall -c -fmessage-length=0 -std=c++0x -o eval.o "..\\eval.cpp"
g++ -O3 -msse4.1 -march=corei7 -fno-strict-aliasing -Wall -c -fmessage-length=0 -std=c++0x -o move.o "..\\move.cpp"
g++ -O3 -msse4.1 -march=corei7 -fno-strict-aliasing -Wall -c -fmessage-length=0 -std=c++0x -o movegen.o "..\\movegen.cpp"
g++ -s -static -o vajolet.exe vajolet.o transposition.o timer.o see.o search.o movegen.o move.o hash.o eval.o data.o command.o book.o board.o bitops.o


don't you need to add -m64 to the compiler arguments?

can you send me the modified code so i can add the 64 bit intrinsic functions
phenri
Posts: 284
Joined: Tue Aug 13, 2013 9:44 am

Re: 64bit compile

Post by phenri »

I tried to compile 64b but without success.

There the makefile from folker (thanks).
I just added -static-libgcc -static-libstdc++

Code: Select all

CXXFLAGS+=-msse4.1 -O3 -Wall -std=gnu++0x -fomit-frame-pointer
LDFLAGS+=-lm -static-libgcc -static-libstdc++

BIN=vajolet.exe
OBJS=bitops.o board.o data.o eval.o hash.o move.o movegen.o search.o see.o timer.o transposition.o vajolet.o command.o

all: $(BIN)

vajolet.exe: $(OBJS)
	$(CXX) $(OBJS) $(LDFLAGS) -o $(BIN)

clean:
	rm -f $(OBJS) $(BIN)
check:
	cppcheck -v --force -j 3 --enable=all --inconclusive -I. . 2> err.txt
	#
	make clean
	scan-build make
How do I know if the compiler is 64b?
I answer to myself.

Code: Select all

$ g++ -v
Using built-in specs.
COLLECT_GCC=C:\MinGW\bin\g++.exe
COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/mingw32/4.6.2/lto-wrapper.exe
Target: mingw32
Configured with: ../gcc-4.6.2/configure --enable-languages=c,c++,ada,fortran,objc,obj-c++ --disable-sjlj-exceptions --with-dwarf2 --enable-shared --enable-libgomp --disable-win32-registry --enable-libstdcxx-debug --enable-version-specific-runtime-libs --build=mingw32 --prefix=/mingw
Thread model: win32
gcc version 4.6.2 (GCC)
How to switch MinGW to 64b?
flok

Re: 64bit compile

Post by flok »

phenri wrote:

Code: Select all

check:
	cppcheck -v --force -j 3 --enable=all --inconclusive -I. . 2> err.txt
	#
	make clean
	scan-build make
Oh by the way: I would very much like to point people at "cppcheck" (http://cppcheck.sourceforge.net/) and the "scan-build" functionality of the LLVM C++ compiler: depending on the code-quality they find hard to find bugs in your code. Also applying for an account at http://www.coverity.com/ can help.
These 3 are static analyzers which can find bugs in codepaths to are not usually invoked - which is problematic with the briliant Valgrind tool http://valgrind.org/ (oh and helgrind (part of valgrind: take a look at that, it finds locking problems: multiple threads writing to the same location without proper locking). Oh for who don't know: with valgrind you can find memory access beyond allocated regions and access-after-free, etc.
elcabesa
Posts: 855
Joined: Sun May 23, 2010 1:32 pm

Re: 64bit compile

Post by elcabesa »

you should add -m64 but I think mingw could not compile 64 bit... you need mingw-w64. this is because I asked the forum for a windows 64 bit compile :)
phenri
Posts: 284
Joined: Tue Aug 13, 2013 9:44 am

Re: 64bit compile

Post by phenri »

elcabesa wrote:you should add -m64 but I think mingw could not compile 64 bit... you need mingw-w64. this is because I asked the forum for a windows 64 bit compile :)
I tried already 64b with code:blocks and Dev-c++
About MinGW, I dont know why I have an 32b version, I tried to reinstall mingw ( https://sourceforge.net/projects/mingwbuilds/ )
but I get error when trying to run mingw-builds-install.exe "cannot download repository.txt"
User avatar
velmarin
Posts: 1600
Joined: Mon Feb 21, 2011 9:48 am

Re: 64bit compile

Post by velmarin »

phenri wrote:
elcabesa wrote:you should add -m64 but I think mingw could not compile 64 bit... you need mingw-w64. this is because I asked the forum for a windows 64 bit compile :)
I tried already 64b with code:blocks and Dev-c++
About MinGW, I dont know why I have an 32b version, I tried to reinstall mingw ( https://sourceforge.net/projects/mingwbuilds/ )
but I get error when trying to run mingw-builds-install.exe "cannot download repository.txt"
Settle this version of DEV_C + + portable, so you will not have problems (path) and test:

Code: Select all

Saturday, May 25, 2013
Dev-C++ 5.4.2, 5.4.3 RC2 released
The portable version which includes TDM-GCC x64 4.7.1 can be downloaded here (32MB).
http://orwelldevcpp.blogspot.com.es/
User avatar
velmarin
Posts: 1600
Joined: Mon Feb 21, 2011 9:48 am

Re: 64bit compile

Post by velmarin »

phenri wrote:
elcabesa wrote:you should add -m64 but I think mingw could not compile 64 bit... you need mingw-w64. this is because I asked the forum for a windows 64 bit compile :)
I tried already 64b with code:blocks and Dev-c++
About MinGW, I dont know why I have an 32b version, I tried to reinstall mingw ( https://sourceforge.net/projects/mingwbuilds/ )
but I get error when trying to run mingw-builds-install.exe "cannot download repository.txt"
Settle this version of DEV_C + + portable, so you will not have problems (path) and test:

Code: Select all

Saturday, May 25, 2013
Dev-C++ 5.4.2, 5.4.3 RC2 released
The portable version which includes TDM-GCC x64 4.7.1 can be downloaded here (32MB).
http://orwelldevcpp.blogspot.com.es/
phenri
Posts: 284
Joined: Tue Aug 13, 2013 9:44 am

Re: 64bit compile

Post by phenri »

Thank you, I will try the portable version :)
phenri
Posts: 284
Joined: Tue Aug 13, 2013 9:44 am

Re: 64bit compile

Post by phenri »

elcabesa wrote:hi, I'd like to test my engine in 64bit mode, can anyone make for me a 64 bit windows build with gcc and do some test of the engine?

I still havent' a 64 bit operating system
There is no need to have a 64bit OS to compile 64bit.

for example see in column Host & Target
http://mingw-w64.sourceforge.net/downlo ... ngw-builds