A couple of days ago I announced the LibSedML sourceforge project, a library for reading / writing SED-ML files. However, what was missing so far is information on how one would start using the library. (If you feel lucky, I provided a binary at the end of this post!)
Preparing the Virtual Machine
In the following, I’ll describe how to set up an OpenSuse 11.2 Virtual Machine, in order to run SED-ML Simulation Experiments:
- Actually, we are not setting up the virtual machine, but instead take the one provided by the Mono team. Simply download the VMware image from:
http://mono-project.com/Downloads
unzip and start the Virtual Machine. It will automatically log in as user ‘rupert’ - The first thing we might want to do is to get SBW started. While not strictly necessary … it will help us later on, when we just copy the binary libraries for LibSedMLRunner to execute the simulations. The Latest SBW version for linux can be found here:
http://sourceforge.net/projects/jdesigner/files/Systems%20Biology%20Workbench/2.7.10/SBW-2.7.10-linux-installer.bin/download
The file is simply installed by making it executable (chmod +x SBW-*bin) and executing the binary installer. - Next we might want to install a fresh copy of LibSBML, which is easily done by checking out libsbml from SVN:
svn co http://sbml.svn.sourceforge.net/svnroot/sbml/trunk/libsbml libsbml
the virtual machine at this point has no g++ so we get one by going to a root shell (root password is ‘mono’) and installing:
zypper install gcc-c++
zypper install libxml2-devel
(i also installed additional packages like ‘lapack’ but I’m not sure they are necessary) - Next we get the latest SWIG from http://www.swig.org/download.html, I just downloaded the 1.3.40 version, unpacked it with tar zxf, ran:
./configure && make && sudo make install
which installes SWIG into /usr/local - Now we can compile and run libsbml:
./configure --with-libxml=/usr --with-swig=/usr/local --with-csharp --enable-layout=no && make
which will compile libsbml and create the bindings in the src/bindings/csharp folder
Compiling LibSedML
So far for the prerequisites. The remaining could not be simpler. Here the whole session:
Directory: /home/rupert/Desktop
Tue Mar 9 02:35:51 UTC 2010
rupert@linux:~/Desktop> cd
rupert@linux:~> cd Development/
rupert@linux:~/Development> l
stotal 12
drwxr-xr-x 3 rupert users 4096 2010-03-08 20:20 ./
drwxr-xr-x 33 rupert users 4096 2010-03-08 22:21 ../
drwxr-xr-x 8 rupert users 4096 2010-03-08 20:21 sbwbuild/
rupert@linux:~/Development> svn co http://libsedml.svn.sourceforge.net/svnroot/libsedml/trunk LibSedML
A LibSedML/ICON_MIASE.ico
A LibSedML/SEDML.sln
A LibSedML/libSedMLScript
A LibSedML/libSedMLScript/HelperFunctions.py
A LibSedML/libSedMLScript/libSedMLScript.csproj
A LibSedML/libSedMLScript/SedMLPythonConverter.cs
A LibSedML/libSedMLScript/ITextImporter.cs
A LibSedML/libSedMLScript/ITextExporter.cs
A LibSedML/libSedMLScript/Properties
A LibSedML/libSedMLScript/Properties/AssemblyInfo.cs
A LibSedML/libSedMLScript/Properties/Resources.resx
A LibSedML/libSedMLScript/Properties/Resources.Designer.cs
A LibSedML/libSedMLScript/SedMLScript.cs
A LibSedML/SedMLWeb
A LibSedML/SedMLWeb/Default.aspx.designer.cs
A LibSedML/SedMLWeb/MasterASPX.master
A LibSedML/SedMLWeb/SedMLWeb.csproj
A LibSedML/SedMLWeb/Web.config
A LibSedML/SedMLWeb/Default.aspx.cs
A LibSedML/SedMLWeb/_sysbiostyles.css
A LibSedML/SedMLWeb/MasterASPX.master.cs
A LibSedML/SedMLWeb/SysBio_MasterASPX.master
A LibSedML/SedMLWeb/KGI0717_MasterASPX.master
A LibSedML/SedMLWeb/Properties
A LibSedML/SedMLWeb/Properties/AssemblyInfo.cs
A LibSedML/SedMLWeb/SysBio_MasterASPX.master.cs
A LibSedML/SedMLWeb/Default.aspx
A LibSedML/SedMLWeb/KGI0717_MasterASPX.master.cs
A LibSedML/Samples
A LibSedML/Samples/model1.xml
A LibSedML/Samples/sedmltest.txt
A LibSedML/Samples/curien.xml
A LibSedML/Samples/EllowitzRepressilator.miase
A LibSedML/Samples/lorenz.txt
A LibSedML/Samples/BIOMD0000000021.xml
A LibSedML/Samples/miaseTest.xml
A LibSedML/Samples/sedmlCurienJWS.xml
A LibSedML/Samples/JanaWolf.miase
A LibSedML/Samples/miaseBioModels21.xml
A LibSedML/Samples/brusselator.miase
A LibSedML/Samples/brusselator.xml
A LibSedML/Samples/lorenz.miase
A LibSedML/Samples/lorenz.xml
A LibSedML/Samples/sedMLBIOM21.miase
A LibSedML/Samples/sedMLBIOM21.xml
A LibSedML/libSedMLRunner
A LibSedML/libSedMLRunner/SedMLRunner.cs
A LibSedML/libSedMLRunner/libSedMLRunner.csproj
A LibSedML/libSedMLRunner/RunResult.cs
A LibSedML/libSedMLRunner/SimpleRunner.cs
A LibSedML/libSedMLRunner/Properties
A LibSedML/libSedMLRunner/Properties/AssemblyInfo.cs
A LibSedML/SedMLConsole
A LibSedML/SedMLConsole/ICON_MIASE.ico
A LibSedML/SedMLConsole/Web References
A LibSedML/SedMLConsole/Web References/BioModels
A LibSedML/SedMLConsole/Web References/BioModels/Reference.cs
A LibSedML/SedMLConsole/Web References/BioModels/BioModelsWebServices.wsdl
A LibSedML/SedMLConsole/Web References/BioModels/Reference.map
A LibSedML/SedMLConsole/Web References/MIRIAM
A LibSedML/SedMLConsole/Web References/MIRIAM/Reference.cs
A LibSedML/SedMLConsole/Web References/MIRIAM/MiriamWebServices.wsdl
A LibSedML/SedMLConsole/Web References/MIRIAM/Reference.map
A LibSedML/SedMLConsole/SedMLConsole.csproj.user
A LibSedML/SedMLConsole/app.config
A LibSedML/SedMLConsole/SedMLConsole.csproj
A LibSedML/SedMLConsole/Resources
A LibSedML/SedMLConsole/Resources/ICON_MIASE.ico
A LibSedML/SedMLConsole/Program.cs
A LibSedML/SedMLConsole/Properties
A LibSedML/SedMLConsole/Properties/AssemblyInfo.cs
A LibSedML/SedMLConsole/Properties/Settings.settings
A LibSedML/SedMLConsole/Properties/Settings.Designer.cs
A LibSedML/SedMLConsole/Properties/Resources.resx
A LibSedML/SedMLConsole/Properties/Resources.Designer.cs
A LibSedML/3rdParty
A LibSedML/3rdParty/Microsoft.Scripting.ExtensionAttribute.dll
A LibSedML/3rdParty/LibRoadRunner.dll
A LibSedML/3rdParty/Microsoft.Scripting.dll
A LibSedML/3rdParty/IronPython.dll
A LibSedML/3rdParty/ICSharpCode.SharpZipLib.dll
A LibSedML/3rdParty/mathLibrary.dll
A LibSedML/3rdParty/CompareData.dll
A LibSedML/3rdParty/IronPython.Modules.dll
A LibSedML/3rdParty/ZedGraph.Web.dll
A LibSedML/3rdParty/Microsoft.Dynamic.dll
A LibSedML/3rdParty/SBMLSupport.dll
A LibSedML/3rdParty/libsbmlcsP.dll
A LibSedML/3rdParty/SBWCSharp.dll
A LibSedML/3rdParty/Microsoft.Scripting.Core.dll
A LibSedML/3rdParty/LibStructuralCSharp.dll
A LibSedML/3rdParty/Microsoft.Scripting.Debugging.dll
A LibSedML/3rdParty/ZedGraph.dll
A LibSedML/SedMLScript
A LibSedML/SedMLScript/ICON_MIASE.ico
A LibSedML/SedMLScript/MainForm.resx
A LibSedML/SedMLScript/SedMLScriptTest.csproj
A LibSedML/SedMLScript/MainForm.Designer.cs
A LibSedML/SedMLScript/Program.cs
A LibSedML/SedMLScript/icons
A LibSedML/SedMLScript/icons/run.png
A LibSedML/SedMLScript/MainForm.cs
A LibSedML/SedMLScript/Properties
A LibSedML/SedMLScript/Properties/AssemblyInfo.cs
A LibSedML/SedMLScript/Properties/Settings.settings
A LibSedML/SedMLScript/Properties/Settings.Designer.cs
A LibSedML/SedMLScript/Properties/Resources.resx
A LibSedML/SedMLScript/Properties/Resources.Designer.cs
A LibSedML/libSedML
A LibSedML/libSedML/Report.cs
A LibSedML/libSedML/Util.cs
A LibSedML/libSedML/ModelStore.cs
A LibSedML/libSedML/UniformTimeCourse.cs
A LibSedML/libSedML/TaskStore.cs
A LibSedML/libSedML/DataGenerator.cs
A LibSedML/libSedML/Parameter.cs
A LibSedML/libSedML/SedMLInfo.cs
A LibSedML/libSedML/Simulation.cs
A LibSedML/libSedML/Variable.cs
A LibSedML/libSedML/Change.cs
A LibSedML/libSedML/libSedML.csproj
A LibSedML/libSedML/Properties
A LibSedML/libSedML/Properties/AssemblyInfo.cs
A LibSedML/libSedML/DataGeneratorStore.cs
A LibSedML/libSedML/SedMLBase.cs
A LibSedML/libSedML/Output.cs
A LibSedML/libSedML/Model.cs
A LibSedML/libSedML/SimulationStore.cs
A LibSedML/libSedML/Task.cs
A LibSedML/libSedML/Plot2D.cs
A LibSedML/IronPythonScript
Checked out revision 4.
rupert@linux:~/Development> cd LibSedML/
rupert@linux:~/Development/LibSedML> ls
3rdParty libSedML Samples SEDML.sln
ICON_MIASE.ico libSedMLRunner SedMLConsole SedMLWeb
IronPythonScript libSedMLScript SedMLScript
rupert@linux:~/Development/LibSedML> mdtool build -c:Release
MonoDevelop Build Tool
Loading solution: ./SEDML.sln
Loading solution: ./SEDML.sln
Loading projects ..
Building: SEDML (Release)
Building Solution SEDML
Building: libSedML (Release)
Performing main compilation...
/usr/bin/gmcs /noconfig
"/out:/home/rupert/Development/LibSedML/bin/libSedML.dll"
"/r:/home/rupert/Development/LibSedML/3rdParty/CompareData.dll"
"/r:/home/rupert/Development/LibSedML/3rdParty/ICSharpCode.SharpZipLib.
dll" "/r:/home/rupert/Development/LibSedML/3rdParty/libsbmlcsP.dll"
"/r:/home/rupert/Development/LibSedML/3rdParty/mathLibrary.dll"
"/r:/home/rupert/Development/LibSedML/3rdParty/SBMLSupport.dll"
"/r:/home/rupert/Development/LibSedML/3rdParty/SBWCSharp.dll"
"/r:System.dll" "/r:System.Data.dll" "/r:System.Xml.dll" /nologo
/warn:4 /optimize+ /codepage:utf8 /platform:x86 "/define:TRACE"
/t:library "/home/rupert/Development/LibSedML/libSedML/Change.cs"
"/home/rupert/Development/LibSedML/libSedML/DataGenerator.cs"
"/home/rupert/Development/LibSedML/libSedML/DataGeneratorStore.cs"
"/home/rupert/Development/LibSedML/libSedML/SedMLBase.cs"
"/home/rupert/Development/LibSedML/libSedML/SedMLInfo.cs"
"/home/rupert/Development/LibSedML/libSedML/Model.cs"
"/home/rupert/Development/LibSedML/libSedML/ModelStore.cs"
"/home/rupert/Development/LibSedML/libSedML/Output.cs"
"/home/rupert/Development/LibSedML/libSedML/Parameter.cs"
"/home/rupert/Development/LibSedML/libSedML/Plot2D.cs"
"/home/rupert/Development/LibSedML/libSedML/Properties/AssemblyInfo.cs"
"/home/rupert/Development/LibSedML/libSedML/Report.cs"
"/home/rupert/Development/LibSedML/libSedML/Simulation.cs"
"/home/rupert/Development/LibSedML/libSedML/SimulationStore.cs"
"/home/rupert/Development/LibSedML/libSedML/Task.cs"
"/home/rupert/Development/LibSedML/libSedML/TaskStore.cs"
"/home/rupert/Development/LibSedML/libSedML/UniformTimeCourse.cs"
"/home/rupert/Development/LibSedML/libSedML/Util.cs"
"/home/rupert/Development/LibSedML/libSedML/Variable.cs"
Compilation succeeded - 1 warning(s)
/home/rupert/Development/LibSedML/libSedML/Util.cs(307,18): warning
CS0219: The variable `length' is assigned but its value is never used
Build complete -- 0 errors, 1 warning
Building: libSedMLRunner (Release)
Performing main compilation...
/usr/bin/gmcs /noconfig
"/out:/home/rupert/Development/LibSedML/bin/libSedMLRunner.dll"
"/r:/home/rupert/Development/LibSedML/3rdParty/CompareData.dll"
"/r:/home/rupert/Development/LibSedML/3rdParty/LibRoadRunner.dll"
"/r:/home/rupert/Development/LibSedML/3rdParty/LibStructuralCSharp.dll"
"/r:System.dll" "/r:System.Data.dll" "/r:System.Drawing.dll"
"/r:System.Windows.Forms.dll" "/r:System.Xml.dll"
"/r:/home/rupert/Development/LibSedML/3rdParty/ZedGraph.dll"
"/r:/home/rupert/Development/LibSedML/bin/libSedML.dll" /nologo
/warn:4 /optimize+ /codepage:utf8 /platform:x86 "/define:TRACE"
/t:library
"/home/rupert/Development/LibSedML/libSedMLRunner/SedMLRunner.cs"
"/home/rupert/Development/LibSedML/libSedMLRunner/Properties/AssemblyIn
fo.cs" "/home/rupert/Development/LibSedML/libSedMLRunner/RunResult.cs"
"/home/rupert/Development/LibSedML/libSedMLRunner/SimpleRunner.cs"
Build complete -- 0 errors, 0 warnings
Building: SedMLConsole (Release)
Performing main compilation...
Compiling resource
/home/rupert/Development/LibSedML/SedMLConsole/Properties/Resources.res
x with /usr/bin/resgen2
/usr/bin/gmcs /noconfig
"/out:/home/rupert/Development/LibSedML/bin/SedMLConsole.exe"
"/r:/home/rupert/Development/LibSedML/3rdParty/CompareData.dll"
"/r:System.dll" "/r:System.Drawing.dll"
"/r:System.EnterpriseServices.dll" "/r:System.Web.Services.dll"
"/r:System.Windows.Forms.dll" "/r:System.Data.dll" "/r:System.Xml.dll"
"/r:/home/rupert/Development/LibSedML/3rdParty/ZedGraph.dll"
"/r:/home/rupert/Development/LibSedML/bin/libSedMLRunner.dll"
"/r:/home/rupert/Development/LibSedML/bin/libSedML.dll" /nologo
/warn:4 /optimize+
"/win32icon:/home/rupert/Development/LibSedML/SedMLConsole/ICON_MIASE.i
co" /codepage:utf8 /platform:x86 "/define:TRACE" /t:winexe
"/home/rupert/Development/LibSedML/SedMLConsole/Program.cs"
"/home/rupert/Development/LibSedML/SedMLConsole/Properties/AssemblyInfo
.cs"
"/home/rupert/Development/LibSedML/SedMLConsole/Properties/Resources.De
signer.cs"
"/home/rupert/Development/LibSedML/SedMLConsole/Properties/Settings.Des
igner.cs" "/home/rupert/Development/LibSedML/SedMLConsole/Web
References/BioModels/Reference.cs"
"/home/rupert/Development/LibSedML/SedMLConsole/Web
References/MIRIAM/Reference.cs"
"/res:/home/rupert/Development/LibSedML/SedMLConsole/Properties/Resourc
es.resources,SedMLConsole.Properties.Resources.resources"
Compilation succeeded - 1 warning(s)
/home/rupert/Development/LibSedML/SedMLConsole/Program.cs(64,29):
warning CS0169: The private method
`SedMLConsole.Program.CreateSedMLProgramatically()' is never used
Build complete -- 0 errors, 1 warning
Building: libSedMLScript (Release)
Performing main compilation...
Compiling resource
/home/rupert/Development/LibSedML/libSedMLScript/Properties/Resources.r
esx with /usr/bin/resgen2
/usr/bin/gmcs /noconfig
"/out:/home/rupert/Development/LibSedML/bin/libSedMLScript.dll"
"/r:/home/rupert/Development/LibSedML/3rdParty/IronPython.dll"
"/r:/home/rupert/Development/LibSedML/3rdParty/Microsoft.Scripting.dll"
"/r:/home/rupert/Development/LibSedML/3rdParty/Microsoft.Scripting.Core
.dll" "/r:System.dll" "/r:System.Core.dll" "/r:System.Xml.Linq.dll"
"/r:System.Data.DataSetExtensions.dll" "/r:System.Data.dll"
"/r:System.Xml.dll"
"/r:/home/rupert/Development/LibSedML/bin/libSedML.dll" /nologo
/warn:4 /optimize+ /codepage:utf8 "/define:TRACE" /t:library
"/home/rupert/Development/LibSedML/libSedMLScript/ITextExporter.cs"
"/home/rupert/Development/LibSedML/libSedMLScript/ITextImporter.cs"
"/home/rupert/Development/LibSedML/libSedMLScript/Properties/Resources.
Designer.cs"
"/home/rupert/Development/LibSedML/libSedMLScript/SedMLPythonConverter.
cs" "/home/rupert/Development/LibSedML/libSedMLScript/SedMLScript.cs"
"/home/rupert/Development/LibSedML/libSedMLScript/Properties/AssemblyIn
fo.cs"
"/res:/home/rupert/Development/LibSedML/libSedMLScript/Properties/Resou
rces.resources,libSedMLScript.Properties.Resources.resources"
Build complete -- 0 errors, 0 warnings
Building: SedMLScriptTest (Release)
Performing main compilation...
WARNING: Assembly 'System.Deployment' not found. Make sure that the
assembly exists in disk. If the reference is required to build the
project you may get compilation errors.
Compiling resource
/home/rupert/Development/LibSedML/SedMLScript/MainForm.resx with
/usr/bin/resgen2
Compiling resource
/home/rupert/Development/LibSedML/SedMLScript/Properties/Resources.resx
with /usr/bin/resgen2
/usr/bin/gmcs /noconfig
"/out:/home/rupert/Development/LibSedML/bin/SedMLScriptTest.exe"
"/r:System.dll" "/r:System.Core.dll" "/r:System.Xml.Linq.dll"
"/r:System.Data.DataSetExtensions.dll" "/r:System.Data.dll"
"/r:System.Drawing.dll" "/r:System.Windows.Forms.dll"
"/r:System.Xml.dll"
"/r:/home/rupert/Development/LibSedML/bin/libSedMLRunner.dll"
"/r:/home/rupert/Development/LibSedML/bin/libSedMLScript.dll"
"/r:/home/rupert/Development/LibSedML/bin/libSedML.dll" /nologo
/warn:4 /optimize+
"/win32icon:/home/rupert/Development/LibSedML/SedMLScript/ICON_MIASE.ic
o" /codepage:utf8 /platform:x86 "/define:TRACE"
/main:SedMLScriptTest.Program /t:winexe
"/home/rupert/Development/LibSedML/SedMLScript/MainForm.cs"
"/home/rupert/Development/LibSedML/SedMLScript/MainForm.Designer.cs"
"/home/rupert/Development/LibSedML/SedMLScript/Program.cs"
"/home/rupert/Development/LibSedML/SedMLScript/Properties/AssemblyInfo.
cs"
"/res:/home/rupert/Development/LibSedML/SedMLScript/MainForm.resources,
SedMLScriptTest.MainForm.resources"
"/res:/home/rupert/Development/LibSedML/SedMLScript/Properties/Resource
s.resources,SedMLScriptTest.Properties.Resources.resources"
"/home/rupert/Development/LibSedML/SedMLScript/Properties/Resources.Des
igner.cs"
"/home/rupert/Development/LibSedML/SedMLScript/Properties/Settings.Desi
gner.cs"
Build complete -- 0 errors, 1 warning
Building: SedMLWeb (Release)
Generating CodeBehind members...
Waiting for project type database to finish updating...
Object reference not set to an instance of an object
rupert@linux:~/Development/LibSedML> cd bin
rupert@linux:~/Development/LibSedML/bin> ls
CompareData.dll Microsoft.Dynamic.dll
ICSharpCode.SharpZipLib.dll Microsoft.Scripting.Core.dll
IronPython.dll Microsoft.Scripting.Debugging.dll
LibRoadRunner.dll Microsoft.Scripting.dll
libsbmlcsP.dll Microsoft.Scripting.ExtensionAttribute.dll
libSedML.dll SBMLSupport.dll
libSedMLRunner.dll SBWCSharp.dll
libSedMLScript.dll SedMLConsole.exe
LibStructuralCSharp.dll SedMLScriptTest.exe
mathLibrary.dll ZedGraph.dll
rupert@linux:~/Development/LibSedML/bin> cp ~/Development/sbwbuild/cvs-dl/libsbml/src/bindings/csharp/libsbmlcs* .
rupert@linux:~/Development/LibSedML/bin> ls
CompareData.dll mathLibrary.dll
ICSharpCode.SharpZipLib.dll Microsoft.Dynamic.dll
IronPython.dll Microsoft.Scripting.Core.dll
LibRoadRunner.dll Microsoft.Scripting.Debugging.dll
libsbmlcs.la Microsoft.Scripting.dll
libsbmlcsP.dll Microsoft.Scripting.ExtensionAttribute.dll
libsbmlcs.snk SBMLSupport.dll
libsbmlcs.so SBWCSharp.dll
libSedML.dll SedMLConsole.exe
libSedMLRunner.dll SedMLScriptTest.exe
libSedMLScript.dll ZedGraph.dll
LibStructuralCSharp.dll
rupert@linux:~/Development/LibSedML/bin> cp ~/SBW-2.7.10/CSharp/libcvode*.so .
rupert@linux:~/Development/LibSedML/bin> cp ~/SBW-2.7.10/CSharp/libNleqLib.so .
rupert@linux:~/Development/LibSedML/bin> cp ~/SBW-2.7.10/CSharp/lib
libblas.so libcvode.so libLibLA.so
libblas.so.3 libg2c.so libLibStructural.so
libblas.so.3.0 libg2c.so.0 libNleqLib.so
libblas.so.3.0.3 libg2c.so.0.0.0 libsbl2SBML.dll
libbz2.so liblapack.so libsbmlcsP.dll
libbz2.so.1 liblapack.so.3 libsbmlcs.so
libbz2.so.1.0.2 liblapack.so.3.0 libsbml.so
libcvodedll.so liblapack.so.3.0.3 libSBW.so
rupert@linux:~/Development/LibSedML/bin> cp ~/SBW-2.7.10/CSharp/libLib*.so .
rupert@linux:~/Development/LibSedML/bin> ls
CompareData.dll libSedMLRunner.dll
ICSharpCode.SharpZipLib.dll libSedMLScript.dll
IronPython.dll LibStructuralCSharp.dll
libcvodedll.so mathLibrary.dll
libcvode.so Microsoft.Dynamic.dll
libLibLA.so Microsoft.Scripting.Core.dll
libLibStructural.so Microsoft.Scripting.Debugging.dll
libNleqLib.so Microsoft.Scripting.dll
LibRoadRunner.dll Microsoft.Scripting.ExtensionAttribute.dll
libsbmlcs.la SBMLSupport.dll
libsbmlcsP.dll SBWCSharp.dll
libsbmlcs.snk SedMLConsole.exe
libsbmlcs.so SedMLScriptTest.exe
libSedML.dll ZedGraph.dll
rupert@linux:~/Development/LibSedML/bin> mono ./SedMLConsole.exe ../Samples/lorenz.miase
The Results
This will result in the Lorenz Attractor simulated, and you should see:
I hope this gave a little over view in how to compile the library at this stage. I’ve archived the resulting binary and uploaded it to SF: