-
Notifications
You must be signed in to change notification settings - Fork 68
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
Fixing UVCDAT runtime environment #747
Conversation
# Everything beyond this point will be determined relatively | ||
# from this path. | ||
install_prefix="${UVCDAT_INSTALL_PREFIX:-@CMAKE_INSTALL_PREFIX@}" |
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 believe we will need UVCDAT_INSTALL_PREFIX for post-install script. Do we really need to take it out?
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.
Are you sure it's used anywhere? A search for it came up empty... @CMAKE_INSTALL_PREFIX@
should always be correct anyway.
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 believe the intention is that we will use that for the DMG and for any other post-install script. We cannot use CMAKE_INSTALL_PREFIX as it is used internally by the cpack. If it is not causing any issue for you, I would say leave it for now, and later we can look into it carefull.
@remram44 can you please rename uvcdatpython to "cdat" that what it used to be and lots of user actually came and asked me what happened to "cdat". |
Renaming to cdat is 👍 |
@remram44 one thing I should note that, are we making a release for 2.0 today, this change might go into master after that unless we can test this change (I cannot as I am busy with some other critical items but may be someone else can) |
Yes, this is probably big enough to require more than a 1-day testing period. |
Thanks @remram44 for the understanding. I am hoping that we can cut the release branch today |
Folks, there's a major issue here in that the setup_runtime has a .csh twin which it doesn't appear it also edited.. I would strongly recommend you folks at a tcsh/csh test case for this, as the bash-only testing is sure to miss configuration issues.. I'd be happy to test this out too.. |
This branch is completely untested and not meant to be included in 2.0. I'm not familiar with csh so somebody else will have to do it before merging; adding a task. |
I confess I'm a tcsh user and I ran into some initialization problems this afternoon that almost got me crazy. I had a quick look at different issues referencing problems with setup_runtime.csh and I have just found out that my problem was due to my using an alias as a shortcut for the source! I used the following test script
And got the following results. Note the very different and wrong result I get when I try to use the alias
|
This doesn't look like it has anything to do with this pull request -- as I said I didn't change anything csh-related. |
Right, sorry! Don't know where I should list this problem/feature :( Maybe this should go to a "faq" or "askbot" page... |
@remram44 I'd just like to add my perspective here.. Like a bunch of other users the way that I utilize the UV-CDAT functionality is on the command line, and I'd be surprised if any usage has ever triggered the (GUI?) wrapper script executing.. For this reason I generally run the setup_runtime.csh (yes I am a tcsher) in whichever terminal window I'm using UV-CDAT, and then happily execute the UV-CDAT python interactively, or calling python scripts to do my work. I also quite like how after running setup_runtime.csh I get access to all the more recent binaries associated with the UV-CDAT install, ncdump 4.3.x etc etc.. So I would certainly push back against where I think you're suggesting this configuration should go.. I agree what you propose is great for GUI instances, but not for users who use the command line functionality like I do.. @doutriaux1 will also likely have a strong opinion on this too.. |
I see. It is certainly interesting to have some feedback here. My goal was to have a wrapper ('uvcdat') for the GUI and another ('uvcdatpython' or 'cdat' as requested by @doutriaux1) for Python, so you'll still be able to run Python scripts or interactive Python sessions easily; however I did not envision that there might be other common entry points. Of course, setup_runtime.sh stays available. It just wouldn't be necessary for the "uvcdat" and "cdat" commands I wrapped. |
@remram44 I've pulled my hair out trying to get the current version of setup_runtime.csh working across all the use cases that I encounter frequently.. Like @jypeter I've also hit very weird config instances/errors by adding a source line to my .cshrc - I do think this should all be cleaned up, and having to support two separate scripts seems like a very painful (and error/bug prone) way to proceed.. At the very minimum I'd suggest that these config scripts get added to the test suite, for both a bash and tcsh/csh environment, so that problems are identified prior to software being compiled and available for users to download.. I'd be more than happy to help out with the testing.. |
@remram44 i think the "cdat" road is a good one we used to have this and users seemed to like it (I still have users coming in my office asking about where it went). BUT will it solve the "multiple cdat in your system" issue. Our users (and developpers) switch back and forth between many versions of UV-CDAT, do you think adding the path to "cdat" in their .login/.profile (to be shell agnostic) will work and the can still use another "cdat" executable? |
Yep, a wrapper for the uvcdat GUI, another one for python, and a script to initialize the full environment for those who need it seem like a good way to go. And we just have to minimize the number of places where we have to hard-code the actual location of the full installation |
I would prefer we have a real executable vs a python script if we go that route. ParaView does that for desktop apps that pulls all the libraries and python path into it which eliminates setting up the paths for the actual app. It will also fix the issue for Mac DMG (and run time controls as well) |
@doutriaux1 I have to review this branch. I am wondering if you reviewed it already?
|
This is definitely not ready, I'll try and do one more pass on this asap. |
Great. It would be nice if you can layout a roadmap here (as serveral people made suggestions after your initial commit). Something as simple as bulleted list, nothing too fancy. |
as far as I can tell the major issue with it was that it fixes ONLY .sh we cannot bring it in until .csh is fixed as well (or at least confirm the issue does not exists for .csh) |
Would it be possible to add csh tests to duplicate any tests that run on the sh versions? It seems kinda silly to have this environment test omitted when it's an important initialization script.. |
I think I'm done, apart from the CSH script. I updated the todo-list. |
I have no idea what |
At least for the diagnostics, "make install" makes two copies, one in a local build directory and the other under the Python's site-packages directory. The one which really matters is under site-packages. I think that a UV-CDAT build is similar, but more complicated. |
I think UV-CDAT's build just installs everything during the |
@remram44 you're right the make install is completely ignored at the moment. "make" does everything, I "think" it's because some packages needs other to be installed in place before build starts, @aashish24 we could probably revise that? But that would be a lot of work for not much benefit (and it would add one line to the install instructions) but at least it would be consistent with regular build systems. |
we should't be installing to the system directories. We install things where the CMAKE_INSTALL_PREFIX is set. Please use that. |
Here it is again: the point of this branch is to have "cdat" and "uvcdat" wrappers, together with "setup_runtime", in separate directories that can be safely exposed to the user without bringing in all the UV-CDAT environment which would definitely break the user's. |
@remi one thing you could do is define a new variable WRAPPER_INSTALL_PREFIX (which can defualt to user's home directory or something reasonable). If you do that, and define this as a external target, then someone can just do this: make wrapper (call it something else ) to me, this makes much more sense. Also, some users might have not root permissions (often in a control environment). So installing it at /usr should n't be the default IMO. Let me know what you think of it. Thanks |
The path is not exactly a prefix, since I don't append eg. There is a possibility of having the |
WRAPPER_INSTALL_LOCATION
|
The script should really only use the current installation (not UVCDAT_INSTALL_PREFIX from the environment). Re-running the script is not an error (return 0), however displays a warning because this happens when users source setup_runtime manually before running 'uvcdat'.
These are not meant to be run, only sourced.
9956c47
to
f6076ee
Compare
This target, run by default, installs wrapper scripts "uvcdat", "cdat" and "loadcdat" into WRAPPER_INSTALL_LOCATION (by default install/wrappers). These scripts setup the environment, so they are safe to be brought in the user's PATH; they won't conflict or break the environment. This should really be "make install" but that target is broken by our CPack setup.
f6076ee
to
4b03f91
Compare
Alright, I rebased everything. Changes:
|
@remram44 thanks. Much appreciated. I will review it and get it merged today. |
Note (cf roadmap) that uvcdat.mac.in and setup_runtime.csh were not updated. |
@@ -39,6 +35,10 @@ library_paths=( @SETUP_LIBRARY_PATHS@ ) | |||
python_paths=( @SETUP_PYTHON_PATHS@ ) | |||
executable_paths=( @SETUP_EXECUTABLE_PATHS@ ) | |||
|
|||
if [ -z "$UVCDAT_DISABLE_PROMPT" ] ; then |
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.
we should document it somewhere...
LGTM 👍 except the documentation part. |
Fixing UVCDAT runtime environment
@aashish24 @doutriaux1 just wondering whether this should be closed when the *.csh variant hasn't been updated? |
How soon you can update the CSH variant? |
@aashish24 I push a PR to "undo" the prompt change. I understand the idea, but it should be done right i.e
In the mean time I turn this ON only if requested, having like that by default is just not right it think |
The wrappers won't break the existing means to run uvcdat right? As far as we can don't break the current functionality I think it's okay to add new one. Thoughts? We won't annouce the feature until then. Also if remi can push a fix for csh soon then also this should be fine. |
Oh, I didn't intend to update the CSH version myself... If a CSH user could do it, that would be a lot faster (and probably safer) than if I have to learn about CSH first. |
Sourcing the setup_environment.sh before using the software is error-prone. Furthermore, it is not actually needed anymore when running 'uvcdat', since the wrapper script will source it; this causes a warning to be displayed (
UVCDAT setup already sourced for this install location.
).Also, once
setup_runtime.sh
is sourced, a whole bunch of executables appear in the path, replacing the system's default (things likepython
,curl
,uuid
... 260 in total on my system). For the same reasons, installing UV-CDAT globally is not a good idea (will break system'spython
).This pull request intends to make the setup_runtime logic internal, and exposes
uvcdat
anduvcdatpython
wrappers that can safely be added to the PATH (since they are on a directory of their own).TODO:
make wrappers
(if you need to do it as root)WRAPPER_INSTALL_LOCATION
cache variable, defaults to${CMAKE_INSTALL_PREFIX}/wrappers
(not so useful but you can manually add on PATH)make install
cannot be used, it is broken because of its special use in CPack