cornelisnetworks / opa-psm2

Other
36 stars 29 forks source link

fix syntax errors in Makefile #58

Closed chuckcranor closed 2 years ago

chuckcranor commented 3 years ago

Calls to $(error) or $(warning) that are indented with tabs generate gmake "recipe commences before first target" errors. example: the warning call on line 121 of buildflags.mak does this:

% make PSM_DISABLE_AVX2=yes
/tmp/bob/opa-psm2/buildflags.mak:121: *** recipe commences before first target.  Stop.
%

To resolve you can delete the spaces, turn the tabs to spaces, or prefix error/warning calls with an assignment ("anerr :="). Since the "anerr" was already in use in other places in psm2, apply that fix to the rest of the Makefile and buildflags.mak.

Also, the definition of DISTRO assumes /bin/sh is bash and uses the bash "[[ a == b ]]" syntax. This generates a shell error every time you run make if /bin/sh isn't bash. For example, on an ubuntu box:

% make
/bin/sh: 1: [[: not found
...

Resolve this by converting "[[ a == b ]]" to the more portable "[ a = b ]" format. This resolves opa-psm2 issue #55 ...

mwheinz commented 3 years ago

Because of the way Intel handled PSM2 source releases, the "[[" issue has actually been resolved for quite a long time, there just hasn't been an updated source release.

Good catch on the tabs, not sure how that got missed for 5 years.

BTW - as with the other PR you issued, this is too late in our internal release cycle to get picked up for the next release of IFS but I'll try to get it into the release after, which means the source will get released a few weeks after the official IFS release comes out.

chuckcranor commented 2 years ago

Looks good. Just add Signed-off-by line to commit message, please.

done