Darwin
1.10(beta)
|
Select the appropriate stable release from here or check out directly from the repository by following the instructions below.
Use GitHub Shell to check out the latest copy of the code from:
where $DARWIN is the directory you want to put the code in. To update previously cloned code use:
The following provides a brief list of steps required for building the code. These instructions assume you are familiar with the Microsoft Visual Studio development environment. More detailed instructions are given below. We use the symbol $DARWIN
to represent the directory in which you are installing the codebase.
$DARWIN/external
folder and rename it eigen3
Eigen
exists directly below $DARWIN/external/eigen3
$DARWIN/external
. This is a self-extracting archive. Running it should decompress OpenCV into folder $DARWIN/external/opencv
(see Optional Software) $DARWIN/src/drwnlibs
.sln Build the libraries.
$DARWIN/src/drwnapps
.sln and build either Debug or Release applications (these should match the library configuration). The Darwin libraries and applications will now be built (in the $DARWIN/bin
folder). To build the projects you will need to open and build the Visual Studio C++ solution file in the corresponding project directory, e.g., $DARWIN/projects/tutorial/tutorial
.sln.
The following list provides links to software that is required for building the Darwin libraries and applications from source code.
The following provides links to software that is optional when building the Darwin libraries and applications from source code. If this software is not installed then some functionality may not be available.
external/opencv
directory "$DARWIN\external\opencv\build\x86\vc10\bin"
directory is added to your Windows PATH variable (see Frequently Asked Questions below) $DARWIN/external/wx
directory Darwin is a C++ software framework consisting of a several component libraries and application code as described in the introduction (on the Darwin homepage). On Windows the code can be compiled using Microsoft Visual Studio C++. These instructions provide a detailed description for compiling Darwin on a Windows system. The Frequently Asked Questions below provides answers to common questions that may be helpful in troubleshooting compilation problems.
The first thing you will need (after obtaining the Darwin code) is to install the Visual Studio C++ compiler. This is freely available software from Microsoft and can be downloaded and installed by following the instructions at http://www.microsoft.com/visualstudio/eng/downloads#d-2010-express
"Tools | Options"
. Select "Projects and Solutions | Build and
Run"
. Set "maximum number of parallel project builds"
to 1.Like any large project Darwin also depends on some third-party software libraries. We have tried to keep these to a minimum. As such, only RapidXML and Eigen are required for the core framework components (specifically drwnBase, drwnIO, drwnML, drwnPGM). For convenience RapidXML is distributed with the source code. The Eigen template library for linear algebra, however, must be installed separately. Other third-party libraries, such as OpenCV, are only necessary if you require certain additional functionality (e.g., drwnVision requires OpenCV).
All third-party libraries should be installed in the $DARWIN/external
directory, where $DARWIN
is the folder where you have downloaded and decompressed the Darwin source code (e.g., C:/darwin
). The Eigen template library for linear algebra should be downloaded from the Eigen website. Make sure you download version 3.1.4 or above. Create a folder called $DARWIN/external/eigen3
and decompress the Eigen code into this folder.
$DARWIN/external/eigen3
contains the Eigen source directly and not a single subdirectory containing the Eigen source. You can check this by verifying that $DARWIN/external/eigen3/Eigen
exists and contains the Eigen template library headers. A common mistake is to for this code to be one level deeper in the directory hierarchy, resulting in compilation errors.OpenCV, which is optional, should be installed in $DARWIN/external/opencv
. Download the OpenCV-2.4.9.exe
self-extracting archive from http://sourceforge.net/projects/opencvlibrary/files/opencv-win and save it to $DARWIN/external
. Running this application with the default options will then create the directory $DARWIN/external/opencv
and decompress the OpenCV libaries into it.
You are now ready to compile the Darwin libraries. The five libraries (drwnBase, drwnIO, drwnML, drwnPGM and drwnVision) are bundled together into a Visual Studio Solution file called $DARWIN/src/drwnlibs
.sln. Open this file in Visual Studio and you will see five projects corresponding to the five libraries. The libraries can be compiled in either Debug or Release mode. The mode can be changed for all projects at once via the Configuration Manager.
To compile all libraries right-click on "Solution 'drwnlibs'"
and select "Build Solution"
(alternatively hit the shortcut F7). Visual Studio will start compiling the code. The libraries are written to the $DARWIN/bin
directory. If compiling in Debug mode library names will have the letter 'd'
appended to them (e.g., drwnBased.lib).
You can also compile each library separately by right-clicking on the library and choosing Build
from the drop-down menu.
Once the libraries have been build you are ready to compile the applications and projects. Open the file $DARWIN/src/drwnapps
.sln in Visual Studio. The solution will show a number of applications. Compile these by right-clicking on "Solution
'drwnapps'"
and selecting "Build Solution"
(alternatively hit F7). This will compile all the applications and place the executables in the $DARWIN/bin
directory.
You can also compile each application separately by right-clicking on the corresponding project and choosing Build
from the drop-down menu.
You can go through the HelloWorld Darwin Tutorial by opening the $DARWIN/projects/tutorial/tutorial
.sln file. Likewise, projects such as rosetta
, multiSeg
and patchMatch
can be compiled by opening the Visual Studio solution file in the corresponding project directory.
"How do I start the GitHub Shell?"
From the Start menu select "All Programs | GitHub, Inc | Git Shell"
.
"How do I turn off MSVC multi-threaded building?"
Select the menu item "Tools | Options"
. Select "Projects and
Solutions | Build and Run"
. Set "maximum number of parallel project builds"
to 1.
"How to I build executables that can be distributed?"
Under "Properties | C/C++ | Code Generation"
set "Runtime Library"
to Multithreaded (/MT) to statically link the Visual Studio runtime libraries. Alternatively ask users to install the Visual C++ Redistribution package.
"Why do I get the error Cannot open include file: 'Eigen/Core'?"
You have installed the Eigen linear algebra package in the wrong location. Make sure the directory "$DARWIN/external/eigen3/Eigen"
exists.
"Why do I get the error Cannot open include file: 'cv.h'?"
Either you have chosen to not install OpenCV or you have installed it in the wrong location. If you have chosen not to install OpenCV then you can ignore this error. However, you will not have access to functionality in the drwnVision library, which depends on OpenCV.
If you want the drwnVision library functionality then make sure OpenCV is installed in $DARWIN/external/opencv
.
Note that at runtime the "$DARWIN\external\opencv\build\x86\vc10\bin"
directory must be included in your system's PATH
environment variable (this can be done via the Windows Control Panel).
"How do I add a directory to the Windows PATH variable?"
Open the Window's "System Properties" dialog box and select the "Advanced" tab. On most Windows installations you can press the Window-Break (or Windows-Pause) and select "Advanced system settings". Click the "Environment Variables..." button. Select the Path system variable and click "Edit..." (if the variable does not exist then click "New...". Add full directory paths as necessary, separated by a semi-colon (;).
"How do I link Darwin to another version of OpenCV?"
If you download a later version of OpenCV you can get Darwin to compile against it by changing the OpenCV library names in the "Property Page | Linker | Input"
field.
"Why do I get 'LINK: fatal error LINK1104: can not open drwnBase.lib' when compiling applications or projects?"
Check the "$DARWIN\bin"
directory. Most likely you are compiling the libraries in Debug mode and the applications in Release mode. Debug libraries end in d
(so "drwnBased.lib"
instead of "drwnBase.lib"
). See Compiling the Darwin Libraries above.
"How do I compile for x64 platforms?"
The default installation of Visual Studio Express 2010 does not allow you to compile 64-bit applications. See this post from Microsoft for further details.