Scons test fails with Release 3.0.0 on Windows

65 views
Skip to first unread message

bertbell2

unread,
Sep 15, 2023, 6:45:35 PM9/15/23
to Cantera Users' Group
I am building the Release 3.0.0 code.
i am using Windows 11 64bit and MSVC 2019

I can build successfully but running scons test terminates with the following error.

cl /Fobuild\samples\clib\demo.obj /c samples\clib\demo.c /MD /nologo /D_SCL_SECURE_NO_WARNINGS /D_CRT_SECURE_NO_WARNINGS /O2 /Zi /Fdbuild\samples\clib\demo.obj.pdb /DNDEBUG /Iinclude
demo.c
link /nologo /DEBUG /OUT:build\samples\clib\demo.exe /LIBPATH:C:\Users\bertb\anaconda3\envs\ct-build\Library\lib /LIBPATH:build\lib cantera_shared.lib build\samples\clib\demo.obj
demo.obj : error LNK2019: unresolved external symbol soln_newSolution referenced in function main
demo.obj : error LNK2019: unresolved external symbol soln_thermo referenced in function main
demo.obj : error LNK2019: unresolved external symbol soln_kinetics referenced in function main
demo.obj : error LNK2019: unresolved external symbol soln_transport referenced in function main
build\samples\clib\demo.exe : fatal error LNK1120: 4 unresolved externals
scons: *** [build\samples\clib\demo.exe] Error 1120
scons: building terminated because of errors.

I have seen errors like this in the past where leading underscore on exposed functions in either added or missing.

Any ideas ?

Thanks,
Bert

Ray Speth

unread,
Sep 15, 2023, 7:20:38 PM9/15/23
to Cantera Users' Group

Hi Bert,

This definitely isn’t a general problem compiling on Windows — we test Windows with MSVC 2019 (and 2022) regularly as part of our CI suite. You can see the latest case where that ran here. The question then is what is different about your configuration. For that, I think it would help to see the full output of the scons build command that includes some information from the configuration checks that are done at the start. It would also help to know what’s installed in your conda environment (the output of conda list).

Regards,
Ray

bertbell2

unread,
Sep 15, 2023, 7:45:00 PM9/15/23
to Cantera Users' Group
The output of my scons build command follows with how I invoked the build

(ct-build) PS C:\Users\bertb\cantera\cantera> scons build toolchain=msvc boost_inc_dir="C:\Boost\boost_1_82_0\boost"
scons: Reading SConscript files ...
SCons 4.5.2 is using the following Python interpreter:
    C:\Users\bertb\anaconda3\envs\ct-build\python.exe (Python 3.10)
Compiling with MSVC version 14.2
Compiling with MSVC toolset 14.2 (default)
Compiling for architecture: amd64
Compiling using the following toolchain(s): ['default']
INFO: Compiling on 'Intel64 Family 6 Model 142 Stepping 12, GenuineIntel'
INFO: Building Cantera from git commit '806842dac'
INFO: Configuration variables read from 'cantera.conf' and command line:
    boost_inc_dir = 'C:\\Boost\\boost_1_82_0\\boost'

INFO: Adding conda include and library paths: C:\Users\bertb\anaconda3\envs\ct-build
Checking for C++ header file cmath... (cached) yes
INFO: Using private installation of fmt library.
INFO: Using fmt version 9.1.0
Checking for YAML::Node().Mark()... (cached) no
INFO: Using private installation of yaml-cpp library.
Checking for C++ header file gtest/gtest.h... (cached) no
Checking for C++ header file gmock/gmock.h... (cached) no
INFO: Using Googletest from Git submodule
Checking for C++ header file eigen3/Eigen/Dense... (cached) no
Checking for C++ header file Eigen/Dense... (cached) no
INFO: Using private installation of Eigen.
INFO: Found Eigen version 3.4.0
Checking whether __GLIBCXX__ is declared... (cached) no
Checking whether _LIBCPP_VERSION is declared... (cached) no
Checking whether __clang__ is declared... (cached) no
Checking for C++ library iomp5... (cached) no
Checking for C++ library omp... (cached) no
Checking for C++ library gomp... (cached) no
INFO: Found Boost version 1.82
Checking for C library mkl_rt... (cached) no
Checking for C library openblas... (cached) no
Checking for C library lapack... (cached) no
INFO: No system BLAS/LAPACK libraries detected.
Checking for CVodeCreate(CV_BDF, CV_NEWTON) in C++ library sundials_cvodes... (cached) no
Checking for CVodeCreate(CV_BDF) in C++ library sundials_cvodes... (cached) no
Checking for SUNContext ctx; SUNContext_Create(0, &ctx) in C++ library sundials_cvodes... (cached) no
Checking for double x; log(x) in C library None... (cached) yes
INFO: Using private installation of Sundials version 5.3.
Checking for C library hdf5... (cached) no
INFO: Skipping compilation of the Fortran 90 interface.
INFO: Using NumPy version 1.25.0
INFO: Using Cython version 0.29.35 (uses legacy NumPy API)
INFO: Building the full Python package for Python 3.10
INFO: Using conda environment as default 'prefix': C:/Users/bertb/anaconda3/envs/ct-build
INFO: Skipping sample 'openmp_ignition' because 'omp.h' was not found.
scons: done reading SConscript files.
scons: Building targets ...
cl /Fobuild\ext\googletest\googletest\src\gtest-all.obj /c ext\googletest\googletest\src\gtest-all.cc /TP /EHsc /std:c++17 /MD /nologo /D_SCL_SECURE_NO_WARNINGS /D_CRT_SECURE_NO_WARNINGS /O2 /Zi /Fdbuild\ext\googletest\googletest\src\gtest-all.obj.pdb /DGTEST_HAS_PTHREAD=0 /DNDEBUG /Iext\googletest\googletest /Iext\googletest\googletest\include /IC:\Users\bertb\anaconda3\envs\ct-build\Library\include /IC:\Boost\boost_1_82_0\boost
gtest-all.cc
lib /nologo /OUT:build\lib\gtest.lib build\ext\googletest\googletest\src\gtest-all.obj
cl /Fobuild\ext\googletest\googlemock\src\gmock-all.obj /c ext\googletest\googlemock\src\gmock-all.cc /TP /EHsc /std:c++17 /MD /nologo /D_SCL_SECURE_NO_WARNINGS /D_CRT_SECURE_NO_WARNINGS /O2 /Zi /Fdbuild\ext\googletest\googlemock\src\gmock-all.obj.pdb /DGTEST_HAS_PTHREAD=0 /DNDEBUG /Iext\googletest\googletest\include /Iext\googletest\googlemock /Iext\googletest\googlemock\include /IC:\Users\bertb\anaconda3\envs\ct-build\Library\include /IC:\Boost\boost_1_82_0\boost
gmock-all.cc
lib /nologo /OUT:build\lib\gmock.lib build\ext\googletest\googlemock\src\gmock-all.obj
ConfigBuilder(["build\ext\sundials_config.h.build"], ["ext\sundials_config.h.in"])
INFO: Generating build\ext\sundials_config.h.build with the following settings:
    SUNDIALS_BLAS_LAPACK                *undefined*
    SUNDIALS_USE_GENERIC_MATH           *undefined*
ConfigBuilder(["build\src\config.h.build"], ["include\cantera\base\config.h.in"])
INFO: Generating build\src\config.h.build with the following settings:
    CANTERA_SHORT_VERSION               "3.0"
    CANTERA_VERSION                     "3.0.0"
    CT_SUNDIALS_USE_LAPACK              0
    CT_SUNDIALS_VERSION                 53
    FTN_TRAILING_UNDERSCORE             1
    LAPACK_FTN_STRING_LEN_AT_END        1
    LAPACK_FTN_TRAILING_UNDERSCORE      1
    CT_USE_HDF5                         *undefined*
    CT_USE_HIGHFIVE_BOOLEAN             *undefined*
    CT_USE_LAPACK                       *undefined*
    CT_USE_SYSTEM_EIGEN                 *undefined*
    CT_USE_SYSTEM_EIGEN_PREFIXED        *undefined*
    CT_USE_SYSTEM_FMT                   *undefined*
    CT_USE_SYSTEM_HIGHFIVE              *undefined*
    CT_USE_SYSTEM_YAMLCPP               *undefined*
postBuildMessage(["finish_build"], [])

********************** Compilation completed successfully **********************

- To run the test suite, type 'scons test'.
- To list available tests, type 'scons test-help'.
- To install, type 'scons install'.
- To create a Windows MSI installer, type 'scons msi'.

********************************************************************************

scons: done building targets.


conda list output

# packages in environment at C:\Users\bertb\anaconda3\envs\ct-build:
#
# Name                    Version                   Build  Channel
asttokens                 2.2.1              pyhd8ed1ab_0    conda-forge
backcall                  0.2.0              pyh9f0ad1d_0    conda-forge
backports                 1.0                pyhd8ed1ab_3    conda-forge
backports.functools_lru_cache 1.6.5              pyhd8ed1ab_0    conda-forge
boost-cpp                 1.82.0               h92ca6c8_1    conda-forge
bzip2                     1.0.8                h8ffe710_4    conda-forge
ca-certificates           2023.5.7             h56e8100_0    conda-forge
cantera                   2.6.0                    pypi_0    pypi
colorama                  0.4.6              pyhd8ed1ab_0    conda-forge
cython                    0.29.35         py310h00ffb61_0    conda-forge
decorator                 5.1.1              pyhd8ed1ab_0    conda-forge
exceptiongroup            1.1.1              pyhd8ed1ab_0    conda-forge
executing                 1.2.0              pyhd8ed1ab_0    conda-forge
iniconfig                 2.0.0              pyhd8ed1ab_0    conda-forge
intel-openmp              2023.1.0         h57928b3_46319    conda-forge
ipython                   8.14.0             pyh08f2357_0    conda-forge
jedi                      0.18.2             pyhd8ed1ab_0    conda-forge
libblas                   3.9.0              17_win64_mkl    conda-forge
libcblas                  3.9.0              17_win64_mkl    conda-forge
libffi                    3.4.2                h8ffe710_5    conda-forge
libhwloc                  2.9.1           nocuda_h15da153_6    conda-forge
libiconv                  1.17                 h8ffe710_0    conda-forge
liblapack                 3.9.0              17_win64_mkl    conda-forge
libsqlite                 3.42.0               hcfcfb64_0    conda-forge
libxml2                   2.11.4               hc3477c8_0    conda-forge
libzlib                   1.2.13               hcfcfb64_5    conda-forge
matplotlib-inline         0.1.6              pyhd8ed1ab_0    conda-forge
mkl                       2022.1.0           h6a75c08_874    conda-forge
numpy                     1.25.0          py310hd02465a_0    conda-forge
openssl                   3.1.1                hcfcfb64_1    conda-forge
packaging                 23.1               pyhd8ed1ab_0    conda-forge
parso                     0.8.3              pyhd8ed1ab_0    conda-forge
pickleshare               0.7.5                   py_1003    conda-forge
pip                       23.1.2             pyhd8ed1ab_0    conda-forge
pluggy                    1.2.0              pyhd8ed1ab_0    conda-forge
prompt-toolkit            3.0.38             pyha770c72_0    conda-forge
prompt_toolkit            3.0.38               hd8ed1ab_0    conda-forge
pthreads-win32            2.9.1                hfa6e2cd_3    conda-forge
pure_eval                 0.2.2              pyhd8ed1ab_0    conda-forge
pygments                  2.15.1             pyhd8ed1ab_0    conda-forge
pytest                    7.4.0              pyhd8ed1ab_0    conda-forge
python                    3.10.12         h4de0772_0_cpython    conda-forge
python_abi                3.10                    3_cp310    conda-forge
ruamel.yaml               0.17.32         py310h8d17308_0    conda-forge
ruamel.yaml.clib          0.2.7           py310h8d17308_1    conda-forge
scons                     4.5.2           py310h5588dad_0    conda-forge
setuptools                68.0.0             pyhd8ed1ab_0    conda-forge
six                       1.16.0             pyh6c4a22f_0    conda-forge
stack_data                0.6.2              pyhd8ed1ab_0    conda-forge
tbb                       2021.9.0             h91493d7_0    conda-forge
tk                        8.6.12               h8ffe710_0    conda-forge
tomli                     2.0.1              pyhd8ed1ab_0    conda-forge
traitlets                 5.9.0              pyhd8ed1ab_0    conda-forge
typing_extensions         4.7.0              pyha770c72_0    conda-forge
tzdata                    2023c                h71feb2d_0    conda-forge
ucrt                      10.0.22621.0         h57928b3_0    conda-forge
vc                        14.3                h64f974e_17    conda-forge
vc14_runtime              14.36.32532         hfdfe4a8_17    conda-forge
vs2015_runtime            14.36.32532         h05e6639_17    conda-forge
wcwidth                   0.2.6              pyhd8ed1ab_0    conda-forge
wheel                     0.40.0             pyhd8ed1ab_0    conda-forge
xz                        5.2.6                h8d14728_0    conda-forge
zstd                      1.5.2                h12be248_6    conda-forge

Thanks,
Bert

Ray Speth

unread,
Sep 15, 2023, 8:03:45 PM9/15/23
to Cantera Users' Group

Hi Bert,

Thanks for providing the requested information. One thing I notice is that you have Cantera 2.6 already installed in your Conda environment. Further, the methods that you mention are all new in Cantera 3.0 (while there are various other Cantera function calls in demo.c that are not being reported as missing symbols). My guess is you are accidentally picking up another copy of the Cantera library files from either that installation of Cantera 2.6 or another one elsewhere on your system (I’m curious especially about whether there’s something in C:\Users\bertb\anaconda3\envs\ct-build\Library\lib.

Regards,
Ray

bertbell2

unread,
Sep 18, 2023, 11:36:58 AM9/18/23
to Cantera Users' Group
Removed the 2.6 install and successfully built and tested 3.0.0

Thanks for the help!

Bert

Reply all
Reply to author
Forward
0 new messages