NFFT / nfft

The official NFFT library repository
https://tu-chemnitz.de/~potts/nfft/
GNU General Public License v2.0
174 stars 46 forks source link

[Build routine] Automatic detection of installation path #121

Open kevinmatthes opened 3 years ago

kevinmatthes commented 3 years ago

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?

michaelquellmalz commented 3 years ago

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.

tvolkmer commented 3 years ago

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