wiki:BuildingAmis
Last modified 5 years ago Last modified on 07/17/12 17:44:56

Building AMIS

AMIS is written in C++ and is organized into two major modules: a core back-end component and a front-end GUI. There are also third-party dependencies and smaller supporting plugin modules.

What you need

Get the following:

  • AMIS source code
  • Xerces source code
  • Ambulant source code

  • Visual Studio 2005 SP1
  • SAPI SDK 5.1
  • Direct X SDK (April 2007)
  • Mercurial version control client
  • Git version control client

Check the build instructions that come with Ambulant to see if you need anything extra. For example, as of March 2008, it looks like MS Platform Server SDK 2003 is required.

See our development machine configuration.

See what third-party code/components we use in AMIS.?

Directory layout

Get the AMIS source code:

git clone git@github.com:daisy-consortium/amis.git

Make sure the directory structure looks like this, where amisapp contains what you got from SVN.

Top-level  
  amis  
    tags
    trunk
      amis
        src
          AmisCore
          AmisGuiMFC2
          ... etc ...
  xerces-c-src
  ambulant
    src
    ...etc...

Other code you need

AMIS depends on some other libraries/tools, and you need to build them from source.

Important

All libraries mentioned in this section (Xerces, Ambulant, Ambulant third party packages) need to be compiled using the /Zc:wchar_t- option. Set this in Visual Studio by going under Project -> Properties -> C/C++ -> Language and setting

treat wchar_t as built-in type == NO

this is a documented headache with VC8

Xerces XML Parser

Download the Xerces XML parser source code. Unzip into your top level folder. Rename the main directory from "xerces-c-src_2.X.X" to "xerces-c-src" (this way we don't have to change all the include search paths in the visual studio projects every time there is a Xerces update). An aside, right now we are using Xerces 3.0.

Follow the instructions for building Xerces under VC8. Be sure to make the wchar_t change (see above).

There are many projects that come with Xerces. You only need to build the project "XercesLib".

Copy the lib and DLL files into AMIS own bin and lib directories.

Ambulant SMIL Player

Download the Ambulant source code. We use their version control repository, so we've been keeping up-to-date with their latest code. We'll post here when there is a frozen Ambulant release we can point to with certainty. Here is how to get their code from Mercurial (the code repository).

Right now we're using a branch ("amis-release-30") in the Ambulant code repository to avoid conflicts with new Ambulant developments.

hg clone http://ambulant.hg.sourceforge.net:8000/hgroot/ambulant/ambulant
hg checkout amis-release-30

Follow the instructions that come with the Ambulant source code. There is a file called "INSTALL" that will tell you everything about how to build Ambulant.

You will be building the projects in the folder ambulant/projects/vc8.

I did the following additional/different steps when building Ambulant:

  1. Set the wchar_t option (see above) for all the third party packages (expat, libjpeg, etc -- they come in one bundle).
  2. Change the include directory for xerces so it points to the same one you downloaded
  3. Copy the lib and dll files for Xerces into the Ambulant lib\win32 and bin\win32 directories.
  4. Set the wchar_t option (described above under "Important") for the libambulant project.
  5. Build libambulant as DebugShLib and ReleaseShLib

The libambulant files will get automatically copied over to AMIS own bin and lib directories when you build AMIS. Unless, of course, you're using a different directory structure -- then you're on your own!

Speech SDK

The Speech SDK does not need to be built from source code; just install it. You do need to change one thing, though:

Copy the sphelper.h file from amis\VC8 and put it in your c:\program files\microsoft speech sdk 5.1\include directory. You might want to back up the old one first. The reason you need to do this is because Microsoft has still not updated their Speech SDK for Visual Studio 2005. You can read more here.

DirectX / DirectShow

Just append the include/lib paths as shown in our sample configuration.

Required DLLS

Copy the avformat, avcodec, and avutil DLLs from the ambulant bin directory to the amis bin directory. You'll only have to do this once.

Visual Leak Detector

Sometimes we use this in the Debug build of AMIS. It doesn't hurt to have it installed. Here is the download link. Get version 1.0.

AMIS

Run (at least once) amisapp\trunk\amis\bin\settings\run_first_to_copy_settings.bat, and REMEMBER that the settings AMIS uses when it runs are in your Application Data directory (usually c:\documents and settings\all users\application data\amis).

It may be that you do not have access to the code required for protected book support. In this case, you should disable this feature by opening amisapp\trunk\amis\VC8\amis.sln and making the following changes:

  • remove the (broken) reference to pdtbplugin
  • remove the (broken) reference to AmisPdtbExtras
  • delete the WITH_PROTECTED_BOOK_SUPPORT flag (AmisGuiMFC2, Properties, Configuration Properties, C++, Preprocessor Definitions)
  • delete the library reference to AmisPdtbExtras.lib (AmisGuiMFC2, Properties, Configuration Properties, Linker, Input, Additional Dependencies)
  • delete the include path to ../AmisPdtbExtras?/include (AmisGuiMFC2, Properties, Configuration Properites, C++, Include Directories)

Do the last three steps for both the Debug and Release configurations of AmisGuiMFC2. Note that, in the case of libraries, the debug version of AmisGuiMFC2 will link to the debug version of the library (so: !AmisPdtbExtrasD.lib).

Build the solution.

Now run AMIS. Use the File->Open command to open a book from your hard drive. You can point to an ncc.html file or an *.opf file.

If you are having any problems, check that the settings folder was successfully copied into your application data directory. Also check that the default language pack went into this folder too (it gets copied over automatically just after it is built, and it's built as a part of the whole solution, so everything should happen automatically). The language pack will be found somewhere like c:\Documents and Settings\All users\AMIS\settings\lang\eng-US.

Building the installer

Read how to create an installer from our scripts.

Compiler options

Just listed here for documentation purposes. The only one you might have to turn off is related to protected books because that code is not included in the public source of AMIS.

AmisCore

Pick a platform by defining one of the following:

  • AMIS_PLATFORM_OSX
  • AMIS_PLATFORM_LINUX
  • AMIS_PLATFORM_WINDOWS

Pick a compiler

  • AMIS_COMPILER_GCC
  • AMIS_COMPILER_MSVC

Say whether an external SMIL player is being used (like Ambulant):

  • WITH_EXTERNAL_SMIL_PLAYER

AmisGuiMFC2

Do we support protected books? ("support" = partial support for PDTB 1.0 spec for Daisy 2.02 books)

  • WITH_PROTECTED_BOOK_SUPPORT

Is Ambulant being given an HTML widget?

  • WITH_HTML_WIDGET

Is Ambulant not getting a log window?

  • WITHOUT_LOG_WINDOW

Use Ambulant workaround (I don't know what this is, but it seems helpful to have it defined)

  • AMBULANT_SEEK_WORKAROUND

This is in the self-voicing AudioSequencePlayer, and I don't know what it does.

  • CCS_ACTIVE

Use the speed-up algorithm for the Audio playback in both Ambulant and AMIS self-voicing.

  • WITH_TPB_AUDIO_SPEEDUP