nfft icon indicating copy to clipboard operation
nfft copied to clipboard

[Build routine] Automatic detection of installation path

Open kevinmatthes opened this issue 2 years ago • 2 comments

When building the project using the ./configure step, users might pass the options --with-matlab= and --with-octave=, followed by the actual installation path each.

UNIX systems offer the which command which returns exactly this installation path. For instance, the default Octave installation may be referred by

./configure <other options here> --with-octave=`which octave`

Windows offers such a semantic, as well. There, the default installation location may be referenced by Magic Variables, framed within %.

I would like to suggest the following additional feature: if users have multiple installations on their systems, they may decide to use the default one (which octave / which matlab) by using another option, --with-default-octave / --with-default-matlab, for example, or by directly stating the paths with the current options. This would benefit the build and testing procedure on systems where just one version of the applications is installed. Most users can be expected to configure their preferred version as default to their account such that this feature would come in handy.

The usage of the system semantics for installation location detection would furthermore reduce the possibility of mistakes during the build process due to some incorrectly stated paths. Since the OS is detected during the build in an earlier step, the semantic would be chosen depending on the already known value, hence the selection would be processed securely.

What do you think about this additional feature?

kevinmatthes avatar Oct 29 '21 12:10 kevinmatthes

Sounds good if you come up with a solution. Maybe the easiest way for users might be if you say --with-matlab without options, then it tries to determine the Matlab path and throws an error if it does not find any, and if you use it with an argument then it is the old behavior.

By the way, we use bash also on Windows. Then one might look for subfolders of $PROGRAMFILES/Matlab, usually named something like R2020b.

michaelquellmalz avatar Oct 29 '21 16:10 michaelquellmalz

Sounds good to me as well. I agree with Michael on --with-matlab without options.

tvolkmer avatar Oct 29 '21 17:10 tvolkmer