I had an individual ask if I could install a Cantera on a computing cluster running RHEL 5.6. He is currently using Cantera 2.1.1 on his laptop and wanted the same version on the cluster. I installed sundials 2.4.0 using
./configure CFLAGS=-fPIC --prefix=xxx/sundials-2.4.0 \
--with-blas=xxx/libblas.so.3 --with-lapcak=xxx/liblapack.so.3
followed by make and sudo make install.
No errors.
I am attempting to install cantera using the following script I wrote myself
SUNDIALSHOME='/groups/hpc-share/sundials/sundials-2.4.0'
echo "listing inside sundials home"
ls $SUNDIALSHOME
echo "listing inside sundials include"
ls $SUNDIALSHOME/include
echo "listing inside sundials lib"
ls $SUNDIALSHOME/lib
scons build prefix='/exports/apps/cantera/2.1.1' \
python_package='new' \
python_cmd='/exports/apps/anaconda/1.7/bin/python' \
python_prefix='/exports/apps/anaconda/1.7/pkgs/' \
python3_package='n' \
use_sundials='y' \
sundials_include="$SUNDIALSHOME/include/" \
sundials_libdir="$SUNDIALSHOME/lib/" \
blas_lapack_libs='lapack,blas' \
boost_inc_dir='/exports/apps/boost/1.55/include' \
boost_lib_dir='/exports/apps/boost/1.55/lib' \
extra_lib_dirs='/usr/lib/liblapack.so.3':'/usr/lib64/libblas.so.3' \
VERBOSE='yes'
The output gives me this:
listing inside sundials home
bin include lib LICENSE
listing inside sundials include
cvode cvodes ida idas kinsol nvector sundials
listing inside sundials lib
libsundials_cvode.a libsundials_fcvode.a libsundials_fkinsol.a libsundials_fnvecserial.a libsundials_idas.a libsundials_nvecparallel.a
libsundials_cvodes.a libsundials_fida.a libsundials_fnvecparallel.a libsundials_ida.a libsundials_kinsol.a libsundials_nvecserial.a
scons: Reading SConscript files ...
Configuration variables read from 'cantera.conf' and command line:
prefix = '/exports/apps/cantera/2.1.1'
python_package = 'new'
python_prefix = '/exports/apps/anaconda/1.7/pkgs/'
python3_package = 'n'
use_sundials = 'y'
sundials_include = '/group/hpc-share/sundials/sundials-2.4.0/include/'
sundials_libdir = '/group/hpc-share/sundials/sundials-2.4.0/lib/'
blas_lapack_libs = 'lapack,blas'
extra_lib_dirs = '/usr/lib/liblapack.so.3:/usr/lib64/libblas.so.3'
boost_inc_dir = '/exports/apps/boost/1.55/include'
boost_lib_dir = '/exports/apps/boost/1.55/lib'
VERBOSE = True
INFO: Using '/usr/bin/gfortran' to build the Fortran 90 interface
Checking for C++ header file cmath... yes
Checking for C header file sys/times.h... yes
Checking for C header file unistd.h... yes
Checking whether erf is declared... yes
Checking for C++ header file boost/math/special_functions/erf.hpp... yes
Checking for CVodeCreate(CV_BDF, CV_NEWTON) in C++ library sundials_cvodes... no
Checking for double x; log(x) in C library None... no
INFO: Found Cython version 0.19.1 for Python 2.x.
INFO: Building the new Python package using numpy.
WARNING: Couldn't find '3to2'. Python examples will not work correctly.
ERROR: Unable to find Sundials headers and / or libraries.
See 'config.log' for details.
if I do a "cat config.log" I get:
file~/src/cantera-2.1.1/SConstruct,line 781:
Configure(confdir = .sconf_temp)
scons: Configure: Checking for C++ header file cmath...
.sconf_temp/conftest_0.cpp <-
|
|#include <cmath>
|
|
g++ -o .sconf_temp/conftest_0.o -c -ftemplate-depth-128 -pthread -O3 -DNDEBUG -finline-functions -Wno-inline -g -I/exports/apps/boost/1.55/include -I/group/hpc-share/sundials/sundials-2.4.0/include .sconf_temp/conftest_0.cpp
scons: Configure: yes
scons: Configure: Checking for C header file sys/times.h...
.sconf_temp/conftest_1.c <-
|
|#include "sys/times.h"
|
|
gcc -o .sconf_temp/conftest_1.o -c -pthread -O3 -DNDEBUG -finline-functions -Wno-inline -g -I/exports/apps/boost/1.55/include -I/group/hpc-share/sundials/sundials-2.4.0/include .sconf_temp/conftest_1.c
scons: Configure: yes
scons: Configure: Checking for C header file unistd.h...
.sconf_temp/conftest_2.c <-
|
|#include "unistd.h"
|
|
gcc -o .sconf_temp/conftest_2.o -c -pthread -O3 -DNDEBUG -finline-functions -Wno-inline -g -I/exports/apps/boost/1.55/include -I/group/hpc-share/sundials/sundials-2.4.0/include .sconf_temp/conftest_2.c
scons: Configure: yes
scons: Configure: Checking whether erf is declared...
.sconf_temp/conftest_3.cpp <-
|#include <math.h>
|int main()
|{
|#ifndef erf
| (void) erf;
|#endif
| ;
| return 0;
|}
|
g++ -o .sconf_temp/conftest_3.o -c -ftemplate-depth-128 -pthread -O3 -DNDEBUG -finline-functions -Wno-inline -g -I/exports/apps/boost/1.55/include -I/group/hpc-share/sundials/sundials-2.4.0/include .sconf_temp/conftest_3.cpp
scons: Configure: yes
scons: Configure: Checking for C++ header file boost/math/special_functions/erf.hpp...
.sconf_temp/conftest_4.cpp <-
|
|#include <boost/math/special_functions/erf.hpp>
|
|
g++ -o .sconf_temp/conftest_4.o -c -ftemplate-depth-128 -pthread -O3 -DNDEBUG -finline-functions -Wno-inline -g -I/exports/apps/boost/1.55/include -I/group/hpc-share/sundials/sundials-2.4.0/include .sconf_temp/conftest_4.cpp
In file included from /exports/apps/boost/1.55/include/boost/fusion/tuple/tuple.hpp:22,
from /exports/apps/boost/1.55/include/boost/fusion/tuple.hpp:10,
from /exports/apps/boost/1.55/include/boost/fusion/include/tuple.hpp:10,
from /exports/apps/boost/1.55/include/boost/math/tools/tuple.hpp:89,
from /exports/apps/boost/1.55/include/boost/math/special_functions/detail/igamma_inverse.hpp:13,
from /exports/apps/boost/1.55/include/boost/math/special_functions/gamma.hpp:1696,
from /exports/apps/boost/1.55/include/boost/math/special_functions/erf.hpp:15,
from .sconf_temp/conftest_4.cpp:2:
/exports/apps/boost/1.55/include/boost/fusion/tuple/detail/preprocessed/tuple.hpp:21:7: warning: no newline at end of file
scons: Configure: yes
.sconf_temp/conftest_5.cpp <-
|#include <boost/version.hpp>
|#include <iostream>
|int main(int argc, char** argv) {
| std::cout << BOOST_LIB_VERSION << std::endl;
| return 0;
|}
|
scons: Configure: Checking for CVodeCreate(CV_BDF, CV_NEWTON) in C++ library sundials_cvodes...
.sconf_temp/conftest_6.cpp <-
|
|
|#include "cvodes/cvodes.h"
|int
|main() {
| CVodeCreate(CV_BDF, CV_NEWTON);
|return 0;
|}
|
scons: Configure: no
scons: Configure: Checking for double x; log(x) in C library None...
.sconf_temp/conftest_7.c <-
|
|
|#include "math.h"
|
|int
|main() {
| double x; log(x);
|return 0;
|}
|
scons: Configure: no
I also tried looking inside the cvodes.h file. Using "cat $SUNDIALSHOME/include/cvodes/cvodes.h | grep CVodeCreate" I get:
* CVodeCreate
* CVodeCreate (lmm, iter),
* Symbolic constants for the lmm and iter parameters to CVodeCreate
* Function : CVodeCreate
* CVodeCreate creates an internal memory block for a problem to
* If successful, CVodeCreate returns a pointer to initialized
* If an initialization error occurs, CVodeCreate prints an error
SUNDIALS_EXPORT void *CVodeCreate(int lmm, int iter);
* cvode_mem is pointer to CVODE memory returned by CVodeCreate.
* CVodeCreate has not been called).
* cvode_mem is a pointer to CVODES memory returned by CVodeCreate
* cvode_mem is pointer to CVODES memory returned by CVodeCreate
* after CVodeCreate, and before CVode. The arguments are:
* cvode_mem = pointer to CVODE memory returned by CVodeCreate.
* returned by CVodeCreate.
* cvode_mem returned by CVodeCreate.
* cvode_mem returned by CVodeCreate.
* pointer cvode_mem returned by CVodeCreate.
* CVodeCreate.
* calling CVodeCreate) failed to set one of the
* CVodeCreate.
* by calling CVodeCreateB). The CVODES memory for the forward and
* CVodeCreateB,
SUNDIALS_EXPORT int CVodeCreateB(void *cvode_mem, int lmmB, int iterB, int *which);
* through calls to CVodeCreateB through a sequence of forward-backward
So the file cvodes.h does exist and it does have a function called CVodeCreate
Next I checked the files in .sconf_temp. If I do "ls .sconf_test" I get:
conftest_0.cpp conftest_0.o conftest_1.c conftest_1.o conftest_2.c conftest_2.o conftest_3.cpp conftest_3.o conftest_4.cpp conftest_4.o conftest_5.cpp conftest_6.cpp conftest_7.c
Then I tried checking to see if the compiler can find the cvodes.h header. I did the following.
mkdir ../test
cp -r .sconf_temp ../test/.sconf_temp
cd ../test
g++ -o .sconf_temp/conftest_6.o -c -ftemplate-depth-128 -pthread -O3 -DNDEBUG -finline-functions -Wno-inline -g -I/exports/apps/boost/1.55/include -I/group/hpc-share/sundials/sundials-2.4.0/include .sconf_temp/conftest_6.cpp
ls .sconf_temp
and I get
conftest_0.cpp conftest_1.c conftest_2.c conftest_3.cpp conftest_4.cpp conftest_5.cpp conftest_6.o
conftest_0.o conftest_1.o conftest_2.o conftest_3.o conftest_4.o conftest_6.cpp conftest_7.c
Which means the compiler can find the header and compile the conftest_6.o successfully.
Can anyone help me from here?
Thanks,
Shane
p.s. I am running scons 2.1.0 and python 2.7.5