lesgourg/class_public

cc1: fatal error: classy/python/../python/classy.c: No such file or directory

akonvisher opened this issue · 5 comments

Hello. During the build or make python module I am getting error:
cc1: fatal error: /home/labs/testlab/alexkon/singularity/ubuntu22.04_clean/classy/classy/classy2.10/class_public-2.10/python/../python/classy.c: No such file or directory
compilation terminated.
error: command '/usr/bin/gcc' failed with exit code 1
And actually classy.c is not presented in any place.
I am getting this message during make, cd python; python setup.py build and even when I am running cobaya install by: cobaya-install cosmo -p cosmo_packages
What can cause to it and how to solve?
Thanks.
Alexey Konvisher

Does the python folder get created, when you are in the CLASS folder, and rebuild the project?

cd CLASS
make clean; make

The make clean deletes files from previous build attempts. make (and not make class(!)) builds the project including the python wrapper. This should create the required python folder and the files therein.

Thank you for your really quick response.
Of course, I did it.
See the full listing:
Singularity> make clean;make
rm -rf /home/labs/testlab/alexkon/singularity/ubuntu22.04_clean/classy/cosmo_packages-alexey/code/classy/build;
rm -f libclass.a
rm -f /home/labs/testlab/alexkon/singularity/ubuntu22.04_clean/classy/cosmo_packages-alexey/code/classy/python/classy.c
rm -rf /home/labs/testlab/alexkon/singularity/ubuntu22.04_clean/classy/cosmo_packages-alexey/code/classy/python/build
rm -f python/autosetup.py
if ! [ -e /home/labs/testlab/alexkon/singularity/ubuntu22.04_clean/classy/cosmo_packages-alexey/code/classy/build ]; then mkdir /home/labs/testlab/alexkon/singularity/ubuntu22.04_clean/classy/cosmo_packages-alexey/code/classy/build ; mkdir /home/labs/testlab/alexkon/singularity/ubuntu22.04_clean/classy/cosmo_packages-alexey/code/classy/build/lib; fi;
touch build/.base
cd /home/labs/testlab/alexkon/singularity/ubuntu22.04_clean/classy/cosmo_packages-alexey/code/classy/build;gcc -O3 -fopenmp -g -fPIC -D__CLASSDIR__='"/home/labs/testlab/alexkon/singularity/ubuntu22.04_clean/classy/cosmo_packages-alexey/code/classy"' -DHYREC -I../include -I../external/RecfastCLASS -I../external/heating -I../external/HyRec2020 -c ../tools/growTable.c -o growTable.o
cd /home/labs/testlab/alexkon/singularity/ubuntu22.04_clean/classy/cosmo_packages-alexey/code/classy/build;gcc -O3 -fopenmp -g -fPIC -D__CLASSDIR__='"/home/labs/testlab/alexkon/singularity/ubuntu22.04_clean/classy/cosmo_packages-alexey/code/classy"' -DHYREC -I../include -I../external/RecfastCLASS -I../external/heating -I../external/HyRec2020 -c ../tools/dei_rkck.c -o dei_rkck.o
cd /home/labs/testlab/alexkon/singularity/ubuntu22.04_clean/classy/cosmo_packages-alexey/code/classy/build;gcc -O3 -fopenmp -g -fPIC -D__CLASSDIR__='"/home/labs/testlab/alexkon/singularity/ubuntu22.04_clean/classy/cosmo_packages-alexey/code/classy"' -DHYREC -I../include -I../external/RecfastCLASS -I../external/heating -I../external/HyRec2020 -c ../tools/sparse.c -o sparse.o
cd /home/labs/testlab/alexkon/singularity/ubuntu22.04_clean/classy/cosmo_packages-alexey/code/classy/build;gcc -O3 -fopenmp -g -fPIC -D__CLASSDIR__='"/home/labs/testlab/alexkon/singularity/ubuntu22.04_clean/classy/cosmo_packages-alexey/code/classy"' -DHYREC -I../include -I../external/RecfastCLASS -I../external/heating -I../external/HyRec2020 -c ../tools/evolver_rkck.c -o evolver_rkck.o
cd /home/labs/testlab/alexkon/singularity/ubuntu22.04_clean/classy/cosmo_packages-alexey/code/classy/build;gcc -O3 -fopenmp -g -fPIC -D__CLASSDIR__='"/home/labs/testlab/alexkon/singularity/ubuntu22.04_clean/classy/cosmo_packages-alexey/code/classy"' -DHYREC -I../include -I../external/RecfastCLASS -I../external/heating -I../external/HyRec2020 -c ../tools/evolver_ndf15.c -o evolver_ndf15.o
cd /home/labs/testlab/alexkon/singularity/ubuntu22.04_clean/classy/cosmo_packages-alexey/code/classy/build;gcc -O3 -fopenmp -g -fPIC -D__CLASSDIR__='"/home/labs/testlab/alexkon/singularity/ubuntu22.04_clean/classy/cosmo_packages-alexey/code/classy"' -DHYREC -I../include -I../external/RecfastCLASS -I../external/heating -I../external/HyRec2020 -c ../tools/arrays.c -o arrays.o
cd /home/labs/testlab/alexkon/singularity/ubuntu22.04_clean/classy/cosmo_packages-alexey/code/classy/build;gcc -O3 -fopenmp -g -fPIC -D__CLASSDIR__='"/home/labs/testlab/alexkon/singularity/ubuntu22.04_clean/classy/cosmo_packages-alexey/code/classy"' -DHYREC -I../include -I../external/RecfastCLASS -I../external/heating -I../external/HyRec2020 -c ../tools/parser.c -o parser.o
cd /home/labs/testlab/alexkon/singularity/ubuntu22.04_clean/classy/cosmo_packages-alexey/code/classy/build;gcc -O3 -fopenmp -g -fPIC -D__CLASSDIR__='"/home/labs/testlab/alexkon/singularity/ubuntu22.04_clean/classy/cosmo_packages-alexey/code/classy"' -DHYREC -I../include -I../external/RecfastCLASS -I../external/heating -I../external/HyRec2020 -c ../tools/quadrature.c -o quadrature.o
cd /home/labs/testlab/alexkon/singularity/ubuntu22.04_clean/classy/cosmo_packages-alexey/code/classy/build;gcc -O3 -fopenmp -g -fPIC -D__CLASSDIR__='"/home/labs/testlab/alexkon/singularity/ubuntu22.04_clean/classy/cosmo_packages-alexey/code/classy"' -DHYREC -I../include -I../external/RecfastCLASS -I../external/heating -I../external/HyRec2020 -c ../tools/hyperspherical.c -o hyperspherical.o
cd /home/labs/testlab/alexkon/singularity/ubuntu22.04_clean/classy/cosmo_packages-alexey/code/classy/build;gcc -O3 -fopenmp -g -fPIC -D__CLASSDIR__='"/home/labs/testlab/alexkon/singularity/ubuntu22.04_clean/classy/cosmo_packages-alexey/code/classy"' -DHYREC -I../include -I../external/RecfastCLASS -I../external/heating -I../external/HyRec2020 -c ../tools/common.c -o common.o
cd /home/labs/testlab/alexkon/singularity/ubuntu22.04_clean/classy/cosmo_packages-alexey/code/classy/build;gcc -O3 -fopenmp -g -fPIC -D__CLASSDIR__='"/home/labs/testlab/alexkon/singularity/ubuntu22.04_clean/classy/cosmo_packages-alexey/code/classy"' -DHYREC -I../include -I../external/RecfastCLASS -I../external/heating -I../external/HyRec2020 -c ../tools/trigonometric_integrals.c -o trigonometric_integrals.o
cd /home/labs/testlab/alexkon/singularity/ubuntu22.04_clean/classy/cosmo_packages-alexey/code/classy/build;gcc -O3 -fopenmp -g -fPIC -D__CLASSDIR__='"/home/labs/testlab/alexkon/singularity/ubuntu22.04_clean/classy/cosmo_packages-alexey/code/classy"' -DHYREC -I../include -I../external/RecfastCLASS -I../external/heating -I../external/HyRec2020 -c ../source/input.c -o input.o
cd /home/labs/testlab/alexkon/singularity/ubuntu22.04_clean/classy/cosmo_packages-alexey/code/classy/build;gcc -O3 -fopenmp -g -fPIC -D__CLASSDIR__='"/home/labs/testlab/alexkon/singularity/ubuntu22.04_clean/classy/cosmo_packages-alexey/code/classy"' -DHYREC -I../include -I../external/RecfastCLASS -I../external/heating -I../external/HyRec2020 -c ../source/background.c -o background.o
cd /home/labs/testlab/alexkon/singularity/ubuntu22.04_clean/classy/cosmo_packages-alexey/code/classy/build;gcc -O3 -fopenmp -g -fPIC -D__CLASSDIR__='"/home/labs/testlab/alexkon/singularity/ubuntu22.04_clean/classy/cosmo_packages-alexey/code/classy"' -DHYREC -I../include -I../external/RecfastCLASS -I../external/heating -I../external/HyRec2020 -c ../source/thermodynamics.c -o thermodynamics.o
cd /home/labs/testlab/alexkon/singularity/ubuntu22.04_clean/classy/cosmo_packages-alexey/code/classy/build;gcc -O3 -fopenmp -g -fPIC -D__CLASSDIR__='"/home/labs/testlab/alexkon/singularity/ubuntu22.04_clean/classy/cosmo_packages-alexey/code/classy"' -DHYREC -I../include -I../external/RecfastCLASS -I../external/heating -I../external/HyRec2020 -c ../source/perturbations.c -o perturbations.o
cd /home/labs/testlab/alexkon/singularity/ubuntu22.04_clean/classy/cosmo_packages-alexey/code/classy/build;gcc -O3 -fopenmp -g -fPIC -D__CLASSDIR__='"/home/labs/testlab/alexkon/singularity/ubuntu22.04_clean/classy/cosmo_packages-alexey/code/classy"' -DHYREC -I../include -I../external/RecfastCLASS -I../external/heating -I../external/HyRec2020 -c ../source/primordial.c -o primordial.o
cd /home/labs/testlab/alexkon/singularity/ubuntu22.04_clean/classy/cosmo_packages-alexey/code/classy/build;gcc -O3 -fopenmp -g -fPIC -D__CLASSDIR__='"/home/labs/testlab/alexkon/singularity/ubuntu22.04_clean/classy/cosmo_packages-alexey/code/classy"' -DHYREC -I../include -I../external/RecfastCLASS -I../external/heating -I../external/HyRec2020 -c ../source/fourier.c -o fourier.o
cd /home/labs/testlab/alexkon/singularity/ubuntu22.04_clean/classy/cosmo_packages-alexey/code/classy/build;gcc -O3 -fopenmp -g -fPIC -D__CLASSDIR__='"/home/labs/testlab/alexkon/singularity/ubuntu22.04_clean/classy/cosmo_packages-alexey/code/classy"' -DHYREC -I../include -I../external/RecfastCLASS -I../external/heating -I../external/HyRec2020 -c ../source/transfer.c -o transfer.o
cd /home/labs/testlab/alexkon/singularity/ubuntu22.04_clean/classy/cosmo_packages-alexey/code/classy/build;gcc -O3 -fopenmp -g -fPIC -D__CLASSDIR__='"/home/labs/testlab/alexkon/singularity/ubuntu22.04_clean/classy/cosmo_packages-alexey/code/classy"' -DHYREC -I../include -I../external/RecfastCLASS -I../external/heating -I../external/HyRec2020 -c ../source/harmonic.c -o harmonic.o
cd /home/labs/testlab/alexkon/singularity/ubuntu22.04_clean/classy/cosmo_packages-alexey/code/classy/build;gcc -O3 -fopenmp -g -fPIC -D__CLASSDIR__='"/home/labs/testlab/alexkon/singularity/ubuntu22.04_clean/classy/cosmo_packages-alexey/code/classy"' -DHYREC -I../include -I../external/RecfastCLASS -I../external/heating -I../external/HyRec2020 -c ../source/lensing.c -o lensing.o
cd /home/labs/testlab/alexkon/singularity/ubuntu22.04_clean/classy/cosmo_packages-alexey/code/classy/build;gcc -O3 -fopenmp -g -fPIC -D__CLASSDIR__='"/home/labs/testlab/alexkon/singularity/ubuntu22.04_clean/classy/cosmo_packages-alexey/code/classy"' -DHYREC -I../include -I../external/RecfastCLASS -I../external/heating -I../external/HyRec2020 -c ../source/distortions.c -o distortions.o
cd /home/labs/testlab/alexkon/singularity/ubuntu22.04_clean/classy/cosmo_packages-alexey/code/classy/build;gcc -O3 -fopenmp -g -fPIC -D__CLASSDIR__='"/home/labs/testlab/alexkon/singularity/ubuntu22.04_clean/classy/cosmo_packages-alexey/code/classy"' -DHYREC -I../include -I../external/RecfastCLASS -I../external/heating -I../external/HyRec2020 -c ../external/RecfastCLASS/wrap_recfast.c -o wrap_recfast.o
cd /home/labs/testlab/alexkon/singularity/ubuntu22.04_clean/classy/cosmo_packages-alexey/code/classy/build;gcc -O3 -fopenmp -g -fPIC -D__CLASSDIR__='"/home/labs/testlab/alexkon/singularity/ubuntu22.04_clean/classy/cosmo_packages-alexey/code/classy"' -DHYREC -I../include -I../external/RecfastCLASS -I../external/heating -I../external/HyRec2020 -c ../external/heating/injection.c -o injection.o
cd /home/labs/testlab/alexkon/singularity/ubuntu22.04_clean/classy/cosmo_packages-alexey/code/classy/build;gcc -O3 -fopenmp -g -fPIC -D__CLASSDIR__='"/home/labs/testlab/alexkon/singularity/ubuntu22.04_clean/classy/cosmo_packages-alexey/code/classy"' -DHYREC -I../include -I../external/RecfastCLASS -I../external/heating -I../external/HyRec2020 -c ../external/heating/noninjection.c -o noninjection.o
cd /home/labs/testlab/alexkon/singularity/ubuntu22.04_clean/classy/cosmo_packages-alexey/code/classy/build;gcc -O3 -fopenmp -g -fPIC -D__CLASSDIR__='"/home/labs/testlab/alexkon/singularity/ubuntu22.04_clean/classy/cosmo_packages-alexey/code/classy"' -DHYREC -I../include -I../external/RecfastCLASS -I../external/heating -I../external/HyRec2020 -c ../external/HyRec2020/hyrectools.c -o hyrectools.o
cd /home/labs/testlab/alexkon/singularity/ubuntu22.04_clean/classy/cosmo_packages-alexey/code/classy/build;gcc -O3 -fopenmp -g -fPIC -D__CLASSDIR__='"/home/labs/testlab/alexkon/singularity/ubuntu22.04_clean/classy/cosmo_packages-alexey/code/classy"' -DHYREC -I../include -I../external/RecfastCLASS -I../external/heating -I../external/HyRec2020 -c ../external/HyRec2020/helium.c -o helium.o
cd /home/labs/testlab/alexkon/singularity/ubuntu22.04_clean/classy/cosmo_packages-alexey/code/classy/build;gcc -O3 -fopenmp -g -fPIC -D__CLASSDIR__='"/home/labs/testlab/alexkon/singularity/ubuntu22.04_clean/classy/cosmo_packages-alexey/code/classy"' -DHYREC -I../include -I../external/RecfastCLASS -I../external/heating -I../external/HyRec2020 -c ../external/HyRec2020/hydrogen.c -o hydrogen.o
cd /home/labs/testlab/alexkon/singularity/ubuntu22.04_clean/classy/cosmo_packages-alexey/code/classy/build;gcc -O3 -fopenmp -g -fPIC -D__CLASSDIR__='"/home/labs/testlab/alexkon/singularity/ubuntu22.04_clean/classy/cosmo_packages-alexey/code/classy"' -DHYREC -I../include -I../external/RecfastCLASS -I../external/heating -I../external/HyRec2020 -c ../external/HyRec2020/history.c -o history.o
cd /home/labs/testlab/alexkon/singularity/ubuntu22.04_clean/classy/cosmo_packages-alexey/code/classy/build;gcc -O3 -fopenmp -g -fPIC -D__CLASSDIR__='"/home/labs/testlab/alexkon/singularity/ubuntu22.04_clean/classy/cosmo_packages-alexey/code/classy"' -DHYREC -I../include -I../external/RecfastCLASS -I../external/heating -I../external/HyRec2020 -c ../external/HyRec2020/wrap_hyrec.c -o wrap_hyrec.o
cd /home/labs/testlab/alexkon/singularity/ubuntu22.04_clean/classy/cosmo_packages-alexey/code/classy/build;gcc -O3 -fopenmp -g -fPIC -D__CLASSDIR__='"/home/labs/testlab/alexkon/singularity/ubuntu22.04_clean/classy/cosmo_packages-alexey/code/classy"' -DHYREC -I../include -I../external/RecfastCLASS -I../external/heating -I../external/HyRec2020 -c ../external/HyRec2020/energy_injection.c -o energy_injection.o
cd /home/labs/testlab/alexkon/singularity/ubuntu22.04_clean/classy/cosmo_packages-alexey/code/classy/build;gcc -O3 -fopenmp -g -fPIC -D__CLASSDIR__='"/home/labs/testlab/alexkon/singularity/ubuntu22.04_clean/classy/cosmo_packages-alexey/code/classy"' -DHYREC -I../include -I../external/RecfastCLASS -I../external/heating -I../external/HyRec2020 -c ../source/output.c -o output.o
cd /home/labs/testlab/alexkon/singularity/ubuntu22.04_clean/classy/cosmo_packages-alexey/code/classy/build;gcc -O3 -fopenmp -g -fPIC -D__CLASSDIR__='"/home/labs/testlab/alexkon/singularity/ubuntu22.04_clean/classy/cosmo_packages-alexey/code/classy"' -DHYREC -I../include -I../external/RecfastCLASS -I../external/heating -I../external/HyRec2020 -c ../main/class.c -o class.o
gcc -O3 -fopenmp -g -fPIC -o class build/growTable.o build/dei_rkck.o build/sparse.o build/evolver_rkck.o build/evolver_ndf15.o build/arrays.o build/parser.o build/quadrature.o build/hyperspherical.o build/common.o build/trigonometric_integrals.o build/input.o build/background.o build/thermodynamics.o build/perturbations.o build/primordial.o build/fourier.o build/transfer.o build/harmonic.o build/lensing.o build/distortions.o build/wrap_recfast.o build/injection.o build/noninjection.o build/hyrectools.o build/helium.o build/hydrogen.o build/history.o build/wrap_hyrec.o build/energy_injection.o build/output.o build/class.o -lm
ar rv libclass.a build/growTable.o build/dei_rkck.o build/sparse.o build/evolver_rkck.o build/evolver_ndf15.o build/arrays.o build/parser.o build/quadrature.o build/hyperspherical.o build/common.o build/trigonometric_integrals.o build/input.o build/background.o build/thermodynamics.o build/perturbations.o build/primordial.o build/fourier.o build/transfer.o build/harmonic.o build/lensing.o build/distortions.o build/wrap_recfast.o build/injection.o build/noninjection.o build/hyrectools.o build/helium.o build/hydrogen.o build/history.o build/wrap_hyrec.o build/energy_injection.o
ar: creating libclass.a
a - build/growTable.o
a - build/dei_rkck.o
a - build/sparse.o
a - build/evolver_rkck.o
a - build/evolver_ndf15.o
a - build/arrays.o
a - build/parser.o
a - build/quadrature.o
a - build/hyperspherical.o
a - build/common.o
a - build/trigonometric_integrals.o
a - build/input.o
a - build/background.o
a - build/thermodynamics.o
a - build/perturbations.o
a - build/primordial.o
a - build/fourier.o
a - build/transfer.o
a - build/harmonic.o
a - build/lensing.o
a - build/distortions.o
a - build/wrap_recfast.o
a - build/injection.o
a - build/noninjection.o
a - build/hyrectools.o
a - build/helium.o
a - build/hydrogen.o
a - build/history.o
a - build/wrap_hyrec.o
a - build/energy_injection.o
cp python/setup.py python/autosetup.py
cd python; export CC=gcc; python autosetup.py install || python autosetup.py install --user
/usr/local/bin/miniconda3/envs/cobaya-new2/lib/python3.8/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.
!!

    ********************************************************************************
    Please avoid running ``setup.py`` directly.
    Instead, use pypa/build, pypa/installer or other
    standards-based tools.

    See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
    ********************************************************************************

!!
self.initialize_options()
/usr/local/bin/miniconda3/envs/cobaya-new2/lib/python3.8/site-packages/setuptools/_distutils/cmd.py:66: EasyInstallDeprecationWarning: easy_install command is deprecated.
!!

    ********************************************************************************
    Please avoid running ``setup.py`` and ``easy_install``.
    Instead, use pypa/build, pypa/installer or other
    standards-based tools.

    See https://github.com/pypa/setuptools/issues/917 for details.
    ********************************************************************************

!!
self.initialize_options()

Error compiling Cython file:

...
cdef output op
cdef lensing le
cdef distortions sd
cdef file_content fc

cpdef int computed # Flag to see if classy has already computed with the given pars
     ^

classy.pyx:103:10: Variables cannot be declared with 'cpdef'. Use 'cdef' instead.

Error compiling Cython file:

...
cdef lensing le
cdef distortions sd
cdef file_content fc

cpdef int computed # Flag to see if classy has already computed with the given pars
cpdef int allocated # Flag to see if classy structs are allocated already
     ^

classy.pyx:104:10: Variables cannot be declared with 'cpdef'. Use 'cdef' instead.

Error compiling Cython file:

...
cdef distortions sd
cdef file_content fc

cpdef int computed # Flag to see if classy has already computed with the given pars
cpdef int allocated # Flag to see if classy structs are allocated already
cpdef object _pars # Dictionary of the parameters
     ^

classy.pyx:105:10: Variables cannot be declared with 'cpdef'. Use 'cdef' instead.

Error compiling Cython file:

...
cdef file_content fc

cpdef int computed # Flag to see if classy has already computed with the given pars
cpdef int allocated # Flag to see if classy structs are allocated already
cpdef object _pars # Dictionary of the parameters
cpdef object ncp   # Keeps track of the structures initialized, in view of cleaning.
     ^

classy.pyx:106:10: Variables cannot be declared with 'cpdef'. Use 'cdef' instead.

Error compiling Cython file:

...
_pars = {
"output":"tCl mPk",}
self.set(**_pars)

def __cinit__(self, default=False):
    cpdef char* dumc
         ^

classy.pyx:131:14: Variables cannot be declared with 'cpdef'. Use 'cdef' instead.
warning: classy.pyx:361:76: local variable 'errmsg' referenced before assignment
warning: classy.pyx:362:39: local variable 'errmsg' referenced before assignment
cc1: fatal error: /home/labs/testlab/alexkon/singularity/ubuntu22.04_clean/classy/cosmo_packages-alexey/code/classy/python/../python/classy.c: No such file or directory
compilation terminated.
error: command '/usr/bin/gcc' failed with exit code 1
/usr/local/bin/miniconda3/envs/cobaya-new2/lib/python3.8/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.
!!

    ********************************************************************************
    Please avoid running ``setup.py`` directly.
    Instead, use pypa/build, pypa/installer or other
    standards-based tools.

    See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
    ********************************************************************************

!!
self.initialize_options()
/usr/local/bin/miniconda3/envs/cobaya-new2/lib/python3.8/site-packages/setuptools/_distutils/cmd.py:66: EasyInstallDeprecationWarning: easy_install command is deprecated.
!!

    ********************************************************************************
    Please avoid running ``setup.py`` and ``easy_install``.
    Instead, use pypa/build, pypa/installer or other
    standards-based tools.

    See https://github.com/pypa/setuptools/issues/917 for details.
    ********************************************************************************

!!
self.initialize_options()

Error compiling Cython file:

...
cdef output op
cdef lensing le
cdef distortions sd
cdef file_content fc

cpdef int computed # Flag to see if classy has already computed with the given pars
     ^

classy.pyx:103:10: Variables cannot be declared with 'cpdef'. Use 'cdef' instead.

Error compiling Cython file:

...
cdef lensing le
cdef distortions sd
cdef file_content fc

cpdef int computed # Flag to see if classy has already computed with the given pars
cpdef int allocated # Flag to see if classy structs are allocated already
     ^

classy.pyx:104:10: Variables cannot be declared with 'cpdef'. Use 'cdef' instead.

Error compiling Cython file:

...
cdef distortions sd
cdef file_content fc

cpdef int computed # Flag to see if classy has already computed with the given pars
cpdef int allocated # Flag to see if classy structs are allocated already
cpdef object _pars # Dictionary of the parameters
     ^

classy.pyx:105:10: Variables cannot be declared with 'cpdef'. Use 'cdef' instead.

Error compiling Cython file:

...
cdef file_content fc

cpdef int computed # Flag to see if classy has already computed with the given pars
cpdef int allocated # Flag to see if classy structs are allocated already
cpdef object _pars # Dictionary of the parameters
cpdef object ncp   # Keeps track of the structures initialized, in view of cleaning.
     ^

classy.pyx:106:10: Variables cannot be declared with 'cpdef'. Use 'cdef' instead.

Error compiling Cython file:

...
_pars = {
"output":"tCl mPk",}
self.set(**_pars)

def __cinit__(self, default=False):
    cpdef char* dumc
         ^

classy.pyx:131:14: Variables cannot be declared with 'cpdef'. Use 'cdef' instead.
warning: classy.pyx:361:76: local variable 'errmsg' referenced before assignment
warning: classy.pyx:362:39: local variable 'errmsg' referenced before assignment
cc1: fatal error: /home/labs/testlab/alexkon/singularity/ubuntu22.04_clean/classy/cosmo_packages-alexey/code/classy/python/../python/classy.c: No such file or directory
compilation terminated.
error: command '/usr/bin/gcc' failed with exit code 1
make: *** [Makefile:195: classy] Error 1
Singularity>

Any help with it, please?

I think there is an easy fix for that:

Go into classy.pyx and replace every instance of cpdef with cdef. Then make clean; make again. :)

Thank you very much. It works now!

This is actually a duplicate of #531.