Opened 4 years ago

Closed 4 years ago

#60711 closed defect (fixed)

py38-numpy @1.19.0 does not build on PPC Tiger, Mac OS X 10.4.11, because error: #pragma GCC diagnostic not allowed inside functions?

Reported by: ballapete (Peter "Pete" Dyballa) Owned by: michaelld (Michael Dickens)
Priority: Normal Milestone:
Component: ports Version: 2.6.2
Keywords: tiger Cc: kencu (Ken)
Port: py-numpy

Description

It's not clear to me where the error appears. Perhaps early here:

gcc-apple-4.2: build/src.macosx-10.4-ppc-3.8/numpy/core/src/multiarray/einsum.c
numpy/core/src/multiarray/einsum.c.src: In function 'get_combined_dims_view':
numpy/core/src/multiarray/einsum.c.src:2156: error: #pragma GCC diagnostic not allowed inside functions
numpy/core/src/multiarray/einsum.c.src:2157: error: #pragma GCC diagnostic not allowed inside functions
numpy/core/src/multiarray/einsum.c.src:2158: error: #pragma GCC diagnostic not allowed inside functions
numpy/core/src/multiarray/einsum.c.src:2173: error: #pragma GCC diagnostic not allowed inside functions

230 lines later this is reported:

error: Command "/opt/local/bin/gcc-apple-4.2 -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -pipe -Os -arch ppc -isysroot/ -DNPY_INTERNAL_BUILD=1 -DHAVE_NPY_CONFIG_H=1 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 -DHAVE_CBLAS -Ibuild/src.macosx-10.4-ppc-3.8/numpy/core/src/umath -Ibuild/src.macosx-10.4-ppc-3.8/numpy/core/src/npymath -Ibuild/src.macosx-10.4-ppc-3.8/numpy/core/src/common -Inumpy/core/include -Ibuild/src.macosx-10.4-ppc-3.8/numpy/core/include/numpy -Inumpy/core/src/common -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -I/opt/local/Library/Frameworks/Python.framework/Versions/3.8/include/python3.8 -Ibuild/src.macosx-10.4-ppc-3.8/numpy/core/src/common -Ibuild/src.macosx-10.4-ppc-3.8/numpy/core/src/npymath -c build/src.macosx-10.4-ppc-3.8/numpy/core/src/multiarray/einsum.c -o build/temp.macosx-10.4-ppc-3.8/build/src.macosx-10.4-ppc-3.8/numpy/core/src/multiarray/einsum.o -MMD -MF build/temp.macosx-10.4-ppc-3.8/build/src.macosx-10.4-ppc-3.8/numpy/core/src/multiarray/einsum.o.d -std=c99" failed with exit status 1
Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_python_py-numpy/py38-numpy/work/numpy-1.19.0" && /opt/local/Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8 setup.py --no-user-cfg build -j1 
Exit code: 1
Error: Failed to build py38-numpy: command execution failed

Attachments (1)

main.log (116.7 KB) - added by ballapete (Peter "Pete" Dyballa) 4 years ago.
Main.log from PPC Tiger, Mac OS X 10.4.11

Download all attachments as: .zip

Change History (13)

Changed 4 years ago by ballapete (Peter "Pete" Dyballa)

Attachment: main.log added

Main.log from PPC Tiger, Mac OS X 10.4.11

comment:1 Changed 4 years ago by mf2k (Frank Schima)

Cc: michaelld@… removed
Owner: set to michaelld
Port: py-numpy added; py38-numpy removed
Status: newassigned

comment:2 Changed 4 years ago by ballapete (Peter "Pete" Dyballa)

I built with configure.compiler=macports-gcc-7.

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

Usually, if there is one pragma inside a function, there's many. You could look -- if there's only a couple, we could patch it -- but I usually just bite the bullet and blacklist gcc-4.2 and ilk when this happens.

comment:4 Changed 4 years ago by michaelld (Michael Dickens)

Would anybody care if I just specify c++11 compliant compilers (C and C++) for NumPy & SciPy? That will take care of this issue and probably some others. I'm testing this right now ... adding in the following ... for now just for PPC:

# on PPC, do not use apple GCC; just specify C++11 since that will work                             
if {${build_arch} eq "ppc" || ${build_arch} eq "ppc64"} {
    compiler.cxx_standard 2011
    compiler.c_standard 2011
}

I'm not sure if I need both C and C++ ... will review the build log once it's done.

comment:5 Changed 4 years ago by michaelld (Michael Dickens)

Cc: michaelld added

comment:6 Changed 4 years ago by michaelld (Michael Dickens)

Cc: michaelld removed

comment:7 Changed 4 years ago by michaelld (Michael Dickens)

Cc: kencu added

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

if gcc-4.2 doesn't allow pragmas inside functions on ppc, it won't allow them on Intel either.... perhaps just KISS?

comment:9 Changed 4 years ago by michaelld (Michael Dickens)

KISS ... "keep it simple stupid" ... meaning? Just go with C/C++11 ... or, just blacklist <= *gcc*4.2? I like the C/C++11 solution since it matches SciPy for Py3.X and really is KISS (IMHO; LOL, BTW & FYI) ...

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

either one, whichever you prefer -- I like the C/C++11 too -- but just thinking somebody is going to try to install this on 10.4 or 10.5 Intel and we'll be back here again for the same issue if we make it PPC only...

comment:11 Changed 4 years ago by michaelld (Michael Dickens)

Gotcha. OK that makes sense. I'll just enforce C/C++11 for all builds. That's really not a burden these days, as many common ports require this anyway so the compatible compilers will generally be installed by the time the NumPy ports are being built.

comment:12 Changed 4 years ago by michaelld (Michael Dickens)

Resolution: fixed
Status: assignedclosed

In ab921da35f56f2b2df27e27e9d9a9db3ad954a69/macports-ports (master):

Py-numpy: require a C/C++11 compliant compiler

This setting matches SciPy and allow some older macOS to build this port.

Closes: #60711

Note: See TracTickets for help on using tickets.