Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

t-route does not compile on Cython==3.0.4 #675

Closed
aaraney opened this issue Oct 30, 2023 · 3 comments · Fixed by #784
Closed

t-route does not compile on Cython==3.0.4 #675

aaraney opened this issue Oct 30, 2023 · 3 comments · Fixed by #784

Comments

@aaraney
Copy link
Member

aaraney commented Oct 30, 2023

t-route fails to compile on Cython==3.0.4 with Cython.Compiler.Errors.CompileError error.

See #783 also. There are combinations of pip and setuptools that can also cause this issue.

Current behavior

Python version: 3.9.18
OS: Debian GNU/Linux 11 (bullseye)
Arch: Apple arm64

pip freeze output
attrs==23.1.0
black==23.10.1
bmipy==2.0.1
certifi==2023.7.22
cftime==1.6.3
click==8.1.7
click-plugins==1.1.1
cligj==0.7.2
Cython==3.0.4
Deprecated==1.2.14
fiona==1.9.5
geopandas==0.14.0
importlib-metadata==6.8.0
Jinja2==3.1.2
joblib==1.3.2
MarkupSafe==2.1.3
mypy-extensions==1.0.0
netCDF4==1.6.5
numpy==1.26.1
-e git+http://github.com/NOAA-OWP/t-route.git@c4c38381457be27ee6ea2e613de07565f56cc811#egg=nwm_routing&subdirectory=src/troute-nwm
packaging==23.2
pandas==2.1.2
pathspec==0.11.2
platformdirs==3.11.0
pyarrow==13.0.0
pydantic==1.10.13
pyproj==3.6.1
python-dateutil==2.8.2
pytz==2023.3.post1
PyYAML==6.0.1
shapely==2.0.2
six==1.16.0
tomli==2.0.1
toolz==0.12.0
-e git+http://github.com/NOAA-OWP/t-route.git@c4c38381457be27ee6ea2e613de07565f56cc811#egg=troute.config&subdirectory=src/troute-config
troute.network @ file:///app/ngen/t-route/src/troute-network
-e git+http://github.com/NOAA-OWP/t-route.git@c4c38381457be27ee6ea2e613de07565f56cc811#egg=troute.routing&subdirectory=src/troute-routing
typing_extensions==4.8.0
tzdata==2023.3
wrapt==1.15.0
xarray==2023.10.1
zipp==3.17.0
compiler.sh traceback
using CC=gcc
using NETCDFINC=/usr/include
rm -f *.o *.mod
gfortran-10 -g -c -O2 -fPIC -lgfortran -lgcc -static-libgfortran -static-libgcc -nodefaultlibs varPrecision.f90
gfortran-10 -g -c -O2 -fPIC -lgfortran -lgcc -static-libgfortran -static-libgcc -nodefaultlibs -o mc_single_seg.o MCsingleSegStime_f2py_NOLOOP.f90
gfortran-10 -g -c -O2 -fPIC -lgfortran -lgcc -static-libgfortran -static-libgcc -nodefaultlibs -o pymc_single_seg.o pyMCsingleSegStime_NoLoop.f90
cp *.o ../../../src/troute-routing/troute/routing/fast_reach
rm -f *.o *.mod
gfortran-10 -g -c -O2 -fPIC -fbounds-check -o diffusive.o diffusive.f90
diffusive.f90:1440:20:

 1440 |          pause !test
      |                    1
Warning: Deleted feature: PAUSE statement at (1)
gfortran-10 -g -c -O2 -fPIC -fbounds-check -o pydiffusive.o pydiffusive.f90
cp *.o ../../../src/troute-routing/troute/routing/fast_reach
rm -f *.o
rm -f *.mod
rm -f *.a
rm -f reservoir_tests
rm -f test_main
gfortran-10 -g -w -c -ffree-form -ffree-line-length-none -fconvert=big-endian -frecord-marker=4 -static-libgfortran -lgfortran -lgcc -static-libgcc  -I/usr/include -I/usr/include -I/usr/include -L/usr/lib/aarch64-linux-gnu -lnetcdff  -nodefaultlibs -fPIC -L/usr/lib/aarch64-linux-gnu -lnetcdff -c -o module_reservoir.o module_reservoir.F
gfortran-10 -g -w -c -ffree-form -ffree-line-length-none -fconvert=big-endian -frecord-marker=4 -static-libgfortran -lgfortran -lgcc -static-libgcc  -I/usr/include -I/usr/include -I/usr/include -L/usr/lib/aarch64-linux-gnu -lnetcdff  -nodefaultlibs -fPIC -L/usr/lib/aarch64-linux-gnu -lnetcdff -c -o module_levelpool_properties.o ./Level_Pool/module_levelpool_properties.F
gfortran-10 -g -w -c -ffree-form -ffree-line-length-none -fconvert=big-endian -frecord-marker=4 -static-libgfortran -lgfortran -lgcc -static-libgcc  -I/usr/include -I/usr/include -I/usr/include -L/usr/lib/aarch64-linux-gnu -lnetcdff  -nodefaultlibs -fPIC -L/usr/lib/aarch64-linux-gnu -lnetcdff -c -o module_levelpool_state.o ./Level_Pool/module_levelpool_state.F
gfortran-10 -g -w -c -ffree-form -ffree-line-length-none -fconvert=big-endian -frecord-marker=4 -static-libgfortran -lgfortran -lgcc -static-libgcc  -I/usr/include -I/usr/include -I/usr/include -L/usr/lib/aarch64-linux-gnu -lnetcdff  -nodefaultlibs -fPIC -L/usr/lib/aarch64-linux-gnu -lnetcdff -c -o module_levelpool.o ./Level_Pool/module_levelpool.F
gfortran-10 -g -w -c -ffree-form -ffree-line-length-none -fconvert=big-endian -frecord-marker=4 -static-libgfortran -lgfortran -lgcc -static-libgcc  -I/usr/include -I/usr/include -I/usr/include -L/usr/lib/aarch64-linux-gnu -lnetcdff  -nodefaultlibs -fPIC -L/usr/lib/aarch64-linux-gnu -lnetcdff -c -o bind_lp.o bind_lp.f90
ar rc binding_lp.a module_reservoir.o module_levelpool_properties.o module_levelpool_state.o module_levelpool.o bind_lp.o
make: *** No rule to make target 'bind_hybrid.a', needed by 'all'.  Stop.
cp binding_lp.a ../../troute-network/libs;
gfortran-10 -g -w -c -ffree-form -ffree-line-length-none -fconvert=big-endian -frecord-marker=4 -static-libgfortran -lgfortran -lgcc -static-libgcc  -I/usr/include -I/usr/include -I/usr/include -L/usr/lib/aarch64-linux-gnu -lnetcdff  -nodefaultlibs -fPIC -L/usr/lib/aarch64-linux-gnu -lnetcdff -c -o module_hydro_stop.o module_hydro_stop.F
gfortran-10 -g -w -c -ffree-form -ffree-line-length-none -fconvert=big-endian -frecord-marker=4 -static-libgfortran -lgfortran -lgcc -static-libgcc  -I/usr/include -I/usr/include -I/usr/include -L/usr/lib/aarch64-linux-gnu -lnetcdff  -nodefaultlibs -fPIC -L/usr/lib/aarch64-linux-gnu -lnetcdff -c -o module_reservoir_utilities.o module_reservoir_utilities.F
gfortran-10 -g -w -c -ffree-form -ffree-line-length-none -fconvert=big-endian -frecord-marker=4 -static-libgfortran -lgfortran -lgcc -static-libgcc  -I/usr/include -I/usr/include -I/usr/include -L/usr/lib/aarch64-linux-gnu -lnetcdff  -nodefaultlibs -fPIC -L/usr/lib/aarch64-linux-gnu -lnetcdff -c -o module_rfc_forecasts_properties.o ./RFC_Forecasts/module_rfc_forecasts_properties.F
gfortran-10 -g -w -c -ffree-form -ffree-line-length-none -fconvert=big-endian -frecord-marker=4 -static-libgfortran -lgfortran -lgcc -static-libgcc  -I/usr/include -I/usr/include -I/usr/include -L/usr/lib/aarch64-linux-gnu -lnetcdff  -nodefaultlibs -fPIC -L/usr/lib/aarch64-linux-gnu -lnetcdff -c -o module_rfc_forecasts_state.o ./RFC_Forecasts/module_rfc_forecasts_state.F
gfortran-10 -g -w -c -ffree-form -ffree-line-length-none -fconvert=big-endian -frecord-marker=4 -static-libgfortran -lgfortran -lgcc -static-libgcc  -I/usr/include -I/usr/include -I/usr/include -L/usr/lib/aarch64-linux-gnu -lnetcdff  -nodefaultlibs -fPIC -L/usr/lib/aarch64-linux-gnu -lnetcdff -c -o module_reservoir_read_rfc_time_series_data.o module_reservoir_read_rfc_time_series_data.F
gfortran-10 -g -w -c -ffree-form -ffree-line-length-none -fconvert=big-endian -frecord-marker=4 -static-libgfortran -lgfortran -lgcc -static-libgcc  -I/usr/include -I/usr/include -I/usr/include -L/usr/lib/aarch64-linux-gnu -lnetcdff  -nodefaultlibs -fPIC -L/usr/lib/aarch64-linux-gnu -lnetcdff -c -o module_rfc_forecasts.o ./RFC_Forecasts/module_rfc_forecasts.F
gfortran-10 -g -w -c -ffree-form -ffree-line-length-none -fconvert=big-endian -frecord-marker=4 -static-libgfortran -lgfortran -lgcc -static-libgcc  -I/usr/include -I/usr/include -I/usr/include -L/usr/lib/aarch64-linux-gnu -lnetcdff  -nodefaultlibs -fPIC -L/usr/lib/aarch64-linux-gnu -lnetcdff -c -o bind_rfc.o bind_rfc.f90
ar rc bind_rfc.a module_reservoir.o module_hydro_stop.o module_reservoir_utilities.o module_rfc_forecasts_properties.o module_rfc_forecasts_state.o module_levelpool_properties.o module_levelpool_state.o module_levelpool.o module_reservoir_read_rfc_time_series_data.o module_rfc_forecasts.o bind_rfc.o
cp bind_rfc.a ../../troute-network/libs;
performance hint: troute/network/reservoirs/levelpool/levelpool.pyx:23:5: Exception check on 'run_lp_c' will always require the GIL to be acquired.
Possible solutions:
        1. Declare the function as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions.
        2. Use an 'int' return type on the function to allow an error code to be returned.
performance hint: troute/network/reservoirs/levelpool/levelpool.pyx:26:5: Exception check on 'update_lp_c' will always require the GIL to be acquired.
Possible solutions:
        1. Declare the function as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions.
        2. Use an 'int' return type on the function to allow an error code to be returned.
performance hint: troute/network/reservoirs/rfc/rfc.pyx:22:5: Exception check on 'run_rfc_c' will always require the GIL to be acquired.
Possible solutions:
        1. Declare the function as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions.
        2. Use an 'int' return type on the function to allow an error code to be returned.
Fortran compiler type is: gnu95
Compiling troute/network/reach.pyx because it changed.
Compiling troute/network/reservoirs/levelpool/levelpool.pyx because it changed.
Compiling troute/network/reservoirs/rfc/rfc.pyx because it changed.
Compiling troute/network/musking/mc_reach.pyx because it changed.
[1/4] Cythonizing troute/network/musking/mc_reach.pyx
[2/4] Cythonizing troute/network/reach.pyx
[3/4] Cythonizing troute/network/reservoirs/levelpool/levelpool.pyx
[4/4] Cythonizing troute/network/reservoirs/rfc/rfc.pyx
running build_ext
building 'troute.network.reach' extension
creating build
creating build/temp.linux-aarch64-3.9
creating build/temp.linux-aarch64-3.9/troute
creating build/temp.linux-aarch64-3.9/troute/network
gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -Itroute/network -I/usr/local/lib/python3.9/site-packages/numpy/core/include -I/usr/local/include/python3.9 -c troute/network/reach.c -o build/temp.linux-aarch64-3.9/troute/network/reach.o -g -g
In file included from /usr/local/lib/python3.9/site-packages/numpy/core/include/numpy/ndarraytypes.h:1929,
                 from /usr/local/lib/python3.9/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,
                 from /usr/local/lib/python3.9/site-packages/numpy/core/include/numpy/arrayobject.h:5,
                 from troute/network/reach.c:1209:
/usr/local/lib/python3.9/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
   17 | #warning "Using deprecated NumPy API, disable it with " \
      |  ^~~~~~~
gcc -pthread -shared build/temp.linux-aarch64-3.9/troute/network/reach.o -L/usr/local/lib -lgfortran -o /app/ngen/t-route/src/troute-network/troute/network/reach.cpython-39-aarch64-linux-gnu.so
building 'troute.network.reservoirs.levelpool.levelpool' extension
creating build/temp.linux-aarch64-3.9/troute/network/reservoirs
creating build/temp.linux-aarch64-3.9/troute/network/reservoirs/levelpool
gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -Itroute/network/reservoirs/levelpool -Itroute/network -I/usr/local/lib/python3.9/site-packages/numpy/core/include -Itroute/network/ -I/usr/local/include/python3.9 -c troute/network/reservoirs/levelpool/levelpool.c -o build/temp.linux-aarch64-3.9/troute/network/reservoirs/levelpool/levelpool.o -g -g
In file included from /usr/local/lib/python3.9/site-packages/numpy/core/include/numpy/ndarraytypes.h:1929,
                 from /usr/local/lib/python3.9/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,
                 from /usr/local/lib/python3.9/site-packages/numpy/core/include/numpy/arrayobject.h:5,
                 from troute/network/reservoirs/levelpool/levelpool.c:1219:
/usr/local/lib/python3.9/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
   17 | #warning "Using deprecated NumPy API, disable it with " \
      |  ^~~~~~~
troute/network/reservoirs/levelpool/levelpool.c: In function ‘__pyx_f_6troute_7network_10reservoirs_9levelpool_9levelpool_12MC_Levelpool_run’:
troute/network/reservoirs/levelpool/levelpool.c:20110:10: warning: ‘result.f1’ may be used uninitialized in this function [-Wmaybe-uninitialized]
20110 |   return __pyx_r;
      |          ^~~~~~~
troute/network/reservoirs/levelpool/levelpool.c:20110:10: warning: ‘result.f0’ may be used uninitialized in this function [-Wmaybe-uninitialized]
gcc -pthread -shared build/temp.linux-aarch64-3.9/troute/network/reservoirs/levelpool/levelpool.o ./libs/binding_lp.a -L/usr/local/lib -lnetcdff -lnetcdf -lgfortran -o /app/ngen/t-route/src/troute-network/troute/network/reservoirs/levelpool/levelpool.cpython-39-aarch64-linux-gnu.so
building 'troute.network.reservoirs.rfc.rfc' extension
creating build/temp.linux-aarch64-3.9/troute/network/reservoirs/rfc
gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -Itroute/network/reservoirs/rfc -Itroute/network -I/usr/local/lib/python3.9/site-packages/numpy/core/include -Itroute/network/ -I/usr/local/include/python3.9 -c troute/network/reservoirs/rfc/rfc.c -o build/temp.linux-aarch64-3.9/troute/network/reservoirs/rfc/rfc.o -g -g
In file included from /usr/local/lib/python3.9/site-packages/numpy/core/include/numpy/ndarraytypes.h:1929,
                 from /usr/local/lib/python3.9/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,
                 from /usr/local/lib/python3.9/site-packages/numpy/core/include/numpy/arrayobject.h:5,
                 from troute/network/reservoirs/rfc/rfc.c:1219:
/usr/local/lib/python3.9/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
   17 | #warning "Using deprecated NumPy API, disable it with " \
      |  ^~~~~~~
troute/network/reservoirs/rfc/rfc.c: In function ‘__pyx_f_6troute_7network_10reservoirs_3rfc_3rfc_6MC_RFC_run’:
troute/network/reservoirs/rfc/rfc.c:20386:10: warning: ‘result.f1’ may be used uninitialized in this function [-Wmaybe-uninitialized]
20386 |   return __pyx_r;
      |          ^~~~~~~
troute/network/reservoirs/rfc/rfc.c:20386:10: warning: ‘result.f0’ may be used uninitialized in this function [-Wmaybe-uninitialized]
gcc -pthread -shared build/temp.linux-aarch64-3.9/troute/network/reservoirs/rfc/rfc.o ./libs/bind_rfc.a -L/usr/local/lib -lnetcdff -lnetcdf -lgfortran -o /app/ngen/t-route/src/troute-network/troute/network/reservoirs/rfc/rfc.cpython-39-aarch64-linux-gnu.so
building 'troute.network.musking.mc_reach' extension
creating build/temp.linux-aarch64-3.9/troute/network/musking
gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -Itroute/network/musking -Itroute/network -I/usr/local/lib/python3.9/site-packages/numpy/core/include -Itroute/network/ -I/usr/local/include/python3.9 -c troute/network/musking/mc_reach.c -o build/temp.linux-aarch64-3.9/troute/network/musking/mc_reach.o -g -g
In file included from /usr/local/lib/python3.9/site-packages/numpy/core/include/numpy/ndarraytypes.h:1929,
                 from /usr/local/lib/python3.9/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,
                 from /usr/local/lib/python3.9/site-packages/numpy/core/include/numpy/arrayobject.h:5,
                 from troute/network/musking/mc_reach.c:1212:
/usr/local/lib/python3.9/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
   17 | #warning "Using deprecated NumPy API, disable it with " \
      |  ^~~~~~~
gcc -pthread -shared build/temp.linux-aarch64-3.9/troute/network/musking/mc_reach.o -L/usr/local/lib -lgfortran -o /app/ngen/t-route/src/troute-network/troute/network/musking/mc_reach.cpython-39-aarch64-linux-gnu.so
Obtaining file:///app/ngen/t-route/src/troute-network
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Installing collected packages: troute.network
  Attempting uninstall: troute.network
    Found existing installation: troute.network 0.0.0
    Uninstalling troute.network-0.0.0:
      Successfully uninstalled troute.network-0.0.0
  Running setup.py develop for troute.network
Successfully installed troute.network-0.0.0
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

[notice] A new release of pip is available: 23.0.1 -> 23.3.1
[notice] To update, run: pip install --upgrade pip
warning: troute/routing/fast_reach/mc_reach.pyx:143:60: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
performance hint: troute/routing/fast_reach/mc_reach.pyx:69:5: Exception check on 'compute_reach_kernel' will always require the GIL to be acquired.
Possible solutions:
        1. Declare the function as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions.
        2. Use an 'int' return type on the function to allow an error code to be returned.
performance hint: troute/routing/fast_reach/mc_reach.pyx:139:5: Exception check on 'fill_buffer_column' will always require the GIL to be acquired.
Possible solutions:
        1. Declare the function as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions.
        2. Use an 'int' return type on the function to allow an error code to be returned.

Error compiling Cython file:
------------------------------------------------------------
...
                lp_obj =  MC_Levelpool(
                    my_id[0],                        # index position of waterbody reach  
                    lake_numbers_col[wbody_index],   # lake number 
                    array('l',upstream_ids),         # upstream segment IDs
                    wbody_parameters[wbody_index],   # water body parameters
                    reservoir_types[wbody_index][0], # waterbody type code
                                   ^
------------------------------------------------------------

troute/routing/fast_reach/mc_reach.pyx:299:35: Compiler crash in AnalyseExpressionsTransform

ModuleNode.body = StatListNode(mc_reach.pyx:3:0)
StatListNode.stats[23] = StatListNode(mc_reach.pyx:163:6)
StatListNode.stats[0] = CFuncDefNode(mc_reach.pyx:163:6,
    args = [...]/51,
    doc = '\n    Compute network\n    Args:\n        nsteps (int): number of time steps\n        reaches_wTypes (list): List of tuples: (reach, reach_type), where reach_type is 0 for Muskingum Cunge reach and 1 is a reservoir\n        upstream_connections (dict): Network\n        data_idx (ndarray): a 1D sorted index for data_values\n        data_values (ndarray): a 2D array of data inputs (nodes x variables)\n        qlats (ndarray): a 2D array of qlat values (nodes x nsteps). The index must be shared with data_values\n        initial_conditions (ndarray): an n x 3 array of initial conditions. n = nodes, column 1 = qu0, column 2 = qd0, column 3 = h0\n        assume_short_ts (bool): Assume short time steps (quc = qup)\n    Notes:\n        Array dimensions are checked as a precondition to this method.\n        This version creates python objects for segments and reaches,\n        but then uses only the C structures and access for efficiency\n    ',
    modifiers = [...]/0,
    outer_attrs = [...]/2,
    overridable = 1,
    visibility = 'private')
File 'Nodes.py', line 397, in analyse_expressions: StatListNode(mc_reach.pyx:217:4,
    is_terminator = True)
File 'Nodes.py', line 7556, in analyse_expressions: ForInStatNode(mc_reach.pyx:278:4)
File 'Nodes.py', line 397, in analyse_expressions: StatListNode(mc_reach.pyx:279:8)
File 'Nodes.py', line 7137, in analyse_expressions: IfStatNode(mc_reach.pyx:282:8)
File 'Nodes.py', line 7184, in analyse_expressions: IfClauseNode(mc_reach.pyx:282:11)
File 'Nodes.py', line 397, in analyse_expressions: StatListNode(mc_reach.pyx:283:12)
File 'Nodes.py', line 7137, in analyse_expressions: IfStatNode(mc_reach.pyx:291:12)
File 'Nodes.py', line 7184, in analyse_expressions: IfClauseNode(mc_reach.pyx:291:15)
File 'Nodes.py', line 397, in analyse_expressions: StatListNode(mc_reach.pyx:294:16)
File 'Nodes.py', line 6026, in analyse_expressions: SingleAssignmentNode(mc_reach.pyx:294:38)
File 'Nodes.py', line 6158, in analyse_types: SingleAssignmentNode(mc_reach.pyx:294:38)
File 'ExprNodes.py', line 6121, in analyse_types: SimpleCallNode(mc_reach.pyx:294:38,
    analysed = True,
    result_is_used = True,
    use_managed_ref = True)
File 'ExprNodes.py', line 8488, in analyse_types: TupleNode(mc_reach.pyx:294:38,
    is_sequence_constructor = 1,
    result_is_used = True,
    use_managed_ref = True)
File 'ExprNodes.py', line 4082, in analyse_types: IndexNode(mc_reach.pyx:299:48,
    is_subscript = True,
    result_is_used = True,
    use_managed_ref = True)
File 'ExprNodes.py', line 4098, in analyse_base_and_index_types: IndexNode(mc_reach.pyx:299:48,
    is_subscript = True,
    result_is_used = True,
    use_managed_ref = True)
File 'ExprNodes.py', line 4082, in analyse_types: IndexNode(mc_reach.pyx:299:35,
    is_subscript = True,
    result_is_used = True,
    use_managed_ref = True)
File 'ExprNodes.py', line 4123, in analyse_base_and_index_types: IndexNode(mc_reach.pyx:299:35,
    is_subscript = True,
    result_is_used = True,
    use_managed_ref = True)
File 'ExprNodes.py', line 4349, in analyse_as_buffer_operation: IndexNode(mc_reach.pyx:299:35,
    is_subscript = True,
    result_is_used = True,
    use_managed_ref = True)
File 'ExprNodes.py', line 4968, in analyse_types: MemoryViewSliceNode(mc_reach.pyx:299:35,
    is_memview_slice = True,
    memslice_index = True,
    result_is_used = True,
    use_managed_ref = True)

Compiler crash traceback from this point on:
  File "/usr/local/lib/python3.9/site-packages/Cython/Compiler/ExprNodes.py", line 4968, in analyse_types
    performance_hint(index.pos, "Index should be typed for more efficient access")
TypeError: performance_hint() missing 1 required positional argument: 'env'
Fortran compiler type is: gnu95
Compiling troute/routing/fast_reach/reach.pyx because it changed.
Compiling troute/routing/fast_reach/mc_reach.pyx because it changed.
Compiling troute/routing/fast_reach/diffusive.pyx because it changed.
Compiling troute/routing/fast_reach/simple_da.pyx because it changed.
[1/4] Cythonizing troute/routing/fast_reach/diffusive.pyx
[2/4] Cythonizing troute/routing/fast_reach/mc_reach.pyx
Traceback (most recent call last):
  File "/app/ngen/t-route/src/troute-routing/setup.py", line 122, in <module>
    ext_modules = cythonize(ext_modules, compiler_directives={"language_level": 3})
  File "/usr/local/lib/python3.9/site-packages/Cython/Build/Dependencies.py", line 1154, in cythonize
    cythonize_one(*args)
  File "/usr/local/lib/python3.9/site-packages/Cython/Build/Dependencies.py", line 1321, in cythonize_one
    raise CompileError(None, pyx_file)
Cython.Compiler.Errors.CompileError: troute/routing/fast_reach/mc_reach.pyx
@aaraney
Copy link
Member Author

aaraney commented Oct 30, 2023

This appears to be a regression that has been resolved in 3.0.5 (unreleased). T-route built correctly from a source build of Cython at cython/cython@f697dec.

@aaraney
Copy link
Member Author

aaraney commented Jun 13, 2024

cython==3.0.5 was released in late October of 2023. I just verified that t-route compiles with this version. Testing other versions now, but we likely can change t-route's pinning of cython.

@aaraney
Copy link
Member Author

aaraney commented Jun 13, 2024

Just verified that >=3.0.5 works just fine.

aaraney added a commit to aaraney/t-route that referenced this issue Jun 13, 2024
JurgenZach-NOAA added a commit that referenced this issue Sep 5, 2024
The non-editable flag:
./compiler.sh no-e
is no longer necessary 

(see #675 for details)
JurgenZach-NOAA added a commit that referenced this issue Sep 6, 2024
The non-editable flag:
./compiler.sh no-e
is no longer necessary 

(see #675 for details)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant