Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#60132 closed defect (fixed)

fftw-3 +threads: error: don't know how to enable OpenMP

Reported by: mouse07410 (Mouse) Owned by: dstrubbe (David Strubbe)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: dstrubbe (David Strubbe)
Port: fftw-3

Description

Catalina 10.15.3, Xcode-11.3.1, Macports clang-9.0.

Problem: fftw-3 configurator uses /usr/bin/clang regardless of what's the default Clang on the system, and fails to find OpenMP.

$ sudo port install fftw-3 +threads
--->  Fetching archive for fftw-3
--->  Attempting to fetch fftw-3-3.3.8_0+threads.darwin_19.x86_64.tbz2 from https://packages.macports.org/fftw-3
--->  Attempting to fetch fftw-3-3.3.8_0+threads.darwin_19.x86_64.tbz2 from https://ywg.ca.packages.macports.org/mirror/macports/packages/fftw-3
--->  Attempting to fetch fftw-3-3.3.8_0+threads.darwin_19.x86_64.tbz2 from http://aus.us.packages.macports.org/macports/packages/fftw-3
--->  Fetching distfiles for fftw-3
--->  Verifying checksums for fftw-3
--->  Extracting fftw-3
--->  Configuring fftw-3
Error: Failed to configure fftw-3, consult /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_math_fftw-3/fftw-3/work/fftw-3.3.8/config.log
Error: Failed to configure fftw-3: configure failure: command execution failed
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_math_fftw-3/fftw-3/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets to report a bug.
Error: Processing of port fftw-3 failed
$ less /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_math_fftw-3/fftw-3/work/fftw-3.3.8/config.log
$ clang -v
clang version 9.0.1 
Target: x86_64-apple-darwin19.3.0
Thread model: posix
InstalledDir: /opt/local/libexec/llvm-9.0/bin
$ port select --list clang
Available versions for clang:
	apple-clang
	mp-clang-9.0 (active)
	none
	uri-clang 
$
$ less /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_math_fftw-3/fftw-3/work/fftw-3.3.8/config.log
. . . . .
It was created by fftw configure 3.3.8, which was
generated by GNU Autoconf 2.69.  Invocation command line was

  $ ./configure --prefix=/opt/local --enable-threads --disable-fortran --enable-shared --enable-openmp --enable-sse2 --enable-avx

## --------- ##
## Platform. ##
## --------- ##

hostname = Uris-MacBook-Air.local
uname -m = x86_64
uname -r = 19.3.0
uname -s = Darwin
uname -v = Darwin Kernel Version 19.3.0: Thu Jan  9 20:58:23 PST 2020; root:xnu-6153.81.5~1/RELEASE_X86_64
. . . . .
/bin/machine           = unknown
/usr/bin/oslevel       = unknown
/bin/universe          = unknown

PATH: /usr/texbin
PATH: /opt/local/bin
PATH: /opt/local/sbin
PATH: /bin
PATH: /sbin
PATH: /usr/bin
PATH: /usr/sbin
PATH: /usr/local/bin
. . . . .
configure:4183: checking for gcc
configure:4210: result: /usr/bin/clang
configure:4439: checking for C compiler version
configure:4448: /usr/bin/clang --version >&5
Apple clang version 11.0.0 (clang-1100.0.33.17)
Target: x86_64-apple-darwin19.3.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
configure:4459: $? = 0
configure:4448: /usr/bin/clang -v >&5
Apple clang version 11.0.0 (clang-1100.0.33.17)
Target: x86_64-apple-darwin19.3.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
. . . . .
configure:21509: result: unknown
configure:21512: error: don't know how to enable OpenMP

Change History (7)

comment:1 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: dstrubbe added
Summary: fftw-3 fails configure with "+threads"fftw-3 +threads: error: don't know how to enable OpenMP

Problem: fftw-3 configurator uses /usr/bin/clang regardless of what's the default Clang on the system

That's not a problem; that's how MacPorts is intended to work. What you have selected with sudo port select is not supposed to influence any port build; it's only meant to be for your own convenience at the command line.

and fails to find OpenMP.

Yes, that might be a problem.

comment:2 Changed 4 years ago by dstrubbe (David Strubbe)

Yes, there is a problem for the default clang, which doesn't support OpenMP; indeed, this should be fixed. It should work fine if you actually use clang-9.0 though, since it does support OpenMP: port configure fftw-3 +clang90 +threads.

comment:3 Changed 4 years ago by dstrubbe (David Strubbe)

Owner: set to dstrubbe
Resolution: fixed
Status: newclosed

In 7bbb797ef205c51f5db83cd9f31ccc732b467604/macports-ports (master):

fftw-3: Warn about default clang +threads.

Fixes: #60132

comment:4 Changed 4 years ago by dstrubbe (David Strubbe)

A further note: there does not seem any obvious way to check whether the built-in clang supports OpenMP or not, nor to make it do so if it doesn't.

comment:5 Changed 4 years ago by kencu (Ken)

No Xcode clang yet supports OpenMP, and it presently cannot be forced to do so.

OSS clangs > 3.7 do support it.

comment:6 Changed 4 years ago by mouse07410 (Mouse)

@Ken, that's not quite correct - there is a way to build an OpenMP executable with Xcode clang, assuming libomp is installed:

$ clang -Xpreprocessor -fopenmp -lomp -I/opt/local/include -L/opt/local/lib/libomp -lomp myfile.cxx

If there's a way to query port for the install directory, something analog to $(brew --prefix libomp), then the hardcoded directories above can be determined at the runtime.

I followed https://iscinumpy.gitlab.io/post/omp-on-high-sierra/ that provided the above guidance, and it worked for the apps I built myself from the source. Having said that, port install fftw-3 +clang90 +threads or port install fftw-3 +gcc9 +threads works.

comment:7 Changed 4 years ago by kencu (Ken)

well, isn't that interesting ... I wonder exactly what that -Xpreprocessor flag is doing here to make that function...

Note: See TracTickets for help on using tickets.