mosra / magnum-plugins

Plugins for the Magnum C++11 graphics engine
https://magnum.graphics/
Other
98 stars 58 forks source link

the "magnum-deps" repository requested #52

Closed hunt978 closed 5 years ago

hunt978 commented 5 years ago

It took me about 8 hours to finally build magnum through out Corrade to project magnum-plugins, what A STEP !!! what cost the most of my time is searching for the correct depended packages and build it, as a matter of fact, i was giving up to build harfbuzz, cuz maybe there is a dependency hell. sometime, there will be some necessary renaming needed to be done, cause the cmake script only accept specific pattern of file arrangement. /package/ci/appveyor* helps a lot through out the process. thx for releasing the scripts.

so, here comes a "fair" call that why not creating another repos, like magnum-deps to collect all the packages needed by magnum components and connecting the cumbersome building processes.

mosra commented 5 years ago

Sorry to hear you had this experience.

For general use and local development, the project provides almost a dozen different packages for various package managers, now with Conan and Hunter being added to the mix. In your case I think either the Vcpkg or MSYS packages would suit most and the workflow there is mostly painless, as the package maintainers went through all the hell for you.

On the other hand, if you want to build yourself, you usually don't need everything, especially not the obscure things like harfbuzz. And for almost every plugin there's an alternative without external dependencies to make building easier -- for example, the StbImageImporter plugin for general image loading or the StbTrueTypeFont for fonts. These cover 90% of use cases and don't require anything extra, as everything is bundled in this repo.

Yes, there could be a better overview of the various plugins together with suggestions for the most painless setup covering most cases. I have this on my TODO list, wasn't able to wrap it up it in time for the current release.

I'm afraid your suggestion with the magnum-deps repo is not feasible -- if I'm counting correctly, there is around 20 optional external dependencies and the list is growing with every release. Note the emphasis on optional -- out of those 20, projects based on Magnum usually need just two or three external dependencies. Some of the dependencies are quite huge, some are proprietary so it's not possible to put them in a repository, and every library has its own different buildsystem. Unix Makefiles, Visual Studio projects, CMake, Meson, bazel, gyp ... To actually make things easier for the users, I would need to replicate buildsystems of all the libraries and unify them to a single buildsystem; just shovelling everything to a single place wouldn't solve anything. I was responsible for something similar in a past project and keeping it all running and up-to-date was a full-time job -- and there it was only 5 dependencies. That's why Magnum is aiming to support as many packaging systems as possible -- to reuse packaging work done by other people, instead of having to do it all again from scratch.

hunt978 commented 5 years ago

I've tried vcpkg, and the experience was awesome! except that the magnum related packages are litter bit out of date, which is fine currently for me as a new graphics learner.

my main working environment is offline, so following rules should be applied:

last but not least,

i choose vcpkg over conan, cause conan basically a 'copy' of apt-like platform with pre-build package cache, which violates the rule no.2. msys on the other hand potentially means a huge offline cache which size can not be determined neither.

That's why Magnum is aiming to support as many packaging systems as possible -- to reuse packaging work done by other people, instead of having to do it all again from scratch.

i agree and respect with your judgement totally.

mosra commented 5 years ago

except that the magnum related packages are litter bit out of date, which is fine currently for me as a new graphics learner

It's stuck on the Vcpkg side: https://github.com/microsoft/vcpkg/pull/5312, hopefully to be merged soon :) It's also possible to install current Git master, but it's not as straightforward as just getting a stable version and upgrading needs to be done carefully. As far as I know, Vcpkg has some caching (as in, build the package on one machine with internet access and then copy the built libraries elsewhere, useful for deploys to e.g. classrooms or teams).

cause conan basically a 'copy' of apt-like platform with pre-build package cache

I'm a Conan noob, but what I gathered from the discussion at mosra/magnum#304, it can either download a prebuilt binary or build the package locally with the environment you want. The Hunter package, once it materializes (in-progress PR here: https://github.com/ruslo/hunter/pull/1731), is even closer to that, I would think -- it gives you a single CMake build directory with all dependencies. And there are no dependencies outside of CMake, so that could tick the checkboxes for your rule no.2 to 4 (but not rule 1, I'm afraid). Tradeoffs...

Few years ago (when Magnum didn't have a regular release schedule) I was providing nightly builds compiled with MSVC, but soon realized it's not sustainable. Now, when I have a regular release schedule, I could reconsider. Something to think about for the next version, I would say.

mosra commented 5 years ago

@hunt978 2019.01 is now available in both Hunter and Vcpkg, so you should be able to upgrade smoothly. Is there anything else I can do about this? Otherwise I'll close :)

hunt978 commented 5 years ago

Great! I'm very grateful to you for all your help, the problem was perfectly resolved under your instructions successfully. it's fine to close this one.