Skip to content

Automatic dependency management - #37

Open
cantordust wants to merge 10 commits into
mainfrom
auto-dep-management
Open

Automatic dependency management#37
cantordust wants to merge 10 commits into
mainfrom
auto-dep-management

Conversation

@cantordust

Copy link
Copy Markdown
Member

Automatic dependency management. Currently, there are only two dependencies (Eigen and Boost Pool), but this paves the way towards adding more dependencies down the track in a predictable way (for instance, the Google Test for testinng and TOML++ for parameter handling).

  • Added a subprojects directory for dependency wrappers.
  • Added a wrapper for Boost Pool + its dependencies.
  • Added a build script.

@cantordust
cantordust marked this pull request as draft August 27, 2026 10:58
@cantordust
cantordust marked this pull request as ready for review August 27, 2026 11:40

@JaroCamphuijsen JaroCamphuijsen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Great work! I saw some things that are unclear or not working, but with some changes it works wonderfully.

Comment thread scripts/build.sh

# Install dependency wraps
echo ">>> Installing dependencies..."
meson wrap install eigen 5.0.1-1

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Installing a specific version of Eigen in this way doesn't work for me, I do have meson v1.3.2 as it comes directly from apt on ubuntu 24.04 (which is still the latest LTS at the moment....). Maybe it works in a newer version of meson, but I also don't see this anywhere mentioned in the documentation. Does this really work for you?

Shouldn't we get the wrapfile for eigen (which specifies the version, and which you can get with the command meson wrap install eigen) and put it in the subprojects folder with the other wrap files? What I understand from the wrap system, that's how you are supposed to manage the dependencies, but maybe I misunderstood.

Comment thread scripts/build.sh
CLEAN=false

# Move to the root directory (one up from this one)
cd $ROOT_DIR

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't like scripts putting me in a different place than where I was working. Can we either go back to the script folder at the end, or just document that people should run this from the root?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I would even be ok to have this in the root of the repo instead of scripts...

Comment thread scripts/build.sh
mkdir -p $BUILD_DIR

# Install dependency wraps
echo ">>> Installing dependencies..."

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This block (with the meson wrap command) is not actually installing any dependencies. This prompt should either replace the configure prompt or be removed.

Comment thread README.md
## Install the dependencies

`corticalsim3D` depends on Eigen and Boost (however, the latter will be dropped soon). In addition, you will need [Meson](https://mesonbuild.com/index.html) to build the executables, as well as a fairly recent C++ compiler (GCC or Clang) supporting the C++ 14 standard. The following instructions outline the process of installing the dependencies on different platforms, as well as compiling and installing the `corticalsim3D` package itself.
Currently, `corticalsim3D` depends on Eigen and Boost (the latter is going to be removed as a dependency at some point). These dependencies are managed automatically by [Meson](https://mesonbuild.com/index.html), which is also used to build the executables. You do need to install a fairly recent C++ compiler (GCC or Clang) supporting the C++ 14 standard. The following instructions outline the process of installing the core dependencies on different platforms, as well as compiling and installing `corticalsim3D` itself.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
Currently, `corticalsim3D` depends on Eigen and Boost (the latter is going to be removed as a dependency at some point). These dependencies are managed automatically by [Meson](https://mesonbuild.com/index.html), which is also used to build the executables. You do need to install a fairly recent C++ compiler (GCC or Clang) supporting the C++ 14 standard. The following instructions outline the process of installing the core dependencies on different platforms, as well as compiling and installing `corticalsim3D` itself.
Currently, `corticalsim3D` depends on Eigen and Boost (the latter is planned for removal as a dependency). These dependencies are managed automatically by [Meson](https://mesonbuild.com/index.html), which is also used to build the executables. You do need to install a fairly recent C++ compiler (GCC or Clang) supporting the C++ 14 standard. The following instructions outline the process of installing the core dependencies on different platforms, as well as compiling and installing `corticalsim3D` itself.

Comment thread README.md
#### Ubuntu

```bash
sudo apt update && apt upgrade && apt install gcc meson ninja-build cmake

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

All three commands need sudo privilage.

Suggested change
sudo apt update && apt upgrade && apt install gcc meson ninja-build cmake
sudo apt update && sudo apt upgrade && sudo apt install gcc meson ninja-build cmake

Comment thread README.md
Comment on lines +68 to +69
cd scripts
./build.sh

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Related to my previous comment on build.sh, should we tell users to install from the root?

Suggested change
cd scripts
./build.sh
./scripts/build.sh

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Or move the script to the root directory...

Comment thread README.md
```bash
sudo apt update && apt upgrade
sudo apt install gcc libboost-filesystem-dev libeigen3-dev meson ninja-build cmake
meson wrap install eigen 5.0.1-1

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is not a valid command for me. Also, I don't think it is the command that installs dependencies. It (when changed to meson wrap install eigen) seems to just retrieve the latest wrap file for eigen from the meson wrapDB (but the documentation suggests otherwise...)

Comment thread README.md
Run the `corticalsim3d` executable with the `corticalsim3D/config/parameters_ARRAY.txt` parameter file as the first argument:
Compare this with the `release` build:

```bash

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is exactly the same as the codeblock above, can we remove one of the two?

@JaroCamphuijsen JaroCamphuijsen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Great work! But some things are unclear or don't seem to work. With some changes this is a very easy installation procedure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants