Open source program Sunsetter (chess related) doesn't compile

Click For Summary

Discussion Overview

The discussion revolves around the challenges of compiling an open source chess engine program called Sunsetter on a Linux system. Participants explore various compilation errors and potential solutions, while addressing the complexities of working with outdated code and differing compiler versions.

Discussion Character

  • Technical explanation
  • Debate/contested
  • Exploratory

Main Points Raised

  • One participant expresses frustration with the inability to compile the program, noting the archaic nature of the code and the lack of assistance from others.
  • Another participant mentions that compilation issues can arise from differences in versions of tools and libraries, suggesting that even if someone else can compile the code, it may not work for the original poster.
  • A suggestion is made to use the compiler option "[-fpermissive]" to address specific errors, with various syntax options proposed for implementation in the Makefile.
  • A participant reports an error related to the selected CPU not supporting the x86-64 instruction set when attempting to use a different set of compiler flags.
  • One participant notes that modifying the Makefile to include the "-fpermissive" option turned some errors into warnings but did not resolve a critical error related to the code itself.
  • Concerns are raised about the feasibility of finding someone willing to fix the code for free, with the uncertainty of how long it might take to resolve the issues.

Areas of Agreement / Disagreement

Participants generally agree on the difficulties of compiling the program and the potential need for code modifications. However, there is no consensus on a definitive solution, and multiple competing views on how to approach the compilation issues remain.

Contextual Notes

Limitations include the reliance on outdated code, potential discrepancies in compiler versions, and unresolved specific errors that may require deeper code understanding to fix.

fluidistic
Gold Member
Messages
3,932
Reaction score
283
Hi guys,
I'm trying to compile an open source program (chess and chess variant engine) under linux but for some reason it doesn't work. I know almost nothing regarding programming so I don't know how to fix the problem. In a chess server I asked some programmers if they knew how to fix the problem and only one could "solve" the problem, but he doesn't want to share his code. He told me he had to tweak the Makefile to allow obsolete compilation or something like that. He said that the code of the program is very archaic, etc.
I posted the code in github, as well as the error I'm getting when I try to compile in a programming forum. But I've received no reply so far. I'm getting desperate to get this program running. So if you can find how to fix the compilation problem, I'd be very happy.
Here's the full code: https://github.com/arbolis/Sunsetter-crazyhouse
Here's my post on another forum that explains more details about the error: http://www.programmersheaven.com/mb/ConLunix/433564/433564/program-in-c++-wont-compile-in-linux/?S=B20000#433564.
The Makefile by the way is
Code:
# Makefile to build sunsetter for linux.
#
# -Wall turns on full compiler warnings, only of interest to developers
# -O1 turns on optimization at a moderate level.
# -O3 turns on optimization at the highest level. (confuses the debugger though)
# -g turns on debugging data in the executable.
# -DNDEBUG turns off assert() debugging in the code
#
# CFLAGS for a "release" built, no debugging and highly optimized.
# CFLAGS = -O3 -DNDEBUG
#
# uncomment this line to build a debug version.
# need to type "make clean;make" to get the full effect
# CFLAGS = -Wall -g -O1 -DDEBUG
#
# or this one for a "light debug" version which works well with gdb
# but is otherwise like the release version.
CFLAGS = -Wall -g -O1 -DNDEBUG
#
# set of flags that produces the best speed on Angrim's
# Athlon Thunderbird with gcc version egcs-2.91.66
# CFLAGS = -O3 -march=i486 -DNDEBUG

OBJECTS = aimoves.o bitboard.o board.o book.o bughouse.o evaluate.o moves.o search.o capture_moves.o check_moves.o interface.o notation.o order_moves.o partner.o quiescense.o tests.o transposition.o validate.o

# sunsetter is the default target, so either "make" or "make sunsetter" will do
sunsetter: $(OBJECTS) Makefile
g++ $(CFLAGS) $(OBJECTS) -o sunsetter

# so "make clean" will wipe out the files created by a make.
clean:
rm $(OBJECTS)

# a general purpose dependancy for makeing .o files from .cpp files
.cpp.o:
g++ $(CFLAGS) -c $<

# more detailed dependancies below for a few critical files

aimoves.o: aimoves.cpp definitions.h variables.h board.h brain.h interface.h
g++ $(CFLAGS) -c aimoves.cpp -o $@

board.o: board.cpp board.h brain.h interface.h definitions.h bughouse.h \
variables.h notation.h
g++ $(CFLAGS) -c board.cpp -o $@

bitboard.o: bitboard.cpp board.h bughouse.h interface.h brain.h
g++ $(CFLAGS) -c bitboard.cpp -o $@

bughouse.o: bughouse.cpp variables.h definitions.h board.h interface.h bughouse.h brain.h
g++ $(CFLAGS) -c bughouse.cpp -o $@

evaluate.o: evaluate.cpp brain.h board.h evaluate.h interface.h
g++ $(CFLAGS) -c evaluate.cpp -o $@

interface.o: interface.cpp interface.h variables.h notation.h bughouse.h brain.h board.h
g++ $(CFLAGS) -c interface.cpp -o $@
in case if you notice something strange.
Thanks for any help.
 
Last edited by a moderator:
Technology news on Phys.org
Not much help here, but compilation of an obscure code can be a nightmare. Note that even if someone will be able to compile it, it still doesn't matter his changes will work for you - it is usually a matter of versions of tools and libraries installed on the computer.
 
The "[-fpermissive]" in your error message might be a clue.

Is that a compiler option? if so try setting it with something like
CFLAGS = -f permissive
or
CFLAGS = -permissive
or
CFLAGS = +permissive
in the makefile. (Check your compiler documentation to find which of those is the right syntax).

I've no idea what "expected initializer before ‘output’ " means without reading the code - but if you get lucky it might be a knock-on effect from the first problem.
 
Borek said:
Not much help here, but compilation of an obscure code can be a nightmare. Note that even if someone will be able to compile it, it still doesn't matter his changes will work for you - it is usually a matter of versions of tools and libraries installed on the computer.
You are right. I tried the command in the Makefile that worked for the last guy who modified sunsetter's code (back in 2004), namely:
Code:
CFLAGS = -O3 -march=i486 -DNDEBUG
but I got the error
Code:
g++ -O3 -march=i486 -DNDEBUG -c aimoves.cpp -o aimoves.o
aimoves.cpp:1:0: error: CPU you selected does not support x86-64 instruction set
aimoves.cpp:1:0: error: CPU you selected does not support x86-64 instruction set
make: *** [aimoves.o] Error 1
. Actually it seems an error due to my gcc 4.8.1 compiler who can't understand old code or something like that... I guess of course.
AlephZero said:
The "[-fpermissive]" in your error message might be a clue.

Is that a compiler option? if so try setting it with something like
CFLAGS = -f permissive
or
CFLAGS = -permissive
or
CFLAGS = +permissive
in the makefile. (Check your compiler documentation to find which of those is the right syntax).

I've no idea what "expected initializer before ‘output’ " means without reading the code - but if you get lucky it might be a knock-on effect from the first problem.
I see. I've checked out on the web and it should be -fpermissive.
So I modified the first non commented line of the Makefile, I tried many variants with -fpermissive but non worked. For example
Code:
CFLAGS = -fpermissive -O3 -march=x86-64 -DNDEBUG
returned
Code:
g++ -fpermissive -O3 -march=x86-64 -DNDEBUG -c aimoves.cpp -o aimoves.o
In file included from aimoves.cpp:19:0:
board.h:740:21: warning: extra qualification ‘boardStruct::’ on member ‘getColorOnMove’ [-fpermissive]
board.h:754:21: warning: extra qualification ‘boardStruct::’ on member ‘getColorOffMove’ [-fpermissive]
In file included from brain.h:20:0,
                 from aimoves.cpp:20:
interface.h:33:14: error: expected initializer before ‘output’
make: *** [aimoves.o] Error 1
.
 
It did "work", in that it turned your first two errors into warnings (which you can ignore). But the bad news is, it didn't fix the other one!

I think you are running out of options, without actually understanding and modifying the code, and it's a bit optimistic to expect somebody to look at that "for free". It might take 10 seconds to fix it, or 10 hours, but there's no way to tell which until you tryi.
 
  • Like
Likes   Reactions: 1 person
AlephZero said:
It did "work", in that it turned your first two errors into warnings (which you can ignore). But the bad news is, it didn't fix the other one!

I think you are running out of options, without actually understanding and modifying the code, and it's a bit optimistic to expect somebody to look at that "for free". It might take 10 seconds to fix it, or 10 hours, but there's no way to tell which until you tryi.
I see... well thanks a lot. I think you're right. Actually a programmer fixed it in a few minutes, I may talk to him soon but there's no guaranty either.
Meanwhile I posted this "problem" in a chess forum, in hope of someone to overcome the problem. But as you said, for free it will be hard.
 

Similar threads

Replies
65
Views
5K
  • · Replies 9 ·
Replies
9
Views
9K
  • · Replies 29 ·
Replies
29
Views
8K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 3 ·
Replies
3
Views
5K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 8 ·
Replies
8
Views
6K
  • · Replies 30 ·
2
Replies
30
Views
7K
Replies
11
Views
2K