Skip to content

Commit

Permalink
Update boost deps for core and mss, track Sparta PR397 (#42)
Browse files Browse the repository at this point in the history
This fixes #35 and tracks the changes in Sparta
[PR397(sparcians/map#397), which are merges into Sparta main already. 

---------

Signed-off-by: Peter Debacker <[email protected]>
Signed-off-by: Knute Lingaard <[email protected]>
Co-authored-by: Peter Debacker <[email protected]>
Co-authored-by: Knute Lingaard <[email protected]>
Co-authored-by: Knute Lingaard <[email protected]>
  • Loading branch information
4 people authored May 8, 2023
1 parent af31204 commit 32fc79d
Show file tree
Hide file tree
Showing 13 changed files with 122 additions and 103 deletions.
11 changes: 5 additions & 6 deletions .github/actions/build/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ echo "Starting Build Entry"
echo "HOME:" $HOME
echo "GITHUB_WORKSPACE:" $GITHUB_WORKSPACE
echo "GITHUB_EVENT_PATH:" $GITHUB_EVENT_PATH
echo "CONDA_PREFIX:" $CONDA_PREFIX
echo "PWD:" `pwd`

#
Expand All @@ -17,16 +18,14 @@ echo "PWD:" `pwd`
#
echo "Building Sparta Infra"
cd ${GITHUB_WORKSPACE}/map/sparta
mkdir -p release # Link step expects "release" as dir name
ln -s release fastdebug
ln -s release debug
mkdir -p release
cd release
cmake .. -DCMAKE_BUILD_TYPE=$OLYMPIA_BUILD_TYPE -DGEN_DEBUG_INFO=OFF
cmake .. -DCMAKE_BUILD_TYPE=$OLYMPIA_BUILD_TYPE -DGEN_DEBUG_INFO=OFF -DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX}
if [ $? -ne 0 ]; then
echo "ERROR: Cmake for Sparta framework failed"
exit 1
fi
make -j$(nproc --all)
make -j$(nproc --all) install
BUILD_SPARTA=$?
if [ ${BUILD_SPARTA} -ne 0 ]; then
echo "ERROR: build sparta FAILED!!!"
Expand All @@ -36,7 +35,7 @@ fi
cd ${GITHUB_WORKSPACE}
mkdir $OLYMPIA_BUILD_TYPE
cd $OLYMPIA_BUILD_TYPE
cmake .. -DCMAKE_BUILD_TYPE=$OLYMPIA_BUILD_TYPE -DGEN_DEBUG_INFO=OFF -DSPARTA_BASE=${GITHUB_WORKSPACE}/map/sparta
cmake .. -DCMAKE_BUILD_TYPE=$OLYMPIA_BUILD_TYPE -DGEN_DEBUG_INFO=OFF
if [ $? -ne 0 ]; then
echo "ERROR: Cmake for olympia failed"
exit 1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ubuntu-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
with:
repository: sparcians/map
path: map
ref: map_v1.1.1
ref: map_v2

# Setup Conda and build environment
- name: Grab Python v3.8
Expand Down
48 changes: 32 additions & 16 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.17)
cmake_minimum_required(VERSION 3.19)
set (CMAKE_CXX_STANDARD 17)
set (CMAKE_CXX_STANDARD_REQUIRED ON)

Expand All @@ -11,16 +11,38 @@ add_compile_options ( -Werror

################################################################################
# Set up Sparta
if (NOT SPARTA_BASE)
message (FATAL_ERROR "Need to define the location of the Sparta: cmake <args> -DSPARTA_BASE=\"/path/to/sparta\"")
endif ()
include (${SPARTA_BASE}/cmake/sparta-config.cmake)
if(IS_DIRECTORY ${SPARTA_SEARCH_DIR})
message (STATUS "Using '${SPARTA_SEARCH_DIR}' for sparta install")
elseif(DEFINED ENV{CONDA_PREFIX})
message (STATUS "Looking for SPARTA in the conda environment: '$ENV{CONDA_PREFIX}'")
set(SPARTA_SEARCH_DIR $ENV{CONDA_PREFIX})
else()
message (STATUS "If needed, please provide the location where sparta is installed: -DSPARTA_SEARCH_DIR=<directory>")
endif()
set(CMAKE_MODULE_PATH "${SPARTA_SEARCH_DIR}/lib/cmake/sparta" ${CMAKE_MODULE_PATH})

find_package(Sparta REQUIRED)

if (NOT SPARTA_FOUND)
message (FATAL_ERROR "Sparta was not found in ${SPARTA_SEARCH_DIR}")
else()
message (STATUS "Sparta was found in ${SPARTA_SEARCH_DIR}")
endif()

include_directories(${SPARTA_INCLUDE_DIRS})

################################################################################
# Set up STF library
set (STF_LIB_BASE ${PROJECT_SOURCE_DIR}/stf_lib)
set (DISABLE_STF_DOXYGEN ON)
#include(${STF_LIB_BASE}/cmake/stf-config.cmake)

if (CMAKE_BUILD_TYPE MATCHES "^[Rr]elease")
set (FULL_LTO true)
include(${STF_LIB_BASE}/cmake/stf_linker_setup.cmake)
setup_stf_linker(false)
endif()



# Use ccache if installed
find_program (CCACHE_PROGRAM ccache)
Expand All @@ -45,12 +67,6 @@ else()
message (FATAL_ERROR "Please provide a CMAKE_BUILD_TYPE: -DCMAKE_BUILD_TYPE=Release|Debug|Profile")
endif()

# Sparta/STF linking
link_directories (
${SPARTA_BASE}/${SPARTA_BUILD_TYPE}
${SPARTA_BASE}/${SPARTA_BUILD_TYPE}/simdb
)

# Profile build flags
set(CMAKE_CXX_FLAGS_PROFILE "-O3 -pg -g -ftime-trace")
set(CMAKE_CXX_FLAGS_FASTDEBUG "-O3 -g")
Expand All @@ -59,8 +75,6 @@ set(CMAKE_CXX_FLAGS_FASTDEBUG "-O3 -g")
include_directories (core mss)
include_directories (SYSTEM mavis)
include_directories (SYSTEM stf_lib)
include_directories (SYSTEM ${SPARTA_BASE})
include_directories (SYSTEM ${SPARTA_BASE}/simdb/include)

# The Core, MSS, and the simulator
add_subdirectory(core)
Expand All @@ -77,10 +91,12 @@ add_executable(olympia
sim/OlympiaSim.cpp
sim/main.cpp
)
target_link_libraries (olympia core mss ${Sparta_LIBS} ${STF_LINK_LIBS})
target_link_libraries (olympia core mss SPARTA::sparta ${STF_LINK_LIBS})
if (CMAKE_BUILD_TYPE MATCHES "^[Rr]elease")
target_link_options (olympia PUBLIC -flto)
target_compile_options (core PUBLIC -flto)
target_compile_options (mss PUBLIC -flto)
target_compile_options (olympia PUBLIC -flto)
target_link_options (olympia PUBLIC -flto)
endif()

# Create a few links like reports and arch directories
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[![Regress Olympia on Ubuntu](https://github.com/riscv-software-src/riscv-perf-model/actions/workflows/ubuntu-build.yml/badge.svg)](https://github.com/riscv-software-src/riscv-perf-model/actions/workflows/ubuntu-build.yml)

# olympia

Olympia is a Performance Model written in C++ for the RISC-V community as an
Expand All @@ -20,7 +22,7 @@ under development.
# Build Directions

1. Set up a clean working `conda` environment by following the directions [here](https://github.com/riscv-software-src/riscv-perf-model/tree/master/conda)
1. Download and build Sparta and checkout tag [map_v1.1.0](https://github.com/sparcians/map/releases/tag/map_v1.1.0). Follow the directions on the [Sparta README](https://github.com/sparcians/map/tree/map_v1.1.0/sparta#building-sparta-with-packages-used-in-continuous-integration-macos--centos7-or-newer-linux)
1. Download and build Sparta and checkout branch [map_v2](https://github.com/sparcians/map/tree/map_v2). Follow the directions on the [Sparta README](https://github.com/sparcians/map/tree/map_v2#building-map) to build _and install_ Sparta
1. Make sure you have the [required libraries](https://github.com/sparcians/stf_lib#required-packages) for the STF toolsuite installed
1. Clone olympia
```
Expand Down
138 changes: 69 additions & 69 deletions conda/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,72 +2,72 @@ name: riscv_perf_model
channels:
- conda-forge
dependencies:
- _libgcc_mutex=0.1=conda_forge
- _openmp_mutex=4.5=2_gnu
- binutils_impl_linux-64=2.39=he00db2b_1
- binutils_linux-64=2.39=h5fc0e48_11
- boost=1.76.0=py310h7c3ba0c_1
- boost-cpp=1.76.0=h312852a_1
- bzip2=1.0.8=h7f98852_4
- c-ares=1.18.1=h7f98852_0
- ca-certificates=2022.12.7=ha878542_0
- cmake=3.17.0=h28c56e5_0
- cppcheck=2.7.5=py310h94ea96f_1
- curl=7.87.0=h6312ad2_0
- doxygen=1.8.20=had0d8f1_0
- expat=2.5.0=h27087fc_0
- gcc_impl_linux-64=10.4.0=h5231bdf_19
- gcc_linux-64=10.4.0=h9215b83_11
- gxx_impl_linux-64=10.4.0=h5231bdf_19
- gxx_linux-64=10.4.0=h6e491c6_11
- hdf5=1.10.6=nompi_h6a2412b_1114
- icu=68.2=h9c3ff4c_0
- kernel-headers_linux-64=2.6.32=he073ed8_15
- keyutils=1.6.1=h166bdaf_0
- krb5=1.20.1=hf9c8cef_0
- ld_impl_linux-64=2.39=hcc3a1bd_1
- libblas=3.9.0=16_linux64_openblas
- libcblas=3.9.0=16_linux64_openblas
- libcurl=7.87.0=h6312ad2_0
- libedit=3.1.20191231=he28a2e2_2
- libev=4.33=h516909a_1
- libffi=3.4.2=h7f98852_5
- libgcc-devel_linux-64=10.4.0=hd38fd1e_19
- libgcc-ng=12.2.0=h65d4601_19
- libgfortran-ng=12.2.0=h69a702a_19
- libgfortran5=12.2.0=h337968e_19
- libgomp=12.2.0=h65d4601_19
- libiconv=1.17=h166bdaf_0
- liblapack=3.9.0=16_linux64_openblas
- libnghttp2=1.51.0=hdcd2b5c_0
- libnsl=2.0.0=h7f98852_0
- libopenblas=0.3.21=pthreads_h78a6416_3
- libsanitizer=10.4.0=h5246dfb_19
- libsqlite=3.40.0=h753d276_0
- libssh2=1.10.0=haa6b8db_3
- libstdcxx-devel_linux-64=10.4.0=hd38fd1e_19
- libstdcxx-ng=12.2.0=h46fd767_19
- libuuid=2.32.1=h7f98852_1000
- libuv=1.44.2=h166bdaf_0
- libzlib=1.2.13=h166bdaf_4
- ncurses=6.3=h27087fc_1
- numpy=1.24.1=py310h08bbf29_0
- openssl=1.1.1s=h0b41bf4_1
- pcre=8.45=h9c3ff4c_0
- pip=22.3.1=pyhd8ed1ab_0
- pygments=2.11.2=pyhd8ed1ab_0
- python=3.10.8=h257c98d_0_cpython
- python_abi=3.10=3_cp310
- rapidjson=1.1.0=he1b5a44_1002
- readline=8.1.2=h0f457ee_0
- rhash=1.4.3=h166bdaf_0
- setuptools=65.6.3=pyhd8ed1ab_0
- sqlite=3.36.0=h9cd32fc_2
- sysroot_linux-64=2.12=he073ed8_15
- tk=8.6.12=h27826a3_0
- tzdata=2022g=h191b570_0
- wheel=0.38.4=pyhd8ed1ab_0
- xz=5.2.6=h166bdaf_0
- yaml-cpp=0.7.0=h27087fc_2
- zlib=1.2.13=h166bdaf_4
- zstd=1.5.2=h6239696_4
- _libgcc_mutex>=0.1=conda_forge
- _openmp_mutex>=4.5=2_gnu
- binutils_impl_linux-64>=2.39=he00db2b_1
- binutils_linux-64>=2.39=h5fc0e48_11
- boost>=1.76.0=py310h7c3ba0c_1
- boost-cpp>=1.76.0=h312852a_1
- bzip2>=1.0.8=h7f98852_4
- c-ares>=1.18.1=h7f98852_0
- ca-certificates>=2022.12.7=ha878542_0
- cmake>=3.19.7
- cppcheck>=2.7.5=py310h94ea96f_1
- curl>=7.87.0=h6312ad2_0
- doxygen>=1.8.20=had0d8f1_0
- expat>=2.5.0=h27087fc_0
- gcc_impl_linux-64>=10.4.0=h5231bdf_19
- gcc_linux-64>=10.4.0=h9215b83_11
- gxx_impl_linux-64>=10.4.0=h5231bdf_19
- gxx_linux-64>=10.4.0=h6e491c6_11
- hdf5>=1.10.6=nompi_h6a2412b_1114
- icu>=68.2=h9c3ff4c_0
- kernel-headers_linux-64>=2.6.32=he073ed8_15
- keyutils>=1.6.1=h166bdaf_0
- krb5>=1.20.1=hf9c8cef_0
- ld_impl_linux-64>=2.39=hcc3a1bd_1
- libblas>=3.9.0=16_linux64_openblas
- libcblas>=3.9.0=16_linux64_openblas
- libcurl>=7.87.0=h6312ad2_0
- libedit>=3.1.20191231=he28a2e2_2
- libev>=4.33=h516909a_1
- libffi>=3.4.2=h7f98852_5
- libgcc-devel_linux-64>=10.4.0=hd38fd1e_19
- libgcc-ng>=12.2.0=h65d4601_19
- libgfortran-ng>=12.2.0=h69a702a_19
- libgfortran5>=12.2.0=h337968e_19
- libgomp>=12.2.0=h65d4601_19
- libiconv>=1.17=h166bdaf_0
- liblapack>=3.9.0=16_linux64_openblas
- libnghttp2>=1.51.0=hdcd2b5c_0
- libnsl>=2.0.0=h7f98852_0
- libopenblas>=0.3.21=pthreads_h78a6416_3
- libsanitizer>=10.4.0=h5246dfb_19
- libsqlite>=3.40.0=h753d276_0
- libssh2>=1.10.0=haa6b8db_3
- libstdcxx-devel_linux-64>=10.4.0=hd38fd1e_19
- libstdcxx-ng>=12.2.0=h46fd767_19
- libuuid>=2.32.1=h7f98852_1000
- libuv>=1.44.2=h166bdaf_0
- libzlib>=1.2.13=h166bdaf_4
- ncurses>=6.3=h27087fc_1
- numpy>=1.24.1=py310h08bbf29_0
- openssl>=1.1.1s=h0b41bf4_1
- pcre>=8.45=h9c3ff4c_0
- pip>=22.3.1=pyhd8ed1ab_0
- pygments>=2.11.2=pyhd8ed1ab_0
- python>=3.10.8=h257c98d_0_cpython
- python_abi>=3.10=3_cp310
- rapidjson>=1.1.0=he1b5a44_1002
- readline>=8.1.2=h0f457ee_0
- rhash>=1.4.3=h166bdaf_0
- setuptools>=65.6.3=pyhd8ed1ab_0
- sqlite>=3.36.0=h9cd32fc_2
- sysroot_linux-64>=2.12=he073ed8_15
- tk>=8.6.12=h27826a3_0
- tzdata>=2022g=h191b570_0
- wheel>=0.38.4=pyhd8ed1ab_0
- xz>=5.2.6=h166bdaf_0
- yaml-cpp>=0.7.0=h27087fc_2
- zlib>=1.2.13=h166bdaf_4
- zstd>=1.5.2=h6239696_4
4 changes: 3 additions & 1 deletion core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,6 @@ add_library(core
CPU.cpp
CPUFactory.cpp
CPUTopology.cpp
)
)
get_property(SPARTA_INCLUDE_PROP TARGET SPARTA::sparta PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
target_include_directories(core SYSTEM PRIVATE ${SPARTA_INCLUDE_PROP})
3 changes: 1 addition & 2 deletions core/Dispatch.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@
#include "sparta/log/MessageSource.hpp"
#include "sparta/statistics/Counter.hpp"
#include "sparta/statistics/ContextCounter.hpp"
#include "sparta/simulation/ResourceFactory.hpp"

#include "sparta/statistics/WeightedContextCounter.hpp"
#include "sparta/simulation/ResourceFactory.hpp"

#include "Dispatcher.hpp"
#include "CoreTypes.hpp"
Expand Down
2 changes: 2 additions & 0 deletions mss/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ add_library(mss
BIU.cpp
MSS.cpp
)
get_property(SPARTA_INCLUDE_PROP TARGET SPARTA::sparta PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
target_include_directories(mss SYSTEM PRIVATE ${SPARTA_INCLUDE_PROP})
2 changes: 1 addition & 1 deletion stf_lib
1 change: 1 addition & 0 deletions test/core/common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ project(common_test)
add_library(common_test
SourceUnit.cpp
)
target_link_libraries(common_test PRIVATE core SPARTA::sparta)
5 changes: 2 additions & 3 deletions test/core/dispatch/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
project(Dispatch_test)

add_executable(Dispatch_test Dispatch_test.cpp)
target_link_libraries(Dispatch_test core common_test ${STF_LINK_LIBS} ${Sparta_LIBS})

include(${SPARTA_BASE}/test/TestingMacros.cmake)
target_link_libraries(Dispatch_test core common_test ${STF_LINK_LIBS} SPARTA::sparta)

file(CREATE_LINK ${SIM_BASE}/mavis/json ${CMAKE_CURRENT_BINARY_DIR}/mavis_isa_files SYMBOLIC)
file(CREATE_LINK ${SIM_BASE}/arches ${CMAKE_CURRENT_BINARY_DIR}/arches SYMBOLIC)
file(CREATE_LINK ${CMAKE_CURRENT_SOURCE_DIR}/test_cores ${CMAKE_CURRENT_BINARY_DIR}/test_cores SYMBOLIC)
file(CREATE_LINK ${CMAKE_CURRENT_SOURCE_DIR}/expected_output ${CMAKE_CURRENT_BINARY_DIR}/expected_output SYMBOLIC)

# Single add per cycle
# Note: these macros get defined when find_package(Sparta) is called
sparta_named_test(Dispatch_test_Run_Small Dispatch_test small_core.out -c test_cores/test_small_core.yaml)
sparta_named_test(Dispatch_test_Run_Medium Dispatch_test medium_core.out -c test_cores/test_medium_core.yaml)
sparta_named_test(Dispatch_test_Run_Big Dispatch_test big_core.out -c test_cores/test_big_core.yaml)
3 changes: 1 addition & 2 deletions test/sim/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
project(olympia_test)

# Include the handy testing marcros defined in Sparta
include(${SPARTA_BASE}/test/TestingMacros.cmake)
# Note: these sparta_* macros/functions get defined when find_package(Sparta) is called

# This line will make sure olympia is built before running the tests
sparta_regress (olympia)
Expand Down

0 comments on commit 32fc79d

Please sign in to comment.