Opened 11 years ago

Closed 11 years ago

#41554 closed enhancement (fixed)

gsl: enable avx-optimized compilation

Reported by: NicosPavlov Owned by: daitakahashi
Priority: Normal Milestone:
Component: ports Version:
Keywords: haspatch Cc:
Port: gsl

Description

The latest apple's clang support now avx instructions, so that it should be now possible to compile GSL with avx optimisations. The attached patch should enable avx instructions in case of the optimize variant if a proper compiler is chosen.

Attachments (4)

patch-Portfile-gsl.diff (1.4 KB) - added by NicosPavlov 11 years ago.
Portfile-gsl-mpclang33.diff (2.8 KB) - added by daitakahashi 11 years ago.
add a new variant mpclang33, and modify the optimize variant for consistency
Portfile-gsl-optimize.diff (3.1 KB) - added by NicosPavlov 11 years ago.
Add cflags also for default compiler
Portfile-gsl-optimize-2.diff (3.2 KB) - added by daitakahashi 11 years ago.

Download all attachments as: .zip

Change History (11)

Changed 11 years ago by NicosPavlov

Attachment: patch-Portfile-gsl.diff added

comment:1 Changed 11 years ago by NicosPavlov

Owner: changed from macports-tickets@… to dtakahashi42@…

comment:2 Changed 11 years ago by daitakahashi

Thank you very much nicos. This is just my preference, but I would like to add another compiler variant, namely mpclang33, rather than implicitly introducing a dependence on the macports' clang-3.3.

Here, I attach my diff, so could you please give me any comments if you like.

Changed 11 years ago by daitakahashi

Attachment: Portfile-gsl-mpclang33.diff added

add a new variant mpclang33, and modify the optimize variant for consistency

comment:3 Changed 11 years ago by NicosPavlov

Sure, I did not include an additional variant because there was not any for clang, but it is indeed definitively better.

One thing is that a gcc48 variant has been recently added, which should probably be added if the conditional.

Another thing, which I wanted to propose to include, although it was not greatly written, was the default case, for which no flags are set for now. In particular, the latest apple clang (>= 5.0) also can handle avx instructions.

I include a new diff which contains these changes, along with your previous modifications. The conditionals could probably be simplified, but the point is to see if you find these changes sensible.

Last edited 11 years ago by NicosPavlov (previous) (diff)

Changed 11 years ago by NicosPavlov

Attachment: Portfile-gsl-optimize.diff added

Add cflags also for default compiler

comment:4 Changed 11 years ago by daitakahashi

I removed an XCode-version check, because the assembler problem does not affect any versions of clang, and In addition to that, any versions of apple clang seems to support "native" architecture, but may not support AVX related flags including "-mno-avx".

Any versions of apple clang seem to support "native" architecture, but an apple lvm-gcc-4.2, which potentially be a default compiler, does not support it.

The "-ftree-vectorize" flag is a gcc-specific flag (I should have notice it before the upload of my previous diff, though), which could be a cause of unnecessary warning on a clang.

I updated your diff. If it looks okay, I will send a commit request of it. Thank you very much.

Changed 11 years ago by daitakahashi

comment:5 Changed 11 years ago by NicosPavlov

Right, I also missed it. The patch seems fine to me. If it is alright like this for you, I could commit it right away, without having to send a commit request.

comment:6 Changed 11 years ago by daitakahashi

I think there are no problems left on the patch, so please commit it. Thank you very much.

comment:7 Changed 11 years ago by NicosPavlov

Resolution: fixed
Status: newclosed

Committed in r114154 along with a rev bump as it changes installed files. Thanks for your help on the patch.

Note: See TracTickets for help on using tickets.