-
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
base: develop
Are you sure you want to change the base?
Restructuring #2
Conversation
Signed-off-by: AdityaPandeyCN <[email protected]> restructured the directory Signed-off-by: AdityaPandeyCN <[email protected]> changed folder names Signed-off-by: AdityaPandeyCN <[email protected]> restructuring the project Signed-off-by: AdityaPandeyCN <[email protected]>
Signed-off-by: AdityaPandeyCN <[email protected]>
Signed-off-by: AdityaPandeyCN <[email protected]>
Signed-off-by: AdityaPandeyCN <[email protected]>
Signed-off-by: AdityaPandeyCN <[email protected]>
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 <[email protected]>
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 <[email protected]>
Signed-off-by: AdityaPandeyCN <[email protected]>
Signed-off-by: AdityaPandeyCN <[email protected]>
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 <[email protected]>
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.
) | ||
|
||
ROOT_EXECUTABLE(samtoramntuple |
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 that did not work?
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.
ping
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.
Re-used this in the tools cmake, there was no reason I was just trying to use other ways
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.
Please use the ROOT_EXECUTABLE
where possible.
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.
ping about this 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 <[email protected]>
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/CountEntriesTest.cxx
Outdated
} | ||
}; | ||
|
||
TEST_F(CountEntriesTest, CompareEntryCountsFromSamFile) { |
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 guess I do not understand what is this intended to test. Nominally the content of samtoram.cxx
should be turned into a test (or some library api that we call from within the test). Then in the benchmark folder we can do all sorts of benchmarks and comparisons...
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 intented to test count of reads for a genomic region from both the implementation rntuple one and the ttree one.
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.
Some part of the test log to give you an overview
RAMRefs vector: 1: 0: chr1 1: RAMRefs vector: 1: 1: Processed 24 SAM headers 1: Processed 33711 SAM records 1: 1: Real time 0:00:01, CP time 1.800 1: 1: Processing samtoramntuple.cxx+("samexample.sam", "rntuple_test.root")... 1: 1: RAM file created: rntuple_test.root 1: Number of entries: 33711 1: RAMNTupleRefs vector: 1: 0: chr1 1: RAMNTupleRefs vector: 1: 1: Index entries: 34 1: 1: Processed 24 SAM headers 1: Processed 33711 SAM records
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.
Alright I understood what you mean to say, I will implement that. Thankyou for this
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.
Should I go on and create a library folder with the content of samtoram.cxx and samtoramntuple.cxx and use them to perform unit tests and move these two in the benchmark folder(with slight modifications)?
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.
Probably a good idea. We will need to meditate on a name of that library though :)
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 <[email protected]>
Hello @vgvassilev Do you want me to address anything more for this PR? |
Signed-off-by: AdityaPandeyCN <[email protected]>
) | ||
|
||
ROOT_EXECUTABLE(samtoramntuple |
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.
Please use the ROOT_EXECUTABLE
where possible.
Signed-off-by: AdityaPandeyCN <[email protected]>
Co-authored-by: Vassil Vassilev <[email protected]>
inc/ramcore/SamToNTuple.h
Outdated
@@ -1,5 +1,5 @@ | |||
#ifndef RAMCORE_SAMTONTUPLE_H | |||
#define RAMCORE_SAMTONTUPLE_H | |||
#ifndef ramcore_SAMTONTUPLE_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.
Header protectors should be all caps.
Signed-off-by: AdityaPandeyCN <[email protected]>
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.