qpDUNES / qpDUNES-dev

Private development repository for qpDUNES
GNU Lesser General Public License v3.0
4 stars 6 forks source link

MSVC build errors #2

Open mkatliar opened 9 years ago

mkatliar commented 9 years ago

The project does not build with MSVC. Reasons:

  1. gcc-specific compiler options are used without checking actual compiler in CMakeLists.txt
  2. <sys/time.h> is absent on Windows
  3. Missing const specifiers in example2_affine.c
  4. Misplaced/missing "#ifdef **cplusplus extern "C""
  5. __MEASURE_TIMINGS** explicitly defined in qp/types.h, QPDUNES_MEASURE_TIMINGS ignored.
jfrasch commented 9 years ago

Support for Windows is only experimental, but any improvement on this end is of course very much appreciated

mkatliar commented 9 years ago

I have fixed the build errors and committed them to the msvc-build-fix.

mvukov commented 9 years ago

:+1: Very good. Does make test work on Windows now?

mkatliar commented 9 years ago

There is no make test on Windows, but ctest -C Debug outputs this:

Test project E:/software/qpDUNES-dev/build/win64
      Start  1: test_chainMass_M3_N50_1stStep
 1/17 Test  #1: test_chainMass_M3_N50_1stStep ....   Passed    0.20 sec
      Start  2: test_doubleIntegrator
 2/17 Test  #2: test_doubleIntegrator ............***Failed    8.02 sec
      Start  3: test_doubleIntegrator_mpc
 3/17 Test  #3: test_doubleIntegrator_mpc ........***Failed    0.70 sec
      Start  4: test_doubleIntegrator_qp
 4/17 Test  #4: test_doubleIntegrator_qp .........***Failed    1.30 sec
      Start  5: test_example1
 5/17 Test  #5: test_example1 ....................   Passed    0.03 sec
      Start  6: test_example1_ltv
 6/17 Test  #6: test_example1_ltv ................   Passed    0.07 sec
      Start  7: test_example2_affine
 7/17 Test  #7: test_example2_affine .............   Passed    0.02 sec
      Start  8: test_example3_affine_mpc
 8/17 Test  #8: test_example3_affine_mpc .........***Exception: SegFault  3.89 sec
      Start  9: test_mhePrototype
 9/17 Test  #9: test_mhePrototype ................***Failed    1.02 sec
      Start 10: test_nmpcPrototype
10/17 Test #10: test_nmpcPrototype ...............   Passed    0.03 sec
      Start 11: test_nmpcPrototype_b
11/17 Test #11: test_nmpcPrototype_b .............***Failed    1.13 sec
      Start 12: test_nmpcTest
12/17 Test #12: test_nmpcTest ....................   Passed    0.03 sec
      Start 13: test_singleIntegrator
13/17 Test #13: test_singleIntegrator ............***Failed    0.73 sec
      Start 14: test_singleIntegrator_b
14/17 Test #14: test_singleIntegrator_b ..........***Failed    0.55 sec
      Start 15: test_singleIntegrator_d
15/17 Test #15: test_singleIntegrator_d ..........   Passed    0.04 sec
      Start 16: test_singleIntegrator_sc
16/17 Test #16: test_singleIntegrator_sc .........***Failed    0.63 sec
      Start 17: test_wang2010
17/17 Test #17: test_wang2010 ....................***Failed    0.05 sec

41% tests passed, 10 tests failed out of 17

Total Test time (real) =  18.67 sec

The following tests FAILED:
          2 - test_doubleIntegrator (Failed)
          3 - test_doubleIntegrator_mpc (Failed)
          4 - test_doubleIntegrator_qp (Failed)
          8 - test_example3_affine_mpc (SEGFAULT)
          9 - test_mhePrototype (Failed)
         11 - test_nmpcPrototype_b (Failed)
         13 - test_singleIntegrator (Failed)
         14 - test_singleIntegrator_b (Failed)
         16 - test_singleIntegrator_sc (Failed)
         17 - test_wang2010 (Failed)
Errors while running CTest

On Linux, 'make test' outputs

Running tests...
Test project /media/sf_E_DRIVE/software/qpDUNES-dev/build/linux
      Start  1: test_chainMass_M3_N50_1stStep
 1/17 Test  #1: test_chainMass_M3_N50_1stStep ....   Passed    0.05 sec
      Start  2: test_doubleIntegrator
 2/17 Test  #2: test_doubleIntegrator ............   Passed    0.02 sec
      Start  3: test_doubleIntegrator_mpc
 3/17 Test  #3: test_doubleIntegrator_mpc ........   Passed    0.04 sec
      Start  4: test_doubleIntegrator_qp
 4/17 Test  #4: test_doubleIntegrator_qp .........   Passed    0.02 sec
      Start  5: test_example1
 5/17 Test  #5: test_example1 ....................   Passed    0.01 sec
      Start  6: test_example1_ltv
 6/17 Test  #6: test_example1_ltv ................   Passed    0.01 sec
      Start  7: test_example2_affine
 7/17 Test  #7: test_example2_affine .............   Passed    0.02 sec
      Start  8: test_example3_affine_mpc
 8/17 Test  #8: test_example3_affine_mpc .........***Exception: SegFault  0.11 sec
      Start  9: test_mhePrototype
 9/17 Test  #9: test_mhePrototype ................   Passed    0.01 sec
      Start 10: test_nmpcPrototype
10/17 Test #10: test_nmpcPrototype ...............   Passed    0.01 sec
      Start 11: test_nmpcPrototype_b
11/17 Test #11: test_nmpcPrototype_b .............   Passed    0.02 sec
      Start 12: test_nmpcTest
12/17 Test #12: test_nmpcTest ....................   Passed    0.01 sec
      Start 13: test_singleIntegrator
13/17 Test #13: test_singleIntegrator ............   Passed    0.01 sec
      Start 14: test_singleIntegrator_b
14/17 Test #14: test_singleIntegrator_b ..........   Passed    0.01 sec
      Start 15: test_singleIntegrator_d
15/17 Test #15: test_singleIntegrator_d ..........   Passed    0.01 sec
      Start 16: test_singleIntegrator_sc
16/17 Test #16: test_singleIntegrator_sc .........   Passed    0.01 sec
      Start 17: test_wang2010
17/17 Test #17: test_wang2010 ....................***Failed    0.01 sec

88% tests passed, 2 tests failed out of 17

Total Test time (real) =   0.51 sec

The following tests FAILED:
      8 - test_example3_affine_mpc (SEGFAULT)
     17 - test_wang2010 (Failed)
Errors while running CTest
Makefile:117: recipe for target 'test' failed
make: *** [test] Error 8

The test that fail on Windows but do not fail on Linux fail because use of uninitialized values is detected.