-
-
Notifications
You must be signed in to change notification settings - Fork 16
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
HDFView fails to find input files on command line when using relative paths #171
Comments
Can you look at the https://github.com/HDFGroup/hdfview/blob/master/docs/WorkingDirectory.txt file and see if there is a workable solution for you, or we would welcome a suggestion. |
I tried various things include changing the java invocation line to:
and it still does not look in $PWD for the specified file:
It looks like it is still looking for the specified "dummy.h5" in /usr/tce/backend/installations/linux-rhel8-x86_64/oneapi-2022.1.0/hdfview-3.3.0-olq4dtqra45vclrqmym5gwijzokox6vh/dummy.h5, which is the installation directory, rather than $PWD. Note that the strace output where it actually finds the proper location is just because its in my "recent file" history. Let me know if I am specifying the start/work directory incorrectly. |
The -D define should go before the program clas - see the hdfview.root define location. We do test these options but maybe I am doing something different, But startDir should have worked. Did you get a log file, you can enable that by adding some defines, the USING_logging.txt file. I will check my test history. |
I moved the -Dhdfview.workdir=$PWD arg to before the hdf.view.HDFVIEW arg and it still did not work. Can you reproduce the behavior that I reported and do some testing and send me the script that works for you so I don't have to keep fumbling around? Thanks. |
Note that I did use the latest 3.3.1 version however everything worked with the define on the command line |
The launcher worked (after edit) without any other changes. However, the supplied hdfview.sh does need to set the the INSTALLDIR up two dirs from the .sh location (export INSTALLDIR=$dir/../..). |
still no luck with me when I run:
This is an hdfview 3.3.0 installation, if that makes a difference. Also, in my strace, I don't see it accessing an HDFView.cfg file. |
I don't think this workdir process changed from 3.3.0 but I will check. |
Looks like we fixed the workdir option in 3.3.1 and forgot to announce it in the release notes. |
still fails for me with 3.3.1 (installed with spack, but added new version and checksum). I have my script run this command: "$JAVABIN/java" "$JAVAOPTS" -Djava.library.path="$INSTALLDIR:$INSTALLDIR/ext" -Dhdfview.root="$INSTALLDIR" -cp "$INSTALLDIR/*" -Dhdfview.workdir="$PWD" hdf.view.HDFView "$@" and it does not appear to be looking for an HDFview.cfg file: [lee218@rzwhippet18:spack]$ strace -f -s 9999 /usr/WS2/lee218/delete/spack/opt/spack/linux-rhel8-ivybridge/gcc-10.3.1/hdfview-3.3.1-ziimwueprhe3m5adhnl35ca3jgifkc4t/bin/hdfview $PWD/data.h5 |& grep -i hdfview.cfg |
I'm guessing you appending the filename to script, that I did not try. After launching HDFView I went to open file menu and the PWD was the selected folder. I will need to try, but imagine that the HDFView argument processing may be not prepending the workdir. |
please read the initial issue report, where I explicitly stated that the issue was opening a file with a relative path from the command line. I hope you can appreciate that I have wasted a fair amount of time on this. |
Actually, have you tried to add the "-start=$PWD" to the command; ... hdf.view.HDFView -start="$PWD" "$@" |
See WorkingDirectory.txt for a description of arguments to HDFView. (-start is at line 16) |
still no luck:
Can you please do the testing yourself and let me know when you have a proper fix? |
The simple workaround is to add "$PWD" to the "$@" -> "$PWD/$@" |
modifying the hdfview launcher script to modify the user's args to "$PWD/$@" would break things if the user specifies a full path or wants to specify any other command-line arguments. I already told my users that they can run |
Will try to fix it in the next release this spring as it looks like it is an implementation bug. It seems to not consider the startDir setting(looks like multiple ways of setting it as well) and tries to pull the dir from the file. |
any updates on a fix and release? |
Changes completed - Having trouble signing the packages. |
Completed for next release |
I see the same issue with version 3.3.2 when I specify the relative path:
this is what I see with a full path to dummy.h5:
|
And in the GUI, with the relative path, the .h5 file does not display, while it does display with the full path. |
Okay, I will need to go back and see where my testing failed. |
I think I have found the problem, maybe I missed the change I tested, however, the input files should be based off the "startDir" and not the "rootDir" for relative files. This happens in the hdf/view/HDFView.java file main function around line 2813. |
I just created some snapshots for this at https://github.com/HDFGroup/hdfview/releases/tag/HDFView-3.3.99 This should fix the issue. |
I initially thought this was a bug in spack/spack#42153, but I think this may be an hdfview issue. When using the "# Default invocation when using modules" execution line in the hdfview.sh script, it appears that the argument -Dhdfview.root="$INSTALLDIR" causes hdfview to look in $INSTALLDIR for input files with a relative path. More concretely, if I run
hdfview file.h5
, I can see via strace that hdfview ends up looking for $INSTALLDIR/file.h5. It works OK if I run using the full path to the input file, such ashdfview $PWD/file.h5
.The text was updated successfully, but these errors were encountered: