0

I am porting a project from linux to windows using cmake. The Project is clapack along with some testing procedures. Everything worked correctly when I built a 32 bit release. However when I build with the 64 bit compiler, the executables cannot be run.

The commands I run are:

32 bit:

    cmake .
    devenv CLAPACK.sln /build

64 bit:

    cmake "-DARCH=x86-64_Windows-7_VC10" -G "Visual Studio 10 Win64"
    devenv CLAPACK.sln /Rebuild "Release|x64" /project ALL_BUILD

I am running Windows 7 and cmake 2.8.4

Community
  • 1
  • 1
Scottfivefour
  • 73
  • 1
  • 1
  • 10
  • 1
    Wait, do you get no executables, or you get executables but they fail when run? With what error? – Ben Voigt Jul 10 '12 at 18:07
  • The executables are created but I get an error: "The system cannot execute the specified program" – Scottfivefour Jul 10 '12 at 21:38
  • 1
    Have you tried opening the generated solution file inside Visual Studio, building and running there? You may get more information about the failure. (Run inside the debugger, even though it's a Release build, the debugger will still trace DLL load attempts and find out where the failure occurs) – Ben Voigt Jul 10 '12 at 22:02
  • Yep, I have attempted to run the program from both the command line and through the debugger in VS. Unfortunately there is no additional information given. I don't know if this has anything to do with missing DLL's because there are no symbols in either the working 32 bit version or the faulty 64 bit version. – Scottfivefour Jul 11 '12 at 14:26
  • 1
    It's possible to generate symbols for an optimized (release) build, but DLL loading problems should be apparent even without symbols. Can you paste the messages from the Output(Debugger) window into your question? – Ben Voigt Jul 11 '12 at 15:16
  • There is no output when I try to debug either a debug or optimized build. There is a popup that says "unable to start program". If this has by chance piqued your interest you can get the source at http://www.netlib.org/clapack/ I am using the cmake 3.2.1 version. – Scottfivefour Jul 11 '12 at 15:48
  • 1
    I'll download it after work and see if I can figure out what's wrong. – Ben Voigt Jul 11 '12 at 16:50
  • 1
    What version of Visual Studio, btw? And which project creates the executable that you can't run? – Ben Voigt Jul 12 '12 at 02:57
  • vs 2010 sp1. The project, ALL_BUILD yields the faulty executables. The executables I cannot run are the in the main Testing directory such as xeigtsts in TESTING\EIG\RELEASE. – Scottfivefour Jul 12 '12 at 14:52
  • Not very amusing: CMake put old copies of msvcrt90.dll into my path, causing random R6034 errors in other applications. – Ben Voigt Jul 18 '12 at 01:39

1 Answers1

1

Well, I don't know how to run the tests, but the programs start just fine on my machine (I used the second cmake command in the question, then opened the generated solution file in Visual Studio 2010 and built the entire solution). I'll retry with 2010 SP1 as soon as the installer finishes.


So here's my output from building RUN_TESTS in VS2010 SP1. xeigtsts passed no problem, but xeigtstz failed repeatedly.

1>  Test project C:/Users/BEN/Downloads/clapack-3.2.1-CMAKE/clapack-3.2.1-CMAKE
1>        Start  1: xblat1s
1>   1/94 Test  #1: xblat1s ..........................   Passed    0.15 sec
1>        Start  2: xblat1c
1>   2/94 Test  #2: xblat1c ..........................   Passed    0.03 sec
1>        Start  3: xblat1d
1>   3/94 Test  #3: xblat1d ..........................   Passed    0.02 sec
1>        Start  4: xblat1z
1>   4/94 Test  #4: xblat1z ..........................   Passed    0.02 sec
1>        Start  5: xblat2s
1>   5/94 Test  #5: xblat2s ..........................   Passed    0.06 sec
1>        Start  6: xblat2c
1>   6/94 Test  #6: xblat2c ..........................   Passed    0.07 sec
1>        Start  7: xblat2d
1>   7/94 Test  #7: xblat2d ..........................   Passed    0.07 sec
1>        Start  8: xblat2z
1>   8/94 Test  #8: xblat2z ..........................   Passed    0.10 sec
1>        Start  9: xblat3s
1>   9/94 Test  #9: xblat3s ..........................   Passed    0.07 sec
1>        Start 10: xblat3c
1>  10/94 Test #10: xblat3c ..........................   Passed    0.12 sec
1>        Start 11: xblat3d
1>  11/94 Test #11: xblat3d ..........................   Passed    0.05 sec
1>        Start 12: xblat3z
1>  12/94 Test #12: xblat3z ..........................   Passed    0.07 sec
1>        Start 13: xlintsts_stest_in
1>  13/94 Test #13: xlintsts_stest_in ................   Passed    2.43 sec
1>        Start 14: xlintstc_ctest_in
1>  14/94 Test #14: xlintstc_ctest_in ................   Passed    7.79 sec
1>        Start 15: xlintstd_dtest_in
1>  15/94 Test #15: xlintstd_dtest_in ................   Passed    2.24 sec
1>        Start 16: xlintstz_ztest_in
1>  16/94 Test #16: xlintstz_ztest_in ................   Passed    7.56 sec
1>        Start 17: xlintstds_dstest_in
1>  17/94 Test #17: xlintstds_dstest_in ..............   Passed    0.59 sec
1>        Start 18: xlintstzc_zctest_in
1>  18/94 Test #18: xlintstzc_zctest_in ..............   Passed    1.64 sec
1>        Start 19: xlintstrfs_stest_rfp_in
1>  19/94 Test #19: xlintstrfs_stest_rfp_in ..........   Passed    0.22 sec
1>        Start 20: xlintstrfd_dtest_rfp_in
1>  20/94 Test #20: xlintstrfd_dtest_rfp_in ..........   Passed    0.21 sec
1>        Start 21: xlintstrfc_ctest_rfp_in
1>  21/94 Test #21: xlintstrfc_ctest_rfp_in ..........   Passed    0.83 sec
1>        Start 22: xlintstrfz_ztest_rfp_in
1>  22/94 Test #22: xlintstrfz_ztest_rfp_in ..........   Passed    0.83 sec
1>        Start 23: xeigtsts_nep_in
1>  23/94 Test #23: xeigtsts_nep_in ..................   Passed    0.10 sec
1>        Start 24: xeigtsts_sep_in
1>  24/94 Test #24: xeigtsts_sep_in ..................   Passed    0.40 sec
1>        Start 25: xeigtsts_svd_in
1>  25/94 Test #25: xeigtsts_svd_in ..................   Passed    2.57 sec
1>        Start 26: xeigtsts_sec_in
1>  26/94 Test #26: xeigtsts_sec_in ..................   Passed    0.27 sec
1>        Start 27: xeigtsts_sed_in
1>  27/94 Test #27: xeigtsts_sed_in ..................   Passed    0.12 sec
1>        Start 28: xeigtsts_sgg_in
1>  28/94 Test #28: xeigtsts_sgg_in ..................   Passed    0.09 sec
1>        Start 29: xeigtsts_sgd_in
1>  29/94 Test #29: xeigtsts_sgd_in ..................   Passed    0.13 sec
1>        Start 30: xeigtsts_ssb_in
1>  30/94 Test #30: xeigtsts_ssb_in ..................   Passed    0.02 sec
1>        Start 31: xeigtsts_ssg_in
1>  31/94 Test #31: xeigtsts_ssg_in ..................   Passed    0.39 sec
1>        Start 32: xeigtsts_sbal_in
1>  32/94 Test #32: xeigtsts_sbal_in .................   Passed    0.02 sec
1>        Start 33: xeigtsts_sbak_in
1>  33/94 Test #33: xeigtsts_sbak_in .................   Passed    0.02 sec
1>        Start 34: xeigtsts_sgbal_in
1>  34/94 Test #34: xeigtsts_sgbal_in ................   Passed    0.02 sec
1>        Start 35: xeigtsts_sgbak_in
1>  35/94 Test #35: xeigtsts_sgbak_in ................   Passed    0.02 sec
1>        Start 36: xeigtsts_sbb_in
1>  36/94 Test #36: xeigtsts_sbb_in ..................   Passed    0.03 sec
1>        Start 37: xeigtsts_glm_in
1>  37/94 Test #37: xeigtsts_glm_in ..................   Passed    0.02 sec
1>        Start 38: xeigtsts_gqr_in
1>  38/94 Test #38: xeigtsts_gqr_in ..................   Passed    0.03 sec
1>        Start 39: xeigtsts_gsv_in
1>  39/94 Test #39: xeigtsts_gsv_in ..................   Passed    0.03 sec
1>        Start 40: xeigtsts_lse_in
1>  40/94 Test #40: xeigtsts_lse_in ..................   Passed    0.02 sec
1>        Start 41: xeigtstc_nep_in
1>  41/94 Test #41: xeigtstc_nep_in ..................   Passed    0.17 sec
1>        Start 42: xeigtstc_sep_in
1>  42/94 Test #42: xeigtstc_sep_in ..................   Passed    0.62 sec
1>        Start 43: xeigtstc_svd_in
1>  43/94 Test #43: xeigtstc_svd_in ..................   Passed    4.62 sec
1>        Start 44: xeigtstc_cec_in
1>  44/94 Test #44: xeigtstc_cec_in ..................   Passed    0.05 sec
1>        Start 45: xeigtstc_ced_in
1>  45/94 Test #45: xeigtstc_ced_in ..................   Passed    0.22 sec
1>        Start 46: xeigtstc_cgg_in
1>  46/94 Test #46: xeigtstc_cgg_in ..................   Passed    0.20 sec
1>        Start 47: xeigtstc_cgd_in
1>  47/94 Test #47: xeigtstc_cgd_in ..................   Passed    0.19 sec
1>        Start 48: xeigtstc_csb_in
1>  48/94 Test #48: xeigtstc_csb_in ..................   Passed    0.03 sec
1>        Start 49: xeigtstc_csg_in
1>  49/94 Test #49: xeigtstc_csg_in ..................   Passed    0.67 sec
1>        Start 50: xeigtstc_cbal_in
1>  50/94 Test #50: xeigtstc_cbal_in .................   Passed    0.04 sec
1>        Start 51: xeigtstc_cbak_in
1>  51/94 Test #51: xeigtstc_cbak_in .................   Passed    0.03 sec
1>        Start 52: xeigtstc_cgbal_in
1>  52/94 Test #52: xeigtstc_cgbal_in ................   Passed    0.02 sec
1>        Start 53: xeigtstc_cgbak_in
1>  53/94 Test #53: xeigtstc_cgbak_in ................   Passed    0.02 sec
1>        Start 54: xeigtstc_cbb_in
1>  54/94 Test #54: xeigtstc_cbb_in ..................   Passed    0.05 sec
1>        Start 55: xeigtstc_glm_in
1>  55/94 Test #55: xeigtstc_glm_in ..................   Passed    0.03 sec
1>        Start 56: xeigtstc_gqr_in
1>  56/94 Test #56: xeigtstc_gqr_in ..................   Passed    0.06 sec
1>        Start 57: xeigtstc_gsv_in
1>  57/94 Test #57: xeigtstc_gsv_in ..................   Passed    0.04 sec
1>        Start 58: xeigtstc_lse_in
1>  58/94 Test #58: xeigtstc_lse_in ..................   Passed    0.03 sec
1>        Start 59: xeigtstd_nep_in
1>  59/94 Test #59: xeigtstd_nep_in ..................   Passed    0.09 sec
1>        Start 60: xeigtstd_sep_in
1>  60/94 Test #60: xeigtstd_sep_in ..................   Passed    0.50 sec
1>        Start 61: xeigtstd_svd_in
1>  61/94 Test #61: xeigtstd_svd_in ..................   Passed    3.00 sec
1>        Start 62: xeigtstd_dec_in
1>  62/94 Test #62: xeigtstd_dec_in ..................   Passed    0.20 sec
1>        Start 63: xeigtstd_ded_in
1>  63/94 Test #63: xeigtstd_ded_in ..................   Passed    0.13 sec
1>        Start 64: xeigtstd_dgg_in
1>  64/94 Test #64: xeigtstd_dgg_in ..................   Passed    0.10 sec
1>        Start 65: xeigtstd_dgd_in
1>  65/94 Test #65: xeigtstd_dgd_in ..................   Passed    0.14 sec
1>        Start 66: xeigtstd_dsb_in
1>  66/94 Test #66: xeigtstd_dsb_in ..................   Passed    0.02 sec
1>        Start 67: xeigtstd_dsg_in
1>  67/94 Test #67: xeigtstd_dsg_in ..................   Passed    0.50 sec
1>        Start 68: xeigtstd_dbal_in
1>  68/94 Test #68: xeigtstd_dbal_in .................   Passed    0.02 sec
1>        Start 69: xeigtstd_dbak_in
1>  69/94 Test #69: xeigtstd_dbak_in .................   Passed    0.02 sec
1>        Start 70: xeigtstd_dgbal_in
1>  70/94 Test #70: xeigtstd_dgbal_in ................   Passed    0.02 sec
1>        Start 71: xeigtstd_dgbak_in
1>  71/94 Test #71: xeigtstd_dgbak_in ................   Passed    0.02 sec
1>        Start 72: xeigtstd_dbb_in
1>  72/94 Test #72: xeigtstd_dbb_in ..................   Passed    0.03 sec
1>        Start 73: xeigtstd_glm_in
1>  73/94 Test #73: xeigtstd_glm_in ..................   Passed    0.03 sec
1>        Start 74: xeigtstd_gqr_in
1>  74/94 Test #74: xeigtstd_gqr_in ..................   Passed    0.03 sec
1>        Start 75: xeigtstd_gsv_in
1>  75/94 Test #75: xeigtstd_gsv_in ..................   Passed    0.03 sec
1>        Start 76: xeigtstd_lse_in
1>  76/94 Test #76: xeigtstd_lse_in ..................   Passed    0.02 sec
1>        Start 77: xeigtstz_nep_in
1>  77/94 Test #77: xeigtstz_nep_in ..................***Failed   42.68 sec
1>        Start 78: xeigtstz_sep_in
1>  78/94 Test #78: xeigtstz_sep_in ..................***Failed    9.85 sec
1>        Start 79: xeigtstz_svd_in
1>  79/94 Test #79: xeigtstz_svd_in ..................***Failed    7.24 sec
1>        Start 80: xeigtstz_zec_in
1>  80/94 Test #80: xeigtstz_zec_in ..................***Failed    9.30 sec
1>        Start 81: xeigtstz_zed_in
1>  81/94 Test #81: xeigtstz_zed_in ..................***Failed    6.65 sec
1>        Start 82: xeigtstz_zgg_in
1>  82/94 Test #82: xeigtstz_zgg_in ..................***Failed    7.73 sec
1>        Start 83: xeigtstz_zgd_in
1>  83/94 Test #83: xeigtstz_zgd_in ..................***Failed    7.55 sec
1>        Start 84: xeigtstz_zsb_in
1>  84/94 Test #84: xeigtstz_zsb_in ..................***Failed    6.85 sec
1>        Start 85: xeigtstz_zsg_in
1>  85/94 Test #85: xeigtstz_zsg_in ..................***Failed    7.41 sec
1>        Start 86: xeigtstz_zbal_in
1>  86/94 Test #86: xeigtstz_zbal_in .................***Failed    7.36 sec
1>        Start 87: xeigtstz_zbak_in
1>  87/94 Test #87: xeigtstz_zbak_in .................***Failed    6.84 sec
1>        Start 88: xeigtstz_zgbal_in
1>  88/94 Test #88: xeigtstz_zgbal_in ................***Failed    7.31 sec
1>        Start 89: xeigtstz_zgbak_in
1>  89/94 Test #89: xeigtstz_zgbak_in ................***Failed    6.79 sec
1>        Start 90: xeigtstz_zbb_in
1>  90/94 Test #90: xeigtstz_zbb_in ..................***Failed    6.81 sec
1>        Start 91: xeigtstz_glm_in
1>  91/94 Test #91: xeigtstz_glm_in ..................***Failed    7.59 sec
1>        Start 92: xeigtstz_gqr_in
1>  92/94 Test #92: xeigtstz_gqr_in ..................***Failed    7.38 sec
1>        Start 93: xeigtstz_gsv_in
1>  93/94 Test #93: xeigtstz_gsv_in ..................***Failed    7.14 sec
1>        Start 94: xeigtstz_lse_in
1>  94/94 Test #94: xeigtstz_lse_in ..................***Failed    7.64 sec
1>  
1>  81% tests passed, 18 tests failed out of 94
1>  
1>  Total Test time (real) = 211.82 sec
1>  
1>  The following tests FAILED:
1>       77 - xeigtstz_nep_in (Failed)
1>       78 - xeigtstz_sep_in (Failed)
1>       79 - xeigtstz_svd_in (Failed)
1>       80 - xeigtstz_zec_in (Failed)
1>       81 - xeigtstz_zed_in (Failed)
1>       82 - xeigtstz_zgg_in (Failed)
1>       83 - xeigtstz_zgd_in (Failed)
1>       84 - xeigtstz_zsb_in (Failed)
1>       85 - xeigtstz_zsg_in (Failed)
1>       86 - xeigtstz_zbal_in (Failed)
1>       87 - xeigtstz_zbak_in (Failed)
1>       88 - xeigtstz_zgbal_in (Failed)
1>       89 - xeigtstz_zgbak_in (Failed)
1>       90 - xeigtstz_zbb_in (Failed)
1>       91 - xeigtstz_glm_in (Failed)
1>       92 - xeigtstz_gqr_in (Failed)
1>       93 - xeigtstz_gsv_in (Failed)
1>       94 - xeigtstz_lse_in (Failed)
1>  Errors while running CTest

The problem doesn't resolve with a rebuild of that project. dumpbin says the PE header is valid.

When I run in the debugger, I most definitely get extensive debug output. Stack overflow. I'll have to enable symbols to see exactly what's going on. But first, let's see if the Debug build fails the same way.

Yes, it does. The test case is seriously broken, it tries to use multiple megabytes of automatic variables, which don't fit onto the stack. Here's the main culprit:

doublecomplex a[243936] /* was [17424][14] */, b[87120] /* was [17424]
    [5] */, c__[160000] /* was [400][400] */;

The project has already been adjusted to use a stack of 10MB instead of the default 1MB. In the x64 build, this is still not enough. After changing the linker option to /STACK:40000000, the crash is gone. (This is not a good solution, neither was the original expansion to 10MB a good idea. Don't use ridiculously sized automatic variables, we have dynamic and static lifetimes for that.)

After changing that test's linker option:

1>  100% tests passed, 0 tests failed out of 94
1>  
1>  Total Test time (real) =  48.98 sec
Ben Voigt
  • 277,958
  • 43
  • 419
  • 720
  • Are you running the clapack testing programs (such as xeigtsts in TESTING\EIG\Release)? – Scottfivefour Jul 12 '12 at 14:45
  • You can also run the test suite with proper test inputs by doing a build of RUN_TESTS. When I do this the first 9 (the blas tests) pass and the remaining fail because they are unable to run. But this route is even less informative because it only says the tests fail and does not indicate it is because the executables were not able to run. – Scottfivefour Jul 12 '12 at 14:58
  • 1
    @Scottfivefour: Most likely it was the blas tests that I was running. I'll check the others tonight. – Ben Voigt Jul 12 '12 at 21:03