cce51dc
%global fork Cantera
cce51dc
cce51dc
Name:          cantera
cce51dc
Version:       2.6.0
daa078f
Release:       %{?autorelease}%{!?autorelease:22{?dist}} 
cce51dc
Summary:       Chemical kinetics, thermodynamics, and transport tool suite
cce51dc
License:       BSD
cce51dc
URL:           https://github.com/%{fork}/%{name}/
f190aa6
Source0:       %{url}archive/refs/tags/v%{version}.tar.gz
cce51dc
daa078f
# thermoToYaml test failures on ppc64le and aarch64 and s390x - BZ #2081451
daa078f
# increase test tolerance to pass
daa078f
Patch0:        cantera-test-ppc64le-aarch64-s390x.patch
daa078f
05b012d
# Fails to build under Python 3.11 due to deprecated mode 'rU' - BZ #2094258
05b012d
# implement patch until upstream releases fix
05b012d
Patch1:        cantera-py311-deprecated-U.patch
05b012d
3025199
# Fix failure to build with pip >= 21.1
3025199
# Fixed upstream: https://github.com/Cantera/cantera/pull/1272
3025199
Patch2:        fix-pip-build-21.1.patch
3025199
cce51dc
BuildRequires:  boost-devel
cce51dc
BuildRequires:  eigen3-devel
cce51dc
BuildRequires:  fmt-devel
cce51dc
BuildRequires:  gcc
cce51dc
BuildRequires:  gcc-c++
cce51dc
BuildRequires:  git
cce51dc
BuildRequires:  gmock-devel
cce51dc
BuildRequires:  gtest-devel
cce51dc
BuildRequires:  python3
cce51dc
BuildRequires:  python3-Cython
cce51dc
BuildRequires:  python3-devel
cce51dc
BuildRequires:  python3-numpy
7dc49d3
BuildRequires:  python3-pip
cce51dc
BuildRequires:  python3-pytest
cce51dc
BuildRequires:  python3-ruamel-yaml
cce51dc
BuildRequires:  python3-scons
7dc49d3
BuildRequires:  python3-wheel
cce51dc
BuildRequires:  sundials-devel
cce51dc
BuildRequires:  yaml-cpp-devel
cce51dc
cce51dc
%if 0%{?fedora}
cce51dc
BuildRequires:  gcc-fortran
cce51dc
%else
cce51dc
BuildRequires:  gcc-gfortran
cce51dc
%endif
cce51dc
cce51dc
%global scons scons%{?rhel:-3}
cce51dc
d1c4274
ExcludeArch: %{ix86}
d1c4274
cce51dc
%global common_description %{expand: \
cce51dc
 Cantera is a suite of object-oriented software tools for solving problems
cce51dc
 involving chemical kinetics, thermodynamics, and/or transport processes.
cce51dc
 Cantera can be used for simulating time-dependent or steady reactor
cce51dc
 networks and one-dimensional reacting flows. Thermodynamic models for
cce51dc
 ideal gases, aqueous electrolytes, plasmas, and multiphase substances
cce51dc
 are provided.}
cce51dc
cce51dc
%description
cce51dc
%{common_description}
cce51dc
cce51dc
cce51dc
%package common
cce51dc
Summary: Common files needed for all Cantera interfaces
cce51dc
%description common
cce51dc
%{common_description}
cce51dc
 .
cce51dc
 This package includes programs for parsing and converting chemical
cce51dc
 mechanisms, a set of common mechanism files, and several sample problems.
cce51dc
cce51dc
cce51dc
%package -n python3-%{name}
cce51dc
Requires: %{name}-common%{_isa} = %{version}-%{release}
cce51dc
Summary: Python 3 user interface for Cantera
cce51dc
%description -n python3-%{name}
cce51dc
%{common_description}
cce51dc
 .
cce51dc
 This package includes the Cantera Python 3 module.
cce51dc
cce51dc
cce51dc
%package devel
cce51dc
Requires: %{name}-common%{_isa} = %{version}-%{release}
cce51dc
Summary: Header files and shared object libraries for Cantera
cce51dc
%description devel
cce51dc
%{common_description}
cce51dc
 .
cce51dc
 This package contains the header files and shared object libraries needed to
cce51dc
 develop applications with the C++ and Fortran interfaces of Cantera.
cce51dc
cce51dc
cce51dc
%package static
cce51dc
Requires: %{name}-common%{_isa} = %{version}-%{release}
cce51dc
Summary: Static libraries for Cantera
cce51dc
%description static
cce51dc
%{common_description}
cce51dc
 .
cce51dc
 This package contains the static libraries for the C++ and Fortran
cce51dc
 interfaces of Cantera.
cce51dc
cce51dc
cce51dc
%prep
daa078f
%setup -n %{name}-%{version}
daa078f
%patch0 -p0
11c0651
%patch1 -p1
3025199
%patch2 -p1
cce51dc
cce51dc
%build
cce51dc
%set_build_flags
cce51dc
78b0adf
%scons build prefix=%{_prefix} python_prefix=%{_prefix} libdirname=%{_lib} system_sundials=y f90_interface=y renamed_shared_libraries=n python_package=full system_eigen=y extra_inc_dirs=/usr/include/eigen3 system_fmt=y cxx_flags='-std=c++14'
cce51dc
cce51dc
cce51dc
%install
7dc49d3
%scons install prefix=%{_prefix} python_prefix=%{_prefix} libdirname=%{_lib} stage_dir=%{buildroot}
cce51dc
cce51dc
%check
cce51dc
%scons test
cce51dc
cce51dc
cce51dc
%files common
cce51dc
%license %{_datadir}/%{name}/doc/LICENSE.txt
cce51dc
cce51dc
%doc AUTHORS README.rst
cce51dc
%doc %{_mandir}/man1/ck2yaml.1.gz
cce51dc
%doc %{_mandir}/man1/cti2yaml.1.gz
cce51dc
%doc %{_mandir}/man1/ctml2yaml.1.gz
73938cd
%doc %{_mandir}/man1/ck2cti.1.gz
73938cd
%doc %{_mandir}/man1/ctml_writer.1.gz
cce51dc
cce51dc
%{_bindir}/ck2yaml
cce51dc
%{_bindir}/cti2yaml
cce51dc
%{_bindir}/ctml2yaml
73938cd
%{_bindir}/ctml_writer
73938cd
%{_bindir}/ck2cti
cce51dc
cce51dc
%{_datadir}/%{name}
cce51dc
de20f0d
#not required for packaged installations
de20f0d
%ghost %{_bindir}/setup_cantera
de20f0d
%ghost %{_bindir}/setup_cantera.csh
cce51dc
7dc49d3
cce51dc
%files -n python3-%{name}
cce51dc
%{python3_sitearch}/%{name}/
73938cd
%{python3_sitearch}/Cantera-%{version}.dist-info/
cce51dc
cce51dc
%files devel
cce51dc
%{_includedir}/%{name}
cce51dc
cce51dc
%{_libdir}/pkgconfig/cantera.pc
cce51dc
%{_libdir}/libcantera.so
cce51dc
%{_libdir}/libcantera.so.2
cce51dc
%{_libdir}/libcantera.so.%{version}
cce51dc
%{_libdir}/libcantera_fortran.so
cce51dc
%{_libdir}/libcantera_fortran.so.2
cce51dc
%{_libdir}/libcantera_fortran.so.%{version}
cce51dc
cce51dc
cce51dc
%files static
cce51dc
%{_libdir}/libcantera.a
cce51dc
%{_libdir}/libcantera_fortran.a
cce51dc
cce51dc
cce51dc
%changelog
000caac
%autochangelog