Registered Member
|
I'm using MarbleWidget in software I'm developing that runs on Mac OSX, Windows, and Linux. I'm currently working on a Mac, and going through the Marble tutorials that are relevant. I've gotten to the search tutorial (http://techbase.kde.org/Projects/Marble/Runners/Search) and I've run into a snag: no search results are found. I've copied and pasted the code from the tutorial exactly as is into a source file, compiled it successfully, and then when nothing seemed to be happening, I added a line to check the size of the searchResult QVector (its size is 0).
I suspect this is related to an oddity that I noticed earlier, in the GeoDataPlacemark tutorial (http://techbase.kde.org/Projects/Marble/Runners/DisplayGeoDataPlacemark). In that tutorial's screenshot, many names of places appear (Europe, and multiple large European cities). When I compile the tutorial (exactly as is), I have the placemark for Bucharest that's added in the code, but no other names appear. Is this specifically a Mac OSX issue? If so, is there a workaround that I can use so that I can still distribute my software to Mac users? The marble binary that was installed when I installed the library seems to work (both displays names of places and allows searching). |
Registered Member
|
Just an update... I've checked this out on a Linux system, and it really does seem to be a Mac issue. Or perhaps an issue with my Marble installation?
|
KDE Developer
|
Yes, I tested it as well on Linux and it works fine here.
Can you give some details on your installation on Mac? Are you using the packages from marble.kde.org and compile against them or do you use a self-compiled one? |
Registered Member
|
I compiled it myself, mostly following the instructions here: https://code.google.com/p/tonatiuh/wiki ... rbleForMac
I had to use install_name_tool to tell libmarblewidget.15.dylib that it had been moved to /usr/local/lib/marble after compilation, and then to fix the plugins that were linked to it. I've been wondering if this could be a plugin-related issue. When I first compiled the library I wrote a simple test program with a MarbleWidget as a central widget, and had to use QApplication::removeLibraryPath and QApplication::addLibraryPath to make sure that the plugins could be loaded. It was compiling, but I'd errors like this:
I don't get this error when I run any of the tutorials, which I assumed was because the plugins weren't loading. Also, I tried adding the app.removeLibraryPath/app.addlibraryPath lines, and the Search tutorial code still didn't produce any search results. |
KDE Developer
|
I just looked over that page and see some serious flaws in the guide:
Instead just let cmake handle the installation by running
This sounds indeed like problems that 'make install' will take care of. Another useful trick to look into plugin loading is running marble with a parameter
|
Registered Member
|
Yes, I definitely followed the instructions to check out Marble from git on the KDE website.
Looking back at what I did, it looks like I had to make a few adjustments to the cmake instructions here: http://techbase.kde.org/Projects/Marble/MacCompiling I had to edit CMakeLists.txt to compile for x86_64 (I'm running OS 10.7, and the Qt libraries seem to be 64-bit only, so linking failed with the file as it was). I commented out the line:
and added:
However, while running make install creates a working version of the Marble.app bundle, THAT'S NOT MY PROBLEM, it doesn't install the library in a sensible location. This is why I followed the instructions on that rather outdated Google Code page: it explained which headers I needed to copy to, e.g., /usr/local/include/marble, and that libmarblewidget*.dylib needed to be copied to, e.g., /usr/local/lib, and the plugins to... somewhere useful. However, I had to also change the id of libmarblewidget with:
But that said, things seem to be running now. When I compile the tutorials I mentioned earlier, I can find several results for Karlsruhe and names of places appear on the map. Sorry for making this excessively long, I figured this might help someone else to get the library working on OSX. |
KDE Developer
|
Great to hear it works now, thanks for getting back and looking into it. Is it possible to choose a sensible default for CMAKE_OSX_ARCHITECTURES? Or offer a cmake option so that users can override it at least without touching cmake files? Would be lovely if you could come up with a patch, we don't have too many developers with mac systems unfortunately.
There's also some work in https://git.reviewboard.kde.org/r/105315 which might be interesting here, also for plugin loading. |
Registered Member
|
That patch was surprisingly helpful. I applied it, but it turns out that it still hard-codes the plugin location, just to a different spot. But it pointed me to the part of the code where the plugin location is set (I'll post this as a solution to my other question once I've sorted it out completely).
I tried passing the architecture as a command line flag to cmake, and it didn't seem to work. However, I (accidentally) tried just commenting out all of the SET( CMAKE_OSX_ARCHITECTURES...) lines from CMakeLists.txt, and things compiled just fine, so maybe that's the solution. |
Registered users: bancha, Bing [Bot], Evergrowing, Google [Bot], lockheed, mesutakcan, Sogou [Bot]