Skip to content
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

Refactored DNASim library #8

Merged
merged 10 commits into from
Feb 2, 2021
Merged

Refactored DNASim library #8

merged 10 commits into from
Feb 2, 2021

Conversation

nicocvn
Copy link
Owner

@nicocvn nicocvn commented Feb 2, 2021

Summary

This PR brings a cleaned up CMake setup for the project and the DNASim library as well as re-organized dependencies. From a code base point of view functionalities have not been changed nor altered with the exception of the OpenDE collision detection feature which has been removed. Note that, this is still a work in progress (see #3) as this does not cover the emDNA part of the code base.

  • All dependencies (except TCLAP) for emDNA and DNSim are now handled via submodules which are located at the root of the repositories in the deps/ directory. The list of dependencies is currently documented in the README.md file.
  • Draft install notes are available in INSTALL.md.
  • Unit tests for DNASim compile and pass although one of the test related to serialization had to be fixed.

Closes #1.

This commit adds a CMake file at the root of the repository to manage
the entire project CMake setup. At the moment this only include the
DNASim/ sub-directory as this the target of this branch.

Relates to #1 and #3
This adds a refactored and significantly revised CMake file for the
DNASim library (in DNASim/ directory). This CMake file only deals with
the library sources at the moment (i.e. no tests).

Remarks about the changes:

- Each sub-directory in the DNASim/src directory (e.g. dna/) owns a
CMakeLists.txt file which defines the list of sources in that
sub-directory.
- The DNASim/src CMakeLists.txt file loops over the list of
sub-directories and collect the source files that are part of the
library.
- Within DNASim, headers are now referenced relative to the root of the
source directory (DNASim/src). As a consequence a large part of this
commit is made of changes in the include directives to account for this
new pattern.
- The DNASim/src CMakeLists.txt also includes install directives but
this might need to be adapted.
- A library header (DNASim.h) is now part of the library to simplify the
include process.

In addition, a README is added to the DNASim directory (placeholder as
of now) and install notes are available at the root of the repository in
INSTALL.md

Relates to #3
- Googletest is now included as a project submodule in the deps/
directory. The submodule is tracking v1.10.0.
- The include directives in the test definitions are updated to simply
include the DNASim library header instead of picking the required ones.
- Tests run successfully.

Relates to #1
- Add top-level cereal submodule in deps/ directory to track current
master branch of cereal project (this seems to be v1.3.0 with a few
minor fixes and additions).
- The DNASim unit test for serialization (test_DNASimArchive) is now
fixed because original implementation was ill-designed: it is not
possible to save polymorphic types via base pointers and reload them to
derived pointers.
- The cereal registration calls for the DNASim polymorphic types are now
included in the DNASim library header.

Relates to #1
- Add nanoflann as a project submodule in the deps/ directory tracking
v1.3.2.

Relates to #1
- Replace in-repo copy of Eigen by a submodule in the deps/ directory
tracking v3.2.9.
- Issue #6 was created to document that current code base for DNASim
breaks with Eigen v3.3.X due to some issue in the `SparseMatrix`
interface.

Relates to #1
Collision detection is not used in emDNA so it is removed from the
codebase. This also makes it possible of getting rid of the ODE (Open
Dynamic Engine) dependency.

This commit also fixes a missing override keyword in `SphereShape`
implementation which was causing a lot of compiler warnings.

Relates to #1
- TCLAP library is relocated to the deps/ directory. There is not GitHub
repo available so a submodule will be difficult to find. - The code
from DNASim/src/dna_force_field_packager is relocated to the root of
the repository. Discussion about how to handle that tool is in #5.

Given that TCLAP was the last dependency to refactor for DNASim this
commit closes #1.
- This commit adds a CLion project to the repository (under .idea).
- Install notes are updated with the git clone instructions.

Relates to #3
@nicocvn nicocvn added this to To Do in emDNA public release via automation Feb 2, 2021
@nicocvn
Copy link
Owner Author

nicocvn commented Feb 2, 2021

@stodolli just noticing now that you are a member of this project ... GitHub suggests you as a reviewer for the PR so here it is 😄; I let you bounce it back to @rty10 if this is more appropriate.

Side note: this PR targets release/v1.0.0 because I am a bit reluctant to merge on master without running some test cases (see one of the question in #5).

@nicocvn nicocvn requested a review from stodolli February 2, 2021 13:48
@nicocvn nicocvn moved this from To Do to In Progress in emDNA public release Feb 2, 2021
@nicocvn nicocvn mentioned this pull request Feb 2, 2021
Copy link
Collaborator

@stodolli stodolli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for being a little bit late to the party here. There was quite a bit of browsing around I needed to do to get a sense of what had happened.
I managed to build the project and run the DNASim tests on Ubuntu just fine.
Comments:

  • I like the more straightforward build structure. Never used git submodules before but it's kinda neat.
  • The Install instructions are pretty clear. Ideally we can flesh them out further later.
    Questions:
  • Do we need to include .idea in the repo? I thought that was usually ignored and left up to the individual contributor? It works ok for me but just wondering what's the common practice.
  • I see you are targeting the release branch with this PR but what workflow are we keeping for this project? One of my confusions is also, are we keeping both main and master? Are we doing away with master altogether, now that the convention is to use main as default?

@stodolli
Copy link
Collaborator

stodolli commented Feb 2, 2021

Never mind, I just realized now what must have happened with the main/master. @rty10 had an existing project in Bitbucket with a master branch so when pushing that project here with a default main, now we have both. Sorry, this is unrelated to the pull request.

@nicocvn
Copy link
Owner Author

nicocvn commented Feb 2, 2021

Do we need to include .idea in the repo? I thought that was usually ignored and left up to the individual contributor? It works ok for me but just wondering what's the common practice.

Well ... yes and no. It is pretty straightforward at the moment to just re-create a CLion project each time but once you start organizing targets and setting parameters on them it will quickly be painful. IMHO it is fine to leave the CLion project in the .idea/ directory ... most people will not even notice it. We should mention somewhere in the doc that it can be open in CLion.

I see you are targeting the release branch with this PR but what workflow are we keeping for this project? One of my confusions is also, are we keeping both main and master? Are we doing away with master altogether, now that the convention is to use main as default?

Yes the main/master is a bit odd right now. I guess we can resolve that when doing the final merge of the release/v1.0.0 branch by targeting main.

In terms of workflow ... well it is a bit ad-hoc right now. I wanted to keep working on release/v1.0.0 until everything is cleaned up and more importantly tested/validated.

@stodolli
Copy link
Collaborator

stodolli commented Feb 2, 2021

Ok it all makes sense. So to the main point, I am assuming any of us 3 can approve the merge commit to the release now, is that correct? Or since you initiated it, you cannot approve it yourself @nicocvn?

@nicocvn
Copy link
Owner Author

nicocvn commented Feb 2, 2021

Well I have no idea how this is setup. I asked @rty10 for admin permissions to actually take care of these things but it seems he had some issues with the user/permissions stuff (see #4). It seems I can approve it myself but I think it is better if someone else takes a look until we adjust permissions.

@stodolli stodolli merged commit ef5b533 into release/v1.0.0 Feb 2, 2021
emDNA public release automation moved this from In Progress to Done Feb 2, 2021
@nicocvn nicocvn linked an issue Feb 3, 2021 that may be closed by this pull request
nicocvn pushed a commit that referenced this pull request Feb 6, 2021
Refactored DNASim library
- Cleaned up CMake setup
- Dependencies now handled via git submodules
- Incomplete: emDNA code still needs to be refractored
@nicocvn nicocvn deleted the issue/DNASim-deps branch November 29, 2021 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

DNASim dependencies cleanup
2 participants