From charlesreid1

No edit summary
Line 17: Line 17:
     with_html_log_files=yes \
     with_html_log_files=yes \
     use_sundials=y \
     use_sundials=y \
    build_with_f2c=no \
     sundials_include=$HOME/pkg/sundials/std/include \
     sundials_include=$HOME/pkg/sundials/std/include \
     sundials_libdir=$HOME/pkg/sundials/std/lib \
     sundials_libdir=$HOME/pkg/sundials/std/lib \

Revision as of 05:52, 26 August 2013

If you've already run scons, and are changing the configuration, run:

rm cantera.conf

before proceeding.

Put the following in a script, make it executable, and run it:

#/bin/sh

scons build \
    prefix=$HOME/pkg/cantera/2.0.2 \
    python_package=full \
    with_html_log_files=yes \
    use_sundials=y \
    build_with_f2c=no \
    sundials_include=$HOME/pkg/sundials/std/include \
    sundials_libdir=$HOME/pkg/sundials/std/lib \
    boost_inc_dir=$HOME/pkg/boost/std \
    boost_lib_dir=$HOME/pkg/boost/std \
    debug=no \
    graphvizdir=/usr/local/bin \
&& \
scons install

Errors

DistributionNotFound Error

If you see a DistributionNotFound error:

$ ./build.sh
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/Current/bin/scons", line 4, in <module>
    import pkg_resources
pkg_resources.DistributionNotFound: scons==2.3.0

The problem is likely with which scons is on your $PATH. I had issues installing scons with pip and with easy_install, so I installed scons directly from source. However, Python was still trying to pull in the scons binary that easy_isntall/pip had created, so I was getting a problem with the distribution not being found.

The fix was to put the correct scons (corresponding to the version of scons I had built) on my $PATH.

Error: ranlib: for architecture: i386 file: build/lib/libcantera_fortran.a(fctxml_interface.o) has no symbols

g++ -o build/src/fortran/fct.o -c -ftemplate-depth-128 -Wall -Wno-deprecated-declarations -O3 -DNDEBUG -finline-functions -Wno-inline -Iinclude -Isrc -I/Users/charles/pkg/sundials/std/include src/fortran/fct.cpp
g++ -o build/src/fortran/fctxml.o -c -ftemplate-depth-128 -Wall -Wno-deprecated-declarations -O3 -DNDEBUG -finline-functions -Wno-inline -Iinclude -Isrc -I/Users/charles/pkg/sundials/std/include src/fortran/fctxml.cpp
ar rc build/lib/libcantera_fortran.a build/src/fortran/cantera.o build/src/fortran/cantera_funcs.o build/src/fortran/cantera_iface.o build/src/fortran/cantera_kinetics.o build/src/fortran/cantera_thermo.o build/src/fortran/cantera_transport.o build/src/fortran/cantera_xml.o build/src/fortran/fct_interface.o build/src/fortran/fctxml_interface.o build/src/fortran/fct.o build/src/fortran/fctxml.o
/usr/bin/ranlib: archive member: build/lib/libcantera_fortran.a(fct.o) cputype (16777223) does not match previous archive members cputype (7) (all members must match)
/usr/bin/ranlib: archive member: build/lib/libcantera_fortran.a(fctxml.o) cputype (16777223) does not match previous archive members cputype (7) (all members must match)
ranlib build/lib/libcantera_fortran.a
ranlib: archive member: build/lib/libcantera_fortran.a(fct.o) cputype (16777223) does not match previous archive members cputype (7) (all members must match)
ranlib: archive member: build/lib/libcantera_fortran.a(fctxml.o) cputype (16777223) does not match previous archive members cputype (7) (all members must match)
ranlib: for architecture: i386 file: build/lib/libcantera_fortran.a(cantera.o) has no symbols
ranlib: for architecture: i386 file: build/lib/libcantera_fortran.a(fct_interface.o) has no symbols
ranlib: for architecture: i386 file: build/lib/libcantera_fortran.a(fctxml_interface.o) has no symbols

The problem here is that Fortran is trying to build with a 32-bit architecture, which is incompatible with what everything else is trying to build (64-bit).

Solution 1: Don't Use Fortran

Solution 1 is to set f90_interface=no in your scons configuration, so you don't even build the Fortran interface.

Solution 2: Set 64-bit Fortran Flags

You can set F90 flags to build 64-bit versions of stuff, by setting F90_FLAGS='-arch x86_64'. Remember to run rm cantera.conf before re-running scons.

Error: Cantera IDA Solver Symbol(s) Not Found

Undefined symbols:
  "Cantera::IDA_Solver::IDA_Solver(Cantera::ResidJacEval&)", referenced from:
      Cantera::newDAE_Solver(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, Cantera::ResidJacEval&)in DAE_solvers.os
ld: symbol(s) not found

This error is caused by using an old version of Sundials (2.3). Upgrade your Sundials version to 2.5 and this error will go away.