Skip to content

Commit 05c8987

Browse files
authored
Merge pull request #291 from tactcomplabs/fix_rvcxx
Pass RVCXX to tests; use ${RVCXX} instead of hard-coded compiler; fix copy-and-paste comments
2 parents 9b8d8f7 + 0fb9e35 commit 05c8987

File tree

19 files changed

+54
-73
lines changed

19 files changed

+54
-73
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,12 @@ Building the Rev SST component from source using CMake (>= 3.19) can be performe
4343
git clone
4444
git config core.hooksPath .githooks
4545
cd rev/build
46-
cmake -DRVCC=/path/to/riscv/compiler/exe ..
46+
cmake -DRVCC=/path/to/riscv/c/compiler/exe -DRVCXX=/path/to/riscv/c++/compiler/exe ..
4747
make -j
4848
make install
4949

50+
RVCC and RVCXX can be set as environment variables in lieu of passing them to CMake.
51+
5052
Additional build options include:
5153
* -DBUILD_ASM_TESTING=ON
5254
* -DBUILD_DOCUMENTATION=ON : enables Doxygen source code generation (use `make doc`)

test/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,15 +140,15 @@ macro(add_rev_test test_name test_dir timeout labels)
140140

141141
set_tests_properties(${test_name_lower}_revmem_${numHarts}_harts_${numCores}_cores
142142
PROPERTIES
143-
ENVIRONMENT "RVCC=${RVCC}"
143+
ENVIRONMENT "RVCC=${RVCC};RVCXX=${RVCXX}"
144144
TIMEOUT ${timeout}
145145
PASS_REGULAR_EXPRESSION "${passRegex}"
146146
LABELS "${labels}"
147147
)
148148
if(add_memh_test)
149149
set_tests_properties(${test_name_lower}_memh_${numHarts}_harts_${numCores}_cores
150150
PROPERTIES
151-
ENVIRONMENT "RVCC=${RVCC}"
151+
ENVIRONMENT "RVCC=${RVCC};RVCXX=${RVCXX}"
152152
TIMEOUT ${timeout}
153153
PASS_REGULAR_EXPRESSION "${passRegex}"
154154
LABELS "${labels}"
@@ -172,7 +172,7 @@ macro(add_rev_test test_name test_dir timeout labels)
172172
# Set test properties for the script test
173173
set_tests_properties(${test_name_lower}_script
174174
PROPERTIES
175-
ENVIRONMENT "RVCC=${RVCC}"
175+
ENVIRONMENT "RVCC=${RVCC};RVCXX=${RVCXX}"
176176
TIMEOUT ${timeout}
177177
PASS_REGULAR_EXPRESSION "${passRegex}"
178178
LABELS "${labels}"

test/argv/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
.PHONY: src
1414

1515
EXAMPLE=argv
16-
CXX=riscv64-unknown-elf-g++
16+
CXX=${RVCXX}
1717
ARCH=rv64imafdc
1818

1919
all: $(EXAMPLE).exe

test/cxx/simple_struct/Makefile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,12 @@
1313
.PHONY: src
1414

1515
EXAMPLE=simple_struct
16-
CC=riscv64-unknown-elf-g++
17-
#ARCH=rv64g
16+
CXX=${RVCXX}
1817
ARCH=rv64gc
1918

2019
all: $(EXAMPLE).exe
2120
$(EXAMPLE).exe: $(EXAMPLE).cc
22-
$(CC) -march=$(ARCH) -I../../../common/syscalls -o $(EXAMPLE).exe $(EXAMPLE).cc -static
21+
$(CXX) -march=$(ARCH) -I../../../common/syscalls -o $(EXAMPLE).exe $(EXAMPLE).cc -static
2322
clean:
2423
rm -Rf $(EXAMPLE).exe
2524

test/cxx/stl/array/Makefile

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#
22
# Makefile
33
#
4-
# makefile: vector
4+
# makefile: array
55
#
66
# Copyright (C) 2017-2024 Tactical Computing Laboratories, LLC
77
# All Rights Reserved
@@ -13,14 +13,12 @@
1313
.PHONY: src
1414

1515
EXAMPLE=array
16-
CC=riscv64-unknown-elf-g++
17-
#CC="${RVCC}"
18-
#ARCH=rv64g
16+
CXX=${RVCXX}
1917
ARCH=rv64gc
2018

2119
all: $(EXAMPLE).exe
2220
$(EXAMPLE).exe: $(EXAMPLE).cc
23-
$(CC) -march=$(ARCH) -O0 -I../../../../common/include -I../../../../common/syscalls -I../../../include -o $(EXAMPLE).exe $(EXAMPLE).cc -static
21+
$(CXX) -march=$(ARCH) -O0 -I../../../../common/include -I../../../../common/syscalls -I../../../include -o $(EXAMPLE).exe $(EXAMPLE).cc -static
2422
clean:
2523
rm -Rf $(EXAMPLE).exe
2624

test/cxx/stl/map/Makefile

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#
22
# Makefile
33
#
4-
# makefile: vector
4+
# makefile: map
55
#
66
# Copyright (C) 2017-2024 Tactical Computing Laboratories, LLC
77
# All Rights Reserved
@@ -13,14 +13,12 @@
1313
.PHONY: src
1414

1515
EXAMPLE=map
16-
CC=riscv64-unknown-elf-g++
17-
#CC="${RVCC}"
18-
#ARCH=rv64g
16+
CXX=${RVCXX}
1917
ARCH=rv64gc
2018

2119
all: $(EXAMPLE).exe
2220
$(EXAMPLE).exe: $(EXAMPLE).cc
23-
$(CC) -march=$(ARCH) -O0 -I../../../../common/include -I../../../../common/syscalls -I../../../include -o $(EXAMPLE).exe $(EXAMPLE).cc -static
21+
$(CXX) -march=$(ARCH) -O0 -I../../../../common/include -I../../../../common/syscalls -I../../../include -o $(EXAMPLE).exe $(EXAMPLE).cc -static
2422
clean:
2523
rm -Rf $(EXAMPLE).exe
2624

test/cxx/stl/map_obj/Makefile

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#
22
# Makefile
33
#
4-
# makefile: vector
4+
# makefile: map_obj
55
#
66
# Copyright (C) 2017-2024 Tactical Computing Laboratories, LLC
77
# All Rights Reserved
@@ -13,14 +13,12 @@
1313
.PHONY: src
1414

1515
EXAMPLE=map_obj
16-
CC=riscv64-unknown-elf-g++
17-
#CC="${RVCC}"
18-
#ARCH=rv64g
16+
CXX=${RVCXX}
1917
ARCH=rv64gc
2018

2119
all: $(EXAMPLE).exe
2220
$(EXAMPLE).exe: $(EXAMPLE).cc
23-
$(CC) -march=$(ARCH) -O0 -I../../../../common/include -I../../../../common/syscalls -I../../../include -o $(EXAMPLE).exe $(EXAMPLE).cc -static
21+
$(CXX) -march=$(ARCH) -O0 -I../../../../common/include -I../../../../common/syscalls -I../../../include -o $(EXAMPLE).exe $(EXAMPLE).cc -static
2422
clean:
2523
rm -Rf $(EXAMPLE).exe
2624

test/cxx/stl/multimap/Makefile

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#
22
# Makefile
33
#
4-
# makefile: vector
4+
# makefile: multimap
55
#
66
# Copyright (C) 2017-2024 Tactical Computing Laboratories, LLC
77
# All Rights Reserved
@@ -13,14 +13,12 @@
1313
.PHONY: src
1414

1515
EXAMPLE=multimap
16-
CC=riscv64-unknown-elf-g++
17-
#CC="${RVCC}"
18-
#ARCH=rv64g
16+
CXX=${RVCXX}
1917
ARCH=rv64gc
2018

2119
all: $(EXAMPLE).exe
2220
$(EXAMPLE).exe: $(EXAMPLE).cc
23-
$(CC) -march=$(ARCH) -O0 -I../../../../common/include -I../../../../common/syscalls -I../../../include -o $(EXAMPLE).exe $(EXAMPLE).cc -static
21+
$(CXX) -march=$(ARCH) -O0 -I../../../../common/include -I../../../../common/syscalls -I../../../include -o $(EXAMPLE).exe $(EXAMPLE).cc -static
2422
clean:
2523
rm -Rf $(EXAMPLE).exe
2624

test/cxx/stl/multimap_obj/Makefile

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#
22
# Makefile
33
#
4-
# makefile: vector
4+
# makefile: multimap_obj
55
#
66
# Copyright (C) 2017-2024 Tactical Computing Laboratories, LLC
77
# All Rights Reserved
@@ -13,14 +13,12 @@
1313
.PHONY: src
1414

1515
EXAMPLE=multimap_obj
16-
CC=riscv64-unknown-elf-g++
17-
#CC="${RVCC}"
18-
#ARCH=rv64g
16+
CXX=${RVCXX}
1917
ARCH=rv64gc
2018

2119
all: $(EXAMPLE).exe
2220
$(EXAMPLE).exe: $(EXAMPLE).cc
23-
$(CC) -march=$(ARCH) -O0 -I../../../../common/include -I../../../../common/syscalls -I../../../include -o $(EXAMPLE).exe $(EXAMPLE).cc -static
21+
$(CXX) -march=$(ARCH) -O0 -I../../../../common/include -I../../../../common/syscalls -I../../../include -o $(EXAMPLE).exe $(EXAMPLE).cc -static
2422
clean:
2523
rm -Rf $(EXAMPLE).exe
2624

test/cxx/stl/unordered_map/Makefile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#
22
# Makefile
33
#
4-
# makefile: vector
4+
# makefile: unordered_map
55
#
66
# Copyright (C) 2017-2024 Tactical Computing Laboratories, LLC
77
# All Rights Reserved
@@ -13,14 +13,15 @@
1313
.PHONY: src
1414

1515
EXAMPLE=unordered_map
16-
CC=riscv64-unknown-elf-g++
17-
#CC="${RVCC}"
16+
CXX=${RVCXX}
17+
CXX=riscv64-unknown-elf-g++ # TODO: Remove this line when "frflags" instruction is implemented (for floor function)
18+
1819
#ARCH=rv64g
1920
ARCH=rv64gc
2021

2122
all: $(EXAMPLE).exe
2223
$(EXAMPLE).exe: $(EXAMPLE).cc
23-
$(CC) -march=$(ARCH) -O0 -I../../../../common/include -I../../../../common/syscalls -I../../../include -o $(EXAMPLE).exe $(EXAMPLE).cc -static
24+
$(CXX) -march=$(ARCH) -O0 -I../../../../common/include -I../../../../common/syscalls -I../../../include -o $(EXAMPLE).exe $(EXAMPLE).cc -static
2425
clean:
2526
rm -Rf $(EXAMPLE).exe
2627

0 commit comments

Comments
 (0)