관리 메뉴

가끔 보자, 하늘.

MongoDB 빌드하기(in VC2008) 본문

개발 이야기/개발툴 및 기타 이야기

MongoDB 빌드하기(in VC2008)

가온아 2010. 6. 1. 10:17

http://www.mongodb.org/display/DOCS/Building+with+Visual+Studio+2008

 
 

Building with Visual Studio 2008

 MongoDB는 VC++를 사용해서 윈도우(32 and 64bit)환경에 컴파일 됩니다.  SCons는 

빌드 처리를 도와는 것이며, 이걸 통해 생성된 솔루션 파일은 VSI를 사용할 때 편리하게

사용할 수 있는 프로젝트 포함... 

이 프로젝트는 아래 리스트에 포함된 여러 다른 프로젝트와 연동되어 있습니다. 

선-빌드된 바이너리를 다운받으면 쉽게 처리할 수 있습니다.

 MongoDB can be compiled for Windows (32 and 64 bit) using Visual C++. SCons is 

the make mechanism, although a solution file is also included in the project 

for convenience when using the Visual Studio IDE.

There are several dependencies exist which are listed below; you may find it easier to 

simply download a pre-built binary.

Get the MongoDB Source Code

소스 코드를 다운 받거나 Git를 이용해 인스톨하세요.

Download the source code from Downloads.

Or install Git. Then:

  • git clone git://github.com/mongodb/mongo.git (more info)
  • git tag -l to see tagged version numbers
  • Switch to a stable branch (unless doing development) -- an even second number indicates "stable".  (Although with sharding you will want the latest if the latest is less than 1.6.0.) For example:
    • git checkout r1.4.1

Get Boost Libraries

  • VS를 위해 선빌드된 부스트 라이브러르를 받으시려면 여기를 클릭하세요. 
  • 7zip 포맷으로 되어 있습니다. 이 파일은 MongoDB를 빌드하기 위해 필요한 
  • 것들만 모아 두었으면 그외 다른 부스트 lib는 제외되어 있습니다.
  • Click here for a prebuilt boost library for Visual Studio.  7zip format. This file has what you need to build MongoDB, but not some other boost libs, so it's partial.
  • 다른 옵션들을 확인할 거라면 "Boost and Windows" 페이지를 보세요.
  • See the Boost and Windows page for other options.

VS프로젝트 파일에 아래 위치한 경로를 세팅하십시요.

The Visual Studio project files are setup to look for boost in the following locations:

  • c:\program files\boost\latest
  • c:\boost
  • \boost

 

You can unzip boost to c:\boost, or use an NTFS junction point to create a junction point to one of the above locations. Some versions of windows come with linkd.exe, but others require you to download Sysinternal's junction.exe to accomplish this task. For example, if you installed boost 1.42 via the installer to the default location of c:\Program Files\boost\boost_1_42, You can create a junction point with the following command:

junction "c:\Program Files\boost\latest" "c:\Program Files\boost\boost_1_42"

This should return the following output:

Junction v1.05 - Windows junction creator and reparse point viewerCopyright (C) 2000-2007 Mark RussinovichSystems Internals - http://www.sysinternals.comCreated: c:\Program Files\boost\latestTargetted at: c:\Program Files\boost\boost_1_42

Get SpiderMonkey

Build a SpiderMonkey js engine library (js.lib) – details here.

Building MongoDB from the IDE

Open the db/db.sln solution file.

Note: currently the 

mongo

 shell and C++ client libraries must be built from scons.  Also, for the VS2008 project files, 64 bit must be built from scons (although you can do 64 bit with db_10.sln in vs2010).

Install SCons

If building with scons, install SCons:

Building MongoDB with SCons

The SConstruct file from the MongoDB project is the preferred way to perform production builds. Run scons in the mongo project directory to build.

If scons does not automatically find Visual Studio, preset your path for it by running the VS2010 vcvars*.bat file.

To build:

scons                   // build mongodscons mongoclient.lib   // build C++ client driver libraryscons all               // build all end user componentsscons .                 // build all including unit test

Troubleshooting

  • Can't find jstypes.h when compiling. This file is generated when building SpiderMonkey. See the Building SpiderMonkey page for more info.
  • Can't find / run cl.exe when building with scons.  See troubleshooting note on the Building SpiderMonkey page.
  • Error building program database.  (VS2008.)  Try installing the Visual Studio 2008 Service Pack 1.
반응형