From bc8061fd1e3c26be37e2cbb83ff9ca26e6f4dead Mon Sep 17 00:00:00 2001 From: WilliamMTK Date: Thu, 4 Apr 2024 18:13:54 -0400 Subject: Migrate gpgpu-sim build system to cmake (#66) * migrate_cmake: add package dependency checking * migrate_cmake: port setup_environment to CMake * migrate_cmake: break dependency checking and env export gen to different .cmake files * migrate_cmake: use CUDAToolkit_FOUND to test for CUDA compiler * migrate_cmake: use CUDAToolkit_FOUND to test for CUDA compiler * migrate_cmake: use CUDAToolkit_FOUND to test for CUDA compiler * migrate_cmake: properly parse for cuda version number * migrate_cmake: set highest CUDA supported to be 11.10.x * migrate_cmake: specify top level CMake file * migrate_cmake: add libcuda cmake file * migrate_cmake: use global compiler options and definitions * migrate_cmake: add cmake file to src * migrate_cmake: add cmake files for cuda-sim folder * migrate_cmake: add cmake files to gpgpu-sim folder * migrate_cmake: add cmake files for intersim * migrate_cmake: add short test using cmake * migrate_cmake: bump CXX standard requirement to 17 * Add cmake files for accelwattch * migrate_cmake: remove use of GLOB to grab source files * migrate_cmake: comment out the write protection on generated instructions.h * migrate_cmake: create sym folder and add newline to generated setup file * migrate_cmake: fix some path issues * migrate_cmake: let cmake thinks flex and bison generate CXX files * migrate_cmake: fix not linking pthread properly * migrate_cmake: remove debug message * migrate_cmake: add empty libopencl cmake file * migrate_cmake: install phase and runtime version detect * Added install phase to install the shared object and add symlinks * Changes with CUDA toolkit will be detected and triggered a rebuild * GPGPU-Sim detailed version string will be updated on each build * Typo fix and fix correct bin dir * Replace gcc -> g++ in intersim * ignore setup * check CMAKE_BUILD_TYPE * set DCMAKE_BUILD_TYPE --------- Co-authored-by: JRPAN <25518778+JRPan@users.noreply.github.com> --- src/accelwattch/CMakeLists.txt | 46 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 src/accelwattch/CMakeLists.txt (limited to 'src/accelwattch') diff --git a/src/accelwattch/CMakeLists.txt b/src/accelwattch/CMakeLists.txt new file mode 100644 index 0000000..cb7dd71 --- /dev/null +++ b/src/accelwattch/CMakeLists.txt @@ -0,0 +1,46 @@ +set(GPGPUSIM_ACCELWATTCH_NTHREADS "4" CACHE STRING "Accelwattch MCPAT thread count") +add_library(accelwattch STATIC + cacti/Ucache.cc + XML_Parse.cc + cacti/arbiter.cc + cacti/area.cc + array.cc + cacti/bank.cc + cacti/basic_circuit.cc + basic_components.cc + cacti/cacti_interface.cc + cacti/component.cc + core.cc + cacti/crossbar.cc + cacti/decoder.cc + cacti/htree2.cc + interconnect.cc + cacti/io.cc + iocontrollers.cc + logic.cc + main.cc + cacti/mat.cc + memoryctrl.cc + noc.cc + cacti/nuca.cc + cacti/parameter.cc + processor.cc + cacti/router.cc + sharedcache.cc + cacti/subarray.cc + cacti/technology.cc + cacti/uca.cc + cacti/wire.cc + xmlParser.cc + gpgpu_sim_wrapper.cc) +target_include_directories(accelwattch PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) +target_include_directories(accelwattch PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/cacti) +# Compile options +target_compile_options(accelwattch PRIVATE "-Wno-unknown-pragmas") +if($) + target_compile_definitions(NTHREADS=1) +else() + target_compile_options(accelwattch PRIVATE "-msse2;-mfpmath=sse") + target_compile_definitions(accelwattch PRIVATE -DNTHREADS=${GPGPUSIM_ACCELWATTCH_NTHREADS}) +endif() +target_link_options(accelwattch PRIVATE "-lm;-lpthread;-lz") \ No newline at end of file -- cgit v1.3