isce-framework / isce3

InSAR Scientific Computing Environment ***NOTICE - This repository is currently a mirror of an internally hosted project and is in the process of migrating the development to this public repository. In near future we will accept external pull requests.***
Other
128 stars 35 forks source link

Python 3.11 support? #24

Closed marklit closed 2 weeks ago

marklit commented 2 weeks ago
$ python -V # Python 3.11.10
$ sudo apt update
$ sudo apt install \
    libeigen3-dev \
    fftw3 \
    fftw3-dev \
    pkg-config

$ cd /mnt/d/code_gis
$ git clone https://github.com/isce-framework/isce3
$ cd isce3
$ mkdir build
$ cd build
$ CC=gcc CXX=g++ cmake -DCMAKE_INSTALL_PREFIX=../install ../
$ make VERBOSE=ON
/mnt/d/code_gis/isce3/build/_deps/pybind11-src/include/pybind11/pybind11.h:2058:52: error: invalid use of incomplete type ‘PyFrameObject’ {aka ‘struct _frame’}
 2058 |             frame->f_locals, PyTuple_GET_ITEM(frame->f_code->co_varnames, 0));
      |                                                    ^~
In file included from /usr/include/python3.11/Python.h:42,
                 from /mnt/d/code_gis/isce3/build/_deps/pybind11-src/include/pybind11/detail/common.h:112,
                 from /mnt/d/code_gis/isce3/build/_deps/pybind11-src/include/pybind11/pytypes.h:12,
                 from /mnt/d/code_gis/isce3/build/_deps/pybind11-src/include/pybind11/cast.h:13,
                 from /mnt/d/code_gis/isce3/build/_deps/pybind11-src/include/pybind11/attr.h:13,
                 from /mnt/d/code_gis/isce3/build/_deps/pybind11-src/include/pybind11/pybind11.h:44,
                 from /mnt/d/code_gis/isce3/build/_deps/pyre-src/extensions/journal/external.h:14,
                 from /mnt/d/code_gis/isce3/build/_deps/pyre-src/extensions/journal/journal.cc:8:
/usr/include/python3.11/pytypedefs.h:22:16: note: forward declaration of ‘PyFrameObject’ {aka ‘struct _frame’}
   22 | typedef struct _frame PyFrameObject;
      |                ^~~~~~

I have python3-pybind11 version 2.9.1-2 and pyre-check version 0.9.23 installed.

piyushrpt commented 2 weeks ago

Its a pybind11 issue - https://github.com/pybind/pybind11/discussions/4333 I have no issues on latest 2.13.6

marklit commented 2 weeks ago

Looks like I am running 2.13.6 as well.

$ pip install -U pybind11
Requirement already satisfied: pybind11 in /home/mark/.nasa_sar/lib/python3.11/site-packages (2.13.6)
$ sudo ldconfig
$ make VERBOSE=ON
/mnt/d/code_gis/isce3/build/_deps/pybind11-src/include/pybind11/pybind11.h:2058:52: error: invalid use of incomplete type ‘PyFrameObject’ {aka ‘struct _frame’}
 2058 |             frame->f_locals, PyTuple_GET_ITEM(frame->f_code->co_varnames, 0));
      |                                                    ^~
In file included from /usr/include/python3.11/Python.h:42,
                 from /mnt/d/code_gis/isce3/build/_deps/pybind11-src/include/pybind11/detail/common.h:112,
                 from /mnt/d/code_gis/isce3/build/_deps/pybind11-src/include/pybind11/pytypes.h:12,
                 from /mnt/d/code_gis/isce3/build/_deps/pybind11-src/include/pybind11/cast.h:13,
                 from /mnt/d/code_gis/isce3/build/_deps/pybind11-src/include/pybind11/attr.h:13,
                 from /mnt/d/code_gis/isce3/build/_deps/pybind11-src/include/pybind11/pybind11.h:44,
                 from /mnt/d/code_gis/isce3/build/_deps/pyre-src/extensions/journal/external.h:14,
                 from /mnt/d/code_gis/isce3/build/_deps/pyre-src/extensions/journal/journal.cc:8:
/usr/include/python3.11/pytypedefs.h:22:16: note: forward declaration of ‘PyFrameObject’ {aka ‘struct _frame’}
   22 | typedef struct _frame PyFrameObject;
      |                ^~~~~~
make[2]: *** [_deps/pyre-build/CMakeFiles/journalmodule.dir/build.make:76: _deps/pyre-build/CMakeFiles/journalmodule.dir/extensions/journal/journal.cc.o] Error 1
marklit commented 2 weeks ago

Cheers for looking at this issue. I managed to fix it.

I created a fresh build folder, ran cmake again and I'm able to get the compiler past the point it was throwing up the above error.