Forums

F.A.Q. F.A.Q.    Register Register    Login Login    Home Home
Search Search
SBML Discussions » libsbml-development » Updating libsbml installation instructions
Show: Today's Posts  :: Message Navigator
| Subscribe to topic 
Return to the default flat view Create a new topic Submit Reply
AuthorTopic
Ben Heavner


Posts: 24
Registered:
October 2009
Updating libsbml installation instructions 02 Oct '09 08:38 Go to previous message

Hello all -

I'm fairly inexperienced with Microsoft development tools, but have spent the past couple weeks working to compile libsbml with Microsoft Visual C++ Express 2008 and the Windows SDK for Windows Server 2008 and .NET Framework 3.5 on a Windows XP box.

I've used the Express Edition of MSVC because it's free, and I'm not a professional developer. There are some significant differences between the Express and Pro editions of MSVC.

It's been a very educational experience - perhaps my notes and experience as a newbie will be useful for updating the libsbml installation instructions, currently at http://sbml.org/Software/libSBML/docs/cpp-api/libsbml-installation.html

Here, step by step, is what I did to get a build of libsbml.dll on my Windows XP box, with a few comments following:

-------------

To build libsbml, I used the following binaries and sources:

bzip2 1.0.5 - http://gnuwin32.sourceforge.net/packages/bzip2.htm
libxml2 2.7.3 - http://www.zlatkovic.com/libxml.en.html
zlib 1.2.3 - http://www.zlatkovic.com/libxml.en.html
iconv 1.9.2 - http://www.zlatkovic.com/libxml.en.html
libsbml 4.0.0 - http://sourceforge.net/projects/sbml/files/libsbml/
(I used the libSBML-4.0.0-src.zip file)

Extract libSBML-4.0.0-src to the desktop.
(C:\Documents and Settings\bdh32\Desktop\libsbml-4.0.0-src for me)

Exctract the other libraries downloaded, and put them in the libsbml-4.0.0-src\
dir on the desktop, too.

So now the directory structure looks like:
\Desktop
|\libxml2-2.7.3.win32
|\iconv-1.9.2.win32
|\zlib-1.2.3.win32
|\libsbml-4.0.0
|\bzip2-1.0.5-bin

Now we need to make some directories.

First, from \Desktop\libsbml-4.0.0-src\libsbml-4.0.0\win\batch-files, run createInclude.bat (apparently this gets automatically executed from some installations of MSVC, but I haven't done that yet).

Since "The DLL file for libxml2, Xerces, or Expat must be placed in the win32/bin subdirectory of the libSBML directory", (from the install docs), makethe directory \Desktop\libsbml-4.0.0-src\libsbml-4.0.0\win\bin, then:

copy libxml2.dll from
\Desktop\libsbml-4.0.0-src\libxml2-2.7.3.win32\bin
to
\Desktop\libsbml-4.0.0-src\libsbml-3.4.1\win\bin

copy iconv.dll from
\Desktop\libsbml-4.0.0-src\iconv-1.9.2.win32\bin
to
\Desktop\libsbml-4.0.0-src\libsbml-4.0.0\win\bin

copy zlib1.dll from
\Desktop\libsbml-4.0.0-src\zlib-1.2.3.win32\bin
to
\Desktop\libsbml-4.0.0-src\libsbml-4.0.0\win\bin

You don't have to add an extra path to MSVC++ if do this with bzip2.dll, too:

copy bzip2.dll from
\Desktop\libsbml-4.0.0-src\bzip2-1.0.5-bin\bin
to
\Desktop\libsbml-4.0.0-src\libsbml-4.0.0\win\bin

Next, from MSVC++ 2008 Express Edition, open project:
\Desktop\libsbml-4.0.0-src\libsbml-4.0.0\win\msvc9\libxml2\libsbml.vcproj

Select Tools->Options, and select Projectsand Solutions->VC++ Directories. The screen for indicating which directories contain project-relevant files appears.

At "Show Directories For:", select "Include Files". Add the following:
\Desktop\libsbml-4.0.0-src\libsbml-4.0.0\include
\Desktop\libsbml-4.0.0-src\libxml2-2.7.3.win32\include
\Desktop\libsbml-4.0.0-src\iconv-1.9.2.win32\include
\Desktop\libsbml-4.0.0-src\zlib-1.2.3.win32\include
\Desktop\libsbml-4.0.0-src\bzip2-1.0.5-bin\include

At "Show Directories For:", select "Library Files". Add the following:
\Desktop\libsbml-4.0.0-src\libsbml-4.0.0\bin
(note: there is not a libsbml \lib directory)
\Desktop\libsbml-4.0.0-src\libxml2-2.7.3.win32\lib
\Desktop\libsbml-4.0.0-src\iconv-1.9.2.win32\lib
\Desktop\libsbml-4.0.0-src\zlib-1.2.3.win32\lib
\Desktop\libsbml-4.0.0-src\bzip2-1.0.5-bin\lib

First, we'll do a debug build to make sure it works. Under project properties, make sure the Configuration is "Active(Debug)". Secelct Configuration Properties -> C/C++ -> Code Generation and make sure that the Runtime Library is set to Multi-threaded Debug DLL (M/MDd).

Hit ok.

Select Build -> Clean Solution from the Visual Studio main menu, then select Build -> Build Solution. The default object name is fine.

For me, the build succeeded with 77 warnings.

Since the debug build worked, next do the release build.

Under project properties, set the Configuration to "Release". Select Configuration Properties -> C/C++ -> Code Generation and make sure that the Runtime Library is set to Multi-threaded DLL (M/MD).

Select Build -> Batch Build. Click the box next to Release/Win32, and click "Clean", then select Build -> Batch Build, and click "Build".

As a result of this build, you should now have libsbml.dll and libsbml.lib in
\Desktop\libsbml-4.0.0-src\libsbml-4.0.0\win\bin (woot!)

-----------

My comments:

libsbml seems to have library files in a different location than other open source projects -
libxml2, iconv, zlib, and bzip2 all have \lib files, but libsbml keeps them in \bin - that seems weird.

The way that libsbml requires users to assemble all the dependencies makes the build process very difficult and confusing for inexperienced users such as myself. Figuring out how to get them in the right locations and being able to compile and link with no errors took the bulk of my time. Since I couldn't find bzip2.dll for a long time, I removed the compression support from libsbml at one point, before getting this process to work. Perhaps there's a way to include the dependencies in the project file, or to use Windows SxS stuff (I know next to nothing about that) to link to .dlls that can be updated if underlying libraries change?


As for my progress towards being able to use the Yeastnet model for my research, I've now done a clean minimal install of Matlab R2009a (no toolboxes), so I'll be working to build translateSBML.mex32 next, and I'll share my experience with that if I get it working, too.

Cheers!
Ben Heavner

      

SubjectPosterDate
Read Message   Updating libsbml installation instructions  Ben Heavner02 Oct '09 08:38
Read Message   Re: Updating libsbml installation instructions Sarah Keating07 Oct '09 05:31
Read Message   Re: Updating libsbml installation instructions Ben Heavner07 Oct '09 07:13
Previous Topic:Problems with translatesbml.mex32
Next Topic:No defaults in SBML L3
Go to forum:
-=] Back to Top [=-

Powered by FUDforum. (Copyright Advanced Internet Designs Inc.)

Please use our issue tracking system for any questions or suggestions about this website.