Problem when building with Mongo on VS2013 update 5

37 views
Skip to first unread message

Yefeng Li

unread,
Oct 19, 2016, 11:35:10 AM10/19/16
to mongodb-dev
Hi,

    It was my first time trying to build the MongoDB development environment on VS2013 update 5. By following the instructions on the MongoDB documentation website, I installed ActivePython 2.7 and Scons 2.5.0 on my Windows 7 Ultimate sp1 (64bits) PC. When installing the Scons, I downloaded the zip file and used the "python setup.py -install" command after unzipping. Then I downloaded the mongodb 3.2.10 source folder, and unzipped it under C:\. By running the following command, I created VS projects for mongod and mongo:

    cd C:\<source folder>
    scons --clean
    scons mongod.exe > build_mongod_x64.log
    scons buildscripts/make_vcxproj.py mongod <build_mongod_x64.log> mongod.vcxproj
    scons mongo.exe > build_mongo_x64.log
    scons buildscripts/make_vcxproj.py mongo <build_mongo_x64.log> mongo.vcxproj

    (By the way, I was unable to use the "--64bits" or "--64" option on Scons, it told me that invalid option. ) 

    For the next, I opened the "mongo" project in VS2013, it automatically created the "mongo.sln" solution file. The I added the "mongod" project to the solution. When I switched to the mongo project and started to build it using "Build mongo" item in the "BUILD" menu of VS2013,  it told me that "src\mongo\base\error_code.h" and "src\mongo\base\error_code.cpp" are missing. Anyway, I found these two files in "build\opt\mongo\base" and copied them to the destination folder to eliminate this error.

    However, it comes the next problem, seemingly the "v8" folder is missing. The information is as follows:
    
1>  python: can't open file 'src\third_party\v8\tools\js2c.py': [Errno 2] No such file or directory
1>C:\mongodb-src-r3.2.10\mongo.vcxproj(205,5): error MSB3073: The command "python src\third_party\v8\tools\js2c.py src\third_party\v8\src\experimental-libraries.cc EXPERIMENTAL off src\third_party\v8\src\proxy.js src\third_party\v8\src\collection.js src\third_party\v8\src\macros.py" exited with code 2.

   I checked the "vcxproj.header" file in the buildscripts folder, and found the following scripts:

   <Target Name="V8ExperimentalLibraries"
      BeforeTargets="ClCompile"
      Outputs="$(MongoV8)\src\experimental-libraries.cc"
      Inputs="$(MongoV8)\tools\js2c.py;$(MongoV8)\src\proxy.js;$(MongoV8)\src\collection.js;$(MongoV8)\src\macros.py" >
<Exec Command="python $(MongoV8)\tools\js2c.py $(MongoV8)\src\experimental-libraries.cc EXPERIMENTAL off $(MongoV8)\src\proxy.js $(MongoV8)\src\collection.js $(MongoV8)\src\macros.py" />
  </Target>
   ...

   Unfortunately there is no "v8" directory in the source files, also the scons command does not generate "v8" either. I'm not sure what to do for this, perhaps I've done something wrong in the previos steps. Would you please give some help ?

Sincerely Regards

Yefeng

Mark Benvenuto

unread,
Oct 24, 2016, 6:21:49 PM10/24/16
to mongo...@googlegroups.com
Hi,

Scons is the only supported build system for MongoDB. The buildscripts/make_vcxproj.py python script is not intended to generate a vcxproj file for building mongod.exe, mongos.exe, or any other binary.

The purpose of the script is to enable Windows developers a way to create a vcxproj file for code browsing and to enable Intellisense in VS.

Even if the .vcxproj file does not build mongod.exe, you can still use Visual Studio for debugging mongod.exe. You just need to set the "Command" in Configuration Properties -> Debugging to the target binary.

mark


--
You received this message because you are subscribed to the Google Groups "mongodb-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-dev+unsubscribe@googlegroups.com.
To post to this group, send email to mongo...@googlegroups.com.
Visit this group at https://groups.google.com/group/mongodb-dev.
For more options, visit https://groups.google.com/d/optout.

Yefeng Li

unread,
Oct 27, 2016, 12:37:55 AM10/27/16
to mongodb-dev
Hi Mark,

    Thank you for your reply. I'm doing as you mentioned.
    As I never used Scons before, the only thing is, the Scons build process takes too much time, even if I modified only one single file. Anyway, the debug feature of VS2013 still helped me a lot for getting understand of the source code. 

Yefeng

在 2016年10月25日星期二 UTC+8上午6:21:49,Mark Benvenuto写道:
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-dev...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages