-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
49 lines (33 loc) · 1.08 KB
/
Makefile
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
# standard amuse configuration include
# config.mk will be made after ./configure has run
AMUSE_DIR?=../../../..
-include $(AMUSE_DIR)/config.mk
GPUARCH ?= 35
CUDAFLAGS += -arch=sm_$(GPUARCH)
######### ugly!!!! should be in the amuse base make file
MPICXX ?= mpicxx
CFLAGS += -Wall -g
CXXFLAGS += $(CFLAGS)
LDFLAGS += -lm $(MUSE_LD_FLAGS)
OBJS = interface.o
CODELIB = src/libetics.a
CODE_GENERATOR = $(AMUSE_DIR)/build.py
all: etics_worker
clean:
$(RM) *.so *.o *.pyc worker_code.cc worker_code.h
$(RM) *~ etics_worker worker_code.cc
make -C src clean
$(CODELIB):
make -C src libetics.a
worker_code.cc: interface.py
$(CODE_GENERATOR) --type=c interface.py EticsInterface -o $@
worker_code.h: interface.py
$(CODE_GENERATOR) --type=H interface.py EticsInterface -o $@
etics_worker: worker_code.cc worker_code.h $(CODELIB) $(OBJS)
$(MPICXX) $(CXXFLAGS) -L/usr/local/cuda/lib64 $< $(OBJS) $(CODELIB) -o $@ -lcudart
echo the above compilation directive is not nice
.SUFFIXES: .cu .o
.cu.o: $<
$(NVCC) -Xcompiler="$(CXXFLAGS)" -c -o $@ $<
# .cc.o: $<
# $(CXX) $(CXXFLAGS) -c -o $@ $<