View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0003730 | OpenFOAM | Bug | public | 2021-09-17 14:49 | 2021-09-26 21:59 |
Reporter | noZeroDays | Assigned To | henry | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | suspended | ||
Summary | 0003730: foamVersion constructs the wrong path | ||||
Description | On Ubuntu, OpenFOAM is typically installed in /opt/ directory. However, when you invoke the foamVersion function on bash with an argument, it tries to construct a path to that version but the path is wrong, e.g: $ foamVersion 8 bash: /opt/OpenFOAM-8/etc/bashrc: No such file or directory Changed to OpenFOAM-8 notice that the path should be: /opt/openfoam8/etc/bashrc Moreover, if you try to run invoke foamVersion again after it fails you will get: foamVersion: command not found Thanks, | ||||
Tags | No tags attached. | ||||
|
foamVersion wasn't designed for /opt installations and never tested for that purpose. Can you propose a version which works for the current purpose and also suits your requirements? |
|
Should the following version be sufficient? foamVersion () { if [ "$1" ]; then foamInstDir=$FOAM_INST_DIR; . $WM_PROJECT_DIR/etc/config.sh/unset; . ${WM_PROJECT_DIR//[0-9]*/$1}/etc/bashrc; # replace the previous version number with the argument cd $WM_PROJECT_DIR; echo "Changed to OpenFOAM-$1" 1>&2; else echo "OpenFOAM-$WM_PROJECT_VERSION" 1>&2; fi } |
|
While that will work for you it won't work for anyone with an OpenFOAM installation built from sources, i.e. anyone with an installation for which the current foamVersion was created. |
|
Should we check if the path is valid before sourcing its bashrc file? |
|
Pending a patch which does not break the current designed behaviour. |
Date Modified | Username | Field | Change |
---|---|---|---|
2021-09-17 14:49 | noZeroDays | New Issue | |
2021-09-17 15:33 | henry | Note Added: 0012194 | |
2021-09-17 18:48 | noZeroDays | Note Added: 0012195 | |
2021-09-17 19:21 | henry | Note Added: 0012196 | |
2021-09-17 19:43 | noZeroDays | Note Added: 0012197 | |
2021-09-26 21:59 | henry | Assigned To | => henry |
2021-09-26 21:59 | henry | Status | new => closed |
2021-09-26 21:59 | henry | Resolution | open => suspended |
2021-09-26 21:59 | henry | Note Added: 0012203 |