s-amouyal12 / cantera

Automatically exported from code.google.com/p/cantera
0 stars 0 forks source link

syntax error in setup.py if NEED_CATHERMO is false #9

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. edit 'preconfig' to disable "ideal solutions" and "electrolytes", but
with full python support.
---------------------
# This flag enables the inclusion of ideal solution capabilities
WITH_IDEAL_SOLUTIONS=${WITH_IDEAL_SOLUTIONS:="n"}

# Enable expanded electrochemistry capabilities, include thermo
# models for electrolyte solutions
WITH_ELECTROLYTES=${WITH_ELECTROLYTES:="n"}
-------------------------------
2. configure && make

What is the expected output? What do you see instead?
During make You get:
----------------------
touch src/pycantera.cpp 
/bin/rm -f _build
(CXX="g++"; export CXX; CC="g++"; export CC; CFLAGS="-O3 -Wall     -fPIC";
export CFLAGS; PURIFY=""; export PURIFY; /usr/bin/python2 setup.py build)
  File "setup.py", line 51
    need_cathermo = 
                   ^
SyntaxError: invalid syntax
make: *** [_build] Error 1
----------------------

What version of the product are you using? On what operating system?
cantera-1.8.0-beta, ubuntu-9.10 x86_64

Please provide any additional information below.

NEED_CATHERMO is defined in configure.in as:
----------
NEED_CATHERMO=
COMPILE_IDEAL_SOLUTIONS=0
if test "$WITH_IDEAL_SOLUTIONS" = "y"; then
   AC_DEFINE(WITH_IDEAL_SOLUTIONS)
   NEED_CATHERMO=1 
   COMPILE_IDEAL_SOLUTIONS=1
fi
AC_SUBST(COMPILE_IDEAL_SOLUTIONS)

COMPILE_ELECTROLYTES=0
if test "$WITH_ELECTROLYTES" = "y"; then
   AC_DEFINE(WITH_ELECTROLYTES)
   NEED_CATHERMO=1 
   COMPILE_ELECTROLYTES=1
fi
AC_SUBST(COMPILE_ELECTROLYTES)
AC_SUBST(NEED_CATHERMO)
----------

That is: NEED_CATHERMO is either 1 or empty string. 
It is later used as:

Line 51 of file Cantera/python/setup.py.in is:
-----
need_cathermo = @NEED_CATHERMO@
-----

Probably NEED_CATHERMO should use 0 as false value (instead of empty
string)? Or it should be inserted into python code as string, not as a number.

Original issue reported on code.google.com by Alexande...@googlemail.com on 13 Jan 2010 at 11:31

GoogleCodeExporter commented 9 years ago
I changed lines 51,52 of Cantera/python/setup.py.in to:
---------
need_cathermo = "@NEED_CATHERMO@"
if need_cathermo == "1":
---------
This allow me to compile everything, but python package was unusable.
An attempt to make "import Cantera" produce error message:
-----------
ImportError: /usr/local/lib/python2.6/dist-packages/Cantera/_cantera.so: 
undefined
symbol: _ZTIN7Cantera9SurfPhaseE
------------
Requred symbol is in libthermo, but this library is not added to 
"LOCAL_LIBS_DEP" if
NEED_CATHERMO is false.

So up to now compilation of cantera without NEED_CATHERMO is impossible.

Original comment by Alexande...@googlemail.com on 13 Jan 2010 at 12:17

GoogleCodeExporter commented 9 years ago

Original comment by yarmond on 28 May 2011 at 12:52

GoogleCodeExporter commented 9 years ago
Implicitly resolved by transition to SCons.

Original comment by yarmond on 9 Apr 2012 at 11:46