Skip to content

Commit ee7cab9

Browse files
committed
Updated Makefile, added README.md
1 parent 70e2fb9 commit ee7cab9

File tree

3 files changed

+50
-80
lines changed

3 files changed

+50
-80
lines changed

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# RakeSearch
2+
Rake search of Diagonal Latin Squares
3+
4+
## Compilation
5+
6+
Application is compiled using gcc and make. Windows version is compiled using MinGW gcc crosscompiler.
7+
8+
To compile everything, you must have BOINC client libraries. Make sure you compile them using the same gcc version as this app, otherwise you may get link errors.
9+
10+
When compiling app for x86/x86_64, you will need gcc 8.x (I used gcc 8.2). Older gcc versions may not support some options used in Makefile.
11+
12+
To compile app, enter RakeSearch/RakeDiagSearch/RakeDiagSearch directory first. Open Makefile and update `BOINC_DIR` variable, so it will point to place where you have BOINC client library and its include files. After doing so, type `make` to start compilation.
13+
14+
Makefile supports number of extra parameters. Here are ones used for x86 and x86_64:
15+
16+
- `SSE2=1` - enable SSE2 instructions (x86 and x86_64)
17+
- `AVX=1` - enable AVX instructions (x86_64 only)
18+
- `AVX2=1` - enable AVX2 and BMI1/2 instructions (x86_64 only)
19+
- `AVX512=1` - enable AVX512 instructions (x86_64 only)
20+
21+
Note: SSE2 is always enabled on x86_64, support for it is part of AMD64 specification.
22+
23+
You can also specify target platform:
24+
- `M32=1` - compile 32-bit app version (used for Linux app)
25+
- `MinGW64=1` - compile 64-bit app for Windows using MinGW crosscompiler
26+
- `MinGW32=1` - compile 32-bit app for Windows using MinGW crosscompiler
27+
28+
You can also compile app for ARM (32-bit) and AARCH64 (64-bit). ARM may support NEON instructions, so there is compilation option `NEON=1` to enable it. AARCH64 always support NEON, so there is no special option for it.

RakeDiagSearch/RakeDiagSearch/Makefile

Lines changed: 22 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,44 +4,48 @@ BOINC_LIB_DIR = $(BOINC_DIR)/lib
44

55
CXX = g++
66

7-
CXXFLAGS += -O3 -ftree-vectorize -std=c++11 -static-libgcc -static-libstdc++ \
7+
CXXFLAGS += -O3 -ftree-vectorize -std=c++11 -Wall -static -static-libgcc -static-libstdc++ -pthread \
88
-I$(BOINC_DIR) \
99
-I$(BOINC_LIB_DIR) \
1010
-I$(BOINC_API_DIR) \
1111
-L$(BOINC_API_DIR) \
1212
-L$(BOINC_LIB_DIR) \
1313

14-
PTHREAD = -pthread
15-
1614
PROGRAM = rakesearch
1715

18-
ifeq ($(MinGW),1)
19-
$(info ===== Compiling MinGW app version =====)
20-
PROGRAM = rakesearch.exe
16+
ifeq ($(MinGW32),1)
17+
$(info ===== Compiling MinGW 32-bit app version =====)
18+
CXX = i686-w64-mingw32-g++
19+
else ifeq ($(MinGW64),1)
20+
$(info ===== Compiling MinGW 64-bit app version =====)
2121
CXX = x86_64-w64-mingw32-g++
22-
PTHREAD = -static -pthread
22+
else ifeq ($(M32),1)
23+
$(info ===== Compiling 32-bit app version =====)
24+
CXX = g++ -m32
25+
else
26+
CXX = g++
2327
endif
2428

2529
ifeq ($(Native),1)
2630
# Tune for machine where app is compiled
2731
$(info ===== Compiling native app version =====)
2832
CXXFLAGS += -march=native -mtune=native
2933
else ifeq ($(AVX512),1)
30-
# AVX512+BMI2, 64-bit
34+
# AVX512+BMI2
3135
$(info ===== Compiling AVX512+BMI2 app version =====)
32-
CXXFLAGS += -march=skylake-avx512 -mprefer-vector-width=256 -m64
36+
CXXFLAGS += -march=skylake-avx512 -mprefer-vector-width=256
3337
else ifeq ($(AVX2),1)
34-
# AVX2+BMI2, 64-bit
38+
# AVX2+BMI2
3539
$(info ===== Compiling AVX2+BMI2 app version =====)
36-
CXXFLAGS += -march=core2 -mtune=haswell -mpopcnt -mavx2 -mbmi -mbmi2 -m64
40+
CXXFLAGS += -march=core2 -mtune=haswell -mpopcnt -mavx2 -mbmi -mbmi2
3741
else ifeq ($(AVX),1)
38-
# AVX, 64-bit
42+
# AVX
3943
$(info ===== Compiling AVX app version =====)
40-
CXXFLAGS += -march=core2 -mtune=sandybridge -mpopcnt -mavx -m64
44+
CXXFLAGS += -march=core2 -mtune=sandybridge -mpopcnt -mavx
4145
else ifeq ($(SSE2),1)
4246
# SSE2, 64-bit
4347
$(info ===== Compiling SSE2 app version =====)
44-
CXXFLAGS += -march=core2 -mtune=generic -m64
48+
CXXFLAGS += -march=core2 -mtune=generic -msse2
4549
else ifeq ($(NEON),1)
4650
# NEON (ARM only; AARCH64 has NEON by default)
4751
$(info ===== Compiling ARM NEON app version =====)
@@ -53,19 +57,10 @@ endif
5357
all: $(PROGRAM)
5458

5559
clean:
56-
rm -f $(PROGRAM) *.o
60+
rm -f $(PROGRAM) $(PROGRAM).exe *.o
5761

5862
$(PROGRAM): main.o Square.o Generator.o MovePairSearch.o $(BOINC_LIB_DIR)/libboinc.a $(BOINC_API_DIR)/libboinc_api.a
59-
$(CXX) $(CXXFLAGS) -o $(PROGRAM) main.o Square.o Generator.o MovePairSearch.o $(PTHREAD) -lboinc_api -lboinc
60-
61-
Square.o: Square.cpp
62-
$(CXX) $(CXXFLAGS) -c Square.cpp
63-
64-
Generator.o: Generator.cpp
65-
$(CXX) $(CXXFLAGS) -c Generator.cpp
66-
67-
MovePairSearch.o: MovePairSearch.cpp
68-
$(CXX) $(CXXFLAGS) -c MovePairSearch.cpp
63+
$(CXX) $(CXXFLAGS) -o $(PROGRAM) main.o Square.o Generator.o MovePairSearch.o -lboinc_api -lboinc
6964

70-
main.o: main.cpp
71-
$(CXX) $(CXXFLAGS) -c main.cpp
65+
%.o: %.cpp
66+
$(CXX) $(CXXFLAGS) -c $< -o $@

RakeDiagSearch/RakeDiagSearch/Makefile32

Lines changed: 0 additions & 53 deletions
This file was deleted.

0 commit comments

Comments
 (0)