Skip to content

Commit

Permalink
cython 3 compatibility fixes (smdogroup#231)
Browse files Browse the repository at this point in the history
* cython 3 fixes

* Fixing minor omissions

* Fixing issue w/ int in rbe2 wrapper

* Bumping cython build lower bound to 3.0.0

* Update cython req in conda meta.yaml

* Moving smeared composite header to cython header files

* Remove debug printing for smeared composite test

---------

Co-authored-by: Graeme Kennedy <[email protected]>
  • Loading branch information
timryanb and gjkennedy authored Jul 28, 2023
1 parent 2ca603e commit 15804d0
Show file tree
Hide file tree
Showing 18 changed files with 1,539 additions and 1,440 deletions.
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ default:
fi
${CXX} ${SO_LINK_FLAGS} ${TACS_OBJS} ${TACS_EXTERN_LIBS} -o ${TACS_DIR}/lib/libtacs.${SO_EXT}
@if [ "${TACS_IS_COMPLEX}" = "true" ]; then \
echo "ctypedef complex TacsScalar" > tacs/TacsTypedefs.pxi; \
echo "ctypedef complex TacsScalar" > tacs/cpp_headers/TacsTypedefs.pxi; \
echo "TACS_NPY_SCALAR = np.NPY_CDOUBLE" > tacs/TacsDefs.pxi; \
echo "dtype = complex" >> tacs/TacsDefs.pxi; \
else \
echo "ctypedef double TacsScalar" > tacs/TacsTypedefs.pxi; \
echo "ctypedef double TacsScalar" > tacs/cpp_headers/TacsTypedefs.pxi; \
echo "TACS_NPY_SCALAR = np.NPY_DOUBLE" > tacs/TacsDefs.pxi; \
echo "dtype = np.double" >> tacs/TacsDefs.pxi; \
fi
Expand All @@ -60,11 +60,11 @@ debug:
fi
${CXX} ${SO_LINK_FLAGS} ${TACS_OBJS} ${TACS_EXTERN_LIBS} -o ${TACS_DIR}/lib/libtacs.${SO_EXT}
@if [ "${TACS_IS_COMPLEX}" = "true" ]; then \
echo "ctypedef complex TacsScalar" > tacs/TacsTypedefs.pxi; \
echo "ctypedef complex TacsScalar" > tacs/cpp_headers/TacsTypedefs.pxi; \
echo "TACS_NPY_SCALAR = np.NPY_CDOUBLE" > tacs/TacsDefs.pxi; \
echo "dtype = complex" >> tacs/TacsDefs.pxi; \
else \
echo "ctypedef double TacsScalar" > tacs/TacsTypedefs.pxi; \
echo "ctypedef double TacsScalar" > tacs/cpp_headers/TacsTypedefs.pxi; \
echo "TACS_NPY_SCALAR = np.NPY_DOUBLE" > tacs/TacsDefs.pxi; \
echo "dtype = np.double" >> tacs/TacsDefs.pxi; \
fi
Expand Down
2 changes: 1 addition & 1 deletion conda/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ requirements:
- metis ==5.1.0
- tecio
- mpi4py
- cython >=0.29,<3.0
- cython >=3.0.0
- setuptools

run:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pyproject.toml
[build-system]
# Minimum requirements for the build system to execute.
requires = ['setuptools>=45.0', 'wheel', 'cython>=0.29,<3.0', 'oldest-supported-numpy',
requires = ['setuptools>=45.0', 'wheel', 'cython>=3.0.0', 'oldest-supported-numpy',
# Build against an old version (3.1.1) of mpi4py for forward compatibility
"mpi4py==3.1.1; python_version<'3.11'",
# Python 3.11 requires 3.1.4+
Expand Down
Loading

0 comments on commit 15804d0

Please sign in to comment.