6 ms·
Wonder if Nix package manager would work here. It is not strictly tied to the OS unlike deb, rpm etc. It should work in most Linux distributions and MacOS. And
by rdtsc 9y ago
Wonder if Nix package manager would work here. It is not strictly tied to the OS unlike deb, rpm etc. It should work in most Linux distributions and MacOS. And it is not a single language. Mono-language package managers work for a while, then all of the sudden needing to deploy other languages / framework and it becomes awkward.
Moreover it emphasizes reproducible build and seems to handle dependencies in a sane way.
- steveklabnik 9y agoNix barely works on Windows, that is, only through the WSL. I’d imagine that alone makes it a non-starter for what OP wants; Windows is a very important platform for C++.
- microcolonel 9y agoIt's such a shameful platform too. A lot of C++ stuff I work on and with has a C++11 path, and a Windows path for anything that needs, for example, guaranteed width integer types. Part of the fault for that in particular lies on the ISO folks for waiting twelve years to introduce <cstdint> instead of at least adding it in C++03 (since that's the first C++ after C99); but a big part of it lies in the fact that Microsoft makes you pay to compile things for their platform, so developers get understandably cheap and stay two (or four!) generations of VS behind.
- pjmlp 9y agoOther platform vendors also sell their compilers. For those on the cheap side, Microsoft had the express versions for quite some years now.
- microcolonel 9y agoExpress doesn't do 64-bit though, does it? or did they drop that restriction? > Other platform vendors also sell their compilers. Also, no, Apple's platform compilers are free (though obviously somebody pays for them), and so are the platform compilers for the major free operating systems GNU/Linux, FreeBSD, OpenBSD, Solaris. Sure, you can buy ICC or XL C/C++, but it isn't the only supported way to build and link against those platforms.
- bbernoulli 9y agoNot sure about the history but I use 2015 express for desktop to build 64-bit apps
- pjmlp 9y agoApple compilers are already included on the price of Apple's hardware, which are a legal requirement for using them. Sun Forte surely wasn't free. While you can install gcc on other systems, usually doesn't support all features available on the OS vendor's compiler toolchain. Specially on commercial proprietary UNIXes, mainframes and embedded systems.
- bbernoulli 9y agoExpress is discontinued going forward according to VS website: "*Visual Studio Express 2017 is available for Windows Desktop developers. This will be the final version of Visual Studio Express, and there will not be a UWP or Web offering of Visual Studio Express 2017. We encourage all users to look at the free development options offered by Microsoft such as Visual Studio Code and Visual Studio Community for future development needs." Community has license restrictions that were not in place for express versions. There is also a build tools package now which has the compiler without an IDE, but i'm not clear on the licensing for it.
- pjmlp 9y agoThe only license restrictions on community are for companies with more than 5 developers. Any larger company can surely afford professional licenses. When I started on IT we had to buy everything, just like on other professions.
- cwyers 9y agoI love contrasting threads like this with the outraged threads over "why aren't companies contributing to open source products that they use?" It makes it very, very clear that there is a large segment of the free software community that is only here for the "free as in beer" part, which is why it's so hard to get funding for a lot of important open source projects.
- pjmlp 9y agoYes, I fully agree with you.
- microcolonel 9y agoIf you "love these threads" so much, you might just be chronically misunderstanding people. The problem is that no matter how far MSVC goes, those with old licenses for one reason or another tend to bring down the lowest common denominator. I would have no qualms buying a VS Professional/Enterprise license and upgrading it if I were in that position, but I can not very well stand on my pulpit demanding that everyone else do so. The great thing about the free compilers is that there are enough disparate incentives in the world to fund their development. AMD, Intel, Samsung, Qualcomm, ARM Holdings, and basically everyone else who designs and sells CPUs or GPUs, or uses either compiler extensively enough, contributes to LLVM and/or GCC for the purely selfish reason of making sure the code that is generated makes their platform or software product look good. The efficiency is very high, because nobody has to sell or market the compiler itself, because the compiler is a tool to ensure the marketability of their hardware products. When AMD wants to sell GPUs to the deep learning community, they base their work on LLVM because it is cheaper for them. They put it in the open because it makes it easier to consider using ROCm in your deep learning or image processing workload; because on the long tail of rare bugs, it is more likely that the customer will fix the compiler than the vendor, even if the vendor is being paid. I don't like the tone or tenor of the responses to me in this thread at all, you folks are making it out like a) I personally don't pay anyone for compilers, or b) I don't think it costs money to develop software. In reality, I just recognize that the recurring licensing cost of MSVC encourages people to use old compilers with lower feature sets, which in turn encourages open source projects to accommodate those lower feature sets way past their due. With the free compilers, yes the majority of people are freeloaders, but you can at least be expected to have the most recent version (and obviously there was enough money in it to make that happen!). MSVC is not a better compiler, by basically any metric except Windows integration, than either GCC or LLVM. LLVM and GCC are built entirely on the selfish interests of the union of its users. They are free to freeloaders, valuable to exploit, and always fresh. What exactly is not to like here? If you spend all your time belittling and making light of people, you'll never hear what they have to say for what it is.
- adrianN 9y agoIs there a good reason not to use GCC or clang on Windows?
- microcolonel 9y agoClang is closer to replacing MSVC, but GCC will only work with MinGW for now. If it's a personal project I don't mind using MinGW, but it gets complicated.
- Merad 9y agoUnless the situation has changed in the last few years, most libraries only offer precompiled windows binaries for MSVC. Using something else means that you’re likely on your own as far as figuring out how to compile libraries that you need (and their dependencies...).
- seba_dos1 9y agoAren't they compatible now on amd64 though?
- hikarudo 9y agoWait, what's wrong with using Visual Studio Community? https://www.visualstudio.com/vs/community/ https://www.visualstudio.com/vs/community/
- microcolonel 9y agoThe problem is that the VS Community license doesn't work for people who are building proprietary or in-house software at a company. Even if the code is open source, they are building it into a proprietary product. For that proprietary product, they are behind on toolchains because $$$, so for the time being we need workarounds. For what it's worth, a lot of the glaring issues will soon be alleviated, I'm not that enthusiastic about C++14, C++17, etc. features anyway. C++11 for me is really about catching up with C99.
- pjmlp 9y agoOther professionals buy their tools. I don't see any reason for a company to not pay for software licenses.
- microcolonel 9y agoThey did buy their tools, they just don't want to buy their tools again, and again, and again, especially if they don't see the value (at the level of the organization) to bother with a new version VS when the one they have is largely adequate and accommodated.
- pjmlp 9y agoSame applies to any other commercial compiler outside GNU/Linux and BSD worlds. They don't offer upgrades for free. Even on macOS eventually getting a new version implies an hardware upgrade to get hold of the newest version, thus indirectly paying for the compiler.
- microcolonel 9y ago
- dozzie 9y ago> It is not strictly tied to the OS unlike deb, rpm etc. Which is false. DEBs and RPMs are not tied to the OS in any particular way. Especially visible in OpenPKG project (it used RPM), which was running on Solaris just fine. It's more likely that it's OS distribution that is tied to the package manager, not the reverse.
- pjmlp 9y agoWhich still is an UNIX OS. I would like to see how it would work on the native environment for IBM z/OS, for example.
- cjwoodall 9y agoI have been contemplating trying to use Nix packages (or debs/rpms) to manage dependencies for embedded/cross-compiled projects. This would mostly just be a matter of putting header files and static-libraries into the correct paths I suppose.
- arximboldi 9y agoI came here to say the same. Recently I have started using Nix as a universal package manager, every project I start starts with a `shell.nix` file with a pinned <nixpkgs> commit and some line to bring in gcc or make. I always build in a nix-shell --pure to make sure I didn't miss anything. The system is so great and works so beautifully it's even hard to explain. Nix has very sensible defaults and defining a Nix expression to install a cmake or autotools package is a breath. But even projects with just Make or no build system at are easy to install, you just need to copy the output to the /nix/store in the installPhase (to $out). And I can easily define Python or any other language dependencies in the same consistent and concise syntax. I have no fear anymore I won't be able to install dependencies in the future. Any other dev just does `nix-shell` in the project root and they are sure they are ready to go. I even used to hate the Nix syntax (as opposed to Guix) but at some point it "clicked" and now it makes a lot of sense. Only drawback is no Windows support. Maybe someone at Microsoft could help with that? It would be so sad to have the community converging to a suboptimal solution just cuz Windows... :/
- twic 9y agoThis sounds like it could be useful for me. I've never so much as looked at Nix; if i go and read the standard documentation, will i learn how to do this? Or is it a creative application of the tools? Does Nix make it easy, or even possible, to bring in dependencies from legacy sources on the network? For example, my company has an FTP server full of carefully-packaged, versioned libraries in tarballs, and it would be great to be able to use those, rather than having to repackage everything.
- arximboldi 9y agoTo your last question: yes! In a "Nix expression" defining how you build the package (i.e. a "derivation") you can specify where the source is fetched from via any mechanism (e.g. http, ftp, git, etc.) The documentation is good but it can sometimes be a bit rough. There are some good blogposts on how to achieve specific things that you may find when searching around. Also the IRC community seems is quite active, responsive and friendly :-)
- pfultz2 9y ago> Wonder if Nix package manager would work here. The problem is extra work is needed to support things like cross compilation. Instead, you want to pass a toolchain file that describes the build environment(including for cross-compilation) to the build system, and it will compile it correctly for the target. This is the way cmake works, but we should have standard toolchain file that can be used across all build systems instead of requiring everyone to use cmake.