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

Refactor cmake includes into functions #350

Merged
merged 3 commits into from Jul 25, 2016

Conversation

Projects
None yet
4 participants
@tammoippen
Contributor

tammoippen commented May 19, 2016

The includes of cmake modules from NEST (within <src>/cmake/) result in executing the contained code at the include position. Due to a not optimal distribution of the code into modules in commit 7488005 at PR #213, this resulted in, e.g., incorrect building of the conngen module, if libneurosim is given.

Built-in modules    : models;precise;topology           # << conngen is missing
• • •
Use libneurosim     : Yes (LibNeurosim 1.0.0)           # although libneurosim is given
    Includes        : /path/to/libneurosim/install/include
    Libraries       : /path/to/libneurosim/install/lib/libneurosim.dylib;/path/to/libneurosim/install/lib/libpyneurosim.dylib

In this PR the cmake functionality is put into fine grain functions, e.g. each command line parameter like -Dwith-gsl=... is put into a function nest_process_with_gsl() that performs all necessary checks and linking. These functions can then be executed in the correct order.

Most of the changes in this PR is putting code into cmake functions and increasing the indent level of the function body. Thus the diff might be easier to view using Githubs whitespace ignore feature - put ?w=1 behind the diff URL like this.
Further, PARENT_SCOPE is the 'return' feature from cmake functions, but it sets the variable only in the parent scope and not in the function scope, this results in some interesting constructs like cmake/CheckExtraCompilerFeatures.cmake:98, where a local variable is set again in parent scope. Also see this discussion on PARENT_SCOPE.

I propose @jougs and @apeyser as reviewers.

@apeyser

This comment has been minimized.

Show comment
Hide comment
@apeyser

apeyser May 20, 2016

Contributor

@tammoippen
Has this been tested on all architectures? It looks like a simple refactor, but unexpected interactions can be painful.

Contributor

apeyser commented May 20, 2016

@tammoippen
Has this been tested on all architectures? It looks like a simple refactor, but unexpected interactions can be painful.

@tammoippen

This comment has been minimized.

Show comment
Hide comment
@tammoippen

tammoippen May 23, 2016

Contributor

Have bin tested on OS X, Lubuntu 14.04 and BG/Q.

Contributor

tammoippen commented May 23, 2016

Have bin tested on OS X, Lubuntu 14.04 and BG/Q.

@tammoippen

This comment has been minimized.

Show comment
Hide comment
@tammoippen

tammoippen Jun 10, 2016

Contributor

@apeyser I also tested the recipes from #385 .

Contributor

tammoippen commented Jun 10, 2016

@apeyser I also tested the recipes from #385 .

@jougs

This comment has been minimized.

Show comment
Hide comment
@jougs

jougs Jun 23, 2016

Contributor

I've just reviewed the code and tested it on top of my conngen-refactoring branch. It now detects libneurosim flawlessly, which used to not work before. Nice work and 👍

Contributor

jougs commented Jun 23, 2016

I've just reviewed the code and tested it on top of my conngen-refactoring branch. It now detects libneurosim flawlessly, which used to not work before. Nice work and 👍

@apeyser apeyser merged commit 96a2c1c into nest:master Jul 25, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@tammoippen tammoippen deleted the tammoippen:refactor_cmake branch Oct 24, 2017

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