tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: conditionals for platform-specific MAKE_ENV options

On 2019-07-23 08:35, Brook Milligan wrote:
I am trying to make a package that has the following notes about compiling:

- If you see compilation errors, try make sse2only=1 to disable SSE4 code.

- It also works with ARM CPUs supporting the NEON instruction sets. To compile for 32 bit ARM architectures (such as ARMv7), use make arm_neon=1. To compile for for 64 bit ARM architectures (such as ARMv8), use make arm_neon=1 aarch64=1.

I am assuming that I should include a conditional based upon MACHINE_PLATFORM to set MAKE_ENV so that (at least some of) these cases are handled.  However, I am not sure what the conditional should be.  Thus, I have several questions.

- I know that SSE4 was introduced a long time ago, but are there any relevant platforms that should still use the sse2only=1 option?

- What is the best way to handle conditionals for the two ARM architectures mentioned above?

Thanks for your help.


I think what you want is MAKE_FLAGS, not MAKE_ENV.  Either might work, but the documentation you cited used make command-line arguments, not env variables.

So I think what you're looking for is something like this:

.if ${MACHINE_ARCH} == "arm32"
MAKE_FLAGS+=    arm_neon=1

I still regularly use machines that don't have SSE4, but all of them have SSE3.  Does the software have an SSE3 knob?

The default build should produce a portable binary for the sake of bulk builds, so it sounds like sse2only=1 should be on by default and disabled by an option if the user wants more optimizations.  The same would go for arm, although I'm not sure how to apply it there.



Home | Main Index | Thread Index | Old Index