View Issue Details

IDProjectCategoryView StatusLast Update
0000591ascendgeneralpublic2017-02-10 17:50
Reportergeorgyberdyshev 
Assigned Tojohn 
PriorityhighSeverityblockReproducibilityalways
Status resolvedResolutionfixed 
PlatformLinuxOSUbuntuOS Version16.04 LTS
Product Version 
Target VersionFixed in VersionSVN 
Summary0000591: FIx for Unknown SWIG preprocessor directive error.
DescriptionThe below commit fixes the Unknown SWIG preprocessor directive error, when using Swig 3.0.8 on Ubuntu 16.04.

This is due to a change in the syntax how comments in Python blocks are treated.

The fix works with Swig 2.x (Swig 2.0.11 on Ubuntu 14.04)

https://github.com/georgyberdyshev/ascend/commit/6962ef6c2ca36ff6cfff85e98c2daeac82619b82


Please merge the changes from the above URL or the attached patch.

Thanks in advance, Georgy
Steps To ReproduceCompile ASCEND using a Swig 3.x version (e.g. on Ubuntu 16.04).
TagsNo tags attached.

Relationships

Activities

georgyberdyshev

2016-04-02 16:44

reporter  

ascend-swig3.patch (1,571 bytes)
diff --git a/ascxx/ascpy.i b/ascxx/ascpy.i
index c31feac..4e2f373 100644
--- a/ascxx/ascpy.i
+++ b/ascxx/ascpy.i
@@ -201,7 +201,7 @@ class UnitsM;
 %rename(__str__) Dimensions::toString;
 
 %extend Dimensions{
-	%pythoncode {
+	%pythoncode %{
 		
 		def __str__(self):
 			return self.toString()
@@ -245,7 +245,7 @@ class UnitsM;
 
 			return Units(str)
 
-	}
+	%}
 }
 
 /*
@@ -308,7 +308,7 @@ public:
 		return self->getName().toString();
 	}
 
-	%pythoncode{
+	%pythoncode %{
 		def getPreferredUnits(self):
 			"""Return preferred units for an instance, which is done by lookup per atom type."""
 			if not self.isRefinedReal():
@@ -327,7 +327,7 @@ public:
 				return None
 
 			return _units;
-	}
+	%}
 }
 
 typedef enum{
@@ -429,7 +429,7 @@ public:
 		}
 	}
 		
-	%pythoncode {
+	%pythoncode %{
 		def getSetValue(self):
 			"""Return the value of a set, as a integer or string Python sequence."""
 			if self.isSetInt():
@@ -528,7 +528,7 @@ public:
 		def __radd__(self,other):
 			a,b = self.__coerce__(other)
 			return b + a
-	}
+	%}
 }
 
 /*
diff --git a/ascxx/plot.i b/ascxx/plot.i
index 5348af4..eb7fda4 100644
--- a/ascxx/plot.i
+++ b/ascxx/plot.i
@@ -7,7 +7,7 @@ SWIG interface for plotting from ASCEND
 %include "plot.h"
 
 %extend Plot{
-	%pythoncode{
+	%pythoncode %{
 		def show(self,mainloop=True):
 			import loading
 			loading.load_matplotlib(throw=True)
@@ -55,6 +55,6 @@ SWIG interface for plotting from ASCEND
 			# if self.getXLow() and self.getXHigh():
 			#	matplotlib.gca().set_xlim([self.getXLow(), self.getXHigh()])
 			# */
-	}
+	%}
 }
 
ascend-swig3.patch (1,571 bytes)

john

2017-02-10 17:50

administrator   ~0001015

fixed in changeset 3106.

Issue History

Date Modified Username Field Change
2016-04-02 16:44 georgyberdyshev New Issue
2016-04-02 16:44 georgyberdyshev File Added: ascend-swig3.patch
2017-02-10 17:50 john Assigned To => john
2017-02-10 17:50 john Status new => resolved
2017-02-10 17:50 john Resolution open => fixed
2017-02-10 17:50 john Fixed in Version => SVN
2017-02-10 17:50 john Note Added: 0001015