ggobi / qtbase

Dynamic bindings from R to the Qt library
20 stars 7 forks source link

OS X install incomplete (when installing qtpaint after qtbase). #37

Closed wspurgin closed 5 years ago

wspurgin commented 8 years ago

For starters, some background: I wanted to install cranvas on my Mac (OS X 10.12). I Already had Qt, but it wasn't installed via Homebrew, however, qmake is still in the path so I don't think anything from having Qt installed by something by Homebrew did anything drastic. From what I can tell, qtbase on its own has installed itself correctly (with some LLVM warnings). However, the kdebindings copy that's installed inside of qtbase seems to be missing some stuff...

I think this has to do with the fact that there's either

  1. A disconnect between qtbase and qtpaint from ongoing development/upkeep of one but not the other
  2. There aren't many contributors historically that develop on OS X, and as OS X marches on its possible that some things that should be happening (like installing the generator from kdebindings.

Anyway, weird stuff is happening, the full output of the installation via R can be found on pastebin here: http://pastebin.com/fxaqekme

Initially, as can be seen at the end of the installation log above, installing qtpaint referencesqtbase/local/bin/smokegen which fails to load the libcppparser.dylib which was located qtbase/local/lib/libcppparser.dylib. For some reason, the smokegen executable is looking for the library in the same directory as the executable and not the lib directory... I was able to fix that though (see image that uses otool and install_name_tool to fix that problem).:

image

However, when trying to install qtpaint again, I get this output:

> install_github('ggobi/qtpaint')
Downloading GitHub repo ggobi/qtpaint@master
from URL https://api.github.com/repos/ggobi/qtpaint/zipball/master
Installing qtpaint
'/usr/local/Cellar/r/3.3.1_3/R.framework/Resources/bin/R' --no-site-file  \
  --no-environ --no-save --no-restore --quiet CMD INSTALL  \
  '/private/var/folders/cs/4cbh30rd3wzdjz31fjnxjvl00000gn/T/RtmplYu9mO/devtools135a047423464/ggobi-qtpaint-bbdb338'  \
  --library='/usr/local/lib/R/3.3/site-library' --install-tests

* installing *source* package ‘qtpaint’ ...
** libs
** arch -
mkdir -p ../src-build;
cd ../src-build; \
        cmake ../src -DR_CXX="clang++" -DR_LIBRARIES="-dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/usr/local/opt/gettext/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/openssl/lib -L/usr/local/lib -F/usr/local/Cellar/r/3.3.1_3/R.framework/.. -framework R" -DR_INCLUDE_DIR=/usr/local/Cellar/r/3.3.1_3/R.framework/Resources/include -DCMAKE_CXX_FLAGS="" -DCMAKE_SHARED_LINKER_FLAGS="" -DQTBASE_DIR="/usr/local/lib/R/3.3/site-library/qtbase"; \
        DYLD_LIBRARY_PATH=:"/usr/local/lib/R/3.3/site-library/qtbase"/local/lib \
        LD_LIBRARY_PATH=:"/usr/local/lib/R/3.3/site-library/qtbase"/local/lib make install
-- The C compiler identification is AppleClang 8.0.0.8000038
-- The CXX compiler identification is AppleClang 8.0.0.8000038
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found OpenGL: /System/Library/Frameworks/OpenGL.framework
-- Configuring done
CMake Warning (dev):
  Policy CMP0042 is not set: MACOSX_RPATH is enabled by default.  Run "cmake
  --help-policy CMP0042" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.

  MACOSX_RPATH is not specified for the following targets:

   qtpaint

This warning is for project developers.  Use -Wno-dev to suppress it.

-- Generating done
-- Build files have been written to: /private/var/folders/cs/4cbh30rd3wzdjz31fjnxjvl00000gn/T/RtmplYu9mO/devtools135a047423464/ggobi-qtpaint-bbdb338/src-build
Scanning dependencies of target qtpaint_automoc
[  4%] Automatic moc for target qtpaint
Generating moc_Layer.cpp
Generating moc_PlotView.cpp
Generating moc_RLayer.cpp
[  4%] Built target qtpaint_automoc
Scanning dependencies of target generate_smoke
[  9%] Generating smokedata.cpp, x_1.cpp
attempting to load generator "/usr/local/lib/R/3.3/site-library/qtbase/local/bin/generator_smoke"
"Cannot load library generator_smoke: (dlopen(generator_smoke, 5): image not found)"
make[3]: *** [kdebindings/smoke/qanviz/smokedata.cpp] Error 1
make[2]: *** [kdebindings/smoke/qanviz/CMakeFiles/generate_smoke.dir/all] Error 2
make[1]: *** [all] Error 2
make: *** [all] Error 2
ERROR: compilation failed for package ‘qtpaint’
* removing ‘/usr/local/lib/R/3.3/site-library/qtpaint’
Error: Command failed (1)

Which makes it seem like generator is not there, and sure enough it's missing and didn't seem to be installed with qtbase:

image

Basically, something seems to have been either skipped or broken in the qtbase install (for the OS X install at least). Obviously I'd like for this to be addressable for OS X and not be a "Just use Ubuntu" solution, but if that's the only solution then knowing that sooner as opposed to later would be nice.

lawremi commented 8 years ago

The generator is not a binary but a dynamically loaded shared object, lib/smokegen/generator_smoke.so. I'm not sure why it keeps looking in bin/ for libraries, but the warning about MACOSX_RPATH is relevant. CMake is now using a different mechanism for embedding library paths.

Frankly, I'm not sure if qtpaint has ever built successfully on the Mac, and I'm not overly motivated to make it work, since the world seems to have moved on to Shiny, etc, for interactive graphics. That said, I will try to look into this, but I can't promise anything.

wspurgin commented 8 years ago

@lawremi Thanks for the response. I say that, if it wasn't much of a priority before, then it's not worth making it a priority now. Thanks for the effort, but I don't want to waste your time.

We can close this issue if you like. If the world comes back around to qtpaint and cranvas, then this can be revisited. Thanks for all the work you've done!

Cheers.

zoberg commented 5 years ago

Hi, @wspurgin. If it is still somehow relevant for you, there is an explanation of how to go through qtbase + qtpaint installation.

wspurgin commented 5 years ago

Thanks @zoberg, but I no longer need this information, but if you want to link your explanation on this issue feel free. I'm closing it for now though to not let it linger.