Running Demos that are included in JetPack 4.2

Hello everyone,
I’m new to linux and Jetson world and I’ve recently started working on Jetson TX2. I’ve flashed it with Jetpack 4.2 and everything went fine. I’ve started by running some cuda demos that are already provided with the Jetpack. For that I followed a toturial that explains how i can run cuda samples and he came to the step where he wrote the command in the path where the samples are : make .j4

So why do we need to run the make command if we want to run some cuda samples for examples?

Would appreciate to get some info

thanks in advance
Khaled

“make” just follows a recipe in the “Makefile”. Usually that recipe is to compile from source code format into binary format. The binary format is the executable. Now if it turns out that the binary was already somewhere in your default execution path, then you wouldn’t have needed to use “make”. This certainly wouldn’t have hurt. Mostly those examples are for people who want to see a source code example of how to do certain things, and thus if these were presented only in binary format, then this wouldn’t actually help in seeing how the source code is set up.

“make” can have different targets. The “-j4” just says to use 4 CPU cores during build…if you had 6 cores, then you might use “make -j6”.

“make” with no targets (and “-j4” is not a target) just executes some default recipe. Often there is a “make install” target (“install” is a target), and this would place the executable somewhere more “standardized”. Usually “install” requires root authority, so it’d be something like “sudo make install”. If “make” had not already been run, then “make” would have been executed, followed by “install” (it is hard to install what doesn’t exist, so “make” will test if the binary executable exists prior to trying to copy it to an install location).