Unable to compile

392 views
Skip to first unread message

Alan Thomason

unread,
Jan 5, 2017, 8:35:15 PM1/5/17
to Cantera Users' Group
Hello Friends...

I am hoping to compile Cantera, although I have previously installed it using the pre-compiled files. 

This is for a Windows 7 64 bit system, using Python 2.7 to compile with the intention of using the system with Python 3.4. 

I am starting from a weak position, since I have done a lot of small projects with Python and Fortran, but have nevery compiled anything on the scale of
Cantera.  So, I could be doing anything wrong.  I had MingW from previous work on another project.

The following is an excerpt of the config.log file....


scons: Configure: Checking for C++ header file fmt/ostream.h...
.sconf_temp\conftest_2.cpp <-
  |
  |#include "fmt/ostream.h"
  |
  |
g++ -o .sconf_temp\conftest_2.o -c -std=c++0x -O3 -Wno-inline -g -DNDEBUG -IC:\local\boost_1_54_0 .sconf_temp\conftest_2.cpp
.sconf_temp\conftest_2.cpp:2:25: fatal error: fmt/ostream.h: No such file or directory
 #include "fmt/ostream.h"
                         ^
compilation terminated.

And this is the last lines of the command window...

             ^~~~~~~~~~~~~~~~~~~~
g++ -o build\src\base\ValueCache.o -c -std=c++0x -O3 -Wno-inline -g -Wall -include src/pch/system.h -DNDEBUG "-DCANTERA_DATA=\"C:\\Program F
iles (x86)\\Cantera\\data\"" -Iinclude -Iinclude\cantera\ext -Ibuild\src -IC:\local\boost_1_54_0 src\base\ValueCache.cpp
src\base\ValueCache.cpp:13:6: error: 'mutex' in namespace 'std' does not name a type
 std::mutex id_mutex;
      ^~~~~
src\base\ValueCache.cpp: In member function 'int Cantera::ValueCache::getId()':
src\base\ValueCache.cpp:23:22: error: 'mutex' is not a member of 'std'
     std::unique_lock<std::mutex> lock(id_mutex);
                      ^~~
src\base\ValueCache.cpp:23:22: error: 'mutex' is not a member of 'std'
src\base\ValueCache.cpp:23:32: error: template argument 1 is invalid
     std::unique_lock<std::mutex> lock(id_mutex);
                                ^
src\base\ValueCache.cpp:23:39: error: 'id_mutex' was not declared in this scope
     std::unique_lock<std::mutex> lock(id_mutex);
                                       ^~~~~~~~
src\base\ValueCache.cpp:23:34: warning: unused variable 'lock' [-Wunused-variable]
     std::unique_lock<std::mutex> lock(id_mutex);
                                  ^~~~
scons: *** [build\src\base\ValueCache.o] Error 1
scons: building terminated because of errors.

Ostream, Cython (for both levels of Python) are installed, but perhaps I've done something wrong on the installation.

I would appreciate any help or questions that might help me.  This forum has been such a help to me, it is much appreciated!

Best Regards,

Alan
config.log
cantera.conf

Ray Speth

unread,
Jan 5, 2017, 9:33:22 PM1/5/17
to Cantera Users' Group
Alan,

As discussed in this thread, not all distributions of MinGW appear to include full support for parts of the C++11 standard that Cantera requires. Two that do are MinGW-w64 and TDM-GCC. I'm guessing the one you have is from another source.

Regards,
Ray

Alan Thomason

unread,
Jan 5, 2017, 11:16:11 PM1/5/17
to Cantera Users' Group
Darn, no luck so far.  I followed your thread and installed the latest.  Still the same result.  Thanks very much any way.  Alan

Bryan W. Weber

unread,
Jan 6, 2017, 9:43:02 AM1/6/17
to Cantera Users' Group
Alan,

Which version of MinGW did you install? Can you link to the page where you downloaded it?

Thanks,
Bryan

Alan Thomason

unread,
Jan 6, 2017, 7:09:25 PM1/6/17
to Cantera Users' Group

Hi Bryan..

I tried the latest version of the following, and the lowest level 5.X. 

https://sourceforge.net/projects/tdm-gcc/?source=typ_redirect

I don't have very much experience compiling large projects, so don't discount something that you might think is obvious.   
Thanks very much,
Alan

Ray Speth

unread,
Jan 6, 2017, 10:40:14 PM1/6/17
to Cantera Users' Group
Alan,

Are you getting the same error (" 'mutex' is not a member of 'std' ") when you use either MinGW-w64 or TDM-GCC, or are you getting a different error?

Note that some compilation errors in the config.log are normal and not indicative of a problem.

Regards,
Ray

Alan Thomason

unread,
Jan 7, 2017, 11:30:10 AM1/7/17
to Cantera Users' Group
Same error, unfortunately.  I can't see a difference.  Is there a way to confirm that SCONS is finding MingGW at all? 

Ray Speth

unread,
Jan 7, 2017, 3:05:45 PM1/7/17
to Cantera Users' Group
Alan,

It's definitely finding some version of MinGW, since the error messages are from G++. Are you specifying the specific copy of MinGW to use, with the CC and CXX flags to SCons? If you have multiple copies of MinGW installed, the first should be set to the full path to gcc.exe and the second should be set to the full path to g++.exe. Otherwise you run the risk of using an unknown version of MinGW.

Regards,
Ray

Alan Thomason

unread,
Jan 12, 2017, 10:41:04 PM1/12/17
to Cantera Users' Group
This help got me one big step further.  SCONS can now find the up to date MinGW compiler. 

Now I have a new problem.  Any further help would be appreciated.

C:/Program Files/mingw-w64/x86_64-6.2.0-posix-seh-rt_v5-rev1/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.2.0/../../../../x86_64-w64-mingw32/
bin/ld.exe: cannot find -lpython27
collect2.exe: error: ld returned 1 exit status
scons: *** [build\python2\cantera\_cantera.pyd] Error 1

scons: building terminated because of errors.


command_log.txt
config.log
cantera.conf

Ray Speth

unread,
Jan 13, 2017, 1:41:57 PM1/13/17
to Cantera Users' Group
Alan,

A few questions:

1. Is the copy of Python in C:\Python27 32-bit or 64-bit?
2. Is the copy of Python in C:\Python34 32-bit or 64-bit?
3. Do you care about building the Python package for Python 2?

Regards,
Ray

Alan Thomason

unread,
Jan 14, 2017, 9:10:28 AM1/14/17
to Cantera Users' Group

Hi Ray...

1. The Python27 is 32 bit. 
2. Python 34 is 64 bit.
3. No, I only use Python 34.

Thanks,
Alan

Ray Speth

unread,
Jan 14, 2017, 2:12:03 PM1/14/17
to Cantera Users' Group
Alan,

You can't compile a 64-bit Cantera and a 32-bit Python module at the same time, so you should disable compilation of the Python 2 module by adding 'python_package=none' to the 'scons build' command line.

Regards,
Ray

Alan Thomason

unread,
Jan 16, 2017, 7:38:31 AM1/16/17
to Cantera Users' Group
That worked!  Thank so much...Alan
Reply all
Reply to author
Forward
0 new messages