NCAR/lrose-core

MacOS source install error

Closed this issue · 13 comments

nguy commented

I tried to install the latest Mac src file lrose-blaze-20180705.src.mac_osx with

python build/build_lrose.py3 --prefix /Users/bguy/software/radar/lrose

and received the following error on install

make: *** [all-recursive] Error 1
make: Target `all' not remade because of errors.
Traceback (most recent call last):
  File "build/build_lrose.py3", line 272, in <module>
    main()
  File "build/build_lrose.py3", line 157, in main
    shellCmd(cmd)
  File "build/build_lrose.py3", line 254, in shellCmd
    retcode = subprocess.check_call(cmd, shell=True)
  File "/Users/bguy/anaconda3/envs/radview/lib/python3.5/subprocess.py", line 271, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command 'make -k -j 8' returned non-zero exit status 2

Note that I also need to modify L237 as such

        try:
            shellCmd("/usr/local/opt/qt/bin/qmake -o Makefile.qmake");
        except:
            shellCmd("qmake -o Makefile.qmake");
nguy commented

Link to Issue #50

There is something odd in your anaconda3 environment: I wouldn't expect subprocess to come from radview.
I'm not sure how mature the python3 build scripts are. You might have better luck starting in a new shell where python2.7 is first in your PATH and just use build_src_release.py.

Note that if you go this route, having which python resolve to a 2.x version is essential.
Just doing /path/tp/python2.7 build_src_release.py won't work if python 3.x is first in PATH because some of the lower scripts will then be run with 3.x

Have you tried installing using Homebrew?
Using the 07/05/18 pre-release:

wget https://github.com/NCAR/lrose-core/releases/download/lrose-20180705/lrose.rb
brew install ./lrose.rb

(You might still need python 2.x first in the path for this to work)

nguy commented

I didn't because of Python 2, I've tried to move completely away from that.

Let me mess with this later and see what might be needed for python 3.

nguy commented

Thanks @leavesntwigs I tried this and received the following error. I check qt/pyqt version is 5.6

/bin/sh: /usr/local/opt/qt/bin/qmake: No such file or directory
Traceback (most recent call last):
  File "build/build_lrose.py3", line 269, in <module>
    main()
  File "build/build_lrose.py3", line 126, in main
    createQtMocFiles(hawkEyeDir)
  File "build/build_lrose.py3", line 237, in createQtMocFiles
    shellCmd("/usr/local/opt/qt/bin/qmake -o Makefile.qmake");
  File "build/build_lrose.py3", line 251, in shellCmd
    retcode = subprocess.check_call(cmd, shell=True)
  File "/Users/bguy/anaconda3/envs/forward/lib/python3.6/subprocess.py", line 291, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '/usr/local/opt/qt/bin/qmake -o Makefile.qmake' returned non-zero exit status 127.
nguy commented

Ah, I just traced the error back and on line 237 it assumes that qmake is a root command because there is a check for operating system and in my case it is a conda environment command.

I tried changing the relevant code to

    if (platform == "darwin"):
        try:
            shellCmd("/usr/local/opt/qt/bin/qmake -o Makefile.qmake")
        except:
            shellCmd("qmake -o Makefile.qmake")
    else:
        shellCmd("qmake-qt5 -o Makefile.qmake")

or the shorter

    import distutils.spawn
    qmake_exe = distutils.spawn.find_executable("qmake")
    shellCmd("{} -o Makefile.qmake".format(qmake_exe))

Both return a different error:

tware/radar/lrose --package lrose-blaze
Project ERROR: Xcode not set up properly. You may need to confirm the license agreement by running /usr/bin/xcodebuild.
Traceback (most recent call last):
  File "build/build_lrose.py3", line 276, in <module>
    main()
  File "build/build_lrose.py3", line 126, in main
    createQtMocFiles(hawkEyeDir)
  File "build/build_lrose.py3", line 246, in createQtMocFiles
    shellCmd("{} -o Makefile.qmake".format(qmake_exe))
  File "build/build_lrose.py3", line 258, in shellCmd
    retcode = subprocess.check_call(cmd, shell=True)
  File "/Users/bguy/anaconda3/envs/forward/lib/python3.6/subprocess.py", line 291, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '/Users/bguy/anaconda3/envs/forward/bin/qmake -o Makefile.qmake' returned non-zero exit status 3.
nguy commented

Oops, just saw that somehow I didn't have Xcode set up. Not sure how I got this far without that?!
So I used that shorter snippet of code above (which seems more robust) and got further in the install, but also back the original error more or less:

libtool: link: g++ -dynamiclib -Wl,-undefined -Wl,dynamic_lookup -o .libs/libkd.0.dylib  kd/.libs/fileoper.o kd/.libs/kd.o kd/.libs/metric.o kd/.libs/naive.o kd/.libs/pqueue.o kd/.libs/kd_interp.o kd/.libs/kd_query.o kd/.libs/tokenize.o   -L/Users/bguy/software/radar/lrose/lib  -O2 -Wl,-rpath -Wl,\$ORIGIN/lrose-blaze_runtime_libs:/Users/bguy/software/radar/lrose/lib   -install_name  /Users/bguy/software/radar/lrose/lib/libkd.0.dylib -compatibility_version 1 -current_version 1.0 -Wl,-single_module
ld: warning: directory not found for option '-L/Users/bguy/software/radar/lrose/lib'
libtool: link: (cd ".libs" && rm -f "libkd.dylib" && ln -s "libkd.0.dylib" "libkd.dylib")
libtool: link: ar cru .libs/libkd.a  kd/fileoper.o kd/kd.o kd/metric.o kd/naive.o kd/pqueue.o kd/kd_interp.o kd/kd_query.o kd/tokenize.o
libtool: link: ranlib .libs/libkd.a
libtool: link: ( cd ".libs" && rm -f "libkd.la" && ln -s "../libkd.la" "libkd.la" )
make[2]: Nothing to be done for `all-am'.
make[1]: Nothing to be done for `all-am'.
make: *** [all-recursive] Error 1
make: Target `all' not remade because of errors.
Traceback (most recent call last):
  File "build/build_lrose.py3", line 276, in <module>
    main()
  File "build/build_lrose.py3", line 157, in main
    shellCmd(cmd)
  File "build/build_lrose.py3", line 258, in shellCmd
    retcode = subprocess.check_call(cmd, shell=True)
  File "/Users/bguy/anaconda3/envs/forward/lib/python3.6/subprocess.py", line 291, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command 'make -k -j 8' returned non-zero exit status 2.

@mjskier The subprocess script is due to the environment that I'm using. I have multiple separate envs to keep things isolated.

nguy commented

I just piped the output and found the following in there as well. There is no include directory.

1 error generated.
make[2]: *** [moments/RadarFft.lo] Error 1
In file included from moments/Sz864.cc:44:
In file included from ./include/radar/Sz864.hh:39:
./include/radar/RadarFft.hh:39:10: fatal error: 'fftw3.h' file not found
#include <fftw3.h>
         ^~~~~~~~~
In file included from moments/RadarMoments.cc:47:
In file included from ./include/radar/RadarMoments.hh:42:
./include/radar/RadarFft.hh:39:10: fatal error: 'fftw3.h' file not found
#include <fftw3.h>
         ^~~~~~~~~
In file included from moments/PhaseCoding.cc:44:
In file included from ./include/radar/PhaseCoding.hh:39:
./include/radar/RadarFft.hh:39:10: fatal error: 'fftw3.h' file not found
#include <fftw3.h>
nguy commented

Ah, you are correct @mjskier I had not installed fftw. I did get further along, now failing with same message but for the apps (L163 of build_lrose.py3). Seems as though it's not finding any of the qt stuff (e.g. QDialog), though I checked and that is installed. Seeing if I can trace back further.

You changed the path to qmake, correct?
There is another place that makes assumptions about the qt location:
os.environ["PKG_CONFIG_PATH"] = "/usr/local/opt/qt/lib/pkgconfig"
You might need to change that too.