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

In summary: I get the same error every time.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: CFLAGS = -O3 -march=i486 -DNDEBUG but I got the error g++ -O3 -march=i486 -DNDEBUG -c aimoves.cpp -o aimoves.o
  • #1
fluidistic
Gold Member
3,923
260
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 [Broken]
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
  • #2
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.
 
  • #3
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.
 
  • #4
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
.
 
  • #5
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
  • #6
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.
 

1. Why isn't the Sunsetter program compiling?

There could be several reasons why the Sunsetter program is not compiling. One possibility is that there are errors in the program's code, which need to be identified and fixed in order for the program to compile successfully.

2. What is the "Open source" aspect of the Sunsetter program?

The term "open source" refers to a type of software development model where the source code of a program is made freely available for anyone to use, modify, and distribute. The Sunsetter program is considered open source because its source code is publicly available.

3. How can I contribute to the development of the Sunsetter program?

If you are interested in contributing to the development of the Sunsetter program, you can do so by submitting bug reports, suggesting new features, or even submitting code changes through the program's open source platform. However, please make sure to follow the project's guidelines and conventions.

4. Is the Sunsetter program compatible with all operating systems?

The compatibility of the Sunsetter program depends on its specific system requirements. Generally, it should be compatible with most operating systems, but it is always best to check the program's documentation or consult with the developers for more information.

5. Are there any known bugs or issues with the Sunsetter program?

As with any software, there may be bugs or issues with the Sunsetter program that have not yet been identified or fixed. It is always recommended to check the program's documentation or issue tracker to see if there are any known bugs before reporting any issues.

Similar threads

  • Programming and Computer Science
2
Replies
65
Views
2K
Replies
6
Views
1K
  • Programming and Computer Science
Replies
29
Views
5K
  • Programming and Computer Science
Replies
2
Views
3K
  • Programming and Computer Science
Replies
9
Views
8K
  • Programming and Computer Science
Replies
1
Views
3K
  • Programming and Computer Science
Replies
5
Views
1K
  • Programming and Computer Science
Replies
4
Views
3K
  • Programming and Computer Science
Replies
8
Views
5K
Back
Top