help for a linux develop environment

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

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
rreagan
Posts: 102
Joined: Sun Sep 09, 2007 6:32 am

Re: help for a linux develop environment

Post by rreagan »

gcc, vi, git, and scons. Works on Windows and Linux.
User avatar
jshriver
Posts: 1342
Joined: Wed Mar 08, 2006 9:41 pm
Location: Morgantown, WV, USA

Re: help for a linux develop environment

Post by jshriver »

I'm kinda going in reverse. Programming and using Linux since circa 1996 till now, and starting to use Windows as a development platform so here's my $0.02.

vi/emacs are nice editors for programming. As for compilers gcc/g++ is pretty much king. There is also the intel ICC compiler (which I'm not entirely sure of the license). However at one point I did download it, maybe it's a "use but only for educational or non-profit"?

Since you're coming from windows this is how my environment has changed. Eclipse is nice so obviously a highly recommend IDE. But for a command line program it just seems like overkill to me.

For GUI dev when you want to be cross platform, I recommend Qt Designer. This is what I'm using now for an upcoming chess project
(non-engine) and want it to run under Linux/Win/OSX with a GUI.

Become friends with apt-get it's a beautiful tool for installing and finding applications. dpkg is also nice for resolving issues if something in apt break.

Good luck!
-Josh
User avatar
jshriver
Posts: 1342
Joined: Wed Mar 08, 2006 9:41 pm
Location: Morgantown, WV, USA

Re: help for a linux develop environment

Post by jshriver »

rtitle wrote:gdb for debugging.
Rich
gdb is such a rich debugger. I still use emacs when I need to do gdb debugging and running/stepping thru code. So much nicer inside emacs :)