From ca6d46698ff1fc7603060f226187f7ebcdd1eeac Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Date: Thu, 29 Sep 2022 15:45:52 +0200 Subject: [PATCH] Move sources to src --- CMakeLists.txt | 68 ++------------------------------ src/CMakeLists.txt | 62 +++++++++++++++++++++++++++++ chan.c => src/chan.c | 0 chan.h => src/chan.h | 0 common.h => src/common.h | 0 compat.h => src/compat.h | 0 dump.c => src/dump.c | 0 emu.c => src/emu.c | 0 emu.h => src/emu.h | 0 emu_kernel.c => src/emu_kernel.c | 0 emu_nanos6.c => src/emu_nanos6.c | 0 emu_nodes.c => src/emu_nodes.c | 0 emu_nosv.c => src/emu_nosv.c | 0 emu_openmp.c => src/emu_openmp.c | 0 emu_ovni.c => src/emu_ovni.c | 0 emu_tampi.c => src/emu_tampi.c | 0 emu_task.c => src/emu_task.c | 0 emu_task.h => src/emu_task.h | 0 heap.h => src/heap.h | 0 ovni.c => src/ovni.c | 0 ovni.h => src/ovni.h | 0 ovni2prv.c => src/ovni2prv.c | 0 ovnisync.c => src/ovnisync.c | 0 parson.c => src/parson.c | 0 parson.h => src/parson.h | 0 pcf.c => src/pcf.c | 0 pcf.h => src/pcf.h | 0 prv.c => src/prv.c | 0 prv.h => src/prv.h | 0 sort.c => src/sort.c | 0 trace.c => src/trace.c | 0 trace.h => src/trace.h | 0 uthash.h => src/uthash.h | 0 utlist.h => src/utlist.h | 0 test/macros.cmake | 2 +- 35 files changed, 67 insertions(+), 65 deletions(-) create mode 100644 src/CMakeLists.txt rename chan.c => src/chan.c (100%) rename chan.h => src/chan.h (100%) rename common.h => src/common.h (100%) rename compat.h => src/compat.h (100%) rename dump.c => src/dump.c (100%) rename emu.c => src/emu.c (100%) rename emu.h => src/emu.h (100%) rename emu_kernel.c => src/emu_kernel.c (100%) rename emu_nanos6.c => src/emu_nanos6.c (100%) rename emu_nodes.c => src/emu_nodes.c (100%) rename emu_nosv.c => src/emu_nosv.c (100%) rename emu_openmp.c => src/emu_openmp.c (100%) rename emu_ovni.c => src/emu_ovni.c (100%) rename emu_tampi.c => src/emu_tampi.c (100%) rename emu_task.c => src/emu_task.c (100%) rename emu_task.h => src/emu_task.h (100%) rename heap.h => src/heap.h (100%) rename ovni.c => src/ovni.c (100%) rename ovni.h => src/ovni.h (100%) rename ovni2prv.c => src/ovni2prv.c (100%) rename ovnisync.c => src/ovnisync.c (100%) rename parson.c => src/parson.c (100%) rename parson.h => src/parson.h (100%) rename pcf.c => src/pcf.c (100%) rename pcf.h => src/pcf.h (100%) rename prv.c => src/prv.c (100%) rename prv.h => src/prv.h (100%) rename sort.c => src/sort.c (100%) rename trace.c => src/trace.c (100%) rename trace.h => src/trace.h (100%) rename uthash.h => src/uthash.h (100%) rename utlist.h => src/utlist.h (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6da8ed8..393a160 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -61,71 +61,11 @@ if (NOT HAVE_CLOCK_GETTIME) endif() endif() -add_library(ovni SHARED - ovni.c - parson.c -) +add_subdirectory(src) -target_include_directories(ovni PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) - -add_executable(ovniemu - chan.c - emu.c - emu_nosv.c - emu_openmp.c - emu_ovni.c - emu_tampi.c - emu_nodes.c - emu_kernel.c - emu_nanos6.c - emu_task.c - trace.c - ovni.c - parson.c - pcf.c - prv.c -) - -add_executable(ovnidump - dump.c - ovni.c - trace.c - parson.c -) - -add_executable(ovni2prv - ovni2prv.c - ovni.c - trace.c - parson.c -) - -add_executable(ovnisort - sort.c - ovni.c - trace.c - parson.c -) - -# Use _ROOT variables if available, commonly used by MPI -# installations -if(POLICY CMP0074) - cmake_policy(SET CMP0074 NEW) +include(CTest) +if(BUILD_TESTING) + add_subdirectory(test) endif() -find_package(MPI REQUIRED) -add_executable(ovnisync ovnisync.c) -target_link_libraries(ovnisync m MPI::MPI_C) - -if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME) - include(CTest) - - if(BUILD_TESTING) - add_subdirectory(test) - endif() -endif() - -install(TARGETS ovni LIBRARY DESTINATION lib) -install(TARGETS ovniemu ovnidump ovni2prv ovnisync ovnisort RUNTIME DESTINATION bin) -install(FILES ovni.h DESTINATION include) install(DIRECTORY cfg/ DESTINATION share/ovni) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 0000000..0737c4e --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,62 @@ +# Copyright (c) 2021-2022 Barcelona Supercomputing Center (BSC) +# SPDX-License-Identifier: GPL-3.0-or-later + +add_library(ovni SHARED + ovni.c + parson.c +) + +target_include_directories(ovni PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) + +add_executable(ovniemu + chan.c + emu.c + emu_nosv.c + emu_openmp.c + emu_ovni.c + emu_tampi.c + emu_nodes.c + emu_kernel.c + emu_nanos6.c + emu_task.c + trace.c + ovni.c + parson.c + pcf.c + prv.c +) + +add_executable(ovnidump + dump.c + ovni.c + trace.c + parson.c +) + +add_executable(ovni2prv + ovni2prv.c + ovni.c + trace.c + parson.c +) + +add_executable(ovnisort + sort.c + ovni.c + trace.c + parson.c +) + +# Use _ROOT variables if available, commonly used by MPI +# installations +if(POLICY CMP0074) + cmake_policy(SET CMP0074 NEW) +endif() + +find_package(MPI REQUIRED) +add_executable(ovnisync ovnisync.c) +target_link_libraries(ovnisync m MPI::MPI_C) + +install(TARGETS ovni LIBRARY DESTINATION lib) +install(TARGETS ovniemu ovnidump ovni2prv ovnisync ovnisort RUNTIME DESTINATION bin) +install(FILES ovni.h DESTINATION include) diff --git a/chan.c b/src/chan.c similarity index 100% rename from chan.c rename to src/chan.c diff --git a/chan.h b/src/chan.h similarity index 100% rename from chan.h rename to src/chan.h diff --git a/common.h b/src/common.h similarity index 100% rename from common.h rename to src/common.h diff --git a/compat.h b/src/compat.h similarity index 100% rename from compat.h rename to src/compat.h diff --git a/dump.c b/src/dump.c similarity index 100% rename from dump.c rename to src/dump.c diff --git a/emu.c b/src/emu.c similarity index 100% rename from emu.c rename to src/emu.c diff --git a/emu.h b/src/emu.h similarity index 100% rename from emu.h rename to src/emu.h diff --git a/emu_kernel.c b/src/emu_kernel.c similarity index 100% rename from emu_kernel.c rename to src/emu_kernel.c diff --git a/emu_nanos6.c b/src/emu_nanos6.c similarity index 100% rename from emu_nanos6.c rename to src/emu_nanos6.c diff --git a/emu_nodes.c b/src/emu_nodes.c similarity index 100% rename from emu_nodes.c rename to src/emu_nodes.c diff --git a/emu_nosv.c b/src/emu_nosv.c similarity index 100% rename from emu_nosv.c rename to src/emu_nosv.c diff --git a/emu_openmp.c b/src/emu_openmp.c similarity index 100% rename from emu_openmp.c rename to src/emu_openmp.c diff --git a/emu_ovni.c b/src/emu_ovni.c similarity index 100% rename from emu_ovni.c rename to src/emu_ovni.c diff --git a/emu_tampi.c b/src/emu_tampi.c similarity index 100% rename from emu_tampi.c rename to src/emu_tampi.c diff --git a/emu_task.c b/src/emu_task.c similarity index 100% rename from emu_task.c rename to src/emu_task.c diff --git a/emu_task.h b/src/emu_task.h similarity index 100% rename from emu_task.h rename to src/emu_task.h diff --git a/heap.h b/src/heap.h similarity index 100% rename from heap.h rename to src/heap.h diff --git a/ovni.c b/src/ovni.c similarity index 100% rename from ovni.c rename to src/ovni.c diff --git a/ovni.h b/src/ovni.h similarity index 100% rename from ovni.h rename to src/ovni.h diff --git a/ovni2prv.c b/src/ovni2prv.c similarity index 100% rename from ovni2prv.c rename to src/ovni2prv.c diff --git a/ovnisync.c b/src/ovnisync.c similarity index 100% rename from ovnisync.c rename to src/ovnisync.c diff --git a/parson.c b/src/parson.c similarity index 100% rename from parson.c rename to src/parson.c diff --git a/parson.h b/src/parson.h similarity index 100% rename from parson.h rename to src/parson.h diff --git a/pcf.c b/src/pcf.c similarity index 100% rename from pcf.c rename to src/pcf.c diff --git a/pcf.h b/src/pcf.h similarity index 100% rename from pcf.h rename to src/pcf.h diff --git a/prv.c b/src/prv.c similarity index 100% rename from prv.c rename to src/prv.c diff --git a/prv.h b/src/prv.h similarity index 100% rename from prv.h rename to src/prv.h diff --git a/sort.c b/src/sort.c similarity index 100% rename from sort.c rename to src/sort.c diff --git a/trace.c b/src/trace.c similarity index 100% rename from trace.c rename to src/trace.c diff --git a/trace.h b/src/trace.h similarity index 100% rename from trace.h rename to src/trace.h diff --git a/uthash.h b/src/uthash.h similarity index 100% rename from uthash.h rename to src/uthash.h diff --git a/utlist.h b/src/utlist.h similarity index 100% rename from utlist.h rename to src/utlist.h diff --git a/test/macros.cmake b/test/macros.cmake index 6469b88..09676f9 100644 --- a/test/macros.cmake +++ b/test/macros.cmake @@ -41,7 +41,7 @@ function(ovni_test source) "OVNI_NPROCS=${OVNI_TEST_NPROC}") list(APPEND OVNI_TEST_ENV - "OVNI_BUILD_DIR=${CMAKE_BINARY_DIR}") + "OVNI_BUILD_DIR=${CMAKE_BINARY_DIR}/src") list(APPEND OVNI_TEST_ENV "OVNI_CURRENT_DIR=${CMAKE_CURRENT_BINARY_DIR}")