Jump to content

how can i run terminal commands on all core's?

Depends what you're compiling.  Make man not be able to parallelize the job.   I'm a bit surprised anyone would suggest using "make -j $(nproc)" though, that is silly for end users.

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, toor said:

Depends what you're compiling.  Make man not be able to parallelize the job.   I'm a bit surprised anyone would suggest using "make -j $(nproc)" though, that is silly for end users.

just installing stuff from the AUR... 

She/Her

Link to comment
Share on other sites

Link to post
Share on other sites

8 hours ago, firelighter487 said:

compiling from the AUR etc takes forever for me because it only does it on 1 core. how can i make it use all 4 core's?

Edit  /etc/makepkg.conf

look for the commented line that says

#MAKEFLAGS="-j2"

and remove the comment tag (#), substitute the 2 with the number of cores you have. You can read about this on the arch wiki as well https://wiki.archlinux.org/index.php/Makepkg#Parallel_compilation

Don't ask to ask, just ask... please 🤨

sudo chmod -R 000 /*

Link to comment
Share on other sites

Link to post
Share on other sites

7 hours ago, toor said:

I'm a bit surprised anyone would suggest using "make -j $(nproc)" though, that is silly for end users.

Since these are AUR packages it's usually safe to assume the maintainers tested them and made sure they work with -j flags. At worst it won't be any faster.

Don't ask to ask, just ask... please 🤨

sudo chmod -R 000 /*

Link to comment
Share on other sites

Link to post
Share on other sites

10 minutes ago, Sauron said:

Edit  /etc/makepkg.conf

look for the commented line that says


#MAKEFLAGS -j2

and remove the comment tag (#), substitute the 2 with the number of cores you have. You can read about this on the arch wiki as well https://wiki.archlinux.org/index.php/Makepkg#Parallel_compilation

for me the -j2 was like this: "-j2". i've edited it now with the quotes still there. is that ok? 

 

also, does it count core's or threads? in other words do i need to set it at 4 or 8 on my laptop, because on that i have 8 threads... 

She/Her

Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, firelighter487 said:

for me the -j2 was like this: "-j2". i've edited it now with the quotes still there. is that ok?

Yeah, I forgot the quotes. The wiki has the right syntax.

3 minutes ago, firelighter487 said:

also, does it count core's or threads? in other words do i need to set it at 4 or 8 on my laptop, because on that i have 8 threads... 

make will spawn as many threads as the number after the j, so yes, hyperthreading counts. You should use 8.

Don't ask to ask, just ask... please 🤨

sudo chmod -R 000 /*

Link to comment
Share on other sites

Link to post
Share on other sites

It should work with or without quotes. So either:

 

MAKEFLAGS="-j6"

or

MAKEFLAGS=-j6

 

Should be fine (quotes are necessary if you have spaces, say adding several MAKEFLAGS; and with that rationale the quotes are more clean or correct, because it will be easier to add flags later if needed).

 

Some programs might compile / parallelize worse than others, some might have some weird (non-standard) way to call make or compiling the source and drop the MAKEFLAGS variable set in /etc/makepkg.conf. In that case you could try to fix the PKGBUILD.

 

IMO it is a bad habit to set MAKEFLAGS in the PKGBUILD (unless there are specific reasons to do so); Usually they are system specific and should be set on the host system.

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, Wild Penquin said:

IMO it is a bad habit to set MAKEFLAGS in the PKGBUILD (unless there are specific reasons to do so); Usually they are system specific and should be set on the host system.

 

That was more where I was heading.  Just because you have 32 cores doesn't mean you get the best performance out of pegging them all at once.   You'll find docs saying to rung make -j (no limit), something that is quite assinine since you can easily cause essentially a forkbomb.     Depending on the build system you can limit based on other metrics.   Example is make has -n for load.

Link to comment
Share on other sites

Link to post
Share on other sites

 

On 10/11/2018 at 2:14 PM, Wild Penquin said:

It should work with or without quotes. So either:

 


MAKEFLAGS="-j6"

or


MAKEFLAGS=-j6

 

Should be fine (quotes are necessary if you have spaces, say adding several MAKEFLAGS; and with that rationale the quotes are more clean or correct, because it will be easier to add flags later if needed).

 

Some programs might compile / parallelize worse than others, some might have some weird (non-standard) way to call make or compiling the source and drop the MAKEFLAGS variable set in /etc/makepkg.conf. In that case you could try to fix the PKGBUILD.

 

IMO it is a bad habit to set MAKEFLAGS in the PKGBUILD (unless there are specific reasons to do so); Usually they are system specific and should be set on the host system.

This is correct, follow that directions, however note that not all AUR packages use the same compiler, this is for GCC, for example clang works even without those build flags, other programs may compile on one core just for compatibility

Anyway I would suggest to use the quotes. By default they should put something like MAKEFLAGS="-j$(nproc)" which automatically detects the number of threads but whatever...
Also you can speed up the package compression, in the same file search for 

COMPRESSXZ=(xz -c -z - --threads=0) 

And edit the number of threads your CPU has

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×