We search for IDA via 'which` utility and in the following locations: on Linux: in $HOME on macOS: in /Applications, $HOME/Applications/, $HOME. up to depth 4, and no more than 1024 entries in total. The first found entry is used.
A path to ida can be hinted by setting opam config variable:
opam config set ida-path
Also can be hinted with IDA_PATH environment variable, e.g.,