Earlier quoted context omitted.
While I've not had that problem, I can see that it's nonobvious. But it's years between me looking at the actual compiled output. I look at assembly output more often, and most people never even do that. What I mean though is that ./configure outputs a config.log that says exactly what was done. Exactly what command line was run and exactly what the error was. I guess I'm confused why you're even looking at the compi…
I just spent some time searching for m4 opinions on HN and it's more like a love-hate than hate-hate. It looks like if you dive head first into learning autotools, then m4 is going to look like nuisance. But if you allocate time to learn m4 for what it is, instead of just something you have to put up with as part of your autotools adventure, then you'll hate m4. m4 is the only (or one of a very few) well-known genera…
Ray Tracing in pure CMake
131–140 of 167 posts
Re: Ray Tracing in pure CMake
#132Earlier quoted context omitted.
On top of that I found the documentation and the book terrible. I thought it might be easier to understand what it does by reading the source code (didn't try yet)
The documentation is "complete" in the way that some manpages are - the biggest problem with it is the lack of best practices guidance. About books, I believe that good ones exist now. The official CMake book is not among the good ones - last time I checked, it was ridiculously outdated (and IMO not even very good at the time it was written). I have extracted some knowledge from the source code. It's more underdesign…
Re: Ray Tracing in pure CMake
#133Earlier quoted context omitted.
Thanks! This is extremely impressive, and looks like far more effort haha
Btw, one of the things I came up with in bash was an “object oriented” pattern (antipattern?) where a “constructor” function would declare variables for “attributes” and functions for “methods”, like for example declaring an object named Vector1 whose fields are Vector1_x Vector1_y Vector1_z and methods like Vector1_Normalize and Vector1_SetMagnitude. The functions would be eval’d for each instance of the object duri…
Re: Ray Tracing in pure CMake
#134Earlier quoted context omitted.
Someone might be working on an article even worse: list of things that raytracers haven't been written in (yet, regularly updated)
To pick from a recent HN thread: A raytracer has probably not been written yet using only printf. Who wants the glory?
Re: Ray Tracing in pure CMake
#135Earlier quoted context omitted.
> Why? I don't see how it's different from requiring a user to install a compiler to build a particular language. The various build systems I've seen, including CMake, are portability projects in themselves. Yes, to build a C++ program you need a C++ compiler. But if it's using CMake then you need CMake. Oh, but you don't have that. Ok, now you have to install that. Oh, it requires Python X.Y (I'm not saying CMake do…
I've built cpython, it's about as inconvenient as building the compiler and runtime for any other major language. What OS ships binaries for gcc/clang but not python? I can't say I've seen any Linux distros that don't have it. >Well that just means CMake has nothing at all going for it, if they are as portable. Sorry, just to be clear, Visual Studio does not have built in support for autotools. (Unless they added it…
So then you need to either compile from src, or sideload install it and pray that cmake finds your new version instead of preferring the distro installed version.
Re: Ray Tracing in pure CMake
#136Earlier quoted context omitted.
The language is extremely error prone. It's like they looked at Bash and thought "hmm, too safe". Everything is a string, even lists are just semicolon-separated lists. The argument expansions rules for calling functions are literally impossible to remember. All variables are implicitly defined as empty strings. Typos silently break things. `if` is completely broken. The separation of the configure step from the buil…
>The separation of the configure step from the build step is needlessly confusing and makes some things impossible. I'm confused. How do you propose CMake supports all those build generators without doing this? (PS. I really don't think the syntax is that bad, aside that it is jarring for C programmers, most complaints are overblown and you get used to it once you learn the rules. It might be interesting if someone m…
Beyond that the difficulty lies in that calling any command lacks consistency and the output is just that some global variable without any convention were reassigned. There is no common semantics so you can not take the knowledge you learned from one operation and apply to the next one, everything is unique and non-composable. The solution to almost everything is just paste this random magic string anywhere in your cmakelist and it will work.
Re: Ray Tracing in pure CMake
#137Earlier quoted context omitted.
Thanks for your reply. Will this include the contrib modules even for Android? And iOS? Once I sat down and read the Cmake basics, yes, it was easy enough to get OpenCV working with basicallly the code you posted, except I couldn't find a way to include the contrib modules in an Android version, it would always complain Aruco wasn't there. Until I went and compiled OpenCV myself, and that was the part that was a mass…
Humility is good, but it's important to acknowledge that CMake very often feels awful. I consider myself a competent developer and it's still pulling teeth trying to get what I want out of it. Some things will get easier with time, and a lot of other things are going to suck shit forever. Keep on truckin'!
Those times coincide with projects that fail to follow the "modern Cmake" style, based on build targets instead of pretending Cmake is a scripting language.
Keep in mind that modern Cmake style is a thing since the release of Cmake 3.0, which was what? A decade ago?
If developers who don't know better end up writing messy unmaintainable code, their code is an unmaintainable mess. That's not a result of their tech stack, but their own work.
Re: Ray Tracing in pure CMake
#138CMake is by far the worst language I have ever worked in.
Agreed. I will never understand how a group looked at overly-complex Makefiles, determined it was hard to write complex build scripts, and concluded: "I should write a Makefile meta-language that can generate these." That would be like looking at a complex Java codebase and concluding that the best solution to simplify it would be to write a Java meta-language for generating your classes...
If that's your personal experience then it seems you do not have any relevant experience at all developing and maintaining software projects, specially if they need to be cross-platform and cross-tech stack.
For example, it's clear to anyone with any basic experience that providing an abstraction over C++ compiler's so that you can ensure your C++ project can and does build successfully regardless of C++ standard, compiler make and model, and eve os and os distribution is extremely valuable.
Can you show me a Makefile that handles that?
With Cmake you get the exact same C++ project building flawlessly on macOS with Xcode and clang, windows with any version of MS Visual Studio, and of course any linux distribution.
You just download the project, run Cmake to generate a makefile, and build
How do you expect to even run a Makefile the same on all those combinations?
There are very good reasons why Cmake is the de facto standard.
Re: Ray Tracing in pure CMake
#139CMake is by far the worst language I have ever worked in.
I think modern cmake mostly has the right ideas, but the overall implementation is poor, mainly due to legacy.
I fail to see how cmake's take on build targets is "poor". Can you provide an example that helps explain your point of view?
Re: Ray Tracing in pure CMake
#140Well well well, we finally found something CMake can actually do. Please, everyone, stop using CMake. It doesn't do its one job.
You mean, besides Cmake being the absolute best build system for C and C++ available, right?
> Please, everyone, stop using CMake. It doesn't do its one job.
What are you talking about? Can you provide a single example where you show Cmake not working?