Cantera / cantera

Chemical kinetics, thermodynamics, and transport tool suite
https://cantera.org
Other
580 stars 341 forks source link

Error trying to build Cantera with option `python_sdist="yes"` #1678

Closed 42n8dzydoo closed 2 weeks ago

42n8dzydoo commented 3 months ago

I encountered an error (shown below) when I use the option python_sdist="yes"

bamidele@bamideleHP:~/CSP_Cantera/cantera$ scons build prefix=/home/bamidele/CSP_Cantera/Cantera_build python_prefix=/home/bamidele/CSP_Cantera/Cantera_python python_package="full" python_sdist="yes" extra_lib_dirs=/usr/lib/x86_64-linux-gnu/hdf5/serial extra_inc_dirs=/usr/include/hdf5/serial

scons: Reading SConscript files ...
SCons 4.6.0.post1 is using the following Python interpreter:
    /home/bamidele/anaconda3/envs/ct-build/bin/python (Python 3.12)
INFO: Compiling on '11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz'
INFO: Building Cantera from git commit 'd49d6f522'
INFO: Configuration variables read from 'cantera.conf' and command line:
    prefix = '/home/bamidele/CSP_Cantera/Cantera_build'
    python_package = 'full'
    python_sdist = True
    python_prefix = '/home/bamidele/CSP_Cantera/Cantera_python'
    extra_inc_dirs = '/usr/include/hdf5/serial'
    extra_lib_dirs = '/usr/lib/x86_64-linux-gnu/hdf5/serial'

INFO: Adding conda include and library paths: /home/bamidele/anaconda3/envs/ct-build
Checking for C++ header file cmath... yes
INFO: Using private installation of fmt library.
INFO: Using fmt version 9.1.0
Checking for YAML::Node().Mark()... no
INFO: Using private installation of yaml-cpp library.
Checking for C++ header file gtest/gtest.h... no
Checking for C++ header file gmock/gmock.h... no
INFO: Using Googletest from Git submodule
Checking for C++ header file eigen3/Eigen/Dense... no
Checking for C++ header file Eigen/Dense... no
INFO: Using private installation of Eigen.
INFO: Found Eigen version 3.4.0
Checking whether __GLIBCXX__ is declared... yes
Checking whether __clang__ is declared... no
Checking for C++ library iomp5... no
Checking for C++ library omp... no
Checking for C++ library gomp... yes
INFO: Found Boost version 1.84
Checking for C library mkl_rt... no
Checking for C library openblas... yes
INFO: Using OpenBLAS 0.3.20
Checking for CVodeCreate(CV_BDF, CV_NEWTON) in C++ library sundials_cvodes... no
Checking for CVodeCreate(CV_BDF) in C++ library sundials_cvodes... no
Checking for SUNContext ctx; SUNContext_Create(0, &ctx) in C++ library sundials_cvodes... no
Checking for double x; log(x) in C library None... no
INFO: Using private installation of Sundials version 5.3.
Checking for C library hdf5... yes
Checking for C++ library hdf5... no
INFO: Using private installation of HighFive library.
Checking for HighFive::details::Boolean::HighFiveTrue... no
INFO: Using HighFive version 2.6.2 for HDF5 1.10.7
INFO: Using 'gfortran' to build the Fortran 90 interface
INFO: Using NumPy version 1.26.4
INFO: Using Cython version 3.0.9
INFO: Building the full Python package for Python 3.12
TypeError: Tried to lookup Dir 'interfaces/cython/cantera/data' as a File.:
  File "/home/bamidele/CSP_Cantera/cantera/SConstruct", line 2320:
    SConscript("interfaces/python_sdist/SConscript", variant_dir="build/python_sdist")
  File "/home/bamidele/anaconda3/envs/ct-build/lib/python3.12/site-packages/SCons/Script/SConscript.py", line 673:
    return method(*args, **kw)
  File "/home/bamidele/anaconda3/envs/ct-build/lib/python3.12/site-packages/SCons/Script/SConscript.py", line 609:
    return _SConscript(self.fs, *files, **subst_kw)
  File "/home/bamidele/anaconda3/envs/ct-build/lib/python3.12/site-packages/SCons/Script/SConscript.py", line 279:
    exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
  File "/home/bamidele/CSP_Cantera/cantera/build/python_sdist/SConscript", line 133:
    sdist(localenv.RecursiveInstall("cantera",
  File "/home/bamidele/anaconda3/envs/ct-build/lib/python3.12/site-packages/SCons/Util/envs.py", line 251:
    return self.method(*nargs, **kwargs)
  File "/home/bamidele/CSP_Cantera/cantera/site_scons/site_tools/recursiveInstall.py", line 52:
    out.extend(env.InstallAs(env.File(t), env.File(s)))
  File "/home/bamidele/anaconda3/envs/ct-build/lib/python3.12/site-packages/SCons/Environment.py", line 2298:
    return self.fs.File(s, *args, **kw)
  File "/home/bamidele/anaconda3/envs/ct-build/lib/python3.12/site-packages/SCons/Node/FS.py", line 1452:
    return self._lookup(name, directory, File, create)
  File "/home/bamidele/anaconda3/envs/ct-build/lib/python3.12/site-packages/SCons/Node/FS.py", line 1431:
    return root._lookup_abs(p, fsclass, create)
  File "/home/bamidele/anaconda3/envs/ct-build/lib/python3.12/site-packages/SCons/Node/FS.py", line 2467:
    result.must_be_same(klass)
  File "/home/bamidele/anaconda3/envs/ct-build/lib/python3.12/site-packages/SCons/Node/FS.py", line 642:
    raise TypeError("Tried to lookup %s '%s' as a %s." %\
(ct-build) bamidele@bamideleHP:~/CSP_Cantera/cantera$

Does anyone know what causes this issue?

42n8dzydoo commented 3 months ago

Apparently, there is a directory missing at cantera/interfaces/cython/cantera/data.

I created an empty data directory in the path. I do not know if this is actually meant to be empty. But this resolved the error in my compilation.

Please, can someone help with this?

Thanks in advance!

bryanwweber commented 3 months ago

Hi, thanks for raising this! I think this is a conflict or a poor dependency resolution between the interfaces, probably a bug in the configuration. In any case, the python_sdist is not necessary for general operation or install of the Python interface, it's really only useful to upload to PyPI. I'd suggest turning that option off unless you have a specific use for it.