LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-03-2016, 07:04 PM   #1
nirvaanr
LQ Newbie
 
Registered: Jun 2016
Distribution: Debian 10
Posts: 26

Rep: Reputation: Disabled
How to compile latest sources using older gcc glibc versions and run them?


Hello friends,

I'm able to compile & run the latest "stockfish chess engine" sources using GCC 4.8 or later on Redhat EL 7.X. The latest source code (alongwith README) is available at https://github.com/mcostalba/Stockfish/tree/master

The commands to compile & build are: (goto "src" directory)

Code:
    gmake build ARCH=x86-64
    gmake install
However my requirement is to compile & run the same on Redhat EL 6.7 Server where the latest GCC version available is 4.4.7 (& glibc 2.12) as I can NOT upgrade GCC version without actually migrating to RHEL 7.X

Is it possible to modify the latest source to get it compliled & run on old version of gcc/glibc? if yes, would anyone be able to modify the sources (perhaps just Makefile?) for me please?

I tried changing "C ++ 11" to "C ++ 0x" in the "Makefile" but no luck. Please see the error I'm getting when I try to compile latest SF source with GCC 4.4.7:


Code:
    [root@test-server src]#  ldd --version
    ldd (GNU libc) 2.12
    Copyright (C) 2010 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.
    Written by Roland McGrath and Ulrich Drepper.
    [root@test-server src]#  gcc --version
    gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-16)
    Copyright (C) 2010 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.
    
    [root@test-server src]#  cat /etc/redhat-release
    Red Hat Enterprise Linux Server release 6.7 (Santiago)
    [root@test-server src]#  uname -r
    2.6.32-573.12.1.el6.x86_64
    [root@test-server src]#  gmake build ARCH=x86-64
    gmake ARCH=x86-64 COMP=gcc config-sanity
    gmake[1]: Entering directory `/root/Stockfish-master/src'
    
    Config:
    debug: 'no'
    optimize: 'yes'
    arch: 'x86_64'
    bits: '64'
    prefetch: 'yes'
    popcnt: 'no'
    sse: 'yes'
    pext: 'no'
    
    Flags:
    CXX: g++
    CXXFLAGS: -Wall -Wcast-qual -fno-exceptions -fno-rtti -std=c++11  -pedantic -Wextra -Wshadow -m64 -DNDEBUG -O3 -DIS_64BIT -msse -flto
    LDFLAGS:  -Wl,--no-as-needed -lpthread -Wall -Wcast-qual -fno-exceptions -fno-rtti -std=c++11  -pedantic -Wextra -Wshadow -m64 -DNDEBUG -O3 -DIS_64BIT -msse -flto
    
    Testing config sanity. If this fails, try 'make help' ...
    
    gmake[1]: Leaving directory `/root/Stockfish-master/src'
    gmake ARCH=x86-64 COMP=gcc all
    gmake[1]: Entering directory `/root/Stockfish-master/src'
    g++ -Wall -Wcast-qual -fno-exceptions -fno-rtti -std=c++11  -pedantic -Wextra -Wshadow -m64 -DNDEBUG -O3 -DIS_64BIT -msse -flto   -c -o benchmark.o benchmark.cpp
    cc1plus: error: unrecognized command line option "-std=c++11"
    cc1plus: error: unrecognized command line option "-flto"
    gmake[1]: * [benchmark.o] Error 1
    gmake[1]: Leaving directory `/root/Stockfish-master/src'
    gmake: * [build] Error 2
    [root@test-server src]#
Many thanks in advance!
 
Old 06-03-2016, 10:34 PM   #2
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,624

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
this is redhat
so you have a current and valid support contract

install the "developer toolset"
it is in the rhn repo
https://access.redhat.com/documentat...loper-toolset/
 
1 members found this post helpful.
Old 06-04-2016, 08:32 PM   #3
nirvaanr
LQ Newbie
 
Registered: Jun 2016
Distribution: Debian 10
Posts: 26

Original Poster
Rep: Reputation: Disabled
Thank you John, I will try this!
 
Old 06-05-2016, 05:43 PM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
The git stockfish builds OK with g++ version 5.3.1 : 'devtoolset-4-gcc-c++'.
( I only installed devtoolset-4-gcc-c++ and itīs four dependencies {-4-gcc, -4-binutils, -4-runtime, -4-libstdc++-devel}.

My test, CentOS 6.8 - 64bits :
$ git clone https://github.com/official-stockfish/Stockfish.git
$ cd Stockfish/src/
$ scl enable devtoolset-4 bash
$ make build ARCH=x86-64


-

Last edited by knudfl; 06-05-2016 at 06:19 PM.
 
1 members found this post helpful.
Old 06-08-2016, 09:32 AM   #5
nirvaanr
LQ Newbie
 
Registered: Jun 2016
Distribution: Debian 10
Posts: 26

Original Poster
Rep: Reputation: Disabled
Many thanks John & knudfl

Successfully installed latest version of gcc and compiled SF
 
  


Reply

Tags
devtoolset, devtoolset-4, stockfish



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there a way to compile gcc with an older version or build gcc manually? anon002 Linux - Software 10 05-11-2015 01:05 AM
Which GCC/glibc 2.5 sources in LFS dev? jayjwa Linux From Scratch 0 10-23-2006 11:56 PM
how can I compile older versions of gcc? drkstr Slackware 11 06-11-2006 11:10 AM
how to use older versions of glibc turls Programming 4 07-07-2004 03:40 PM
compile glibc or gcc first? carboncopy Slackware 2 07-29-2003 07:26 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:09 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration