help for a linux develop environment

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

geko
Posts: 36
Joined: Fri Sep 06, 2013 11:20 am
Location: Italy
Full name: Giuseppe Cannella

Re: help for a linux develop environment

Post by geko »

Ciao Marco,
i use linux Mint with Mate for many years, codeblocks, gcc 4.8.1, gdb, valgrind, gprof, cutechess-cli bayeselo, clop, polyglot, svn, Arena with wine, something Xboard and bash shell for testing.

in windows i use mingw 4.8.1

I recompile source for windows and osx with a single Makefile, osx is on virtualbox

Giuseppe
jdart
Posts: 4367
Joined: Fri Mar 10, 2006 5:23 am
Location: http://www.arasanchess.org

Re: help for a linux develop environment

Post by jdart »

My development environment on Linux is emacs + gcc. I don't use a GUI.

If you want to try different compilers, you can try clang, or download the Intel compiler and tools for Linux, which are free for non-commercial use (see http://software.intel.com/en-us/non-com ... evelopment). Their C++ Studio product suite includes a very good execution profiler (note though: requires Intel hardware, preferably Sandy Bridge or later, for most functions to work).

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

Re: help for a linux develop environment

Post by bob »

elcabesa wrote:hi, I use Linux at home for everything but chess development and I'd like to change the state of the things.

I mainly use kubuntu and as you can image kde.
1) what development environment can you suggest? I was thinking about Eclipse, so I can reuse it for windows too.
2) what compilers are available for linux? I'd like to test my engine with more than one compiler and have it work in a deterministic way, giving always the same result independent from the compiler
3) what chess testing environment are available in linux? i'd like to test the engine with cutechess, but I also would like to test it against pgn/epd file.

thank you all for your help
For linux there are two good choices. GCC has been around for ever, is being actively developed using the open-source model, and works just fine on linux. Intel's C compiler is free for non-commercial use on linux (you have to look to find it on intel's web site, but it is there). It will produce a faster executable than gcc if you are running on an intel platform, if you use AMD you might get slower code.

The "IDE" I use is a terminal window + vi + make, and occasionally using gcc (or idb for intel)... I'm not a big fan of integrated environments myself, which lets me work on my office box from home without trying to tunnel x11 stuff out to my home boxes...
User avatar
Codesquid
Posts: 138
Joined: Tue Aug 23, 2011 10:25 pm
Location: Germany

Re: help for a linux develop environment

Post by Codesquid »

I recommend QtCreator, works great for all things C/C++, even if you're not using Qt.

As for C/C++ compilers, there's GCC available on every decent Linux distribution. On some distributions, there's also clang/llvm, though personally I didn't have much success with that compiler, always some bizarre linking problems.
nanos gigantium humeris insidentes
Rein Halbersma
Posts: 741
Joined: Tue May 22, 2007 11:13 am

Re: help for a linux develop environment

Post by Rein Halbersma »

bob wrote: For linux there are two good choices. GCC has been around for ever, is being actively developed using the open-source model, and works just fine on linux. Intel's C compiler is free for non-commercial use on linux (you have to look to find it on intel's web site, but it is there). It will produce a faster executable than gcc if you are running on an intel platform, if you use AMD you might get slower code.
3 good choices, actually: Clang is at least as good as gcc, especially if you are doing C++11, in which area Intel is lagging quite a bit.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: help for a linux develop environment

Post by bob »

Rein Halbersma wrote:
bob wrote: For linux there are two good choices. GCC has been around for ever, is being actively developed using the open-source model, and works just fine on linux. Intel's C compiler is free for non-commercial use on linux (you have to look to find it on intel's web site, but it is there). It will produce a faster executable than gcc if you are running on an intel platform, if you use AMD you might get slower code.
3 good choices, actually: Clang is at least as good as gcc, especially if you are doing C++11, in which area Intel is lagging quite a bit.
Depends. clang as distributed by apple breaks crafty. gcc 4.7.2 and intel compile it correctly.
Rein Halbersma
Posts: 741
Joined: Tue May 22, 2007 11:13 am

Re: help for a linux develop environment

Post by Rein Halbersma »

bob wrote:
Rein Halbersma wrote:
bob wrote: For linux there are two good choices. GCC has been around for ever, is being actively developed using the open-source model, and works just fine on linux. Intel's C compiler is free for non-commercial use on linux (you have to look to find it on intel's web site, but it is there). It will produce a faster executable than gcc if you are running on an intel platform, if you use AMD you might get slower code.
3 good choices, actually: Clang is at least as good as gcc, especially if you are doing C++11, in which area Intel is lagging quite a bit.
Depends. clang as distributed by apple breaks crafty. gcc 4.7.2 and intel compile it correctly.
We've discussed this before: this is only true for older apples, and then only if you don't properly install/upgrade to a recent version of libstdc++ (and not the default one based on gcc 4.2). There are plenty of sites (StackOverflow e.g.) that can help you run Clang on Apple.
User avatar
lucasart
Posts: 3232
Joined: Mon May 31, 2010 1:29 pm
Full name: lucasart

Re: help for a linux develop environment

Post by lucasart »

elcabesa wrote:hi, I use Linux at home for everything but chess development and I'd like to change the state of the things.

I mainly use kubuntu and as you can image kde.
1) what development environment can you suggest? I was thinking about Eclipse, so I can reuse it for windows too.
2) what compilers are available for linux? I'd like to test my engine with more than one compiler and have it work in a deterministic way, giving always the same result independent from the compiler
3) what chess testing environment are available in linux? i'd like to test the engine with cutechess, but I also would like to test it against pgn/epd file.

thank you all for your help
All you need is a text editor and a compiler. You have that already, as it comes with any POSIX compliant distro (cc = compiler, vi = editor). I would add git too.

Personally, I use Codelite, which is an very simple to use IDE. I don't like Eclipse and find it horribly complicated. But if you're used to Eclipse and you know how to use it, that's what you should use. Choose whatever you're most comfortable with.

For cutechess, you can either download a compiled version or compile it yourself. However, to compile yourself, you have to to install hundreds of megabytes of cruft: g++, qt-dev-tools.
Theory and practice sometimes clash. And when that happens, theory loses. Every single time.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: help for a linux develop environment

Post by bob »

Rein Halbersma wrote:
bob wrote:
Rein Halbersma wrote:
bob wrote: For linux there are two good choices. GCC has been around for ever, is being actively developed using the open-source model, and works just fine on linux. Intel's C compiler is free for non-commercial use on linux (you have to look to find it on intel's web site, but it is there). It will produce a faster executable than gcc if you are running on an intel platform, if you use AMD you might get slower code.
3 good choices, actually: Clang is at least as good as gcc, especially if you are doing C++11, in which area Intel is lagging quite a bit.
Depends. clang as distributed by apple breaks crafty. gcc 4.7.2 and intel compile it correctly.
We've discussed this before: this is only true for older apples, and then only if you don't properly install/upgrade to a recent version of libstdc++ (and not the default one based on gcc 4.2). There are plenty of sites (StackOverflow e.g.) that can help you run Clang on Apple.
Sorry, but you are wrong. My macbook is maybe 8 months old. Intel 2.0ghz i7 cpu. Do you consider 8 months to be "old"???

How do you not properly install anything? You MUST install xcode to get the compiler. Auto-update then grabs whatever is the latest at that point. Early this year, clang was broken, period. I have not tried it since, as I used macports to down load gcc 4.7.2..
rtitle
Posts: 33
Joined: Wed Aug 14, 2013 7:23 pm

Re: help for a linux develop environment

Post by rtitle »

On Linux, if developing C++ code (which I do for my day job), I use vi for editing, gcc for compiling, and gdb for debugging. Old-fashioned, but it works for me. It's possible to use Eclipse for C++ development if you prefer an IDE with a graphical interface.

My chess engine (strictly a spare-time project) runs on all 3 major platforms - Windows, Linux, and Mac OSX. Mostly I develop it on Windows using Visual Studio and port to the other environments. As much as I don't like Microsoft in general, I have to admit they did a nice job with Visual Studio.

Rich