Project-Onion / Intro_To_Linux_Course

This repository contains material for an introduction to linux course
0 stars 1 forks source link

Cocos2d-x Install (Not involved in Intro to Linux) #8

Open JarvisDevon opened 6 years ago

JarvisDevon commented 6 years ago

Hey all

Someone asked me today in the lecture about installing cocos2d-x (a library for developing games for android). Here is a link to a video I found going through the process. They mentioned they were having trouble with missing dependencies and definitely with the make file. This video covers both. To the person asking, I hope this helps, this should work if you follow it exactly. If not chat to me again after you've tried it out. (it isn't the best produced video but he seems reliable)

https://www.youtube.com/watch?v=mc8ip48oivQ

Note, compiling with the make file can take some time. If you use the '-j' flag you can specify the number of threads you want to use (don't worry too much about what threads are for now). Using 'make -j8' instead of 'make' should save you some time. (I'm assuming your laptop/computer is optimal with 8 threads which is pretty common. If not optimal it'll still be faster)

Linking to the linux course, note that he uses a shell script to install the dependencies. We will cover shell scripts later but for now you would've seen us use './' before which is what he does. Also the use of flags in the make command above is pretty cool.

Good luck!

ohanoch commented 6 years ago

Devon mentioned that 8 threads is common on computers and laptops - he got a bit confused. Im sorry for getting a bit hardware technical, but here is the story (you can skip the next 2 paragraphs if you don't feel like a short lecture on processors):

Desktops - unless your computer is new from the last year (8th gen intel processor or ryzen) then if you have an i5 you have 4 cores and 4 threads. i7 processors have hyperthreading, this means they have 4 cores and 8 threads (like Devon mentioned). Higher end varients of processors (like ones ending with HQ) have higher thread counts, but unless you know you have a very beefy machine you probably don't have those.

Laptops - if you have a laptop older than 1 year you probably have 2 cores with 4 threads. If you have a beefy laptop (with an HQ processor) you might have 4 cores with 8 threads. New laptop from the last year (8th gen intel processor) i3 has 4cores and 4 threads but i5 and i7 have has 4 cores and 8 threads.

If you skipped, continue here: Right, so all of this probably just confused you more than anything else, the easy way of knowing how many threads you have is to find your processor model and google it, intel's website will tell you your processor specifications including cores and threads. We covered in last weeks lecture where in the file system this is kept - /proc! so you can just run the command:
cat /proc/cpuinfo
And find your cpu information, including the cpu model (which looks something like "Intel(R) Core(TM) i7-6500U CPU")

By the way if you don't feel like googling and just want to know the amount of threads you can just look at the amount of processors /proc/cpuinfo shows you (notice it starts from 0). So if the last processor I have is processor 3 then I know I have 4 threads (0,1,2,3).

As Devon mentioned what you care about are the threads, not the cores, but honestly, if this was too confusing just avoid using the -j8 flag and wait 10 more minutes.. Also note that if you allocate all your threads to a task that pretty much means your computer needs to be left completely alone until the make process is over.