NCAR/lrose-core

LROSE installation on Apple M1 machine

Closed this issue · 2 comments

Hi,

I was trying to install lrose on Apple Macbook Pro M1 Max but seems like there is some issue with the qt5 dependency. MacOS: Monterey. Here is the error message:

==> Installing lrose-core
==> cmake ..
Last 15 lines from /Users/sharm261/Library/Logs/Homebrew/lrose-core/01.cmake:
CMake Error at apps/radar/src/HawkEye/CMakeLists.txt:73 (find_package):
  Could not find a package configuration file provided by "Qt5" with any of
  the following names:

    Qt5Config.cmake
    qt5-config.cmake

  Add the installation prefix of "Qt5" to CMAKE_PREFIX_PATH or set "Qt5_DIR"
  to a directory containing one of the above files.  If "Qt5" provides a
  separate development package or SDK, be sure it has been installed.


-- Configuring incomplete, errors occurred!

Has anyone come across this and resolved it?

I found this link to build qt for macos arm64 architecture but the build was not successful.

Any ideas would be much appreciated!

To get around the Qt5Config error, find the location of either
Qt5Config.cmake or qt5-config.cmake
Since Qt is installed in different locations depending on the IT environment, please find the location of those files and add the location to the path or set an environment variable, like the error message states.

Add the installation prefix of "Qt5" to CMAKE_PREFIX_PATH or set "Qt5_DIR" to a directory containing one of the above files.

For example, on one computer we used:
$ find / -name Qt5Config.cmake
find: /usr/sbin/authserver: Permission denied
/usr/local/homebrew/Cellar/qt@5/5.15.5_1/lib/cmake/Qt5/Qt5Config.cmake

Then depending on the linux shell you are using (export for bash, setenv for tsh, or csh):
export Qt5_DIR=/usr/local/homebrew/Cellar/qt@5/5.15.5_1/lib/cmake/Qt5

The latest lrose release now builds on the M1 and M2 macs.
The problem was that Qt dependencies could not be found because brew is in /opt instead of /usr/local on the latest macs.
The problem was fixed by searching both /usr/local and /opt for Qt in codebase/CMakeLists.txt.