-
Notifications
You must be signed in to change notification settings - Fork 5
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
Use CMakeLists.txt instead of Makefile #4
Conversation
cmake/SetupRUClient.cmake
Outdated
@@ -0,0 +1,132 @@ | |||
function(setup_ruclient) |
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 all related to this repo, right? Is there a reason to keep it private, while relying on it in RawHash, which is public? It's somewhat confusing to have it mentioned here without e.g. being added as a submodule. Are there plans to make readuntil_fake
public and add it as a submodule? Should simplify testing 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.
Yes, there are plans to do so. For now, it stays private.
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.
Eh, okay, I guess I will rewrite this part under the assumption that someone with the private repo access checked it out at /extern
.
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't properly debug it locally due to
Please make sure you have the correct access rights
and the repository exists.
fatal: clone of '[email protected]:maximilianmordig/slow5lib.git' into submodule path '/home/adamant/RawHash/extern/readuntil_fake/external/slow5lib' failed
Failed to clone 'external/slow5lib' a second time, aborting
Waiting for permissions.
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 managed to build readuntil_fake
on its own locally, but RawHash's relevant part doesn't compile due to mismatch with the state of the current readuntil_fake
's main branch:
/home/adamant/RawHash/src/main.cpp:174:59: error: 'class ru_client::DeviceServiceClient' has no member named 'get_calibration'
174 | auto calibrations = device_client.get_calibration(1, n_channels);
/home/adamant/RawHash/src/main.cpp:185:25: error: 'ReportNumSamplesBehindCallback' was not declared in this scope
185 | ReportNumSamplesBehindCallback report_num_samples_behind_cb(acquisition_client, 10); // todo1: n_channels instead of 10
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/adamant/RawHash/src/rawhash_ruclient.hpp:70:26: error: 'virtual ru_client::DecisionMaker::Decision RawHashDecisionMaker::decide(const ru_client::ReadIdentifier&, const ru_client::DecisionMaker::ChunkType&, uint32_t)' marked 'override', but does not override
70 | virtual Decision decide(ReadIdentifier const& read_ident, ChunkType const& chunk, uint32_t chunk_idx) override;
| ^~~~~~
Etc.
src/CMakeLists.txt
Outdated
|
||
option(NOPOD5 "Do not use POD5" OFF) | ||
option(NOHDF5 "Do not use HDF5" OFF) | ||
option(NOSLOW5 "Do not use SLOW5" OFF) |
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.
FYI: When this is ON, rmap.cpp
does not compile because of __ac_Wang_hash
, which seems to be part of Slow5.
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.
So we disable slow5 for now.
@canfirtina relevant for you to fix "multiple definitions of function" (error I think)
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.
It's actually "function is undefined" kind of error rather than "multiple definitions of functions". It seems that previously it was propagated from Slow5's include directory, even when slow5 is not linked and NOSLOW5
is set to true. But currently CMake only adds Slow5's include directories if it is also linked, so the error popped up.
The docker build hang still needs to be resolved. |
@maximilianmordig @canfirtina hi, any further feedback for this PR? It now successfully builds RawHash with POD5, HDF5 and SLOW5 and runs Also it's my first time using Docker and manually setting up a GitHub Workflow with it, so please let me know if I missed anything important. |
builds are too slow: cache the build directory as well (as an artifact) You may run into an issue when submodules are updated because ExternalProject_Add did not work for me with slow5lib. I had to delete the build dir. ExternalProject_Add is not the best option. Will merge it, so this can be fixed in another branch |
Most urgent: |
Hi Max, thanks for the update! As a note, I used static libraries because that's what was used in the initial Makefile, and I didn't want to disrupt the logic, as I wasn't sure if there was a specific reasoning behind using them earlier. For now, I pushed a quick fix that should now use proper path for slow5lib (at least it seems to work for me locally, let's see if CI also work with it). I would've implement it this way from the start if I knew that we need shared libraries, as previous configuration was like this because slow5lib's CMakeLists.txt doesn't seem to generate a static library, and somewhat annoyingly doesn't have an I can look further into other issues next week. |
Dockerfile
Outdated
&& cmake .. \ | ||
&& make -j 1 | ||
|
||
ENTRYPOINT ["./build/bin/rawhash2_usinglib"] |
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 changed this to rawhash2_usinglib
for now to make the CI run properly. Generally, do we want to include build commands and entrypoint like this in the docker, or in workflows description? In any case, I suppose we should finalise on the target name that is used in the workflows.
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 entrypoint is for the end user.
The CI can override the endpoint as needed.
RawHash has one CLI version and a shared library version so it can be integrated with Python.
The goal is to clean up the build process, so make whatever changes are needed, following the best practices for cmake. Of course, functionality should be similar. I modified slow5tools at some point in my own fork (https://github.com/maximilianmordig/slow5lib), so feel free to do so as well. |
include dir should also be there instead of having to use |
ccache is not operating, please fix. |
Hi Max! In the future, could you please leave comments in the "Files changed" section as a code review comments, whenever possible? This way it would be much easier to reply and keep track of them separately than in the general "Conversation" section.
It is done now, and CI seems to take around 13m instead of 30m (not sure why it seemingly builds tflite or large portion of it from scratch anyway). But it's probably important to point out that the builds now will not reproduce exactly what happens on "clean" installation, so e.g. if we update default cached values, they will not be properly propagated. I'm not sure what's the best way to deal with it. Add Generally I'm a bit wary of using this approach, as it is likely to create some hard to catch issues. Are you sure that we should do this?
Seems to be done.
Mold seems to already work after your updates. I also added
It works for me. Maybe I'm also looking into some other issues that you've mentioned, will keep posting updates. |
This pull request is supposed to implement the switch from Makefile to CMakeLists.txt. Making it a pull request rather than direct commit, as the change is significant, and there might still be potential discrepancies with prior behavior.