gull chess

Discussion about chess-playing software (engines, hosts, opening books, platforms, etc...)
User923005
Posts: 616
Joined: Thu May 19, 2011 1:35 am

Re: gull chess

Post by User923005 » Sat Dec 22, 2012 5:39 am

lucasart wrote:
User923005 wrote:Since it is an open source project, it would be easy to fork it or to contribute to the existing project.
The oddball stuff is only needed for SMP, so a simple translation layer like so many other chess programs have for threading would do the trick.
Yes, but the entire code is riddled with unportable things, in place where it is neither necessary nor useful (__int64 to begin with). And for SMP, there is absolutely no need to write unportable code. C++11 has all one needs to write it clean, portable, safe and simple code. In the C++11 branch of Stockfish, Marco demonstrates that fact with "maestria".
The problem with C++11 is that compiler support is spotty.
As far as the __int64, just do a global search and replace with "long long", because that works with the Microsoft and Intel compilers now, so there is no need for it.

User923005
Posts: 616
Joined: Thu May 19, 2011 1:35 am

Re: gull chess

Post by User923005 » Sat Dec 22, 2012 5:40 am

lucasart wrote:
User923005 wrote:Since it is an open source project, it would be easy to fork it or to contribute to the existing project.
The oddball stuff is only needed for SMP, so a simple translation layer like so many other chess programs have for threading would do the trick.
Yes, but the entire code is riddled with unportable things, in place where it is neither necessary nor useful (__int64 to begin with). And for SMP, there is absolutely no need to write unportable code. C++11 has all one needs to write it clean, portable, safe and simple code. In the C++11 branch of Stockfish, Marco demonstrates that fact with "maestria".
Where can I find out more about maestria?
First I have heard of it.

lucasart
Posts: 201
Joined: Mon Dec 17, 2012 1:09 pm
Contact:

Re: gull chess

Post by lucasart » Sat Dec 22, 2012 6:04 am

User923005 wrote:
lucasart wrote:
User923005 wrote:Since it is an open source project, it would be easy to fork it or to contribute to the existing project.
The oddball stuff is only needed for SMP, so a simple translation layer like so many other chess programs have for threading would do the trick.
Yes, but the entire code is riddled with unportable things, in place where it is neither necessary nor useful (__int64 to begin with). And for SMP, there is absolutely no need to write unportable code. C++11 has all one needs to write it clean, portable, safe and simple code. In the C++11 branch of Stockfish, Marco demonstrates that fact with "maestria".
Where can I find out more about maestria?
First I have heard of it.
It's just an expression. With impressive talent & skiil if you prefer.
"Talk is cheap. Show me the code." -- Linus Torvalds.

User923005
Posts: 616
Joined: Thu May 19, 2011 1:35 am

Re: gull chess

Post by User923005 » Sat Dec 22, 2012 6:14 am

Is the C++11 branch of stockfish publicly available? Is it a branch at the git repository, or found somewhere else or is it private?

User923005
Posts: 616
Joined: Thu May 19, 2011 1:35 am

Re: gull chess

Post by User923005 » Sat Dec 22, 2012 6:34 am


User923005
Posts: 616
Joined: Thu May 19, 2011 1:35 am

Re: gull chess

Post by User923005 » Sat Dec 22, 2012 6:45 am

It appears that Mingw 4.7.3 won't compile it under Mingw on Windows. So for now, it is probably a Posix only option. So maximum portability (ironically) limits the platforms.

$ gcc --version
gcc.exe (GCC) 4.7.3 20121102 (prerelease)
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ make profile-build ARCH=x86-64-modern
make ARCH=x86-64-modern COMP=gcc config-sanity
make[1]: Entering directory `/c/project/Stockfish-c-11/src'

Config:
debug: 'no'
optimize: 'yes'
arch: 'x86_64'
os: 'any'
bits: '64'
prefetch: 'yes'
bsfq: 'yes'
popcnt: 'yes'
sse: 'yes'

Flags:
CXX: g++
CXXFLAGS: -g -Wall -Wcast-qual -fno-exceptions -fno-rtti -std=c++11 -pedantic -Wno-long-long -Wextra -Wshadow -DNDEBUG -O3 -DIS_64BIT -msse -DUSE
FQ -msse3 -DUSE_POPCNT -flto
LDFLAGS: -lpthread -g -Wall -Wcast-qual -fno-exceptions -fno-rtti -std=c++11 -pedantic -Wno-long-long -Wextra -Wshadow -DNDEBUG -O3 -DIS_64BIT -
e -DUSE_BSFQ -msse3 -DUSE_POPCNT -flto

Testing config sanity. If this fails, try 'make help' ...

make[1]: Leaving directory `/c/project/Stockfish-c-11/src'

Step 0/4. Preparing for profile build.
make ARCH=x86-64-modern COMP=gcc gcc-profile-prepare
make[1]: Entering directory `/c/project/Stockfish-c-11/src'
make ARCH=x86-64-modern COMP=gcc gcc-profile-clean
make[2]: Entering directory `/c/project/Stockfish-c-11/src'
make[2]: Leaving directory `/c/project/Stockfish-c-11/src'
make[1]: Leaving directory `/c/project/Stockfish-c-11/src'

Step 1/4. Building executable for benchmark ...
make ARCH=x86-64-modern COMP=gcc gcc-profile-make
make[1]: Entering directory `/c/project/Stockfish-c-11/src'
make ARCH=x86-64-modern COMP=gcc \
EXTRACXXFLAGS='-fprofile-generate' \
EXTRALDFLAGS='-lgcov' \
all
make[2]: Entering directory `/c/project/Stockfish-c-11/src'
g++ -g -Wall -Wcast-qual -fno-exceptions -fno-rtti -std=c++11 -fprofile-generate -pedantic -Wno-long-long -Wextra -Wshadow -DNDEBUG -O3 -DIS_64BIT
sse -DUSE_BSFQ -msse3 -DUSE_POPCNT -flto -c -o benchmark.o benchmark.cpp
In file included from benchmark.cpp:28:0:
thread.h:55:5: error: 'mutex' in namespace 'std' does not name a type
thread.h:93:5: error: 'thread' in namespace 'std' does not name a type
thread.h:94:5: error: 'mutex' in namespace 'std' does not name a type
thread.h:95:5: error: 'condition_variable' in namespace 'std' does not name a type
thread.h:148:5: error: 'mutex' in namespace 'std' does not name a type
thread.h:149:5: error: 'condition_variable' in namespace 'std' does not name a type
benchmark.cpp: In function 'void benchmark(const Position&, std::istream&)':
benchmark.cpp:80:44: error: 'stoi' was not declared in this scope
benchmark.cpp:83:34: error: 'stoi' was not declared in this scope
benchmark.cpp:86:34: error: 'stoi' was not declared in this scope
make[2]: *** [benchmark.o] Error 1
make[2]: Leaving directory `/c/project/Stockfish-c-11/src'
make[1]: *** [gcc-profile-make] Error 2
make[1]: Leaving directory `/c/project/Stockfish-c-11/src'
make: *** [profile-build] Error 2

User923005
Posts: 616
Joined: Thu May 19, 2011 1:35 am

Re: gull chess

Post by User923005 » Sat Dec 22, 2012 6:49 am

The clang compiler fared no better:

$ clang --version
clang version 3.1 (branches/release_31)
Target: x86_64-w64-mingw32
Thread model: posix

$ make profile-build ARCH=x86-64-modern COMP=clang
make ARCH=x86-64-modern COMP=clang config-sanity
make[1]: Entering directory `/c/project/Stockfish-c-11/src'

Config:
debug: 'no'
optimize: 'yes'
arch: 'x86_64'
os: 'any'
bits: '64'
prefetch: 'yes'
bsfq: 'yes'
popcnt: 'yes'
sse: 'yes'

Flags:
CXX: clang++
CXXFLAGS: -g -Wall -Wcast-qual -fno-exceptions -fno-rtti -std=c++11 -pedantic -Wno-long-long -Wextra -Wshadow -DNDEBUG -O3 -DIS_64BIT -msse -DUSE_BS
FQ -msse3 -DUSE_POPCNT
LDFLAGS: -lpthread

Testing config sanity. If this fails, try 'make help' ...

make[1]: Leaving directory `/c/project/Stockfish-c-11/src'

Step 0/4. Preparing for profile build.
make ARCH=x86-64-modern COMP=clang gcc-profile-prepare
make[1]: Entering directory `/c/project/Stockfish-c-11/src'
make ARCH=x86-64-modern COMP=clang gcc-profile-clean
make[2]: Entering directory `/c/project/Stockfish-c-11/src'
make[2]: Leaving directory `/c/project/Stockfish-c-11/src'
make[1]: Leaving directory `/c/project/Stockfish-c-11/src'

Step 1/4. Building executable for benchmark ...
make ARCH=x86-64-modern COMP=clang gcc-profile-make
make[1]: Entering directory `/c/project/Stockfish-c-11/src'
make ARCH=x86-64-modern COMP=clang \
EXTRACXXFLAGS='-fprofile-generate' \
EXTRALDFLAGS='-lgcov' \
all
make[2]: Entering directory `/c/project/Stockfish-c-11/src'
clang++ -g -Wall -Wcast-qual -fno-exceptions -fno-rtti -std=c++11 -fprofile-generate -pedantic -Wno-long-long -Wextra -Wshadow -DNDEBUG -O3 -DIS_64BI
T -msse -DUSE_BSFQ -msse3 -DUSE_POPCNT -c -o benchmark.o benchmark.cpp
In file included from benchmark.cpp:27:
In file included from ./search.h:24:
In file included from c:/mingw64/bin\..\lib\clang\3.1/../../../include/c++/4.6.3\memory:75:
c:/mingw64/bin\..\lib\clang\3.1/../../../include/c++/4.6.3\ext/concurrence.h:228:2: error: no matching function for call to '_S_destroy'
_S_destroy(&_M_mutex);
^~~~~~~~~~
c:/mingw64/bin\..\lib\clang\3.1/../../../include/c++/4.6.3\ext/concurrence.h:273:7: note: candidate template ignored: substitution failure
[with _Rm = __gthread_recursive_mutex_t]
_S_destroy(_Rm* __mx)
^
c:/mingw64/bin\..\lib\clang\3.1/../../../include/c++/4.6.3\ext/concurrence.h:282:7: note: candidate template ignored: substitution failure
[with _Rm = __gthread_recursive_mutex_t]
_S_destroy(_Rm* __mx)
^
c:/mingw64/bin\..\lib\clang\3.1/../../../include/c++/4.6.3\ext/concurrence.h:290:7: note: candidate template ignored: substitution failure
[with _Rm = __gthread_recursive_mutex_t]
_S_destroy(_Rm* __mx)
^
In file included from benchmark.cpp:28:
In file included from ./thread.h:23:
In file included from c:/mingw64/bin\..\lib\clang\3.1/../../../include/c++/4.6.3\condition_variable:37:
c:/mingw64/bin\..\lib\clang\3.1/../../../include/c++/4.6.3\chrono:240:10: error: cannot cast from lvalue of type 'const long long' to rvalue
reference type 'rep' (aka 'long long &&'); types are not compatible
: __r(static_cast<rep>(__rep)) { }
^~~~~~~~~~~~~~~~~~~~~~~
c:/mingw64/bin\..\lib\clang\3.1/../../../include/c++/4.6.3\chrono:128:13: note: in instantiation of function template specialization
'std::chrono::duration<long long &&, std::ratio<1, 1000000> >::duration<long long, void>' requested here
return _ToDur(static_cast<__to_rep>(__d.count()));
^
c:/mingw64/bin\..\lib\clang\3.1/../../../include/c++/4.6.3\chrono:182:9: note: in instantiation of function template specialization
'std::chrono::__duration_cast_impl<std::chrono::duration<long long &&, std::ratio<1, 1000000> >, std::ratio<1, 1>, long long &&, true,
true>::__cast<long long, std::ratio<1, 1000000> >' requested here
return __dc::__cast(__d);
^
c:/mingw64/bin\..\lib\clang\3.1/../../../include/c++/4.6.3\chrono:247:10: note: in instantiation of function template specialization
'std::chrono::duration_cast<std::chrono::duration<long long &&, std::ratio<1, 1000000> >, long long, std::ratio<1, 1000000> >' requested here
: __r(duration_cast<duration>(__d).count()) { }
^
c:/mingw64/bin\..\lib\clang\3.1/../../../include/c++/4.6.3\chrono:466:9: note: in instantiation of function template specialization
'std::chrono::duration<long long &&, std::ratio<1, 1000000> >::duration<long long, std::ratio<1, 1000000>, void>' requested here
return __ct(__lhs).count() < __ct(__rhs).count();
^
c:/mingw64/bin\..\lib\clang\3.1/../../../include/c++/4.6.3\chrono:667:7: note: in instantiation of function template specialization
'std::chrono::operator<<long long, std::ratio<1, 1000000>, long long, std::ratio<1, 1000000> >' requested here
< system_clock::duration::zero(),
^
c:/mingw64/bin\..\lib\clang\3.1/../../../include/c++/4.6.3\chrono:128:13: error: call to implicitly-deleted copy constructor of
'std::chrono::duration<long long &&, std::ratio<1, 1000000> >'
return _ToDur(static_cast<__to_rep>(__d.count()));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c:/mingw64/bin\..\lib\clang\3.1/../../../include/c++/4.6.3\chrono:182:9: note: in instantiation of function template specialization
'std::chrono::__duration_cast_impl<std::chrono::duration<long long &&, std::ratio<1, 1000000> >, std::ratio<1, 1>, long long &&, true,
true>::__cast<long long, std::ratio<1, 1000000> >' requested here
return __dc::__cast(__d);
^
c:/mingw64/bin\..\lib\clang\3.1/../../../include/c++/4.6.3\chrono:247:10: note: in instantiation of function template specialization
'std::chrono::duration_cast<std::chrono::duration<long long &&, std::ratio<1, 1000000> >, long long, std::ratio<1, 1000000> >' requested here
: __r(duration_cast<duration>(__d).count()) { }
^
c:/mingw64/bin\..\lib\clang\3.1/../../../include/c++/4.6.3\chrono:466:9: note: in instantiation of function template specialization
'std::chrono::duration<long long &&, std::ratio<1, 1000000> >::duration<long long, std::ratio<1, 1000000>, void>' requested here
return __ct(__lhs).count() < __ct(__rhs).count();
^
c:/mingw64/bin\..\lib\clang\3.1/../../../include/c++/4.6.3\chrono:667:7: note: in instantiation of function template specialization
'std::chrono::operator<<long long, std::ratio<1, 1000000>, long long, std::ratio<1, 1000000> >' requested here
< system_clock::duration::zero(),
^
c:/mingw64/bin\..\lib\clang\3.1/../../../include/c++/4.6.3\chrono:233:12: note: explicitly defaulted function was implicitly deleted here
constexpr duration(const duration&) = default;
^
c:/mingw64/bin\..\lib\clang\3.1/../../../include/c++/4.6.3\chrono:349:6: note: copy constructor of 'duration<long long &&, std::ratio<1, 1000000> >'
is implicitly deleted because field '__r' is of rvalue reference type 'rep' (aka 'long long &&')
rep __r;
^
c:/mingw64/bin\..\lib\clang\3.1/../../../include/c++/4.6.3\chrono:182:9: error: call to implicitly-deleted copy constructor of 'typename
enable_if<__is_duration<duration<long long &&, ratio<1, 1000000> > >::value, duration<long long &&, ratio<1, 1000000> > >::type' (aka
'std::chrono::duration<long long &&, std::ratio<1, 1000000> >')
return __dc::__cast(__d);
^~~~~~~~~~~~~~~~~
c:/mingw64/bin\..\lib\clang\3.1/../../../include/c++/4.6.3\chrono:247:10: note: in instantiation of function template specialization
'std::chrono::duration_cast<std::chrono::duration<long long &&, std::ratio<1, 1000000> >, long long, std::ratio<1, 1000000> >' requested here
: __r(duration_cast<duration>(__d).count()) { }
^
c:/mingw64/bin\..\lib\clang\3.1/../../../include/c++/4.6.3\chrono:466:9: note: in instantiation of function template specialization
'std::chrono::duration<long long &&, std::ratio<1, 1000000> >::duration<long long, std::ratio<1, 1000000>, void>' requested here
return __ct(__lhs).count() < __ct(__rhs).count();
^
c:/mingw64/bin\..\lib\clang\3.1/../../../include/c++/4.6.3\chrono:667:7: note: in instantiation of function template specialization
'std::chrono::operator<<long long, std::ratio<1, 1000000>, long long, std::ratio<1, 1000000> >' requested here
< system_clock::duration::zero(),
^
c:/mingw64/bin\..\lib\clang\3.1/../../../include/c++/4.6.3\chrono:233:12: note: explicitly defaulted function was implicitly deleted here
constexpr duration(const duration&) = default;
^
c:/mingw64/bin\..\lib\clang\3.1/../../../include/c++/4.6.3\chrono:349:6: note: copy constructor of 'duration<long long &&, std::ratio<1, 1000000> >'
is implicitly deleted because field '__r' is of rvalue reference type 'rep' (aka 'long long &&')
rep __r;
^
c:/mingw64/bin\..\lib\clang\3.1/../../../include/c++/4.6.3\chrono:255:11: error: rvalue reference to type 'long long' cannot bind to lvalue of type
'long long'
{ return __r; }
^~~
c:/mingw64/bin\..\lib\clang\3.1/../../../include/c++/4.6.3\chrono:247:39: note: in instantiation of member function 'std::chrono::duration<long long
&&, std::ratio<1, 1000000> >::count' requested here
: __r(duration_cast<duration>(__d).count()) { }
^
c:/mingw64/bin\..\lib\clang\3.1/../../../include/c++/4.6.3\chrono:466:9: note: in instantiation of function template specialization
'std::chrono::duration<long long &&, std::ratio<1, 1000000> >::duration<long long, std::ratio<1, 1000000>, void>' requested here
return __ct(__lhs).count() < __ct(__rhs).count();
^
c:/mingw64/bin\..\lib\clang\3.1/../../../include/c++/4.6.3\chrono:667:7: note: in instantiation of function template specialization
'std::chrono::operator<<long long, std::ratio<1, 1000000>, long long, std::ratio<1, 1000000> >' requested here
< system_clock::duration::zero(),
^
c:/mingw64/bin\..\lib\clang\3.1/../../../include/c++/4.6.3\chrono:666:21: error: static_assert expression is not an integral constant expression
static_assert(system_clock::duration::min()
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c:/mingw64/bin\..\lib\clang\3.1/../../../include/c++/4.6.3\chrono:666:21: note: undefined function 'operator<<long long, std::ratio<1, 1000000>, long

long, std::ratio<1, 1000000> >' cannot be used in a constant expression
c:/mingw64/bin\..\lib\clang\3.1/../../../include/c++/4.6.3\chrono:460:7: note: declared here
operator<(const duration<_Rep1, _Period1>& __lhs,
^
c:/mingw64/bin\..\lib\clang\3.1/../../../include/c++/4.6.3\chrono:141:40: error: cannot cast from lvalue of type 'const intmax_t'
(aka 'const long long') to rvalue reference type 'long long &&'; types are not compatible
static_cast<_CR>(__d.count()) / static_cast<_CR>(_CF::den)));
^~~~~~~~~~~~~~~~~~~~~~~~~~
c:/mingw64/bin\..\lib\clang\3.1/../../../include/c++/4.6.3\chrono:182:9: note: in instantiation of function template specialization
'std::chrono::__duration_cast_impl<std::chrono::duration<long long, std::ratio<1, 1> >, std::ratio<1, 1000000>, long long &&, true,
false>::__cast<long long, std::ratio<1, 1000000> >' requested here
return __dc::__cast(__d);
^
c:/mingw64/bin\..\lib\clang\3.1/../../../include/c++/4.6.3\chrono:679:21: note: in instantiation of function template specialization
'std::chrono::duration_cast<std::chrono::duration<long long, std::ratio<1, 1> >, long long, std::ratio<1, 1000000> >' requested here
return std::time_t(duration_cast<chrono::seconds>
^
c:/mingw64/bin\..\lib\clang\3.1/../../../include/c++/4.6.3\chrono:154:40: error: cannot cast from lvalue of type 'const intmax_t'
(aka 'const long long') to rvalue reference type 'long long &&'; types are not compatible
static_cast<_CR>(__d.count()) * static_cast<_CR>(_CF::num)));
^~~~~~~~~~~~~~~~~~~~~~~~~~
c:/mingw64/bin\..\lib\clang\3.1/../../../include/c++/4.6.3\chrono:182:9: note: in instantiation of function template specialization
'std::chrono::__duration_cast_impl<std::chrono::duration<long long, std::ratio<1, 1000000> >, std::ratio<1000000, 1>, long long &&, false,
true>::__cast<long long, std::ratio<1, 1> >' requested here
return __dc::__cast(__d);
^
c:/mingw64/bin\..\lib\clang\3.1/../../../include/c++/4.6.3\chrono:577:22: note: in instantiation of function template specialization
'std::chrono::duration_cast<std::chrono::duration<long long, std::ratio<1, 1000000> >, long long, std::ratio<1, 1> >' requested here
return __time_point(duration_cast<_ToDur>(__t.time_since_epoch()));
^
c:/mingw64/bin\..\lib\clang\3.1/../../../include/c++/4.6.3\chrono:687:9: note: in instantiation of function template specialization
'std::chrono::time_point_cast<std::chrono::duration<long long, std::ratio<1, 1000000> >, std::chrono::system_clock, std::chrono::duration<long
long, std::ratio<1, 1> > >' requested here
return time_point_cast<system_clock::duration>
^
In file included from benchmark.cpp:28:
./thread.h:55:10: error: no type named 'mutex' in namespace 'std'
std::mutex mutex;
~~~~~^
./thread.h:93:10: error: no type named 'thread' in namespace 'std'
std::thread nativeThread;
~~~~~^
./thread.h:94:10: error: no type named 'mutex' in namespace 'std'
std::mutex mutex;
~~~~~^
./thread.h:95:10: error: no type named 'condition_variable' in namespace 'std'
std::condition_variable sleepCondition;
~~~~~^
./thread.h:148:10: error: no type named 'mutex' in namespace 'std'
std::mutex mutex;
~~~~~^
./thread.h:149:10: error: no type named 'condition_variable' in namespace 'std'
std::condition_variable sleepCondition;
~~~~~^
benchmark.cpp:80:34: error: use of undeclared identifier 'stoi'; did you mean 'atoi'?
limits.movetime = 1000 * stoi(limit); // movetime is in ms
^~~~
atoi
c:/mingw64/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\stdlib.h:342:15: note: 'atoi' declared here
int __cdecl atoi(const char *_Str);
^
benchmark.cpp:80:39: error: no viable conversion from 'string' (aka 'basic_string<char>') to 'const char *'
limits.movetime = 1000 * stoi(limit); // movetime is in ms
^~~~~
c:/mingw64/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\stdlib.h:342:32: note: passing argument to parameter '_Str' here
int __cdecl atoi(const char *_Str);
^
benchmark.cpp:83:24: error: use of undeclared identifier 'stoi'; did you mean 'atoi'?
limits.nodes = stoi(limit);
^~~~
atoi
c:/mingw64/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\stdlib.h:342:15: note: 'atoi' declared here
int __cdecl atoi(const char *_Str);
^
benchmark.cpp:83:29: error: no viable conversion from 'string' (aka 'basic_string<char>') to 'const char *'
limits.nodes = stoi(limit);
^~~~~
c:/mingw64/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\stdlib.h:342:32: note: passing argument to parameter '_Str' here
int __cdecl atoi(const char *_Str);
^
benchmark.cpp:86:24: error: use of undeclared identifier 'stoi'; did you mean 'atoi'?
limits.depth = stoi(limit);
^~~~
atoi
c:/mingw64/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\stdlib.h:342:15: note: 'atoi' declared here
int __cdecl atoi(const char *_Str);
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make[2]: *** [benchmark.o] Error 1
make[2]: Leaving directory `/c/project/Stockfish-c-11/src'
make[1]: *** [gcc-profile-make] Error 2
make[1]: Leaving directory `/c/project/Stockfish-c-11/src'
make: *** [profile-build] Error 2

$

User923005
Posts: 616
Joined: Thu May 19, 2011 1:35 am

Re: gull chess

Post by User923005 » Sat Dec 22, 2012 7:05 am

P.S.
Sorry for hijacking this thread. Simple thoughtlessness on my part.

ThinkingALot
Posts: 144
Joined: Sun Jun 13, 2010 7:32 am
Contact:

Re: gull chess

Post by ThinkingALot » Sat Dec 22, 2012 8:09 am

lucasart wrote:Is there any poroject to make the code portable one day?
It's very unlikely to happen in the foreseeable future. For years I've been writing under MSVC only, and I just don't know how most of the things needed are done in linux. Such things as
1) Intrinsics for bitscan & popcnt & atomic operations.
2) Forking new processes.
3) Allocating shared memory.
Digging into all of this requires loads of time and I think the time is better spent improving playing strength.
lucasart wrote:And for SMP, there is absolutely no need to write unportable code. C++11 has all one needs to write it clean, portable, safe and simple code. In the C++11 branch of Stockfish, Marco demonstrates that fact with "maestria".
Stockfish uses threads instead of processes. So I think it was somewhat easier to make it portable.

User923005
Posts: 616
Joined: Thu May 19, 2011 1:35 am

Re: gull chess

Post by User923005 » Sat Dec 22, 2012 8:24 am

ThinkingALot wrote:
lucasart wrote:Is there any poroject to make the code portable one day?
It's very unlikely to happen in the foreseeable future. For years I've been writing under MSVC only, and I just don't know how most of the things needed are done in linux. Such things as
1) Intrinsics for bitscan & popcnt & atomic operations.
Gcc makes a nice portable layer for intrinsic functions.
— Built-in Function: int __builtin_popcountll (unsigned long long) // population count
— Built-in Function: int __builtin_clzll (unsigned long long) // number of leading zero bits
— Built-in Function: int __builtin_ctzll (unsigned long long) // number of trailing zero bits
There is a note on it in the chess programming Wiki, I think.
2) Forking new processes.
fork()
No, really it is that simple. And in Posix land, the child process inherits all the stack variables from the parent, so the only way you even know you are the child process is by the return of fork().
It's also faster than Windows CreateProcess.
3) Allocating shared memory.
The guy who wrote FastDb and GigaBase wrote a some nice utilities for this stuff.
http://www.garret.ru/sal.html
Ace could also be used, which abstracts the entire operating system for a host of different environments:
http://www.cs.wustl.edu/~schmidt/ACE.html
Digging into all of this requires loads of time and I think the time is better spent improving playing strength.
Maybe someone else will create a fork of your project that runs under Posix.
To me, this project is far more interesting than Ivanhoe and friends.
It shows every important idea from those projects, but much more succinctly done (material imbalance, savage leaf pruning, etc).

My Little Prophecy:
If there is going to be an engine that de-thrones Houdini, it will come from this tree and not the other.

Post Reply