Cantera install and fortran f77 linking

101 views
Skip to first unread message

Benjamin Keeton

unread,
Nov 14, 2023, 6:10:45 PM11/14/23
to Cantera Users' Group
Hi, I'm attempting to compile Cantera 3.0 from source, and use it with my fortran77 code.

To build cantera, I first checked out v3.0 (git clone --recursive https://github.com/Cantera/cantera.git and git checkout 3.0). I notice that the ext/sundials directory is empty, so that scons build fails, indicating again that git cannot checkout the submodule ext/sundials.

As a workaround, I installed sundials separately (v6.6), and used the attached cantera.conf file. I get a similar sundials-related error (ERROR: Expected system installation of Sundials, but it could not be found), with a more detailed description given in the attached config.log file.

Are there any suggestions on how to use git to checkout the sundials submodule properly, so that a separate installation of sundials is not necessary? Alternatively, if the separate installation is needed, are there any suggestions to resolve the error in the config.log file?

Thanks,
Ben Keeton
config.log
cantera.conf

Ray Speth

unread,
Nov 15, 2023, 3:07:03 PM11/15/23
to Cantera Users' Group

Hi Ben,

What is the output of the git clone ... command? It should mention “Cloning into …/ext/sundials”, among other things. This works just fine for me when making a fresh checkout of the repository.

Second, I’m not sure why you’re setting cxx_flags to -g -Wextra -O3 --std=c++11 in cantera.conf. Cantera 3.0 requires C++17, and will specify that on its own by default, but not if you override the value of cxx_flags.

Regards,
Ray

Benjamin Keeton

unread,
Nov 16, 2023, 10:02:01 AM11/16/23
to Cantera Users' Group
Hi Ray, here is the end of the output for the git clone command:

Cloning into 'ext/googletest'...
remote: Enumerating objects: 27028, done.
remote: Counting objects: 100% (67/67), done.
remote: Compressing objects: 100% (37/37), done.
remote: Total 27028 (delta 27), reused 46 (delta 26), pack-reused 26961
Receiving objects: 100% (27028/27028), 12.52 MiB | 0 bytes/s, done.
Resolving deltas: 100% (20057/20057), done.
Submodule path 'ext/googletest': checked out 'e2239ee6043f73722e7aa812a459f54a28552929'
Cloning into 'ext/sundials'...
remote: Enumerating objects: 127647, done.
remote: Counting objects: 100% (9671/9671), done.
remote: Compressing objects: 100% (3003/3003), done.
remote: Total 127647 (delta 7405), reused 8640 (delta 6638), pack-reused 117976
Receiving objects: 100% (127647/127647), 120.48 MiB | 30.18 MiB/s, done.
Resolving deltas: 100% (102809/102809), done.
fatal: reference is not a tree: 887af4374af2271db9310d31eaa9b5aeff49e829
Cloning into 'ext/yaml-cpp'...
remote: Enumerating objects: 8700, done.
remote: Counting objects: 100% (98/98), done.
remote: Compressing objects: 100% (62/62), done.
remote: Total 8700 (delta 42), reused 70 (delta 24), pack-reused 8602
Receiving objects: 100% (8700/8700), 4.34 MiB | 0 bytes/s, done.
Resolving deltas: 100% (5657/5657), done.
Submodule path 'ext/yaml-cpp': checked out '0579ae3d976091d7d664aa9d2527e0d0cff25763'
Unable to checkout '887af4374af2271db9310d31eaa9b5aeff49e829' in submodule path 'ext/sundials'

As for the cantera.conf file, that is my mistake. That was an old line from a previous attempt to install cantera 2.4. I removed that line from the cantera.conf file.

Ben

Benjamin Keeton

unread,
Jan 16, 2024, 10:25:12 AM1/16/24
to Cantera Users' Group
I was able to get 3.0 installed with the Fortran interface using a conda environment (https://cantera.org/install/conda-install.html#sec-conda-development-interface). I've confirmed the f77 demo works properly when built with scons.

I'm now trying to link cantera to my f77 application, and was curious where I can find a makefile, or if there is a convenient way to convert the SConstruct file to a makefile? I would like to have a single makefile that builds both my application as well as the cantera code.

Thanks,
Ben

Ray Speth

unread,
Jan 16, 2024, 7:52:13 PM1/16/24
to Cantera Users' Group

Hi Ben,

You should be able to build the demos with the build system of your choice. For the F77 demo, we only provide pre-populated build configurations for use with SCons, but you should be able to use the contents of that SConstruct file to set the necessary variables in a Makefile or other build configuration. You might also consider using some of the information that is provided by the pkg-config tool (see https://cantera.org/tutorials/cxx-guide/compiling.html#pkg-config), although that is geared toward C++ usage and doesn’t include Fortran-specific options.

Regards,
Ray

Reply all
Reply to author
Forward
0 new messages