-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathMakefile
More file actions
114 lines (85 loc) · 3.11 KB
/
Makefile
File metadata and controls
114 lines (85 loc) · 3.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
default: install
install-deps:
pip -q install build --user
pip -q install cython==3.0.10 --user
pip -q install numpy==2.0.1 --user
install-meson-deps:
pip -q install meson==1.5.1 --user
build-sdist: install-deps
python -m build --sdist
build-wheel: install-deps
python -m build --wheel
build-all: build-sdist build-wheel
dev: install-deps install-meson-deps
meson setup build --python.install-env auto
meson compile -C build
python -m pip install --no-build-isolation --editable .
build-debug: install-deps install-meson-deps
meson setup build-debug --python.install-env auto --buildtype="debug"
meson compile -C build-debug
install-debug: install-deps install-meson-deps build-debug
python -m pip install --no-binary :all: --debug --no-build-isolation --editable .
debug: uninstall build-debug
mkdir -p debug/gomea/
cp -r build-debug/* debug/gomea/
cp -r gomea/__init__.py debug/gomea/
install: install-deps build-wheel
pip install dist/*.whl --user
reinstall: install-deps build-wheel
pip install dist/*.whl --user --force-reinstall
src-install: install-deps build-sdist
pip install dist/*.tar.gz --user
uninstall:
pip uninstall -y gomea
cibuildwheel: clean
sudo pipx run cibuildwheel
doc:
sphinx-build -b html docs/source/ docs/build/html
clean:
rm -f *.so
rm -rf gomea.egg-info/
rm -rf build/
rm -rf build_cpp/
rm -rf dist/
rm -rf build-debug/
rm -rf debug/gomea/
rm -f gomea/*.cpp
rm -f gomea/*.h
rm -f gomea/*.so
rm -rf cython_debug/
rm -rf gomea/__pycache__/
######################################################################################################
CXX_GOMEA_CPP=g++
CXX_INC_GOMEA_CPP=-I./ -Igomea/ -Igomea/lib/Eigen/ -Igomea/lib/cxxopts-3.1.1/include/
CXXFLAGS_GOMEA_CPP=-g -fopenmp -Wall -std=c++17 -DCPP_STANDALONE $(CXX_INC_GOMEA_CPP) #-pg ## For profiling
SRCDIR=gomea/src
OBJDIR=build_cpp/obj
OBJDIR_DISCRETE=build_cpp/obj_discrete
OBJDIR_RV=build_cpp/obj_realvalued
BINDIR=build_cpp
# list of all source files
SRCS=$(wildcard $(SRCDIR)/fitness/*.cpp $(SRCDIR)/common/*.cpp $(SRCDIR)/utils/*.cpp)
SRCS_DISCRETE=$(wildcard $(SRCDIR)/fitness/benchmarks-discrete/*.cpp $(SRCDIR)/discrete/*.cpp)
SRCS_RV=$(wildcard $(SRCDIR)/fitness/benchmarks-rv/*.cpp $(SRCDIR)/real_valued/*.cpp)
# generate a list of object files based on source files
OBJS=$(patsubst $(SRCDIR)/%.cpp,$(OBJDIR)/%.o,$(SRCS))
OBJS_DISCRETE=$(patsubst $(SRCDIR)/%.cpp,$(OBJDIR_DISCRETE)/%.o,$(SRCS_DISCRETE))
OBJS_RV=$(patsubst $(SRCDIR)/%.cpp,$(OBJDIR_RV)/%.o,$(SRCS_RV))
# the final executable file
TARGET_DISCRETE=$(BINDIR)/DiscreteGOMEA
TARGET_RV=$(BINDIR)/RealValuedGOMEA
#### Object files ####
$(OBJDIR)/%.o: $(SRCDIR)/%.cpp
@mkdir -p $(@D)
$(CXX_GOMEA_CPP) $(CXXFLAGS_GOMEA_CPP) -c $< -o $@
$(OBJDIR_DISCRETE)/%.o: $(SRCDIR)/%.cpp
@mkdir -p $(@D)
$(CXX_GOMEA_CPP) $(CXXFLAGS_GOMEA_CPP) -c $< -o $@
$(OBJDIR_RV)/%.o: $(SRCDIR)/%.cpp
@mkdir -p $(@D)
$(CXX_GOMEA_CPP) $(CXXFLAGS_GOMEA_CPP) -c $< -o $@
$(TARGET_DISCRETE): $(OBJS_DISCRETE) $(OBJS)
$(CXX_GOMEA_CPP) $(CXXFLAGS_GOMEA_CPP) $^ -o $@
$(TARGET_RV): $(OBJS_RV) $(OBJS)
$(CXX_GOMEA_CPP) $(CXXFLAGS_GOMEA_CPP) $^ -o $@
cpp: $(TARGET_DISCRETE) $(TARGET_RV)