-
Notifications
You must be signed in to change notification settings - Fork 1
Restructuring #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Restructuring #2
Conversation
Signed-off-by: AdityaPandeyCN <adityapand3y666@gmail.com> restructured the directory Signed-off-by: AdityaPandeyCN <adityapand3y666@gmail.com> changed folder names Signed-off-by: AdityaPandeyCN <adityapand3y666@gmail.com> restructuring the project Signed-off-by: AdityaPandeyCN <adityapand3y666@gmail.com>
Signed-off-by: AdityaPandeyCN <adityapand3y666@gmail.com>
Signed-off-by: AdityaPandeyCN <adityapand3y666@gmail.com>
Signed-off-by: AdityaPandeyCN <adityapand3y666@gmail.com>
Signed-off-by: AdityaPandeyCN <adityapand3y666@gmail.com>
tools/checkindex.cxx
Outdated
#include "utils.h" | ||
|
||
#include "ramrecord.C" | ||
#include "../inc/ttree/Utils.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the tools folder is where the executables are we need to find a better solution to this. The CMakeLists in tools should start depending on ttree
and then it will need to automatically adjust the include paths so that you do not need to type ../inc
.
tools/samtoramntuple.cxx
Outdated
@@ -1,8 +1,9 @@ | |||
// samtoramntuple.C | |||
// SAM to RAM converteR | |||
|
|||
#include "RAMntuplerecord.C" | |||
#include "RAMNTupleRecord.h" | |||
#include "../src/rntuple/RAMNTupleRecord.cxx" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why we have to include the cxx file here?
Signed-off-by: AdityaPandeyCN <adityapand3y666@gmail.com>
CMakeLists.txt
Outdated
|
||
add_library(ramtools_tree STATIC | ||
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/inc/ttree) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably use target_include_directories
. include_directories
is not recommended unless there is a good reason for it.
CMakeLists.txt
Outdated
ROOT_GENERATE_DICTIONARY(G__ramtools_tree | ||
RAMRecord.h | ||
Utils.h | ||
CigarOps.h | ||
LINKDEF ${CMAKE_CURRENT_SOURCE_DIR}/inc/ttree/LinkDef.h | ||
MODULE ramtools_tree | ||
) | ||
|
||
add_library(ramtools_tree SHARED |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not combining these two by using ROOT_STANDARD_LIBRARY_PACKAGE
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Getting errors after implementing this
CMake Error at /home/aditya/root-6.35-ntuple/share/root/cmake/RootMacros.cmake:1237 (install): install DIRECTORY given no DESTINATION! Call Stack (most recent call first): /home/aditya/root-6.35-ntuple/share/root/cmake/RootMacros.cmake:1428 (ROOT_INSTALL_HEADERS) CMakeLists.txt:22 (ROOT_STANDARD_LIBRARY_PACKAGE)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The message says it all, right? We need to pass some install directory of the component..
tools/ramview.cxx
Outdated
@@ -15,8 +15,8 @@ | |||
#include <TTreeIndex.h> | |||
#include <TTreePerfStats.h> | |||
|
|||
#include "../inc/ttree/Utils.h" | |||
#include "../inc/ttree/RAMRecord.h" | |||
#include "Utils.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally these should be ttree/Utils.h
to be able to know what's where...
Signed-off-by: AdityaPandeyCN <adityapand3y666@gmail.com>
Signed-off-by: AdityaPandeyCN <adityapand3y666@gmail.com>
Signed-off-by: AdityaPandeyCN <adityapand3y666@gmail.com>
inc/rntuple/RAMNTupleRecord.h
Outdated
}; | ||
|
||
// CIGAR operation codes (from BAM format) | ||
#include "../ttree/CigarOps.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#include "../ttree/CigarOps.h" | |
#include "ttree/CigarOps.h" |
inc/ttree/RAMRecord.h
Outdated
const UChar_t RAM_CIGAR_P = 6; | ||
const UChar_t RAM_CIGAR_EQUAL = 7; | ||
const UChar_t RAM_CIGAR_X = 8; | ||
#include "CigarOps.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#include "CigarOps.h" | |
#include "ttree/CigarOps.h" |
src/rntuple/RAMNTupleRecord.cxx
Outdated
@@ -0,0 +1,749 @@ | |||
// | |||
// RAMNTupleRecord.cpp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// RAMNTupleRecord.cpp | |
// RAMNTupleRecord.cxx |
const auto &entries = index_view(0); | ||
fgIndex->SetEntries(entries); | ||
} catch (...) { | ||
// Field doesn't exist |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's something we should rework maybe not part of this PR. We should not rely on exceptions to check if a field exists or not...
test/CMakeLists.txt
Outdated
@@ -0,0 +1,37 @@ | |||
include(FetchContent) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is how we are doing this reliably: https://github.com/vgvassilev/clad/blob/master/cmake/modules/CladGoogleTest.cmake
tools/CMakeLists.txt
Outdated
if(${tool_name} MATCHES "ntuple") | ||
target_link_libraries(${tool_name} PRIVATE | ||
ramtools_ntuple | ||
ROOT::Core | ||
ROOT::RIO | ||
ROOT::ROOTNTuple | ||
ROOT::ROOTNTupleUtil | ||
) | ||
else() | ||
target_link_libraries(${tool_name} PRIVATE | ||
ramtools_tree | ||
ROOT::Core | ||
ROOT::RIO | ||
ROOT::Tree | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The dependencies should come from the outside as LIBRARY
or something like that. We can use ROOT_EXECUTABLE
.
Signed-off-by: AdityaPandeyCN <adityapand3y666@gmail.com>
I have tried to address the suggestions also apologies for the foolish errors I have made. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add some basic linux CI?
CMakeLists.txt
Outdated
@@ -1,44 +1,75 @@ | |||
cmake_minimum_required(VERSION 3.16) | |||
project(ramtools VERSION 1.0.0 LANGUAGES C CXX) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why C
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually build was failing with empty CMAKE_C_COMPILER
variable error so added C
to check, now have removed passing it explicitly.
CMakeLists.txt
Outdated
SOURCES ramrecord.C | ||
HEADERS ramrecord.h | ||
LIBRARIES ROOT::Core ROOT::RIO ROOT::Tree | ||
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/inc) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't ROOT_STANDARD_LIBRARY_PACKAGE
set this properly up?
CMakeLists.txt
Outdated
INSTALL_OPTIONS | ||
DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
) | ||
add_library(ramtools_ntuple SHARED |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this is a separate library?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought it was better to separate them but now will make it one.
cmake/ramtoolsConfig.cmake.in
Outdated
@PACKAGE_INIT@ | ||
|
||
include("${CMAKE_CURRENT_LIST_DIR}/ramtoolsTargets.cmake") | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this file needed?
test/CMakeLists.txt
Outdated
add_executable(CountEntriesTest CountEntriesTest.cxx) | ||
target_link_libraries(CountEntriesTest PRIVATE | ||
ramtools_tree | ||
ramtools_ntuple | ||
gtest | ||
gtest_main | ||
) | ||
add_test(NAME CountEntriesTest COMMAND CountEntriesTest) | ||
set_tests_properties(CountEntriesTest PROPERTIES | ||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/tools | ||
ENVIRONMENT "ROOT_INCLUDE_PATH=${CMAKE_SOURCE_DIR}/inc;LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}" | ||
) | ||
|
||
add_executable(RamviewCountsTest RamviewCountsTest.cxx) | ||
target_link_libraries(RamviewCountsTest PRIVATE | ||
ramtools_tree | ||
ramtools_ntuple | ||
gtest | ||
gtest_main | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we move this into a cmake function? You can take a look at how it's done in clad...
Signed-off-by: AdityaPandeyCN <adityapand3y666@gmail.com>
CMakeLists.txt
Outdated
set(CMAKE_INSTALL_LIBDIR lib) | ||
set(CMAKE_INSTALL_INCLUDEDIR include) | ||
|
||
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES ${CMAKE_CURRENT_SOURCE_DIR}/inc) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's the same as include_directories
. Why do we need this to be set globally?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am still confused about this, not able to implement removing include directories
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will need more information about that. Compiling which library fails if you remove that line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made some changes, what do you think about it now?
test/CountEntriesTest.cxx
Outdated
#include <gtest/gtest.h> | ||
#include <TSystem.h> | ||
#include <TFile.h> | ||
#include <TTree.h> | ||
#include <ROOT/RNTupleReader.hxx> | ||
#include <iostream> | ||
#include <string> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The includes are not ordered by component and then alphabetically.
test/RamviewCountsTest.cxx
Outdated
} | ||
}; | ||
|
||
TEST_F(RamviewCountsTest, CompareViewCountsForRegion) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Likewise.
Signed-off-by: AdityaPandeyCN <adityapand3y666@gmail.com>
Hello @vgvassilev Do you want me to address anything more for this PR? |
Signed-off-by: AdityaPandeyCN <adityapand3y666@gmail.com>
Signed-off-by: AdityaPandeyCN <adityapand3y666@gmail.com>
Co-authored-by: Vassil Vassilev <v.g.vassilev@gmail.com>
Signed-off-by: AdityaPandeyCN <adityapand3y666@gmail.com>
Signed-off-by: AdityaPandeyCN <adityapand3y666@gmail.com> using ROOT_EXCEUTABLE Signed-off-by: AdityaPandeyCN <adityapand3y666@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well done. LGTM.
This PR restructures the project directory following our ROOT project. The benchmark folder and other files will be updated continuously to make it a proper package.