[MacPorts] #41622: fftw-3: enable avx instructions
#41622: fftw-3: enable avx instructions -------------------------+-------------------- Reporter: nicos@… | Owner: ram@… Type: enhancement | Status: new Priority: Normal | Milestone: Component: ports | Version: Keywords: haspatch | Port: fftw-3 -------------------------+-------------------- The proposed patch enables avx optimisation in case of clang compiler, along with the other optimizations in the portfile. -- Ticket URL: <https://trac.macports.org/ticket/41622> MacPorts <http://www.macports.org/> Ports system for OS X
#41622: fftw-3: enable avx instructions --------------------------+---------------------- Reporter: nicos@… | Owner: ram@… Type: enhancement | Status: assigned Priority: Normal | Milestone: Component: ports | Version: Resolution: | Keywords: haspatch Port: fftw-3 | --------------------------+---------------------- Changes (by ram@…): * status: new => assigned -- Ticket URL: <https://trac.macports.org/ticket/41622#comment:1> MacPorts <http://www.macports.org/> Ports system for OS X
#41622: fftw-3: enable avx instructions --------------------------+---------------------- Reporter: nicos@… | Owner: ram@… Type: enhancement | Status: closed Priority: Normal | Milestone: Component: ports | Version: Resolution: fixed | Keywords: haspatch Port: fftw-3 | --------------------------+---------------------- Changes (by ram@…): * status: assigned => closed * resolution: => fixed Comment: Committed in r114195, with appropriate revision bumps. Thanks. -- Ticket URL: <https://trac.macports.org/ticket/41622#comment:2> MacPorts <http://www.macports.org/> Ports system for OS X
#41622: fftw-3: enable avx instructions --------------------------+---------------------- Reporter: nicos@… | Owner: ram@… Type: enhancement | Status: closed Priority: Normal | Milestone: Component: ports | Version: Resolution: fixed | Keywords: haspatch Port: fftw-3 | --------------------------+---------------------- Comment (by ryandesign@…): What about when the compiler is e.g. "macports-clang-3.3"? Usually we detect clang by using `[string match *clang* ${configure.compiler}]`. -- Ticket URL: <https://trac.macports.org/ticket/41622#comment:3> MacPorts <http://www.macports.org/> Ports system for OS X
#41622: fftw-3: enable avx instructions --------------------------+---------------------- Reporter: nicos@… | Owner: ram@… Type: enhancement | Status: closed Priority: Normal | Milestone: Component: ports | Version: Resolution: fixed | Keywords: haspatch Port: fftw-3 | --------------------------+---------------------- Comment (by ram@…): Good catch, also on a second look it doesn't apply the flag to the fftw-3-single subport. -- Ticket URL: <https://trac.macports.org/ticket/41622#comment:4> MacPorts <http://www.macports.org/> Ports system for OS X
#41622: fftw-3: enable avx instructions --------------------------+---------------------- Reporter: nicos@… | Owner: ram@… Type: enhancement | Status: reopened Priority: Normal | Milestone: Component: ports | Version: Resolution: | Keywords: haspatch Port: fftw-3 | --------------------------+---------------------- Changes (by ram@…): * status: closed => reopened * resolution: fixed => -- Ticket URL: <https://trac.macports.org/ticket/41622#comment:5> MacPorts <http://www.macports.org/> Ports system for OS X
#41622: fftw-3: enable avx instructions --------------------------+---------------------- Reporter: nicos@… | Owner: ram@… Type: enhancement | Status: reopened Priority: Normal | Milestone: Component: ports | Version: Resolution: | Keywords: haspatch Port: fftw-3 | --------------------------+---------------------- Comment (by ram@…): I think the following is now correct? {{{ --- a/math/fftw-3/Portfile +++ b/math/fftw-3/Portfile @@ -52,7 +52,7 @@ configure.cflags-append \ -fomit-frame-pointer \ -fstrict-aliasing -if { ![string compare ${configure.compiler} "clang"] } { +if { [string match *clang* ${configure.compiler}] } { set is_clang 1 } else { set is_clang 0 @@ -97,11 +97,20 @@ platform powerpc { subport fftw-3-single { configure.args-append --enable-float - array set merger_configure_args { - ppc "--enable-fma --enable-altivec" - ppc64 "--enable-fma --enable-altivec" - i386 "--enable-sse" - x86_64 "--enable-sse" + if { $is_clang == 1 } { + array set merger_configure_args { + ppc "--enable-fma --enable-altivec" + ppc64 "--enable-fma --enable-altivec" + i386 "--enable-sse --enable-avx" + x86_64 "--enable-sse --enable-avx" + } + } else { + array set merger_configure_args { + ppc "--enable-fma --enable-altivec" + ppc64 "--enable-fma --enable-altivec" + i386 "--enable-sse" + x86_64 "--enable-sse" + } } depends_lib port:fftw-3 @@ -110,6 +119,9 @@ subport fftw-3-single { if {![variant_isset universal]} { configure.args-delete --enable-sse2 configure.args-append --enable-sse + if { $is_clang == 1 } { + configure.args-append --enable-avx + } } } }}} -- Ticket URL: <https://trac.macports.org/ticket/41622#comment:6> MacPorts <http://www.macports.org/> Ports system for OS X
#41622: fftw-3: enable avx instructions --------------------------+---------------------- Reporter: nicos@… | Owner: ram@… Type: enhancement | Status: reopened Priority: Normal | Milestone: Component: ports | Version: Resolution: | Keywords: haspatch Port: fftw-3 | --------------------------+---------------------- Comment (by peppecal@…): I attached my log. Revision 4 does not work for me. -- Ticket URL: <https://trac.macports.org/ticket/41622#comment:7> MacPorts <http://www.macports.org/> Ports system for OS X
#41622: fftw-3: enable avx instructions --------------------------+---------------------- Reporter: nicos@… | Owner: ram@… Type: enhancement | Status: reopened Priority: Normal | Milestone: Component: ports | Version: Resolution: | Keywords: haspatch Port: fftw-3 | --------------------------+---------------------- Comment (by ram@…): That's not from a clean attempted, can you clean the port and rebuild and then attach that log. -- Ticket URL: <https://trac.macports.org/ticket/41622#comment:8> MacPorts <http://www.macports.org/> Ports system for OS X
#41622: fftw-3: enable avx instructions --------------------------+---------------------- Reporter: nicos@… | Owner: ram@… Type: enhancement | Status: reopened Priority: Normal | Milestone: Component: ports | Version: Resolution: | Keywords: haspatch Port: fftw-3 | --------------------------+---------------------- Comment (by peppecal@…): Replying to [comment:8 ram@…]:
That's not from a clean attempted, can you clean the port and rebuild and then attach that log.
Done. {{{ % sudo port clean fftw-3 ---> Cleaning fftw-3 % sudo port upgrade fftw-3 ---> Fetching archive for fftw-3 ---> Attempting to fetch fftw-3-3.3.3_4.darwin_10.x86_64.tbz2 from http://lil.fr.packages.macports.org/fftw-3 ---> Attempting to fetch fftw-3-3.3.3_4.darwin_10.x86_64.tbz2 from http://mse.uk.packages.macports.org/sites/packages.macports.org/fftw-3 ---> Attempting to fetch fftw-3-3.3.3_4.darwin_10.x86_64.tbz2 from http://packages.macports.org/fftw-3 ---> Fetching distfiles for fftw-3 ---> Verifying checksums for fftw-3 ---> Extracting fftw-3 ---> Configuring fftw-3 ---> Building fftw-3 Error: org.macports.build for port fftw-3 returned: command execution failed Please see the log file for port fftw-3 for details: /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_ports_math_fftw-3/fftw-3/main.log Error: Unable to upgrade port: 1 To report a bug, follow the instructions in the guide: http://guide.macports.org/#project.tickets }}} -- Ticket URL: <https://trac.macports.org/ticket/41622#comment:9> MacPorts <http://www.macports.org/> Ports system for OS X
#41622: fftw-3: enable avx instructions --------------------------+---------------------- Reporter: nicos@… | Owner: ram@… Type: enhancement | Status: reopened Priority: Normal | Milestone: Component: ports | Version: Resolution: | Keywords: haspatch Port: fftw-3 | --------------------------+---------------------- Comment (by ram@…): I can't reproduce this on my Mountain Lion or Mavericks box, it looks like you're using Snow Leopard. Nicolas: Any ideas as this was your patch? -- Ticket URL: <https://trac.macports.org/ticket/41622#comment:10> MacPorts <http://www.macports.org/> Ports system for OS X
#41622: fftw-3: enable avx instructions --------------------------+---------------------- Reporter: nicos@… | Owner: ram@… Type: enhancement | Status: reopened Priority: Normal | Milestone: Component: ports | Version: Resolution: | Keywords: haspatch Port: fftw-3 | --------------------------+---------------------- Comment (by peppecal@…): Replying to [comment:10 ram@…]:
it looks like you're using Snow Leopard.
I am. -- Ticket URL: <https://trac.macports.org/ticket/41622#comment:12> MacPorts <http://www.macports.org/> Ports system for OS X
#41622: fftw-3: enable avx instructions --------------------------+---------------------- Reporter: nicos@… | Owner: ram@… Type: enhancement | Status: reopened Priority: Normal | Milestone: Component: ports | Version: Resolution: | Keywords: haspatch Port: fftw-3 | --------------------------+---------------------- Comment (by nicos@…): Replying to [comment:10 ram@…]:
I can't reproduce this on my Mountain Lion or Mavericks box, it looks like you're using Snow Leopard.
Nicolas: Any ideas as this was your patch?
It is quite possible that the patch provoked this indirectly. Looking up this type of error, it seems that people attribute it to a regression in clang-3.2, but testing {{{ sudo port -d install fftw-3 configure.compiler=macports-clang-3.2 }}} on my system also compiles the port (Mavericks). It may be deeper in the libraries, and be dependent on the XCode version. Which one do you have ? -- Ticket URL: <https://trac.macports.org/ticket/41622#comment:13> MacPorts <http://www.macports.org/> Ports system for OS X
#41622: fftw-3: enable avx instructions --------------------------+---------------------- Reporter: nicos@… | Owner: ram@… Type: enhancement | Status: reopened Priority: Normal | Milestone: Component: ports | Version: Resolution: | Keywords: haspatch Port: fftw-3 | --------------------------+---------------------- Comment (by peppecal@…): Replying to [comment:13 nicos@…]:
It may be deeper in the libraries, and be dependent on the XCode version. Which one do you have ?
4.2. Should I upgrade? -- Ticket URL: <https://trac.macports.org/ticket/41622#comment:14> MacPorts <http://www.macports.org/> Ports system for OS X
#41622: fftw-3: enable avx instructions --------------------------+---------------------- Reporter: nicos@… | Owner: ram@… Type: enhancement | Status: reopened Priority: Normal | Milestone: Component: ports | Version: Resolution: | Keywords: haspatch Port: fftw-3 | --------------------------+---------------------- Comment (by nicos@…): Not necessarily, but this may mean that some older versions of clang may have to be blacklisted since they can't handle the additional options from the patch. Another option would be to apply the options from this patch only on some versions of clang, but that seems more complicated. The attached patch could be used to blacklist the clang compiler from Xcode version 4.2 and older (which would in practice fall back to llvm- gcc-4.2 on 10.6). -- Ticket URL: <https://trac.macports.org/ticket/41622#comment:15> MacPorts <http://www.macports.org/> Ports system for OS X
#41622: fftw-3: enable avx instructions --------------------------+---------------------- Reporter: nicos@… | Owner: ram@… Type: enhancement | Status: reopened Priority: Normal | Milestone: Component: ports | Version: Resolution: | Keywords: haspatch Port: fftw-3 | --------------------------+---------------------- Comment (by ram@…): Looks like this also affects Lion: #41662 -- Ticket URL: <https://trac.macports.org/ticket/41622#comment:16> MacPorts <http://www.macports.org/> Ports system for OS X
#41622: fftw-3: enable avx instructions --------------------------+---------------------- Reporter: nicos@… | Owner: ram@… Type: enhancement | Status: reopened Priority: Normal | Milestone: Component: ports | Version: Resolution: | Keywords: haspatch Port: fftw-3 | --------------------------+---------------------- Comment (by ram@…): OP for #41662 hadn't updated the command line tools in a long time. It looked that the version of clang installed was from Xcode-3.x. Updating to the Lion command line tools fixed the issue. -- Ticket URL: <https://trac.macports.org/ticket/41622#comment:17> MacPorts <http://www.macports.org/> Ports system for OS X
#41622: fftw-3: enable avx instructions --------------------------+---------------------- Reporter: nicos@… | Owner: ram@… Type: enhancement | Status: reopened Priority: Normal | Milestone: Component: ports | Version: Resolution: | Keywords: haspatch Port: fftw-3 | --------------------------+---------------------- Comment (by ram@…): peppecal: Does this patch allow you to build? -- Ticket URL: <https://trac.macports.org/ticket/41622#comment:18> MacPorts <http://www.macports.org/> Ports system for OS X
#41622: fftw-3: enable avx instructions --------------------------+---------------------- Reporter: nicos@… | Owner: ram@… Type: enhancement | Status: reopened Priority: Normal | Milestone: Component: ports | Version: Resolution: | Keywords: haspatch Port: fftw-3 | --------------------------+---------------------- Comment (by peppecal@…): Replying to [comment:18 ram@…]:
peppecal: Does this patch allow you to build?
yes. {{{ % patch Portfile Portfile-fftw-3-olderclang.diff /tmp 00:06:31 patching file Portfile % sudo port install /tmp 00:06:41 Password: ---> Fetching archive for fftw-3 ---> Attempting to fetch fftw-3-3.3.3_4.darwin_10.x86_64.tbz2 from http://lil.fr.packages.macports.org/fftw-3 ---> Attempting to fetch fftw-3-3.3.3_4.darwin_10.x86_64.tbz2 from http://mse.uk.packages.macports.org/sites/packages.macports.org/fftw-3 ---> Attempting to fetch fftw-3-3.3.3_4.darwin_10.x86_64.tbz2 from http://packages.macports.org/fftw-3 ---> Fetching distfiles for fftw-3 ---> Verifying checksums for fftw-3 ---> Extracting fftw-3 ---> Configuring fftw-3 ---> Building fftw-3 ---> Staging fftw-3 into destroot ---> Installing fftw-3 @3.3.3_4 ---> Deactivating fftw-3 @3.3.3_3 ---> Cleaning fftw-3 ---> Activating fftw-3 @3.3.3_4 ---> Cleaning fftw-3 ---> Updating database of binaries: 100.0% ---> Scanning binaries for linking errors: 100.0% ---> No broken files found. % /tmp 00:10:34 }}} -- Ticket URL: <https://trac.macports.org/ticket/41622#comment:19> MacPorts <http://www.macports.org/> Ports system for OS X
#41622: fftw-3: enable avx instructions --------------------------+---------------------- Reporter: nicos@… | Owner: ram@… Type: enhancement | Status: reopened Priority: Normal | Milestone: Component: ports | Version: Resolution: | Keywords: haspatch Port: fftw-3 | --------------------------+---------------------- Comment (by ram@…): Great, thanks for the confirmation. -- Ticket URL: <https://trac.macports.org/ticket/41622#comment:20> MacPorts <http://www.macports.org/> Ports system for OS X
#41622: fftw-3: enable avx instructions --------------------------+---------------------- Reporter: nicos@… | Owner: ram@… Type: enhancement | Status: closed Priority: Normal | Milestone: Component: ports | Version: Resolution: fixed | Keywords: haspatch Port: fftw-3 | --------------------------+---------------------- Changes (by ram@…): * status: reopened => closed * resolution: => fixed Comment: r114261 -- Ticket URL: <https://trac.macports.org/ticket/41622#comment:21> MacPorts <http://www.macports.org/> Ports system for OS X
participants (1)
-
MacPorts