Solved [Solved] Changing CFLAGS and the make -j8 parameter

dcbdbis

Active Member

Reaction score: 5
Messages: 172

Good morning,

FreeBSD 10.0-RELEASE, x64. 32 GB of RAM. AMD FX-8350 (8-core processor)

I don't see this in the docs where it applies to clang. I see it in old man pages that dealt with the GNU compiler.

I'm starting to port some applications I have written to FreeBSD. Is there a way to change the march setting to native, and is there a way to tell clang to use -J8?

And then of course I need to ask... are there good arguments on why I shouldn't change these settings?

I build both userland applications, and I build my own custom kernels... So any/etc/make.conf changes (which doesn't exist on my system except as samples) would also apply to kernel builds, so I am nervous before I do this.

I've been on FreeBSD for six months now, and I'm very satisfied. I am using Linux development terms so I apologize. Linux was where I came from. I am now beginning my FreeBSD development phase for my clients that I support.

Sincerely and respectfully,

Dave
 
OP
OP
dcbdbis

dcbdbis

Active Member

Reaction score: 5
Messages: 172

Re: Changing cflags and the make -j8 parameter

Thank you very much for the reply.

I will add the march=native flag to my compiler settings in Code::Blocks.

On the make setting of "-j8": there is no /etc/make.conf on my system, nor on any of the other systems I have deployed. But there are make examples (two to be specific) in other directories.

I guess the better questions should be:
  • Where can I set the make variable for the option of "-j8", if not in make.conf?
  • If it is make.conf, will I screw up my kernel compilations if I install one of the example files and tweak it? I ask, because I build custom kernels for all my clients and I get the payoff I expect from a custom kernel compile. FreeBSD is so easy to compile kernels for, compared to my old OS of Linux.

I really appreciate the response. I need the clarification.

Sincerely and respectfully,

Dave
 

wblock@

Beastie Himself
Developer

Reaction score: 3,645
Messages: 13,850

Re: Changing cflags and the make -j8 parameter

Don't set -j in /etc/make.conf, use it on the command line. For ports, it can be set in make.conf:
Code:
MAKE_JOBS_NUMBER?=8
 
OP
OP
dcbdbis

dcbdbis

Active Member

Reaction score: 5
Messages: 172

Thank you for the reply!

I have added these settings to the compile options in Code::Blocks. Nothing throws up when I compile.

And I appreciate the heads up about the link recommending not to use make.conf and just let clang figure things out for itself. So I am not changing nor setting any CFLAGS anywhere. Only on the compile options of Code::Blocks.

Again, thank you for the clarifications.

Sincerely and respectfully,

Dave
 
Top