Skip to content

Commit 35f4018

Browse files
committed
Update handcomp_tests for C++ runtime
1 parent 5119f84 commit 35f4018

File tree

8 files changed

+19
-16
lines changed

8 files changed

+19
-16
lines changed

handcomp_test/Makefile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
include ../config.mk
22

3-
SRCS = $(wildcard *.c)
3+
SRCS = $(wildcard *.cpp)
44
HDRS = $(wildcard *.h)
5-
OBJS = $(patsubst %.c,%.o,$(SRCS))
5+
OBJS = $(patsubst %.cpp,%.o,$(SRCS))
66

77
DEFINES = $(ABI_DEF)
88

@@ -21,11 +21,14 @@ TIMING_COUNT ?= 1
2121
all: $(TESTS)
2222

2323
$(TESTS): %: %.o ktiming.o getoptions.o ZERO.o
24-
$(CC) $^ -o $@ $(RTS_LIBS) -lrt -lpthread -lm
24+
$(CXX) $^ -o $@ $(RTS_LIBS) -lrt -lpthread -lm
2525

2626
%.o: %.c
2727
$(CC) -c $(OPTIONS) -DTIMING_COUNT=$(TIMING_COUNT) -o $@ $<
2828

29+
%.o: %.cpp
30+
$(CXX) -c $(OPTIONS) -DTIMING_COUNT=$(TIMING_COUNT) -o $@ $<
31+
2932
memcheck:
3033
$(MAKE) clean; $(MAKE) > /dev/null
3134
date
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
#include <string.h>
6060

6161
#include "../runtime/cilk2c.h"
62-
#include "../runtime/cilk2c_inlined.c"
62+
#include "../runtime/cilk2c_inlined.cpp"
6363
#include "ktiming.h"
6464
#include "getoptions.h"
6565

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#include <stdlib.h>
33

44
#include "../runtime/cilk2c.h"
5-
#include "../runtime/cilk2c_inlined.c"
5+
#include "../runtime/cilk2c_inlined.cpp"
66
#include "ktiming.h"
77

88

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#include <stdlib.h>
33

44
#include "../runtime/cilk2c.h"
5-
#include "../runtime/cilk2c_inlined.c"
5+
#include "../runtime/cilk2c_inlined.cpp"
66
#include "ktiming.h"
77
#include "getoptions.h"
88

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#include <string.h>
88

99
#include "../runtime/cilk2c.h"
10-
#include "../runtime/cilk2c_inlined.c"
10+
#include "../runtime/cilk2c_inlined.cpp"
1111
#include "ktiming.h"
1212

1313
extern size_t ZERO;

runtime/Makefile

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ REDUCER_DEF = -DREDUCER_MODULE
88
RESOURCE_DIR=$(realpath ..)
99
MAIN = $(RTS_LIBDIR)/$(RTS_LIB)
1010
BITCODE_ABI = $(MAIN)-abi.bc
11-
SRCS = $(filter-out pedigree_ext.c $(PEDIGREE_LIB_SRC).c $(PERSON_C_SRC).c $(PERSON_CPP_SRC).cpp, $(wildcard *.c))
11+
SRCS = $(filter-out pedigree_ext.cpp $(PEDIGREE_LIB_SRC).cpp $(PERSON_C_SRC).c $(PERSON_CPP_SRC).cpp, $(wildcard *.cpp))
1212
HDRS = $(wildcard *.h)
13-
OBJS = $(patsubst %.c,./build/%.o,$(SRCS))
13+
OBJS = $(patsubst %.cpp,./build/%.o,$(SRCS))
1414
INCLUDES = -I../include/
1515
DEFINES = $(REDUCER_DEF) $(ABI_DEF) $(ALERT_DEF)
1616
OPTIONS = $(OPT) $(DBG) $(ARCH) -Werror -Wall -fpic $(DEFINES) $(INCLUDES) -gdwarf-4
@@ -30,7 +30,7 @@ $(MAIN).a: $(OBJS)
3030
$(AR) rcs $@ $^
3131

3232
$(MAIN).so: $(OBJS)
33-
$(CC) -shared -o $@ $^
33+
$(CXX) -shared -o $@ $^
3434

3535
$(PERSON_C).a: build/$(PERSON_C_SRC).o
3636
$(AR) rcs $@ $^
@@ -48,22 +48,22 @@ $(PEDIGREE_LIB).a: build/$(PEDIGREE_LIB_SRC).o
4848
$(AR) rcs $@ $^
4949

5050
$(PEDIGREE_LIB).so: ./build/$(PEDIGREE_LIB_SRC).o
51-
$(CC) -shared -o $@ $^
51+
$(CXX) -shared -o $@ $^
5252

5353
build:
5454
mkdir -p $@
5555

5656
$(RTS_LIBDIR):
5757
mkdir -p $@
5858

59-
build/%.o: %.c $(HDRS)
60-
$(CC) -c $(OPTIONS) -o $@ $<
61-
6259
build/%.o: %.cpp $(HDRS)
6360
$(CXX) -c $(OPTIONS) -o $@ $<
6461

65-
build/cilk2c_inlined.bc: cilk2c_inlined.c $(HDRS)
66-
$(CC) $(OPT) -DCHEETAH_API="" -DCHEETAH_INTERNAL_NORETURN='__attribute__((noreturn))' -DCHEETAH_INTERNAL="" -DCILK_DEBUG=0 -c -emit-llvm $(INCLUDES) -gdwarf-4 -g -o $@ $<
62+
build/%.o: %.c $(HDRS)
63+
$(CC) -c $(OPTIONS) -o $@ $<
64+
65+
build/cilk2c_inlined.bc: cilk2c_inlined.cpp $(HDRS)
66+
$(CXX) $(OPT) -DCHEETAH_API_CONSUMER -DCILK_DEBUG=0 -c -emit-llvm $(INCLUDES) -gdwarf-4 -g -o $@ $<
6767

6868
$(BITCODE_ABI) : build/cilk2c_inlined.bc
6969
cp $< $@

0 commit comments

Comments
 (0)