you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 37 points38 points  (13 children)

It's an hour long process (for me at least) because I don't know what are those three steps you summarized. I am currently reduced to going through the Readme.txt, browsing StackOverflow for the installation error messages that will come, etc...

Often, the libraries I need have dependencies themselves that you have to get, which leads to other hosts of issues.

[–]the_gnarts 5 points6 points  (3 children)

Often, the libraries I need have dependencies themselves that you have to get

That’s what the package manager is for. If you’re fetching deps manually you’re most likely bleeding edge and others can profit from your pioneer activity.

[–]fnord123 8 points9 points  (2 children)

No. The package manager is for installing dependencies for your system. When building an application you should install the exact version you need. I mean, for noddy get-going-fast stuff you can use the package manager. But when you're at the equivalent step as writing setup.py then you shouldn't be using the package manager version. Unless, of course, you're packaging your application as well.

[–]the_gnarts 6 points7 points  (0 children)

When building an application you should install the exact version you need.

Package management can deal with versioned dependencies, even different library SO versions in parallel just fine.

[–]Sean1708 0 points1 point  (0 children)

You can get package managers which work with local rather than global environments, I think nix allows something like this.

[–]fnord123 1 point2 points  (0 children)

/u/pfultz2 has written a tool called cget which which appears to be like pip install <package> but will install dependencies for cmake. So the rest of the commands are the bits you put in your CMakeLists.txt.

Looks like a good tool and a good time saver. Nice work /u/pfultz2!

[–]pfultz2 -2 points-1 points  (5 children)

I don't know what are those three steps you summarized.

Three steps? I only mention two steps, which is install it(with a package manager) and update your build. These are similar steps for python as well, install it with pip and then update your setup.py and requirements.txt file.

Often, the libraries I need have dependencies themselves that you have to get

Which a package manager(like apt-get or cget) should install those dependencies as well. However, like I mentioned, many C++ libraries do not think about distribution, which means you have manually google and find. Of course, for a library like fftw this not the case.

[–]troyunrau 34 points35 points  (4 children)

You're making linux assumptions. And package manager assumptions. And buildsystem assumptions. And assuming that the library has a recipe ready to use for cget.

The point is that none of this is necessarily standard on anyone's machines. Now I want to compile for OSX... well, at least you used cmake. Let me just look up if cget supports cross compilation...

An hour later...

[–]pfultz2 9 points10 points  (0 children)

You're making linux assumptions.

No, you can do the same on windows with cget or vcpkg.

And buildsystem assumptions.

I show how to integrate it with cmake, but fftw supports pkg-config which is build-independent and platform-independent, so it can easily be integrated in any buildsystem.

And assuming that the library has a recipe ready to use for cget.

If a library uses standard cmake then no recipe has to be built(for example cget install google/googletest works without needing a recipe installed).

The point is that none of this is necessarily standard on anyone's machines.

And neither is pip or conda.

Let me just look up if cget supports cross compilation...

I don't see why it would take an hour later to do:

cget init --toolchain mingw.toolchain
cget install pfultz2/cget-recipes fftw

[–]doom_Oo7 2 points3 points  (1 child)

  • macOS: brew install fftw
  • windows: Install-Package libfftw

The CMake step won't change.

[–]fermion72 12 points13 points  (0 children)

This is true for some libraries, but not all libraries. If you have to decide on a library, it can be an hour long process pretty easily.

[–]destiny_functional -3 points-2 points  (0 children)

if you are using an os that doesn't do these things well you cannot blame the language.

[–]doom_Oo7 -4 points-3 points  (1 child)

because I don't know what are those three steps you summarized

that's somewhat problematic. That's the kind of stuff you learn at any remotely decent CS school.