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

Has anyone tried a Python 3.11 conda package build yet? #1632

Closed
swails opened this issue May 24, 2023 · 11 comments
Closed

Has anyone tried a Python 3.11 conda package build yet? #1632

swails opened this issue May 24, 2023 · 11 comments

Comments

@swails
Copy link
Contributor

swails commented May 24, 2023

Attempts to do this for AmberTools 23 are failing.

build log here: https://dev.azure.com/conda-forge/feedstock-builds/_build/results?buildId=700933&view=logs&j=9a864fd9-6c8f-52ca-79ce-2aa6dca1a1de&t=10fc5aa2-324e-5982-4c88-6b31fcab16b3)

PR here: conda-forge/ambertools-feedstock#113

@hainm
Copy link
Contributor

hainm commented May 24, 2023

I have not tried with python 3.11 yet.

pytraj/trajectory/frame.cpp:45333:1: error: too many initializers for 'PyTypeObject' {aka '_typeobject'}

frame.cpp file is generated by cython and that file is included in the release. wondering if we can have better luck with latest cython version?

@DrDomenicoMarson
Copy link
Contributor

Hi,
I can confirm that I have the same issue building amber23 in an Anaconda environment with python 3.11.3 + cython 0.29.35.

Is there some workaround that can be done to successfully build pytraj? I'd hate to have to disable its installation!

@swails
Copy link
Contributor Author

swails commented Jun 8, 2023

Update cython and recythonize the files?

I haven't had a chance to try it out yet.

@DrDomenicoMarson
Copy link
Contributor

Unfortunatelly I don't know how to do that (I'm not compiling from pytraj git repo, but from AmberTools23).

To briefly describe what I've done:

  • I created a conda environment with python3.11

  • added cython, numpy, mpi4py, and other dependencies

  • ran cmake (python is successfully found)

  • when running make install the above errors stop the installation, while if I exclude pytraj from the required packages, everything is compiled successfully!

Doesn't the cmake procedure cythonize the files with the available cython?

@hainm
Copy link
Contributor

hainm commented Jun 9, 2023 via email

@DrDomenicoMarson
Copy link
Contributor

Hi! I'm sorry to bother you on vacation!

I tried as you suggested, but the same error

pytraj/core/c_dict.cpp:460:62: error: invalid use of incomplete type 'PyFrameObject' {aka 'struct _frame'}

unfortunatelly arise...

I checked the make output, and indeed the is_release seems to be recognized. I just paste here the relevant part of the make output, because another warning is also raised:

[ 79%] Building pytraj native library
sys.argv ['setup.py', 'build', '-b', '/opt/amber22_src/build/AmberTools/src/pytraj/CMakeFiles/python-build']
Original compiler envs
CXX = /opt/anaconda3/envs/p11/bin/g++
CC = /opt/anaconda3/envs/p11/bin/gcc
COMPILER = 
use_pip = False, cpptraj_home = 
compile_c_extension = True
2.0.6.dev0
use_prebuilt_cythonized_files =  False
[ 82%] Built target sander_base_obj_omp
pytraj is inside AMBERHOME
using environment: CC=/opt/anaconda3/envs/p11/bin/gcc, CXX=/opt/anaconda3/envs/p11/bin/g++
using CC=/opt/anaconda3/envs/p11/bin/gcc, CXX=/opt/anaconda3/envs/p11/bin/g++
Final compiler envs
CXX = /opt/anaconda3/envs/p11/bin/g++
CC = /opt/anaconda3/envs/p11/bin/gcc
COMPILER = 
install = True
set rpath to /opt/amber22_src/build/AmberTools/src/cpptraj/src
/opt/anaconda3/envs/p11/lib/python3.11/site-packages/setuptools/dist.py:755: SetuptoolsDeprecationWarning: Invalid dash-separated options
!!

        ********************************************************************************
        Usage of dash-separated 'description-file' will not be supported in future
        versions. Please use the underscore name 'description_file' instead.

        By 2023-Sep-26, you need to update your project and remove deprecated calls
        or your builds will no longer be supported.

        See https://setuptools.pypa.io/en/latest/userguide/declarative_config.html for details.
        ********************************************************************************

!!
  opt = self.warn_dash_deprecation(opt, section)
running build
running build_py
copying pytraj/version.py -> /opt/amber22_src/build/AmberTools/src/pytraj/CMakeFiles/python-build/lib.linux-x86_64-cpython-311/pytraj
running build_ext
skipping 'pytraj/analysis/c_analysis/c_analysis.cpp' Cython extension (up-to-date)
skipping 'pytraj/analysis/c_action/actionlist.cpp' Cython extension (up-to-date)
skipping 'pytraj/analysis/c_action/c_action.cpp' Cython extension (up-to-date)
skipping 'pytraj/math/cpp_math.cpp' Cython extension (up-to-date)
skipping 'pytraj/topology/topology.cpp' Cython extension (up-to-date)
skipping 'pytraj/core/topology_objects.cpp' Cython extension (up-to-date)
skipping 'pytraj/core/coordinfo.cpp' Cython extension (up-to-date)
skipping 'pytraj/core/parameter_types.cpp' Cython extension (up-to-date)
skipping 'pytraj/core/c_dict.cpp' Cython extension (up-to-date)
skipping 'pytraj/core/c_options.cpp' Cython extension (up-to-date)
skipping 'pytraj/core/box.cpp' Cython extension (up-to-date)
skipping 'pytraj/core/c_core.cpp' Cython extension (up-to-date)
skipping 'pytraj/utils/cyutils.cpp' Cython extension (up-to-date)
skipping 'pytraj/datafiles/datafiles.cpp' Cython extension (up-to-date)
skipping 'pytraj/datasets/c_datasetlist.cpp' Cython extension (up-to-date)
skipping 'pytraj/datasets/c_datasets.cpp' Cython extension (up-to-date)
skipping 'pytraj/datasets/cast_dataset.cpp' Cython extension (up-to-date)
skipping 'pytraj/trajectory/frame.cpp' Cython extension (up-to-date)
skipping 'pytraj/trajectory/c_traj/c_trajout.cpp' Cython extension (up-to-date)
skipping 'pytraj/trajectory/c_traj/c_trajectory.cpp' Cython extension (up-to-date)
building 'pytraj.core.c_dict' extension

@hainm
Copy link
Contributor

hainm commented Jun 9, 2023 via email

@hainm
Copy link
Contributor

hainm commented Jun 10, 2023 via email

@DrDomenicoMarson
Copy link
Contributor

Just a quick update, deleting all the *.cpp files in the src/pytraj/pytraj directory worked fine with python3.11!

(I also had scripts/base_setup.py with is_release setted to False)

@hainm
Copy link
Contributor

hainm commented Jun 12, 2023 via email

@hainm
Copy link
Contributor

hainm commented Jun 20, 2023

I think we can close this case since the question is answered. #1632 (comment)

Further discussions are happening in https://github.com/conda-forge/ambertools-feedstock

@hainm hainm closed this as completed Jun 20, 2023
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

No branches or pull requests

3 participants