astropy / pyregion

ds9 region parser for python
https://pyregion.readthedocs.io
MIT License
39 stars 38 forks source link

Clang error while building a wheel #163

Open ikhrykin opened 2 weeks ago

ikhrykin commented 2 weeks ago

OS: Mac OS Sonoma 14.4.1 Python: 3.7.6 pyregion: 2.2.0 Issue: when installing pyregion at the stage of building wheels, I get the following error. Any suggestions?

`Building wheels for collected packages: pyregion Building wheel for pyregion (pyproject.toml) ... error error: subprocess-exited-with-error

× Building wheel for pyregion (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [118 lines of output] running bdist_wheel running build running build_py creating build creating build/lib.macosx-10.9-x86_64-cpython-37 creating build/lib.macosx-10.9-x86_64-cpython-37/pyregion copying pyregion/conftest.py -> build/lib.macosx-10.9-x86_64-cpython-37/pyregion copying pyregion/version.py -> build/lib.macosx-10.9-x86_64-cpython-37/pyregion copying pyregion/region_numbers.py -> build/lib.macosx-10.9-x86_64-cpython-37/pyregion copying pyregion/region_to_filter.py -> build/lib.macosx-10.9-x86_64-cpython-37/pyregion copying pyregion/init.py -> build/lib.macosx-10.9-x86_64-cpython-37/pyregion copying pyregion/core.py -> build/lib.macosx-10.9-x86_64-cpython-37/pyregion copying pyregion/ds9_region_parser.py -> build/lib.macosx-10.9-x86_64-cpython-37/pyregion copying pyregion/parser_helper.py -> build/lib.macosx-10.9-x86_64-cpython-37/pyregion copying pyregion/wcs_helper.py -> build/lib.macosx-10.9-x86_64-cpython-37/pyregion copying pyregion/mpl_helper.py -> build/lib.macosx-10.9-x86_64-cpython-37/pyregion copying pyregion/ds9_attr_parser.py -> build/lib.macosx-10.9-x86_64-cpython-37/pyregion copying pyregion/physical_coordinate.py -> build/lib.macosx-10.9-x86_64-cpython-37/pyregion copying pyregion/wcs_converter.py -> build/lib.macosx-10.9-x86_64-cpython-37/pyregion creating build/lib.macosx-10.9-x86_64-cpython-37/pyregion/tests copying pyregion/tests/test_ds9_attr_parser.py -> build/lib.macosx-10.9-x86_64-cpython-37/pyregion/tests copying pyregion/tests/test_cube.py -> build/lib.macosx-10.9-x86_64-cpython-37/pyregion/tests copying pyregion/tests/test_region_numbers.py -> build/lib.macosx-10.9-x86_64-cpython-37/pyregion/tests copying pyregion/tests/test_parser_helper.py -> build/lib.macosx-10.9-x86_64-cpython-37/pyregion/tests copying pyregion/tests/test_region.py -> build/lib.macosx-10.9-x86_64-cpython-37/pyregion/tests copying pyregion/tests/test_get_mask.py -> build/lib.macosx-10.9-x86_64-cpython-37/pyregion/tests copying pyregion/tests/test_wcs.py -> build/lib.macosx-10.9-x86_64-cpython-37/pyregion/tests copying pyregion/tests/test_ds9_region_parser.py -> build/lib.macosx-10.9-x86_64-cpython-37/pyregion/tests running egg_info writing pyregion.egg-info/PKG-INFO writing dependency_links to pyregion.egg-info/dependency_links.txt writing requirements to pyregion.egg-info/requires.txt writing top-level names to pyregion.egg-info/top_level.txt listing git files failed - pretending there aren't any reading manifest file 'pyregion.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' no previously-included directories found matching 'build' no previously-included directories found matching 'docs/_build' no previously-included directories found matching 'docs/api' adding license file 'LICENSE' writing manifest file 'pyregion.egg-info/SOURCES.txt' copying pyregion/_region_filter.c -> build/lib.macosx-10.9-x86_64-cpython-37/pyregion copying pyregion/_region_filter.pyx -> build/lib.macosx-10.9-x86_64-cpython-37/pyregion copying pyregion/c_numpy.pxd -> build/lib.macosx-10.9-x86_64-cpython-37/pyregion copying pyregion/c_python.pxd -> build/lib.macosx-10.9-x86_64-cpython-37/pyregion copying pyregion/geom.h -> build/lib.macosx-10.9-x86_64-cpython-37/pyregion copying pyregion/tests/coveragerc -> build/lib.macosx-10.9-x86_64-cpython-37/pyregion/tests creating build/lib.macosx-10.9-x86_64-cpython-37/pyregion/tests/data copying pyregion/tests/data/sample_fits01.header -> build/lib.macosx-10.9-x86_64-cpython-37/pyregion/tests/data copying pyregion/tests/data/sample_fits02.header -> build/lib.macosx-10.9-x86_64-cpython-37/pyregion/tests/data copying pyregion/tests/data/sample_fits03.header -> build/lib.macosx-10.9-x86_64-cpython-37/pyregion/tests/data copying pyregion/tests/data/sample_fits04.header -> build/lib.macosx-10.9-x86_64-cpython-37/pyregion/tests/data copying pyregion/tests/data/test.header -> build/lib.macosx-10.9-x86_64-cpython-37/pyregion/tests/data copying pyregion/tests/data/test01.reg -> build/lib.macosx-10.9-x86_64-cpython-37/pyregion/tests/data copying pyregion/tests/data/test01_ciao.reg -> build/lib.macosx-10.9-x86_64-cpython-37/pyregion/tests/data copying pyregion/tests/data/test01_ciao_physical.reg -> build/lib.macosx-10.9-x86_64-cpython-37/pyregion/tests/data copying pyregion/tests/data/test01_ds9_physical.reg -> build/lib.macosx-10.9-x86_64-cpython-37/pyregion/tests/data copying pyregion/tests/data/test01_fk4.reg -> build/lib.macosx-10.9-x86_64-cpython-37/pyregion/tests/data copying pyregion/tests/data/test01_fk5.reg -> build/lib.macosx-10.9-x86_64-cpython-37/pyregion/tests/data copying pyregion/tests/data/test01_fk5_degree.reg -> build/lib.macosx-10.9-x86_64-cpython-37/pyregion/tests/data copying pyregion/tests/data/test01_fk5_sexagecimal.reg -> build/lib.macosx-10.9-x86_64-cpython-37/pyregion/tests/data copying pyregion/tests/data/test01_gal.reg -> build/lib.macosx-10.9-x86_64-cpython-37/pyregion/tests/data copying pyregion/tests/data/test01_icrs.reg -> build/lib.macosx-10.9-x86_64-cpython-37/pyregion/tests/data copying pyregion/tests/data/test01_img.reg -> build/lib.macosx-10.9-x86_64-cpython-37/pyregion/tests/data copying pyregion/tests/data/test01_mixed.reg -> build/lib.macosx-10.9-x86_64-cpython-37/pyregion/tests/data copying pyregion/tests/data/test01_print.reg -> build/lib.macosx-10.9-x86_64-cpython-37/pyregion/tests/data copying pyregion/tests/data/test02.reg -> build/lib.macosx-10.9-x86_64-cpython-37/pyregion/tests/data copying pyregion/tests/data/test02_1_fk5.reg -> build/lib.macosx-10.9-x86_64-cpython-37/pyregion/tests/data copying pyregion/tests/data/test02_1_img.reg -> build/lib.macosx-10.9-x86_64-cpython-37/pyregion/tests/data copying pyregion/tests/data/test03_ciao_physical.reg -> build/lib.macosx-10.9-x86_64-cpython-37/pyregion/tests/data copying pyregion/tests/data/test03_fk5.reg -> build/lib.macosx-10.9-x86_64-cpython-37/pyregion/tests/data copying pyregion/tests/data/test03_gal.reg -> build/lib.macosx-10.9-x86_64-cpython-37/pyregion/tests/data copying pyregion/tests/data/test03_icrs.reg -> build/lib.macosx-10.9-x86_64-cpython-37/pyregion/tests/data copying pyregion/tests/data/test03_img.reg -> build/lib.macosx-10.9-x86_64-cpython-37/pyregion/tests/data copying pyregion/tests/data/test04_img.reg -> build/lib.macosx-10.9-x86_64-cpython-37/pyregion/tests/data copying pyregion/tests/data/test_annuli.reg -> build/lib.macosx-10.9-x86_64-cpython-37/pyregion/tests/data copying pyregion/tests/data/test_annuli_ciao.reg -> build/lib.macosx-10.9-x86_64-cpython-37/pyregion/tests/data copying pyregion/tests/data/test_annuli_wcs.reg -> build/lib.macosx-10.9-x86_64-cpython-37/pyregion/tests/data copying pyregion/tests/data/test_context.reg -> build/lib.macosx-10.9-x86_64-cpython-37/pyregion/tests/data copying pyregion/tests/data/test_text.reg -> build/lib.macosx-10.9-x86_64-cpython-37/pyregion/tests/data running build_ext building 'pyregion._region_filter' extension creating build/temp.macosx-10.9-x86_64-cpython-37 creating build/temp.macosx-10.9-x86_64-cpython-37/pyregion x86_64-apple-darwin13.4.0-clang -fno-strict-aliasing -Wsign-compare -Wunreachable-code -DNDEBUG -fwrapv -O3 -Wall -Wstrict-prototypes -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O3 -pipe -fdebug-prefix-map=${SRC_DIR}=/usr/local/src/conda/${PKG_NAME}-${PKG_VERSION} -fdebug-prefix-map=/opt/anaconda3=/usr/local/src/conda-prefix -flto -Wl,-export_dynamic -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O3 -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -D_FORTIFY_SOURCE=2 -mmacosx-version-min=10.9 -I/private/var/folders/0s/vzb0c8p12slcn1gksx6zx3tr0000gn/T/pip-build-env-ttp5e53d/overlay/lib/python3.7/site-packages/numpy/core/include -I/opt/anaconda3/include/python3.7m -c pyregion/_region_filter.c -o build/temp.macosx-10.9-x86_64-cpython-37/pyregion/_region_filter.o clang-4.0: warning: -Wl,-export_dynamic: 'linker' input unused [-Wunused-command-line-argument] In file included from pyregion/_region_filter.c:1242: In file included from /private/var/folders/0s/vzb0c8p12slcn1gksx6zx3tr0000gn/T/pip-build-env-ttp5e53d/overlay/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4: In file included from /private/var/folders/0s/vzb0c8p12slcn1gksx6zx3tr0000gn/T/pip-build-env-ttp5e53d/overlay/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:18: In file included from /private/var/folders/0s/vzb0c8p12slcn1gksx6zx3tr0000gn/T/pip-build-env-ttp5e53d/overlay/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1816: /private/var/folders/0s/vzb0c8p12slcn1gksx6zx3tr0000gn/T/pip-build-env-ttp5e53d/overlay/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-W#warnings]

warning "Using deprecated NumPy API, disable it by " \

   ^
  pyregion/_region_filter.c:18294:3: warning: incompatible pointer to integer conversion returning 'void *' from a function with result type 'int' [-Wint-conversion]
    import_array();
    ^~~~~~~~~~~~~~
  /private/var/folders/0s/vzb0c8p12slcn1gksx6zx3tr0000gn/T/pip-build-env-ttp5e53d/overlay/lib/python3.7/site-packages/numpy/core/include/numpy/__multiarray_api.h:1547:151: note: expanded from macro 'import_array'
  #define import_array() {if (_import_array() < 0) {PyErr_Print(); PyErr_SetString(PyExc_ImportError, "numpy.core.multiarray failed to import"); return NUMPY_IMPORT_ARRAY_RETVAL; } }
                                                                                                                                                        ^~~~~~~~~~~~~~~~~~~~~~~~~
  /private/var/folders/0s/vzb0c8p12slcn1gksx6zx3tr0000gn/T/pip-build-env-ttp5e53d/overlay/lib/python3.7/site-packages/numpy/core/include/numpy/__multiarray_api.h:1542:35: note: expanded from macro 'NUMPY_IMPORT_ARRAY_RETVAL'
  #define NUMPY_IMPORT_ARRAY_RETVAL NULL
                                    ^~~~
  /opt/anaconda3/bin/../lib/clang/4.0.1/include/stddef.h:105:16: note: expanded from macro 'NULL'
  #  define NULL ((void*)0)
                 ^~~~~~~~~~
  pyregion/_region_filter.c:19984:76: warning: code will never be executed [-Wunreachable-code]
          if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad;
                                                                             ^~~~~~~~
  pyregion/_region_filter.c:19984:73: note: silence by adding parentheses to mark code as explicitly dead
          if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad;
                                                                          ^
                                                                          /* DISABLES CODE */ ( )
  3 warnings generated.
  x86_64-apple-darwin13.4.0-clang -bundle -undefined dynamic_lookup -Wl,-pie -Wl,-headerpad_max_install_names -Wl,-dead_strip_dylibs -Wl,-rpath,/opt/anaconda3/lib -L/opt/anaconda3/lib -flto -Wl,-export_dynamic -Wl,-pie -Wl,-headerpad_max_install_names -Wl,-dead_strip_dylibs -Wl,-rpath,/opt/anaconda3/lib -L/opt/anaconda3/lib -Wl,-pie -Wl,-headerpad_max_install_names -Wl,-dead_strip_dylibs -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -D_FORTIFY_SOURCE=2 -mmacosx-version-min=10.9 build/temp.macosx-10.9-x86_64-cpython-37/pyregion/_region_filter.o -o build/lib.macosx-10.9-x86_64-cpython-37/pyregion/_region_filter.cpython-37m-darwin.so
  ld: warning: -pie being ignored. It is only used when linking a main executable
  clang-4.0: error: unable to execute command: Segmentation fault: 11
  clang-4.0: error: linker command failed due to signal (use -v to see invocation)
  error: command '/opt/anaconda3/bin/x86_64-apple-darwin13.4.0-clang' failed with exit code 254
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for pyregion Failed to build pyregion ERROR: Could not build wheels for pyregion, which is required to install pyproject.toml-based projects`

ikhrykin commented 2 weeks ago

Update: changing the compiler to gcc worked CXX='gcc' CC='gcc' pip install pyregion

Parkerwise commented 3 days ago

I got this same error with OS: Arch Linux Kernel: 6.9.3-arch1-1 Python: Python 3.11.9 pyregion: 2.2.0