View Issue Details

IDProjectCategoryView StatusLast Update
0000583ascendbuild-linuxpublic2014-06-07 04:25
Reporteracobar 
Assigned Tojohn 
PriorityhighSeveritymajorReproducibilityalways
Status assignedResolutionopen 
PlatformlinuxOSopenSUSEOS Version 13.1
Product Version 
Target VersionFixed in Version 
Summary0000583: Patches for issues with python, tcl/tk and scons build script
DescriptionHi,

While trying to build ascend on openSUSE I had to cope with some small issues:

- pygtk module could not be build because of a deprecated property;
- tcl/tk could not be build also because of deprecated access method;
- sundials validity check failed;
- ufsparse on many distributions now goes to "/usr/include/suitesparse";
- SConstruct had many checks that should be changed.

I patched everything I found and it is building properly (almost) now. There is a last issue, though, I could not spot the correct place to change: where goes the "models" modules. With the changes I did, I expected them to be installed on "/usr/lib64/ascend/models" and, even though this is the place where the installer put them, to make ascend actually find them I had to create a link from there to "/usr/share/ascend/models", after what, everything seems to be working fine.

Attached are the patches I had to apply.

Let me know if I may help with something else.

Best regards,
André
Additional Information--- ./ascend-config.in.orig 2013-03-10 17:03:10.603758980 -0300
+++ ./ascend-config.in 2014-03-06 15:59:34.362308266 -0300
@@ -111,7 +111,7 @@
 
 if options.libs:
     libs = ""
- if LIB!="/usr/lib":
+ if LIB!="/usr/lib64":
         libs = LIB
     Lflag = ""
     if len(libs):

--- ./ascend/linear/mtx_csparse.h.orig 2013-03-10 17:02:59.719758972 -0300
+++ ./ascend/linear/mtx_csparse.h 2014-03-06 15:59:34.524306240 -0300
@@ -39,7 +39,7 @@
 */
 
 # ifdef ASC_WITH_UFSPARSE
-# include "ufsparse/cs.h"
+# include "suitesparse/cs.h"
 /* defaults to (int,int,double) which is what we want. */
 
 ASC_DLLSPEC cs *mtx_to_cs(mtx_matrix_t M);

--- ./pygtk/ipython_view.py.orig 2013-05-10 23:29:00.407123184 -0300
+++ ./pygtk/ipython_view.py 2014-03-06 15:59:30.951350909 -0300
@@ -67,7 +67,10 @@
     io = IPython.utils.io
 
     if input_func:
- IPython.frontend.terminal.interactiveshell.raw_input_original = input_func
+ if hasattr(IPython, 'frontend'):
+ IPython.frontend.terminal.interactiveshell.raw_input_original = input_func
+ else:
+ IPython.terminal.interactiveshell.raw_input_original = input_func
     if cin:
       io.stdin = io.IOStream(cin)
     if cout:
@@ -89,8 +92,12 @@
     configuring.InteractiveShell.colors = "Linux"
     old_stdout, old_stderr = sys.stdout, sys.stderr
     sys.stdout, sys.stderr = io.stdout.stream, io.stderr.stream
- self.IP = IPython.frontend.terminal.embed.InteractiveShellEmbed.instance(\
- config=configuring, user_ns=user_ns)
+ if hasattr(IPython, 'frontend'):
+ self.IP = IPython.frontend.terminal.embed.InteractiveShellEmbed.instance(\
+ config=configuring, user_ns=user_ns)
+ else:
+ self.IP = IPython.terminal.embed.InteractiveShellEmbed.instance(\
+ config=configuring, user_ns=user_ns)
     sys.stdout, sys.stderr = old_stdout, old_stderr
 
 
--- ./scons/sundials.py.orig 2013-09-22 11:45:44.115901396 -0300
+++ ./scons/sundials.py 2014-03-06 15:59:28.935376112 -0300
@@ -95,22 +95,8 @@
             env1['LIBS'] = None
             env1.ParseConfig(cmd)
 
- # tricky stuff to detect the necessary extra 'lapack' linkage if required
- if os.path.exists("/etc/lsb-release"):
- print "CHECKING SUNDIALS"
- s = env.WhereIs('sundials-config')
- if s == "/usr/bin/sundials-config":
- print "STANDARD CONFIG"
- # With Ubuntu 11.10 onwards, we need to explicitly add lapack (and blas?)
- f = file("/etc/lsb-release")
- v = {}
- for l in f:
- x = l.strip().split("=")
- v[x[0]] = x[1]
- print v
- if v['DISTRIB_ID']=="Ubuntu" and float(v['DISTRIB_RELEASE'])>=11.10:
- print "ADDING LAPACK"
- env1['LIBS'].append("lapack")
+ env1['LIBS'].append("lapack")
+ env1['LIBS'].append("blas")
 
             env['SUNDIALS_CPPPATH'] = env1.get('CPPPATH')
             env['SUNDIALS_LIBPATH'] = env1.get('LIBPATH')

--- ./solvers/ida/ida.h.orig 2013-03-10 17:02:33.732758954 -0300
+++ ./solvers/ida/ida.h 2014-03-06 15:59:34.893301627 -0300
@@ -38,7 +38,7 @@
 #endif
 
 /* SUNDIALS 2.4.0 introduces new DlsMat in place of DenseMat */
-#if SUNDIALS_VERSION_MAJOR==2 && SUNDIALS_VERSION_MINOR==4
+#if SUNDIALS_VERSION_MAJOR==2 && SUNDIALS_VERSION_MINOR>=4
 # define IDA_MTX_T DlsMat
 # define IDADENSE_SUCCESS IDADLS_SUCCESS
 # define IDADENSE_MEM_NULL IDADLS_MEM_NULL

--- ./tcltk/interface/Driver.c.orig 2013-03-10 17:01:54.316758926 -0300
+++ ./tcltk/interface/Driver.c 2014-03-06 15:59:34.592305390 -0300
@@ -1018,7 +1018,7 @@
   Tcl_CreateChannelHandler(chan, TCL_READABLE, StdinProc,
                            (ClientData) chan);
   Tcl_DStringFree(&g_command);
- if (*interp->result != 0) {
+ if (*Tcl_GetStringResult(interp) != 0) {
     if ((code != TCL_OK) || (tty)) {
       /*
        * The statement below used to call "printf", but that resulted
@@ -1027,7 +1027,7 @@
        * NOTE: This probably will not work under Windows either.
        */
 
- puts(interp->result);
+ puts(Tcl_GetStringResult(interp));
     }
   }
 
@@ -1103,7 +1103,7 @@
 
       errChannel = Tcl_GetChannel(interp, "stderr", NULL);
       if (errChannel != (Tcl_Channel) NULL) {
- Tcl_Write(errChannel, interp->result, -1);
+ Tcl_Write(errChannel, Tcl_GetStringResult(interp), -1);
         Tcl_Write(errChannel, "\n", 1);
       }
       goto defaultPrompt;

--- ./tcltk/interface/ScriptProc.c.orig 2013-03-10 17:01:56.180758927 -0300
+++ ./tcltk/interface/ScriptProc.c 2014-03-06 15:59:34.814302615 -0300
@@ -212,7 +212,7 @@
   mainwin = Tk_MainWindow(interp);
   tkwin = Tk_NameToWindow(interp,argv[1],mainwin);
   if (!tkwin) {
- return TCL_ERROR; /* a message should be in the interp->result */
+ return TCL_ERROR; /* a message should be in the Tcl_GetStringResult(interp) */
   }
   display = Tk_Display(tkwin);
   window = Tk_WindowId(tkwin);

--- ./SConstruct.orig 2013-12-18 14:56:42.319431313 -0200
+++ ./SConstruct 2014-03-06 15:59:34.522306265 -0300
@@ -34,9 +34,15 @@
 #print "PLATFORM = ",platform.system()
 
 soname_major = "." + soname_major_int
-default_install_prefix = '/usr/local'
+lib_dir = 'lib64'
+tcl_ver = '8.6'
+tk_ver = '8.6'
+tcltk_minor_max = '6'
+tktable_ver = '2.10'
+sundials_minor_max = '5'
+default_install_prefix = '/usr'
 default_install_bin = "$INSTALL_PREFIX/bin"
-default_install_lib = "$INSTALL_PREFIX/lib"
+default_install_lib = "$INSTALL_PREFIX/${lib_dir}"
 default_install_models = "$INSTALL_LIB/ascend/models"
 default_install_solvers = "$INSTALL_LIB/ascend/solvers"
 default_install_assets = "$INSTALL_ASCDATA/glade/"
@@ -45,15 +51,15 @@
 default_install_python = distutils.sysconfig.get_python_lib(plat_specific=1)
 default_install_python_ascend = "$INSTALL_PYTHON/ascend"
 default_tcl = '/usr'
-default_tcl_libpath = "$TCL/lib"
+default_tcl_libpath = "$TCL/${lib_dir}"
 default_tcl_cpppath = "$TCL/include"
 default_conopt_envvar="CONOPT_PATH"
 default_with_graphviz = True
-default_tcl_lib = "tcl8.5"
-default_tk_lib = "tk8.5"
-default_tktable_lib = "Tktable2.9"
+default_tcl_lib = "tcl${tcl_ver}"
+default_tk_lib = "tk${tk_ver}"
+default_tktable_lib = "Tktable${tktable_ver}"
 default_ida_prefix="$DEFAULT_PREFIX"
-default_ipopt_libpath = "$IPOPT_PREFIX/lib"
+default_ipopt_libpath = "$IPOPT_PREFIX/${lib_dir}"
 default_ipopt_dll = ["$DEFAULT_PREFIX/bin/%s.dll"%i for i in ["libgfortran$MINGW64SUFF-3", "libstdc++$MINGW64SUFF-6","libquadmath$MINGW64SUFF-0","libgcc_s$MINGW64EXCPT$MINGW64SUFF-1"]]+[None] # should be five here
 default_ipopt_libs = ["$F2C_LIB","blas","lapack","pthread","ipopt"]
 default_conopt_prefix="$DEFAULT_PREFIX"
@@ -61,7 +67,7 @@
 default_conopt_cpppath="$CONOPT_PREFIX"
 default_conopt_dlpath="$CONOPT_PREFIX"
 default_prefix="/usr"
-default_libpath="$DEFAULT_PREFIX/lib"
+default_libpath="$DEFAULT_PREFIX/${lib_dir}"
 default_cpppath="$DEFAULT_PREFIX/include"
 default_f2c_lib="gfortran"
 default_swig="swig"
@@ -181,16 +187,16 @@
 
     # here's the folklore we know.
     if os.path.exists("/etc/debian_version"):
- default_tcl_cpppath = "/usr/include/tcl8.4"
- default_tcl_lib = "tcl8.4"
- default_tk_lib = "tk8.4"
- default_tktable_lib = "Tktable2.8"
+ default_tcl_cpppath = "/usr/include/tcl${tcl_ver}"
+ default_tcl_lib = "tcl${tcl_ver}"
+ default_tk_lib = "tk${tk_ver}"
+ default_tktable_lib = "Tktable${tktable_ver}"
 
     if os.path.exists("/etc/SuSE-release"):
         default_tcl_cpppath = "/usr/include"
- default_tcl_lib = "tcl8.4"
- default_tk_lib = "tk8.4"
- default_tktable_lib = "Tktable2.9"
+ default_tcl_lib = "tcl${tcl_ver}"
+ default_tk_lib = "tk${tk_ver}"
+ default_tktable_lib = "Tktable${tktable_ver}"
 
     if os.path.exists("/etc/lsb-release"):
         _f = file("/etc/lsb-release")
@@ -202,15 +208,15 @@
                 print LSB
         if LSB.has_key('DISTRIB_ID') and LSB['DISTRIB_ID'] == "Ubuntu":
             if float(LSB['DISTRIB_RELEASE']) >= 9.04:
- default_tcl_lib = "tcl8.5"
- default_tk_lib = "tk8.5"
- default_tktable_lib = "Tktable2.9"
- default_tcl_cpppath = "/usr/include/tcl8.5"
+ default_tcl_lib = "tcl${tcl_ver}"
+ default_tk_lib = "tk${tk_ver}"
+ default_tktable_lib = "Tktable${tktable_ver}"
+ default_tcl_cpppath = "/usr/include/tcl${tcl_ver}"
             if not os.path.exists(default_tcl_cpppath):
- default_tcl_lib = "tcl8.4"
- default_tk_lib = "tk8.4"
- default_tktable_lib = "Tktable2.9"
- default_tcl_cpppath = "/usr/include/tcl8.4"
+ default_tcl_lib = "tcl${tcl_ver}"
+ default_tk_lib = "tk${tk_ver}"
+ default_tktable_lib = "Tktable${tktable_ver}"
+ default_tcl_cpppath = "/usr/include/tcl${tcl_ver}"
                 
     # centos 5
     if os.path.exists("/etc/redhat-release"):
@@ -219,20 +225,20 @@
         if sys.maxint > 2**32:
             default_tcl_libpath = "/usr/lib64"
         else:
- default_tcl_libpath = "/usr/lib"
+ default_tcl_libpath = "/usr/${lib_dir}"
         default_tk_lib = "tk"
- default_tktable_lib = "Tktable2.9"
+ default_tktable_lib = "Tktable${tktable_ver}"
             
 
     default_absolute_paths = True
     default_dist_rel_bin = '..'
     default_tk_rel_dist = 'share/ascend/tcltk'
- default_library_rel_dist = 'lib/ascend/models'
- default_solvers_rel_dist = 'lib/ascend/solvers'
+ default_library_rel_dist = '${lib_dir}/ascend/models'
+ default_solvers_rel_dist = '${lib_dir}/ascend/solvers'
 
- default_conopt_libpath="$CONOPT_PREFIX/lib"
+ default_conopt_libpath="$CONOPT_PREFIX/${lib_dir}"
     default_conopt_cpppath="$CONOPT_PREFIX/include"
- default_conopt_dlpath= default_conopt_libpath + ":/usr/local/lib"
+ default_conopt_dlpath= default_conopt_libpath + ":/usr/${lib_dir}"
     default_conopt_lib="consub3"
 
     need_libm = True
@@ -405,7 +411,7 @@
 # Where are the CUnit libraries?
 vars.Add(PackageVariable('CUNIT_LIBPATH'
     ,"Where are your CUnit libraries?"
- ,"$CUNIT_PREFIX/lib"
+ ,"$CUNIT_PREFIX/${lib_dir}"
 ))
 
 # ----- conopt-----
@@ -558,11 +564,11 @@
 
 vars.Add('TKTABLE_LIBPATH'
     ,'Location of TkTable static library'
- ,'$TCL_LIBPATH/Tktable2.8'
+ ,'$TCL_LIBPATH/Tktable${tktable_ver}'
 )
 
 vars.Add('TKTABLE_LIB'
- ,'Stem name of TkTable (eg tktable2.8, no ".so" or "lib") shared library, or full path of static tktable (/usr/lib/...)'
+ ,'Stem name of TkTable (eg tktable${tktable_ver}, no ".so" or "lib") shared library, or full path of static tktable (/usr/${lib_dir}/...)'
     ,default_tktable_lib
 )
 
@@ -578,7 +584,7 @@
 
 vars.Add('X11_LIBPATH'
     ,'Location of X11 lib. EXPERIMENTAL'
- ,'$X11/lib'
+ ,'$X11/${lib_dir}'
 )
 
 vars.Add('X11_CPPPATH'
@@ -1417,7 +1423,7 @@
 # ufsparse test
 
 ufsparse_test_text = """
-#include <ufsparse/cs.h>
+#include <suitesparse/cs.h>
 int main(void){
     cs *A,*B,*C;
     C = cs_multiply(A,B);
@@ -1428,7 +1434,7 @@
 def CheckUFSparse(context):
     return CheckExtLib(context
         ,libname='cxsparse'
- ,varprefix='ufsparse'
+ ,varprefix='suitesparse'
         ,text=ufsparse_test_text
         ,ext=".c"
     )
@@ -1602,7 +1608,7 @@
 
 sundials_version_major_required = 2
 sundials_version_minor_min = 4
-sundials_version_minor_max = 4
+sundials_version_minor_max = sundials_minor_max
 
 sundials_version_text = """
 #include <sundials/sundials_config.h>
@@ -1759,7 +1765,7 @@
 # Tcl test
 
 # TCL and TK required version 8.1 through 8.5:
-tcltk_minor_newest_acceptable = 5
+tcltk_minor_newest_acceptable = tcltk_minor_max
 tcltk_major_required = 8
 
 tcl_check_text = r"""
@@ -2707,7 +2713,7 @@
     libascend_env.Append(LIBS=['dmalloc'])
 
 if with_ufsparse:
- libascend_env.Append(LIBS=['cxsparse'])
+ libascend_env.Append(LIBS=['cxsparse', 'metis', 'suitesparseconfig', 'cerbla'])
 
 if platform.system()=="Linux":
     libascend_env.Append(LINKFLAGS=['-Wl,-soname,%s' % soname_full])
TagsNo tags attached.

Relationships

Activities

acobar

2014-03-07 06:51

reporter  

ascend-ascend-config.in.diff (265 bytes)
--- ./ascend-config.in.orig	2013-03-10 17:03:10.603758980 -0300
+++ ./ascend-config.in	2014-03-06 15:59:34.362308266 -0300
@@ -111,7 +111,7 @@
 
 if options.libs:
 	libs = ""
-	if LIB!="/usr/lib":
+	if LIB!="/usr/lib64":
 		libs = LIB
 	Lflag  = ""
 	if len(libs):

acobar

2014-03-07 06:51

reporter  

ascend-ascend_linear_mtx_csparse.h.diff (360 bytes)
--- ./ascend/linear/mtx_csparse.h.orig	2013-03-10 17:02:59.719758972 -0300
+++ ./ascend/linear/mtx_csparse.h	2014-03-06 15:59:34.524306240 -0300
@@ -39,7 +39,7 @@
 */
 
 # ifdef ASC_WITH_UFSPARSE
-#  include "ufsparse/cs.h"
+#  include "suitesparse/cs.h"
 /* defaults to (int,int,double) which is what we want. */
 
 ASC_DLLSPEC cs *mtx_to_cs(mtx_matrix_t M);

acobar

2014-03-07 06:51

reporter  

ascend-pygtk_ipython_view.py.diff (1,244 bytes)
--- ./pygtk/ipython_view.py.orig	2013-05-10 23:29:00.407123184 -0300
+++ ./pygtk/ipython_view.py	2014-03-06 15:59:30.951350909 -0300
@@ -67,7 +67,10 @@
     io = IPython.utils.io
 
     if input_func:
-      IPython.frontend.terminal.interactiveshell.raw_input_original = input_func
+      if hasattr(IPython, 'frontend'):
+        IPython.frontend.terminal.interactiveshell.raw_input_original = input_func
+      else:
+        IPython.terminal.interactiveshell.raw_input_original = input_func
     if cin:
       io.stdin = io.IOStream(cin)
     if cout:
@@ -89,8 +92,12 @@
     configuring.InteractiveShell.colors = "Linux"
     old_stdout, old_stderr = sys.stdout, sys.stderr
     sys.stdout, sys.stderr = io.stdout.stream, io.stderr.stream
-    self.IP = IPython.frontend.terminal.embed.InteractiveShellEmbed.instance(\
-            config=configuring, user_ns=user_ns)
+    if hasattr(IPython, 'frontend'):
+      self.IP = IPython.frontend.terminal.embed.InteractiveShellEmbed.instance(\
+                config=configuring, user_ns=user_ns)
+    else:
+      self.IP = IPython.terminal.embed.InteractiveShellEmbed.instance(\
+                config=configuring, user_ns=user_ns)
     sys.stdout, sys.stderr = old_stdout, old_stderr
 
 

acobar

2014-03-07 06:52

reporter  

ascend-scons_sundials.py.diff (982 bytes)
--- ./scons/sundials.py.orig	2013-09-22 11:45:44.115901396 -0300
+++ ./scons/sundials.py	2014-03-06 15:59:28.935376112 -0300
@@ -95,22 +95,8 @@
 			env1['LIBS'] = None
 			env1.ParseConfig(cmd)
 
-			# tricky stuff to detect the necessary extra 'lapack' linkage if required
-			if os.path.exists("/etc/lsb-release"):
-				print "CHECKING SUNDIALS"
-				s = env.WhereIs('sundials-config')
-				if s == "/usr/bin/sundials-config":
-					print "STANDARD CONFIG"
-					# With Ubuntu 11.10 onwards, we need to explicitly add lapack (and blas?)
-					f = file("/etc/lsb-release")
-					v = {}
-					for l in f:
-						x = l.strip().split("=")
-						v[x[0]] = x[1]
-					print v
-					if v['DISTRIB_ID']=="Ubuntu" and float(v['DISTRIB_RELEASE'])>=11.10:
-						print "ADDING LAPACK"
-						env1['LIBS'].append("lapack")
+			env1['LIBS'].append("lapack")
+			env1['LIBS'].append("blas")
 
 			env['SUNDIALS_CPPPATH'] = env1.get('CPPPATH')
 			env['SUNDIALS_LIBPATH'] = env1.get('LIBPATH')

acobar

2014-03-07 06:52

reporter  

ascend-SConstruct.diff (6,716 bytes)
--- ./SConstruct.orig	2013-12-18 14:56:42.319431313 -0200
+++ ./SConstruct	2014-03-06 15:59:34.522306265 -0300
@@ -34,9 +34,15 @@
 #print "PLATFORM = ",platform.system()
 
 soname_major = "." + soname_major_int
-default_install_prefix = '/usr/local'
+lib_dir = 'lib64'
+tcl_ver = '8.6'
+tk_ver = '8.6'
+tcltk_minor_max = '6'
+tktable_ver = '2.10'
+sundials_minor_max = '5'
+default_install_prefix = '/usr'
 default_install_bin = "$INSTALL_PREFIX/bin"
-default_install_lib = "$INSTALL_PREFIX/lib"
+default_install_lib = "$INSTALL_PREFIX/${lib_dir}"
 default_install_models = "$INSTALL_LIB/ascend/models"
 default_install_solvers = "$INSTALL_LIB/ascend/solvers"
 default_install_assets = "$INSTALL_ASCDATA/glade/"
@@ -45,15 +51,15 @@
 default_install_python = distutils.sysconfig.get_python_lib(plat_specific=1)
 default_install_python_ascend = "$INSTALL_PYTHON/ascend"
 default_tcl = '/usr'
-default_tcl_libpath = "$TCL/lib"
+default_tcl_libpath = "$TCL/${lib_dir}"
 default_tcl_cpppath = "$TCL/include"
 default_conopt_envvar="CONOPT_PATH"
 default_with_graphviz = True
-default_tcl_lib = "tcl8.5"
-default_tk_lib = "tk8.5"
-default_tktable_lib = "Tktable2.9"
+default_tcl_lib = "tcl${tcl_ver}"
+default_tk_lib = "tk${tk_ver}"
+default_tktable_lib = "Tktable${tktable_ver}"
 default_ida_prefix="$DEFAULT_PREFIX"
-default_ipopt_libpath = "$IPOPT_PREFIX/lib"
+default_ipopt_libpath = "$IPOPT_PREFIX/${lib_dir}"
 default_ipopt_dll = ["$DEFAULT_PREFIX/bin/%s.dll"%i for i in ["libgfortran$MINGW64SUFF-3", "libstdc++$MINGW64SUFF-6","libquadmath$MINGW64SUFF-0","libgcc_s$MINGW64EXCPT$MINGW64SUFF-1"]]+[None] # should be five here
 default_ipopt_libs = ["$F2C_LIB","blas","lapack","pthread","ipopt"]
 default_conopt_prefix="$DEFAULT_PREFIX"
@@ -61,7 +67,7 @@
 default_conopt_cpppath="$CONOPT_PREFIX"
 default_conopt_dlpath="$CONOPT_PREFIX"
 default_prefix="/usr"
-default_libpath="$DEFAULT_PREFIX/lib"
+default_libpath="$DEFAULT_PREFIX/${lib_dir}"
 default_cpppath="$DEFAULT_PREFIX/include"
 default_f2c_lib="gfortran"
 default_swig="swig"
@@ -181,16 +187,16 @@
 
 	# here's the folklore we know.
 	if os.path.exists("/etc/debian_version"):
-		default_tcl_cpppath = "/usr/include/tcl8.4"
-		default_tcl_lib = "tcl8.4"
-		default_tk_lib = "tk8.4"
-		default_tktable_lib = "Tktable2.8"
+		default_tcl_cpppath = "/usr/include/tcl${tcl_ver}"
+		default_tcl_lib = "tcl${tcl_ver}"
+		default_tk_lib = "tk${tk_ver}"
+		default_tktable_lib = "Tktable${tktable_ver}"
 
 	if os.path.exists("/etc/SuSE-release"):
 		default_tcl_cpppath = "/usr/include"
-		default_tcl_lib = "tcl8.4"
-		default_tk_lib = "tk8.4"
-		default_tktable_lib = "Tktable2.9"
+		default_tcl_lib = "tcl${tcl_ver}"
+		default_tk_lib = "tk${tk_ver}"
+		default_tktable_lib = "Tktable${tktable_ver}"
 
 	if os.path.exists("/etc/lsb-release"):
 		_f = file("/etc/lsb-release")
@@ -202,15 +208,15 @@
                 print LSB
 		if LSB.has_key('DISTRIB_ID') and LSB['DISTRIB_ID'] == "Ubuntu":
 			if float(LSB['DISTRIB_RELEASE']) >= 9.04:
-				default_tcl_lib = "tcl8.5"
-				default_tk_lib = "tk8.5"
-				default_tktable_lib = "Tktable2.9"
-				default_tcl_cpppath = "/usr/include/tcl8.5"
+				default_tcl_lib = "tcl${tcl_ver}"
+				default_tk_lib = "tk${tk_ver}"
+				default_tktable_lib = "Tktable${tktable_ver}"
+				default_tcl_cpppath = "/usr/include/tcl${tcl_ver}"
 			if not os.path.exists(default_tcl_cpppath):
-				default_tcl_lib = "tcl8.4"
-				default_tk_lib = "tk8.4"
-				default_tktable_lib = "Tktable2.9"
-				default_tcl_cpppath = "/usr/include/tcl8.4"
+				default_tcl_lib = "tcl${tcl_ver}"
+				default_tk_lib = "tk${tk_ver}"
+				default_tktable_lib = "Tktable${tktable_ver}"
+				default_tcl_cpppath = "/usr/include/tcl${tcl_ver}"
 				
 	# centos 5
 	if os.path.exists("/etc/redhat-release"):
@@ -219,20 +225,20 @@
 		if sys.maxint > 2**32:
 			default_tcl_libpath = "/usr/lib64"
 		else:
-			default_tcl_libpath = "/usr/lib"
+			default_tcl_libpath = "/usr/${lib_dir}"
 		default_tk_lib = "tk"
-		default_tktable_lib = "Tktable2.9"
+		default_tktable_lib = "Tktable${tktable_ver}"
 			
 
 	default_absolute_paths = True
 	default_dist_rel_bin = '..'
 	default_tk_rel_dist = 'share/ascend/tcltk'
-	default_library_rel_dist = 'lib/ascend/models'
-	default_solvers_rel_dist = 'lib/ascend/solvers'
+	default_library_rel_dist = '${lib_dir}/ascend/models'
+	default_solvers_rel_dist = '${lib_dir}/ascend/solvers'
 
-	default_conopt_libpath="$CONOPT_PREFIX/lib"
+	default_conopt_libpath="$CONOPT_PREFIX/${lib_dir}"
 	default_conopt_cpppath="$CONOPT_PREFIX/include"
-	default_conopt_dlpath= default_conopt_libpath + ":/usr/local/lib"
+	default_conopt_dlpath= default_conopt_libpath + ":/usr/${lib_dir}"
 	default_conopt_lib="consub3"
 
 	need_libm = True
@@ -405,7 +411,7 @@
 # Where are the CUnit libraries?
 vars.Add(PackageVariable('CUNIT_LIBPATH'
 	,"Where are your CUnit libraries?"
-	,"$CUNIT_PREFIX/lib"
+	,"$CUNIT_PREFIX/${lib_dir}"
 ))
 
 # ----- conopt-----
@@ -558,11 +564,11 @@
 
 vars.Add('TKTABLE_LIBPATH'
 	,'Location of TkTable static library'
-	,'$TCL_LIBPATH/Tktable2.8'
+	,'$TCL_LIBPATH/Tktable${tktable_ver}'
 )
 
 vars.Add('TKTABLE_LIB'
-	,'Stem name of TkTable (eg tktable2.8, no ".so" or "lib") shared library, or full path of static tktable (/usr/lib/...)'
+	,'Stem name of TkTable (eg tktable${tktable_ver}, no ".so" or "lib") shared library, or full path of static tktable (/usr/${lib_dir}/...)'
 	,default_tktable_lib
 )
 
@@ -578,7 +584,7 @@
 
 vars.Add('X11_LIBPATH'
 	,'Location of X11 lib. EXPERIMENTAL'
-	,'$X11/lib'
+	,'$X11/${lib_dir}'
 )
 
 vars.Add('X11_CPPPATH'
@@ -1417,7 +1423,7 @@
 # ufsparse test
 
 ufsparse_test_text = """
-#include <ufsparse/cs.h>
+#include <suitesparse/cs.h>
 int main(void){
 	cs *A,*B,*C;
 	C = cs_multiply(A,B);
@@ -1428,7 +1434,7 @@
 def CheckUFSparse(context):
 	return CheckExtLib(context
 		,libname='cxsparse'
-		,varprefix='ufsparse'
+		,varprefix='suitesparse'
 		,text=ufsparse_test_text
 		,ext=".c"
 	)
@@ -1602,7 +1608,7 @@
 
 sundials_version_major_required = 2
 sundials_version_minor_min = 4
-sundials_version_minor_max = 4
+sundials_version_minor_max = sundials_minor_max
 
 sundials_version_text = """
 #include <sundials/sundials_config.h>
@@ -1759,7 +1765,7 @@
 # Tcl test
 
 # TCL and TK required version 8.1 through 8.5:
-tcltk_minor_newest_acceptable = 5
+tcltk_minor_newest_acceptable = tcltk_minor_max
 tcltk_major_required = 8
 
 tcl_check_text = r"""
@@ -2707,7 +2713,7 @@
 	libascend_env.Append(LIBS=['dmalloc'])
 
 if with_ufsparse:
-	libascend_env.Append(LIBS=['cxsparse'])
+	libascend_env.Append(LIBS=['cxsparse', 'metis', 'suitesparseconfig', 'cerbla'])
 
 if platform.system()=="Linux":
 	libascend_env.Append(LINKFLAGS=['-Wl,-soname,%s' % soname_full])
ascend-SConstruct.diff (6,716 bytes)

acobar

2014-03-07 06:52

reporter  

ascend-solvers_ida_ida.h.diff (451 bytes)
--- ./solvers/ida/ida.h.orig	2013-03-10 17:02:33.732758954 -0300
+++ ./solvers/ida/ida.h	2014-03-06 15:59:34.893301627 -0300
@@ -38,7 +38,7 @@
 #endif
 
 /* SUNDIALS 2.4.0 introduces new DlsMat in place of DenseMat */
-#if SUNDIALS_VERSION_MAJOR==2 && SUNDIALS_VERSION_MINOR==4
+#if SUNDIALS_VERSION_MAJOR==2 && SUNDIALS_VERSION_MINOR>=4
 # define IDA_MTX_T DlsMat
 # define IDADENSE_SUCCESS IDADLS_SUCCESS
 # define IDADENSE_MEM_NULL IDADLS_MEM_NULL

acobar

2014-03-07 06:53

reporter  

ascend-tcltk_interface_Driver.c.diff (1,005 bytes)
--- ./tcltk/interface/Driver.c.orig	2013-03-10 17:01:54.316758926 -0300
+++ ./tcltk/interface/Driver.c	2014-03-06 15:59:34.592305390 -0300
@@ -1018,7 +1018,7 @@
   Tcl_CreateChannelHandler(chan, TCL_READABLE, StdinProc,
                            (ClientData) chan);
   Tcl_DStringFree(&g_command);
-  if (*interp->result != 0) {
+  if (*Tcl_GetStringResult(interp) != 0) {
     if ((code != TCL_OK) || (tty)) {
       /*
        * The statement below used to call "printf", but that resulted
@@ -1027,7 +1027,7 @@
        * NOTE: This probably will not work under Windows either.
        */
 
-      puts(interp->result);
+      puts(Tcl_GetStringResult(interp));
     }
   }
 
@@ -1103,7 +1103,7 @@
 
       errChannel = Tcl_GetChannel(interp, "stderr", NULL);
       if (errChannel != (Tcl_Channel) NULL) {
-        Tcl_Write(errChannel, interp->result, -1);
+        Tcl_Write(errChannel, Tcl_GetStringResult(interp), -1);
         Tcl_Write(errChannel, "\n", 1);
       }
       goto defaultPrompt;

acobar

2014-03-07 06:53

reporter  

ascend-tcltk_interface_ScriptProc.c.diff (496 bytes)
--- ./tcltk/interface/ScriptProc.c.orig	2013-03-10 17:01:56.180758927 -0300
+++ ./tcltk/interface/ScriptProc.c	2014-03-06 15:59:34.814302615 -0300
@@ -212,7 +212,7 @@
   mainwin = Tk_MainWindow(interp);
   tkwin = Tk_NameToWindow(interp,argv[1],mainwin);
   if (!tkwin) {
-    return TCL_ERROR; /* a message should be in the interp->result */
+    return TCL_ERROR; /* a message should be in the Tcl_GetStringResult(interp) */
   }
   display = Tk_Display(tkwin);
   window = Tk_WindowId(tkwin);

acobar

2014-03-07 11:35

reporter   ~0000991

Last edited: 2014-03-07 11:43

View 3 revisions

There is one more thing to add, the default sundials (2.5.0) package of openSUSE lacks the ascend needed header file. On investigation I noted that a minor adjustment was needed, i.e., I had to add the below command to sundials.spec:

for dir in cvode cvodes ida idas kinsol nvec_ser nvec_par; do
  cp -r src/$dir/*.h ${RPM_BUILD_ROOT}%{_includedir}/${dir/_*/tor}
done

May I remember something I missed, I will update this report.

Thank you for the useful and nice application.

Regards,
André

john

2014-03-07 12:05

administrator   ~0000992

Last edited: 2014-03-07 12:06

View 2 revisions

Hi André

Thanks so much for this group of patches! I don't suppose you're able to provide a single patch file against our SVN trunk repository current head revision, by any chance?

I think there have been some API changes in Sundials 2.5.0, so I will need to check carefully on this. Ksenija Bestuzheva is also worth asking about this, http://ascend4.org/User:Ksenija.

Cheers
JP

acobar

2014-03-07 17:50

reporter   ~0000993

Hi John,

They are already against svn trunk. You can just catenate the attached patches but I would not do it because, I think, it is easier to revise them by seeing what modules they affect. The logic applied to patch name generation is the following:

ascend-${file_path//\//_}.diff

Cheers,
André

acobar

2014-03-09 11:14

reporter   ~0000994

OK, my bad, found why I had to create the link to models directory, was a problem on my ascend.spec, it is already fixed and working fine.

Regards,
André

sagitter

2014-06-07 04:25

reporter   ~0000995

Hi.

In reply to http://bugs.ascend4.org/view.php?id=583#c992 for John.

In Fedora, there is a difference between builds of release Sundials-2.5.0:

sundials-devel-2.5.0-3 (f20 package, see http://koji.fedoraproject.org/koji/rpminfo?rpmID=4294306), ascend detects properly all sundials libraries and IDA solver is compiled.

sundials-devel-2.5.0-4 (f21 package for testing, see http://koji.fedoraproject.org/koji/rpminfo?rpmID=5043919), ascend does not detect sundials libraries and IDA is not compiled.

Issue History

Date Modified Username Field Change
2014-03-07 06:49 acobar New Issue
2014-03-07 06:49 acobar Status new => assigned
2014-03-07 06:49 acobar Assigned To => john
2014-03-07 06:51 acobar File Added: ascend-ascend-config.in.diff
2014-03-07 06:51 acobar File Added: ascend-ascend_linear_mtx_csparse.h.diff
2014-03-07 06:51 acobar File Added: ascend-pygtk_ipython_view.py.diff
2014-03-07 06:52 acobar File Added: ascend-scons_sundials.py.diff
2014-03-07 06:52 acobar File Added: ascend-SConstruct.diff
2014-03-07 06:52 acobar File Added: ascend-solvers_ida_ida.h.diff
2014-03-07 06:53 acobar File Added: ascend-tcltk_interface_Driver.c.diff
2014-03-07 06:53 acobar File Added: ascend-tcltk_interface_ScriptProc.c.diff
2014-03-07 11:35 acobar Note Added: 0000991
2014-03-07 11:39 acobar Note Edited: 0000991 View Revisions
2014-03-07 11:43 acobar Note Edited: 0000991 View Revisions
2014-03-07 12:05 john Note Added: 0000992
2014-03-07 12:06 john Note Edited: 0000992 View Revisions
2014-03-07 17:50 acobar Note Added: 0000993
2014-03-09 11:14 acobar Note Added: 0000994
2014-06-07 04:25 sagitter Note Added: 0000995