Menu

CompileScid

BuildScid (6)
Israel Chauca F. Fulvio bstp

If you want to compile the developer's code, you need to get the master branch.
If you want to compile the stable code, see [GetScid].
If you want the help of a human being, please ask on the [MailingList].

Do I need to Install Tcl/Tk?

Yes.
Tcl (Tool Command Language) and Tk (graphical user interface toolkit) are necessary for Scid's GUI.
You can download the latest sources:
https://www.tcl.tk/software/tcltk/download.html
and compile them:
https://www.tcl.tk/doc/howto/compile.html

Alternatively, you can get precompiled binary;
from repositories:
(Fedora) sudo yum install tk-devel
(Debian/Ubuntu) sudo apt-get install tk8.6 tcl8.6 tcl8.6-dev
or from external sources:
(ActiveState) http://www.activestate.com/activetcl/downloads

MacOS have a old Tcl/Tk 8.5.9 version pre-installed, but using it is not recommended.
On MacOS, Tcl/Tk should be build as a framework:
./configure --enable-framework

Which Version of Tcl/Tk Do I Need?

The most recent one, the better.
But as long as your Makefile contains the correct version number, it should be OK.

To verify the installed version, type this in the Terminal:

tclsh
info patchlevel

If Scid's configuration step tells you that you might need to edit your Makefile, look if if your Makefile refers to the latest Tcl/Tk version installed on your machine. If that's not the case, edit your Makefile accordingly.

Linux: gcc

The usual:
./configure
and
make
should suffice.
If you have problems you can try:
./configure THREADS=""
that will disable multi-threading and the Gamelist windows will be slower).
Scid can be run with:
./scid
To install Scid to system dirs:
sudo make install

Linux: clang

Alternatively LLVM/clang can be used:
./configure COMPILE=clang++ CC=clang LINK=clang++ THREADS="-std=c++11"
and
make all_scid
This will built Scid executable and scripts, but not the chess engines phalanx and toga.

Windows: Visual Studio

The preferred way to compile on Windows is to use Microsoft Visual Studio.
The free Visual Studio Express 2012 for Windows Desktop can be downloaded here:
http://www.microsoft.com/visualstudio/eng/downloads
After install two new Command Prompt links are created:
64bit: VS2012 x64 Cross Tools Command Prompt
32bit: VS2012 x86 Native Tools Command Prompt
Open the one that matches the installed version of Tcl/Tk and cd into Scid source directory.
If you did not installed tcl in the directory C:\TCL you need to manually write into Makefile.vc the right tcl directory.
To compile and run Scid type in the command prompt:
nmake -f Makefile.vc all && Release\scid.exe

Mac OS X

1) Open a terminal and cd into Scid's directory
2) Launch the configure script:

./configure

3) If necessary, an automatic dialog will appear asking to install the package "clang++" (the package can be installed manually with "xcode-select --install")
4) Create the scid executable with:

make install

The application Scid.app can be found inside the "dist" directory.

MacOS Catalina

Alan Bennet kindly provided a tutorial on How to Install SCID from Source on [MacOSCatalina].

Advanced: CMake

CMake is a flexible tool that generate native makefiles and workspaces that can be used in the compiler environment of your choice.
Debug Makefile:

mkdir Debug && cd Debug
cmake .. -DCMAKE_BUILD_TYPE=Debug && make
gdb scid

Release Makefile:

mkdir Release && cd Release
cmake .. && make
./scid

Unit tests:

mkdir Testing && cd Testing
cmake ../gtest && make
cd ../gtest
./runAll

CMake can also generate projects for Visual Studio, Xcode, MinGW, ..., :
https://cmake.org/cmake/help/v3.0/manual/cmake-generators.7.html

and packages like .tar.gz, .deb. .rpm, .dmg, ..., :
https://cmake.org/Wiki/CMake:CPackPackageGenerators


Related

Wiki: GetLatestCode
Wiki: GetScid
Wiki: InstallOsxDMG
Wiki: MacOSCatalina
Wiki: MailingList
Wiki: SendPatches

Discussion

  • Kayvan Sylvan

    Kayvan Sylvan - 2014-03-25

    I used the usual "./configure" and "make" to compile SCID on Fedora 20 x86_64. When I ran it, I saw this message:

    $ ./scid
    terminate called after throwing an instance of 'std::system_error'
      what():  Enable multithreading to use std::thread: Operation not permitted
    Aborted (core dumped)
    

    When I did the following:

    ./configure LINK='g++ -pthread'
    make
    

    then it all worked as expected.

     
  • Thomas Schlapp

    Thomas Schlapp - 2018-10-02

    Link is dead:
    If you want to compile the developer's code, you need to get the master branch.
    Change to article GetLatestCode?

     
    • bstp

      bstp - 2018-10-20

      Hello,

      I've edited the link to the master branch itself:

      https://sourceforge.net/p/scid/code/ci/master/tree/

      If this is too obscure, I'll add a wiki entry.

       
  • yorkman

    yorkman - 2020-02-10

    Getting these errors when compiling in Windows using Visual Studio 2019 (using current master):

    tkscid.cpp(9162): error C2065: 'CONST84': undeclared identifier
    tkscid.cpp(9162): error C2062: type 'char' unexpected
    tkscid.cpp(9162): error C2143: syntax error: missing ';' before '{'

    Any ideas?

     
    • Fulvio

      Fulvio - 2020-02-10

      It is caused by the tcl version: use tcl 8.6 (CONST84 was removed in tcl 9.0)

       
  • yorkman

    yorkman - 2020-02-10

    Thanks for the reply Fulvio. Unfortunately I still can't get it to compile. I uninstall tcl 8.7 and tried tcl 8.6.9 and 8.6.10 but I always get this error:

    N:\scid>nmake -f Makefile.vc all && Release\scid.exe

    Microsoft (R) Program Maintenance Utility Version 14.24.28316.0
    Copyright (C) Microsoft Corporation. All rights reserved.

    ===============================================================================
    Output directory = '.\Release'
    Intermediate directory = '.\Release\Temp'
    Tcl directory = 'C:\Tcl'
    Build 'Release' Version = yes
    CFLAGS: -DNDEBUG -DWIN32 -DWIN32_LEAN_AND_MEAN -O2 /EHsc -W2 -I"C:\Tcl\incl
    ude" -c -nologo -std:c++17
    LDFLAGS: -opt:icf,3 -nologo
    ===============================================================================

    Creating directory '.\Release\Temp'...
    Creating directory '.\Release\Temp\polyglot'...
    tkscid.cpp
    NMAKE : fatal error U1073: don't know how to make '.\Release\Temp\bytebuf.obj'
    Stop.

    I also tried TCL 32bit and 64bit and using Visual Studio 2019 on Win'2012R2 to compile. TCL/TK are installed in C:\TCL

    I have tried all of these TCL installers:

    Thomas Perschak, BAWT Project, Magicsplat

     
    • Fulvio

      Fulvio - 2020-02-11

      Ops, my bad!
      I removed bytebuf.cpp and forgot to update the Makefile.vc.
      I have pushed a patch, please try it now.

       
  • yorkman

    yorkman - 2020-02-11

    Works great now! Thanks.
    All this time I thought I was doing something wrong.

     
  • yorkman

    yorkman - 2020-02-11

    It'd be nice if I could compile this in MSYS2 though where I always compile my chess engines on windows. This way I wouldn't have to bother with Visual Studio and could just uninstall it.

    Running the 'make' command compiles everything without errors, when I run 'make install' I always get these errors:

    engines/scidlet/scidlet.cpp: In function 'bool inputReady()':
    engines/scidlet/scidlet.cpp:78:5: error: 'fd_set' was not declared in this scope
    78 | fd_set fd;
    | ^~~~~~
    engines/scidlet/scidlet.cpp:82:14: error: 'fd' was not declared in this scope
    82 | FD_ZERO(&fd);
    | ^~
    engines/scidlet/scidlet.cpp:82:5: error: 'FD_ZERO' was not declared in this scope
    82 | FD_ZERO(&fd);
    | ^~~~~~~
    engines/scidlet/scidlet.cpp:83:5: error: 'FD_SET' was not declared in this scope
    83 | FD_SET(0, &fd);
    | ^~~~~~
    engines/scidlet/scidlet.cpp:84:13: error: 'select' was not declared in this scope
    84 | return (select(1, &fd, NULL, NULL, &tv) > 0);
    | ^~~~~~
    make: *** [Makefile:126: scidlet] Error 1

    While these errors may be valid if I wanted the engines compiled too, I don't think I should be getting these errors since I ran 'make all_scid' as engines shouldn't be compiled with this command.

    Doing it this way, will it compile Scid.exe for me or just the linux version of scid?

     
    • Fulvio

      Fulvio - 2020-02-12

      To install only SCID without the engines use:
      make install_scid

      I should also point out that after "make all_scid" it can be launched from the compiled directory and the installation is not necessary.

      I don't know MSYS2 so I can give only some general advice:
      -- The Visual Studio terminal have a command to list the depencies of an executable:
      dumpbin /IMPORTS scid.exe
      You can use it to see which dlls are necessary for the executable compiled with MSYS2

      -- SCID can also be compiled using cmake, which at the moment is the most portable thing for c++

      Also, I moved the other comment to the bug tracker.

       

      Last edit: Fulvio 2020-02-12
  • cinocode

    cinocode - 2022-10-03
    Post awaiting moderation.

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.