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

Remove redundant setting of environment variables #1561

Merged
merged 21 commits into from
May 11, 2020

Conversation

clinssen
Copy link
Contributor

@clinssen clinssen commented Apr 28, 2020

Replaces #1545 and fixes #972.

@clinssen clinssen marked this pull request as draft April 28, 2020 18:58
@clinssen
Copy link
Contributor Author

(Please see prior discussion in #1545.)

The underlying issue was as follows: the binaries could find the libraries (libnestkernel.so and so on) because their runpath includes ../lib/nest.

pynestkernel.so could find the libraries because its runpath includes ../../../lib/nest.

But the libraries themselves (e.g. libnestkernel.so) could not find the other libraries (e.g. libsli.so) because . (or, indirectly, ../../lib/nest, which from the perspective of these libraries points back to .), was missing. The latest commit adds the latter to the RPATH.

@jougs jougs requested review from jougs and gtrensch April 29, 2020 13:18
@jougs jougs added I: No breaking change Previously written code will work as before, no one should note anything changing (aside the fix) S: Normal Handle this with default priority T: Maintenance Work to keep up the quality of the code and documentation. labels Apr 29, 2020
@jougs jougs added this to the NEST 3.0 milestone Apr 29, 2020
@@ -108,7 +106,7 @@ if [ "$xLIBNEUROSIM" = "1" ] ; then
CONFIGURE_LIBNEUROSIM="-Dwith-libneurosim=$HOME/.cache/libneurosim.install"
chmod +x extras/install_csa-libneurosim.sh
./extras/install_csa-libneurosim.sh
export LD_LIBRARY_PATH=$HOME/.cache/csa.install/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$HOME/.cache/csa.install/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

extras/travis_build.sh Show resolved Hide resolved
Copy link
Contributor

@jougs jougs left a comment

Choose a reason for hiding this comment

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

I'll approve once the tests pass

CMakeLists.txt Show resolved Hide resolved
Copy link
Contributor

@gtrensch gtrensch left a comment

Choose a reason for hiding this comment

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

@clinssen
This change causes make installcheck to behave like if it is running on Travis.
bash: /home/travis/build/nest/nest-simulator/result/bin/nest_vars.sh: No such file or directory
The user specified install directory seems to be ignored.

@clinssen
Copy link
Contributor Author

clinssen commented May 4, 2020

I really appreciate all the feedback so far, but we are still in draft mode and I'm still experimenting with possible solutions!

@jougs: regrettably, it seems that the adding a custom dependency option will not work. The environment sourced in the "update_environment" custom CMake target does not carry over to the environment in which do_tests.sh will be run.

It looks like the invocation in "make installcheck" could be changed from just invoking do_tests.sh to invoking bash -c "source nest_vars.sh && do_tests.sh. I tested this and it works.

@heplesser: I can still add the dependency of installcheck on install without a problem.

@heplesser
Copy link
Contributor

It looks like the invocation in "make installcheck" could be changed from just invoking do_tests.sh to invoking bash -c "source nest_vars.sh && do_tests.sh. I tested this and it works.

This looks like a clean solution.

@heplesser: I can still add the dependency of installcheck on install without a problem.

Good.

@jougs
Copy link
Contributor

jougs commented May 5, 2020

Just a quick heads up: I decided to resect my solution to #345 out of #1404 and make it into a new standalone PR. With that finished, do_test.sh will set paths according to what it is given on the command line instead of relying on the environment. This means that this PR does not have to handle that at all.

@clinssen
Copy link
Contributor Author

clinssen commented May 5, 2020

Thanks @jougs, that simplifies things. Then hopefully you won't mind if I crudely insert a source ${CMAKE_INSTALL_FULL_BINDIR}/nest_vars.sh in do_tests.sh.in as a temporary solution.

There is one related issue that I'm now running into. After #1513, we are falsely advertising nest_vars.sh as being POSIX-compliant. Actually, for the MacOS check, we use $OSTYPE and the [[ ]] operators, which are not in /bin/sh. I have replaced this with a more compliant check using uname, so we wouldn't have to "downgrade" /bin/sh to /bin/bash in nest_vars.sh, and by extension in do_tests.sh.

@heplesser: adding a dependency of "installtarget" on "install" turns out to be not supported by CMake, because "install" is a built-in target. They've had an issue open for this for over 10 years (https://gitlab.kitware.com/cmake/cmake/-/issues/8438). There are no workarounds that I could find.

@jougs
Copy link
Contributor

jougs commented May 5, 2020

Thanks @jougs, that simplifies things. Then hopefully you won't mind if I crudely insert a source ${CMAKE_INSTALL_FULL_BINDIR}/nest_vars.sh in do_tests.sh.in as a temporary solution.

I do exactly the same in my refactoring branch 😄

There is one related issue that I'm now running into. After #1513, we are falsely advertising nest_vars.sh as being POSIX-compliant. Actually, for the MacOS check, we use $OSTYPE and the [[ ]] operators, which are not in /bin/sh. I have replaced this with a more compliant check using uname, so we wouldn't have to "downgrade" /bin/sh to /bin/bash in nest_vars.sh, and by extension in do_tests.sh.

This sounds good to me.

@heplesser: adding a dependency of "installtarget" on "install" turns out to be not supported by CMake, because "install" is a built-in target. They've had an issue open for this for over 10 years (https://gitlab.kitware.com/cmake/cmake/-/issues/8438). There are no workarounds that I could find.

Probably this is the reason why it is not implemented. Can you please add a corresponding comment, so we don't have to re-discover this each second year? Thanks!

@heplesser
Copy link
Contributor

@clinssen Let me know when this PR can be moved out of Draft state!

@clinssen clinssen marked this pull request as ready for review May 6, 2020 08:20
@clinssen
Copy link
Contributor Author

clinssen commented May 6, 2020

@heplesser: it's ready for review! Could you double-check the new MacOS test in nest_vars.sh? Cheers!

Copy link
Contributor

@heplesser heplesser left a comment

Choose a reason for hiding this comment

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

@clinssen Looks good!

Copy link
Contributor

@jougs jougs left a comment

Choose a reason for hiding this comment

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

Nice! Please see my inline comments for a more refined assessment ;-)


NP: Kid Loco – Confessions (Parov Stelar Remix)

CMakeLists.txt Outdated Show resolved Hide resolved
cmake/ProcessOptions.cmake Show resolved Hide resolved
extras/travis_build.sh Show resolved Hide resolved
extras/travis_build.sh Show resolved Hide resolved
Copy link
Contributor

@jougs jougs left a comment

Choose a reason for hiding this comment

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

Just a small one left.

cmake/ProcessOptions.cmake Outdated Show resolved Hide resolved
@jougs
Copy link
Contributor

jougs commented May 7, 2020

@gtrensch, just to be on the safe side: Does this now solve all issues you described and observed?

Co-authored-by: Jochen Martin Eppler <[email protected]>
Copy link
Contributor

@gtrensch gtrensch left a comment

Choose a reason for hiding this comment

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

Approving.

@heplesser heplesser merged commit 7361bad into nest:master May 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I: No breaking change Previously written code will work as before, no one should note anything changing (aside the fix) S: Normal Handle this with default priority T: Maintenance Work to keep up the quality of the code and documentation.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

make installcheck reaches wrong testing code after sourcing nest_vars.sh for a different version
4 participants