0

Visual Studio 2015 with CMake

right after you installed visual studio 2015, CMake cannot find C and C++ compiler of it because Visual Studio 2015 installer didn’t install any compiler. Although I have no ideas this is due to default or my install setting, I found the solution.

Open Visual Studio 2015 and create a new project using C or C++ so that FXXX Visual Studio asks you whether you install the compiler or not.

Advertisements
0

gflags with Visual Studio

  1. Run CMake
  2. Run Visual Studio as a superuser
  3. Open gflags.sln with Visual Studio
  4. Batch build ALL_BUILD, INSTALL, and RUN_TESTS

The result is as folllows:

—— Rebuild All started: Project: INSTALL, Configuration: Release x64 ——
— Install configuration: “Release”
— Installing: C:/Program Files/gflags/Lib/gflags.lib
— Installing: C:/Program Files/gflags/Lib/gflags_nothreads.lib
— Installing: C:/Program Files/gflags/Include/gflags/gflags.h
— Installing: C:/Program Files/gflags/Include/gflags/gflags_declare.h
— Installing: C:/Program Files/gflags/Include/gflags/gflags_completions.h
— Installing: C:/Program Files/gflags/Include/gflags/gflags_gflags.h
— Installing: C:/Program Files/gflags/CMake/gflags-config.cmake
— Installing: C:/Program Files/gflags/CMake/gflags-config-version.cmake
— Installing: C:/Program Files/gflags/CMake/gflags-export.cmake
— Installing: C:/Program Files/gflags/CMake/gflags-export-release.cmake
—— Rebuild All started: Project: RUN_TESTS, Configuration: Release x64 ——
Test project C:/Users/charmie/Documents/work/code/extern/gflags/gflags-build
Start 1: strip_flags_help
1/52 Test #1: strip_flags_help …………….. Passed 0.06 sec
Start 2: strip_flags_binary
2/52 Test #2: strip_flags_binary …………… Passed 0.08 sec
Start 3: unittest
3/52 Test #3: unittest ……………………. Passed 0.08 sec
Start 4: help-reporting
4/52 Test #4: help-reporting ………………. Passed 0.13 sec
Start 5: long-helpstring
5/52 Test #5: long-helpstring ……………… Passed 0.11 sec
Start 6: changed_bool1
6/52 Test #6: changed_bool1 ……………….. Passed 0.11 sec
Start 7: changed_bool2
7/52 Test #7: changed_bool2 ……………….. Passed 0.11 sec
Start 8: changeable_string_var
8/52 Test #8: changeable_string_var ………… Passed 0.11 sec
Start 9: nohelp
9/52 Test #9: nohelp ……………………… Passed 0.08 sec
Start 10: help=false
10/52 Test #10: help=false ………………….. Passed 0.08 sec
Start 11: helpfull
11/52 Test #11: helpfull ……………………. Passed 0.13 sec
Start 12: helpshort
12/52 Test #12: helpshort …………………… Passed 0.12 sec
Start 13: helpshort-tldflag1
13/52 Test #13: helpshort-tldflag1 …………… Passed 0.11 sec
Start 14: helpshort-tldflag2
14/52 Test #14: helpshort-tldflag2 …………… Passed 0.11 sec
Start 15: helpshort-main
15/52 Test #15: helpshort-main ………………. Passed 0.12 sec
Start 16: helpshort_main
16/52 Test #16: helpshort_main ………………. Passed 0.14 sec
Start 17: helpon
17/52 Test #17: helpon ……………………… Passed 0.08 sec
Start 18: helpon=gflags
18/52 Test #18: helpon=gflags ……………….. Passed 0.08 sec
Start 19: helpon_gflags
19/52 Test #19: helpon_gflags ……………….. Passed 0.09 sec
Start 20: helpon=gflags_unittest
20/52 Test #20: helpon=gflags_unittest ……….. Passed 0.11 sec
Start 21: helpmatch_reporting
21/52 Test #21: helpmatch_reporting ………….. Passed 0.08 sec
Start 22: helpmatch=unittest
22/52 Test #22: helpmatch=unittest …………… Passed 0.13 sec
Start 23: helpmatch=nosuchsubstring
23/52 Test #23: helpmatch=nosuchsubstring …….. Passed 0.08 sec
Start 24: helpon=nosuchmodule
24/52 Test #24: helpon=nosuchmodule ………….. Passed 0.08 sec
Start 25: helppackage
25/52 Test #25: helppackage …………………. Passed 0.17 sec
Start 26: helpxml
26/52 Test #26: helpxml …………………….. Passed 0.16 sec
Start 27: version-1
27/52 Test #27: version-1 …………………… Passed 0.06 sec
Start 28: version-2
28/52 Test #28: version-2 …………………… Passed 0.08 sec
Start 29: undefok-1
29/52 Test #29: undefok-1 …………………… Passed 0.06 sec
Start 30: undefok-2
30/52 Test #30: undefok-2 …………………… Passed 0.06 sec
Start 31: undefok-3
31/52 Test #31: undefok-3 …………………… Passed 0.06 sec
Start 32: undefok-4
32/52 Test #32: undefok-4 …………………… Passed 0.08 sec
Start 33: undefok-5
33/52 Test #33: undefok-5 …………………… Passed 0.06 sec
Start 34: undefok-6
34/52 Test #34: undefok-6 …………………… Passed 0.06 sec
Start 35: flagfile.1
35/52 Test #35: flagfile.1 ………………….. Passed 0.06 sec
Start 36: flagfile.2
36/52 Test #36: flagfile.2 ………………….. Passed 0.08 sec
Start 37: flagfile.3
37/52 Test #37: flagfile.3 ………………….. Passed 0.08 sec
Start 38: fromenv=version
38/52 Test #38: fromenv=version ……………… Passed 0.06 sec
Start 39: tryfromenv=version
39/52 Test #39: tryfromenv=version …………… Passed 0.06 sec
Start 40: fromenv=help
40/52 Test #40: fromenv=help ………………… Passed 0.08 sec
Start 41: tryfromenv=help
41/52 Test #41: tryfromenv=help ……………… Passed 0.08 sec
Start 42: fromenv=helpfull
42/52 Test #42: fromenv=helpfull …………….. Passed 0.06 sec
Start 43: tryfromenv=helpfull
43/52 Test #43: tryfromenv=helpfull ………….. Passed 0.06 sec
Start 44: tryfromenv=undefok
44/52 Test #44: tryfromenv=undefok …………… Passed 0.06 sec
Start 45: tryfromenv=weirdo
45/52 Test #45: tryfromenv=weirdo ……………. Passed 0.09 sec
Start 46: tryfromenv-multiple
46/52 Test #46: tryfromenv-multiple ………….. Passed 0.06 sec
Start 47: fromenv=test_bool
47/52 Test #47: fromenv=test_bool ……………. Passed 0.06 sec
Start 48: fromenv=test_bool-ok
48/52 Test #48: fromenv=test_bool-ok …………. Passed 0.06 sec
Start 49: version-overrides-fromenv
49/52 Test #49: version-overrides-fromenv …….. Passed 0.06 sec
Start 50: dashdash
50/52 Test #50: dashdash ……………………. Passed 0.08 sec
Start 51: always_fail
51/52 Test #51: always_fail …………………. Passed 0.06 sec
Start 52: gflags_declare
52/52 Test #52: gflags_declare ………………. Passed 0.02 sec

100% tests passed, 0 tests failed out of 52

Total Test time (real) = 4.83 sec
========== Rebuild All: 11 succeeded, 0 failed, 0 skipped ==========

7

levmar 2.6 with Visual Studio 2010

memo for compiling levmar 2.6 on windows with visual studio 2010.

we need to modify the code a bit for compilation!!!

  1. .lib files
    CmakeLists.txt of levmar 2.6 assumes that you put all lapack related .lib files into one directory. In Cmake GUI, it’s called LAPACKBLAS_DIR that is pre-defined as ‘/usr/lib’. If you compile clapack by yourself, the lib files are generated in different directories not in a directory. To use original CmakeLists.txt, you should put the .lib files into one directory and set LAPACKBLAS_DIR on Cmake GUI. Then, link problem should be solved.
  2. setting related to BLAS
    See the FAQ. We have to modify misc.h according to BLAS. The original misc.h assumes that you have a F77 BLAS. If your BLAS is either f2c’ed BLAS or CBLAS, you should modify a few lines in misc.h. If you compiled CLAPACK by yourself, your BLAS is f2d’ed one. Then, what you should do is

    1. Uncomment the line 31 of ”#define LM_BLAS_PREFIX f2c_”.
    2. Comment out the line 37 of “#define LM_BLAS_SUFFIX _
    3. Uncomment the line 35 of “#define LM_BLAS_SUFFIX”.
  3. HAVE_LAPACK
    check the HAVE_LAPACK option in cmake, and then compile it.

You can see how levmar works with an example program provided by the author.

0

Visual Studio 2010: switch development environment

How to switch development environment from/to C++ to/from C# is

  1. Tools->Import and Export Settings …
  2. Choose a radio button “Import selected environment settings” and click Next
  3. Choose either save current settings or not (yes is better) and click Next
  4. Then, you can choose which setting you will use from the following list
  5. General Development Settings is better if you use different environment like C++ and C#.