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

Click For Summary
The discussion revolves around difficulties in compiling an open-source chess engine on Linux due to outdated code and compiler incompatibilities. The original poster lacks programming knowledge and is seeking help after receiving limited assistance from programmers, with one individual mentioning the need to modify the Makefile for compatibility. They have shared their code on GitHub and detailed the compilation errors in a programming forum but have not received responses. Key issues include the use of an old compiler version and errors related to the x86-64 instruction set. Suggestions have been made to adjust compiler flags, particularly using the "-fpermissive" option, but these have only resolved some warnings without fixing the main errors. The poster expresses frustration and desperation for a solution, acknowledging the challenge of finding free help for such a niche problem.
fluidistic
Gold Member
Messages
3,931
Reaction score
281
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 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.
 
Learn If you want to write code for Python Machine learning, AI Statistics/data analysis Scientific research Web application servers Some microcontrollers JavaScript/Node JS/TypeScript Web sites Web application servers C# Games (Unity) Consumer applications (Windows) Business applications C++ Games (Unreal Engine) Operating systems, device drivers Microcontrollers/embedded systems Consumer applications (Linux) Some more tips: Do not learn C++ (or any other dialect of C) as a...

Similar threads

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