Problems of developing in C++ and run tests

Hi Juan.

I want to develop an FVM Solver based on the source code of DEVSIM. And I tried to utilize the source code but encountered some problems.

The first problem is as follows.

I have built the program using the automated scripts provided. And it processed successfully. The commands are as follows.

git clone https://github.com/devsim/devsim.git
cd devsim
git submodule update --init
scripts\build_appveyor.bat x64 conda 1.0

Then there are some files of Visual Studio project in the folder \win64. And I opened DEVSIM.sln in VS. But I have no idea about what to do next.

I want to code a project for diode_3d example (like the one in the folder \examples\diode) in C++. Should I add a new project in the solution and locate the project files in the folder \win64\src\diode_3d?

I did this and wrote a simple source file in the diode_3d project like:

#include <iostream>
using namespace std;

int main() {
    return 0;
}

I just wanted to know if it is alright to create a new project in the solution. However, when I started to build this new project, it seems like all of the projects started to build again and the build failed finally. Could you please tell me what should I do if I want to utilize the source code in VS?

The second question is that many tests failed after my build.

After the process of build completed, I run the test for Windows. And it turns out that 42 of 86 tests failed. The commands are as follows.

git clone https://github.com/devsim/devsim_tests_win64.git
cd devsim_tests_win64
preinstall.bat
conda activate devsim_test
pip install --target devsim_win64_2.9.0 devsim-2.9.0-cp37-abi3-win_amd64.whl
run_tests.bat 2.9.0

The .whl file for the test run is duplicated from \devsim\dist\devsim-2.9.0-cp37-abi3-win_amd64.whl.

Is there something that I’ve done wrong?

The log files of command output for build and test are below.

Thanks for your reading.

Wong

The command output while building is so long that it can’t be posted. Those while running tests are as follows.

H:\devsim\devsim_tests_win64\devsim_win64_2.9.0\devsim_data\run>ctest -j4
Test project H:/devsim/devsim_tests_win64/devsim_win64_2.9.0/devsim_data/run
      Start 34: testing/mesh3
      Start 46: testing/trimesh1
      Start 50: testing/mos_2d
      Start 15: testing/pythonmesh1d
 1/86 Test #34: testing/mesh3 ..........................   Passed    0.27 sec
      Start 35: testing/mesh4
 2/86 Test #15: testing/pythonmesh1d ...................   Passed    0.27 sec
      Start 36: testing/mesh2d
 3/86 Test #46: testing/trimesh1 .......................   Passed    0.42 sec
      Start 47: testing/trimesh2
 4/86 Test #35: testing/mesh4 ..........................   Passed    0.19 sec
      Start 48: testing/noise_res_2d
 5/86 Test #36: testing/mesh2d .........................   Passed    0.19 sec
      Start 66: examples/capacitance/cap2d
 6/86 Test #47: testing/trimesh2 .......................   Passed    0.34 sec
      Start 68: examples/bioapp1/bioapp1_2d
 7/86 Test #48: testing/noise_res_2d ...................***Failed    0.39 sec
      Start 70: examples/bioapp1/bioapp1_3d
 8/86 Test #50: testing/mos_2d .........................***Failed    1.20 sec
      Start 52: testing/mos_2d_restart2
 9/86 Test #66: examples/capacitance/cap2d .............***Failed    1.02 sec
      Start 75: examples/diode/gmsh_diode2d
10/86 Test #52: testing/mos_2d_restart2 ................***Failed    0.59 sec
      Start 76: examples/diode/gmsh_diode3d
11/86 Test #75: examples/diode/gmsh_diode2d ............***Failed    0.98 sec
      Start  1: testing/info
12/86 Test  #1: testing/info ...........................   Passed    0.19 sec
      Start  2: testing/cap2
13/86 Test  #2: testing/cap2 ...........................***Failed    0.42 sec
      Start  3: testing/ssac_cap
14/86 Test  #3: testing/ssac_cap .......................***Failed    0.38 sec
      Start  4: testing/ssac_cap_2d_edge
15/86 Test  #4: testing/ssac_cap_2d_edge ...............***Failed    0.93 sec
      Start  5: testing/ssac_cap_2d_element
16/86 Test #70: examples/bioapp1/bioapp1_3d ............***Failed    4.25 sec
      Start  6: testing/ssac_cap_3d_edge
17/86 Test  #5: testing/ssac_cap_2d_element ............***Failed    1.01 sec
      Start  7: testing/ssac_cap_3d_element
18/86 Test  #6: testing/ssac_cap_3d_edge ...............***Failed    0.40 sec
      Start  8: testing/equation1
19/86 Test  #7: testing/ssac_cap_3d_element ............***Failed    0.38 sec
      Start  9: testing/ptest1
20/86 Test  #8: testing/equation1 ......................   Passed    0.37 sec
      Start 10: testing/ptest2
21/86 Test #76: examples/diode/gmsh_diode3d ............***Failed    4.23 sec
      Start 11: testing/testfunc
22/86 Test  #9: testing/ptest1 .........................   Passed    0.40 sec
      Start 12: testing/testfunc_extended
23/86 Test #11: testing/testfunc .......................   Passed    0.19 sec
      Start 13: testing/utf8_2
24/86 Test #12: testing/testfunc_extended ..............   Passed    0.19 sec
      Start 14: testing/laux1
25/86 Test #10: testing/ptest2 .........................***Failed    0.56 sec
      Start 16: testing/Fermi1
26/86 Test #13: testing/utf8_2 .........................   Passed    0.32 sec
      Start 17: testing/Fermi1_float128
27/86 Test #16: testing/Fermi1 .........................   Passed    0.24 sec
      Start 18: testing/GaussFermi
28/86 Test #17: testing/Fermi1_float128 ................   Passed    0.22 sec
      Start 19: testing/GaussFermi_float128
29/86 Test #18: testing/GaussFermi .....................   Passed    0.20 sec
      Start 20: testing/kahan
30/86 Test #19: testing/GaussFermi_float128 ............   Passed    0.25 sec
      Start 21: testing/kahan_float128
31/86 Test #20: testing/kahan ..........................   Passed    0.21 sec
      Start 22: testing/fpetest1
32/86 Test #14: testing/laux1 ..........................   Passed    0.83 sec
      Start 23: testing/fpetest2
33/86 Test #21: testing/kahan_float128 .................   Passed    0.21 sec
      Start 24: testing/res1
34/86 Test #22: testing/fpetest1 .......................   Passed    0.20 sec
      Start 25: testing/res2
35/86 Test #23: testing/fpetest2 .......................   Passed    0.19 sec
      Start 26: testing/res3
36/86 Test #24: testing/res1 ...........................***Failed    0.37 sec
      Start 27: testing/ssac_res
37/86 Test #25: testing/res2 ...........................***Failed    0.42 sec
      Start 28: testing/noise_res
38/86 Test #26: testing/res3 ...........................***Failed    0.41 sec
      Start 29: testing/symdiff1
39/86 Test #29: testing/symdiff1 .......................   Passed    0.18 sec
      Start 30: testing/erf1
40/86 Test #27: testing/ssac_res .......................***Failed    0.41 sec
      Start 31: testing/erf2
41/86 Test #28: testing/noise_res ......................***Failed    0.38 sec
      Start 32: testing/mesh1
42/86 Test #31: testing/erf2 ...........................   Passed    0.20 sec
      Start 33: testing/mesh2
43/86 Test #30: testing/erf1 ...........................   Passed    0.32 sec
      Start 37: testing/transient_circ
44/86 Test #32: testing/mesh1 ..........................   Passed    0.32 sec
      Start 38: testing/transient_circ2
45/86 Test #33: testing/mesh2 ..........................***Failed    0.35 sec
      Start 39: testing/transient_circ3
46/86 Test #38: testing/transient_circ2 ................   Passed    0.32 sec
      Start 40: testing/transient_rc
47/86 Test #37: testing/transient_circ .................   Passed    0.41 sec
      Start 41: testing/circ1
48/86 Test #39: testing/transient_circ3 ................   Passed    0.33 sec
      Start 42: testing/circ2
49/86 Test #40: testing/transient_rc ...................   Passed    0.38 sec
      Start 43: testing/circ3
50/86 Test #41: testing/circ1 ..........................***Failed    0.38 sec
      Start 44: testing/circ4
51/86 Test #68: examples/bioapp1/bioapp1_2d ............***Failed    8.43 sec
      Start 45: testing/ssac_circ
52/86 Test #42: testing/circ2 ..........................***Failed    0.38 sec
      Start 49: testing/dio2_element_2d
53/86 Test #43: testing/circ3 ..........................   Passed    0.35 sec
      Start 51: testing/mos_2d_restart
54/86 Test #44: testing/circ4 ..........................***Failed    0.40 sec
      Start 53: testing/pythonmesh1d_comp
55/86 Test #45: testing/ssac_circ ......................   Passed    0.33 sec
      Start 54: testing/mesh3_comp
56/86 Test #54: testing/mesh3_comp .....................   Passed    0.10 sec
      Start 55: testing/mesh4_comp
57/86 Test #53: testing/pythonmesh1d_comp ..............   Passed    0.12 sec
      Start 56: testing/trimesh2_msh_comp
58/86 Test #55: testing/mesh4_comp .....................   Passed    0.09 sec
      Start 57: testing/trimesh3_msh_comp
59/86 Test #56: testing/trimesh2_msh_comp ..............   Passed    0.10 sec
      Start 58: testing/mesh2d_msh_comp
60/86 Test #57: testing/trimesh3_msh_comp ..............   Passed    0.10 sec
      Start 59: testing/mesh2d_tec_comp
61/86 Test #58: testing/mesh2d_msh_comp ................   Passed    0.11 sec
      Start 60: testing/mesh2d_reduced_tec_comp
62/86 Test #59: testing/mesh2d_tec_comp ................   Passed    0.12 sec
      Start 61: testing/noise_res_2d_tec_comp
63/86 Test #60: testing/mesh2d_reduced_tec_comp ........   Passed    0.11 sec
      Start 62: testing/mos_2d_dd_comp
64/86 Test #61: testing/noise_res_2d_tec_comp ..........***Failed    0.12 sec
      Start 63: testing/mos_2d_vtu_comp
65/86 Test #62: testing/mos_2d_dd_comp .................***Failed    0.12 sec
      Start 64: testing/mos_2d_restart2_comp
66/86 Test #51: testing/mos_2d_restart .................***Failed    0.76 sec
      Start 65: examples/capacitance/cap1d
67/86 Test #63: testing/mos_2d_vtu_comp ................   Passed    0.14 sec
      Start 67: examples/capacitance/cap2d_comp
68/86 Test #64: testing/mos_2d_restart2_comp ...........***Failed    0.14 sec
      Start 69: examples/bioapp1/bioapp1_2d_comp
69/86 Test #49: testing/dio2_element_2d ................***Failed    0.96 sec
      Start 71: examples/bioapp1/bioapp1_3d_comp
70/86 Test #67: examples/capacitance/cap2d_comp ........***Failed    0.13 sec
      Start 72: examples/diode/diode_1d
71/86 Test #71: examples/bioapp1/bioapp1_3d_comp .......***Failed    0.14 sec
      Start 73: examples/diode/diode_1d_custom
72/86 Test #69: examples/bioapp1/bioapp1_2d_comp .......***Failed    0.22 sec
      Start 74: examples/diode/diode_2d
73/86 Test #65: examples/capacitance/cap1d .............   Passed    0.32 sec
      Start 77: examples/diode/gmsh_diode3d_float128
74/86 Test #72: examples/diode/diode_1d ................***Failed    0.65 sec
      Start 78: examples/diode/ssac_diode
75/86 Test #73: examples/diode/diode_1d_custom .........***Failed    0.68 sec
      Start 79: examples/diode/tran_diode
76/86 Test #78: examples/diode/ssac_diode ..............***Failed    0.64 sec
      Start 80: examples/diode/laux2d
77/86 Test #74: examples/diode/diode_2d ................***Failed    1.25 sec
      Start 81: examples/diode/laux3d
78/86 Test #79: examples/diode/tran_diode ..............***Failed    0.95 sec
      Start 82: examples/diode/pythonmesh3d
79/86 Test #80: examples/diode/laux2d ..................***Failed    0.98 sec
      Start 83: examples/mobility/gmsh_mos2d
80/86 Test #82: examples/diode/pythonmesh3d ............   Passed    0.63 sec
      Start 84: examples/mobility/gmsh_mos2d_kla
81/86 Test #83: examples/mobility/gmsh_mos2d ...........***Failed    3.97 sec
      Start 85: examples/mobility/pythonmesh2d
82/86 Test #85: examples/mobility/pythonmesh2d .........   Passed    0.35 sec
      Start 86: examples/vectorpotential/twowire
83/86 Test #86: examples/vectorpotential/twowire .......***Failed    0.83 sec
84/86 Test #81: examples/diode/laux3d ..................   Passed    6.96 sec
85/86 Test #77: examples/diode/gmsh_diode3d_float128 ...***Failed   18.42 sec
86/86 Test #84: examples/mobility/gmsh_mos2d_kla .......***Failed   20.32 sec

51% tests passed, 42 tests failed out of 86

Total Test time (real) =  33.01 sec

The following tests FAILED:
          2 - testing/cap2 (Failed)
          3 - testing/ssac_cap (Failed)
          4 - testing/ssac_cap_2d_edge (Failed)
          5 - testing/ssac_cap_2d_element (Failed)
          6 - testing/ssac_cap_3d_edge (Failed)
          7 - testing/ssac_cap_3d_element (Failed)
         10 - testing/ptest2 (Failed)
         24 - testing/res1 (Failed)
         25 - testing/res2 (Failed)
         26 - testing/res3 (Failed)
         27 - testing/ssac_res (Failed)
         28 - testing/noise_res (Failed)
         33 - testing/mesh2 (Failed)
         41 - testing/circ1 (Failed)
         42 - testing/circ2 (Failed)
         44 - testing/circ4 (Failed)
         48 - testing/noise_res_2d (Failed)
         49 - testing/dio2_element_2d (Failed)
         50 - testing/mos_2d (Failed)
         51 - testing/mos_2d_restart (Failed)
         52 - testing/mos_2d_restart2 (Failed)
         61 - testing/noise_res_2d_tec_comp (Failed)
         62 - testing/mos_2d_dd_comp (Failed)
         64 - testing/mos_2d_restart2_comp (Failed)
         66 - examples/capacitance/cap2d (Failed)
         67 - examples/capacitance/cap2d_comp (Failed)
         68 - examples/bioapp1/bioapp1_2d (Failed)
         69 - examples/bioapp1/bioapp1_2d_comp (Failed)
         70 - examples/bioapp1/bioapp1_3d (Failed)
         71 - examples/bioapp1/bioapp1_3d_comp (Failed)
         72 - examples/diode/diode_1d (Failed)
         73 - examples/diode/diode_1d_custom (Failed)
         74 - examples/diode/diode_2d (Failed)
         75 - examples/diode/gmsh_diode2d (Failed)
         76 - examples/diode/gmsh_diode3d (Failed)
         77 - examples/diode/gmsh_diode3d_float128 (Failed)
         78 - examples/diode/ssac_diode (Failed)
         79 - examples/diode/tran_diode (Failed)
         80 - examples/diode/laux2d (Failed)
         83 - examples/mobility/gmsh_mos2d (Failed)
         84 - examples/mobility/gmsh_mos2d_kla (Failed)
         86 - examples/vectorpotential/twowire (Failed)
Errors while running CTest
Output from these tests are in: H:/devsim/devsim_tests_win64/devsim_win64_2.9.0/devsim_data/run/Testing/Temporary/LastTest.log
Use "--rerun-failed --output-on-failure" to re-run the failed cases verbosely.

I find an error report while building which happens after msys2 installed some libraries. The error reads

:: Processing package changes...
(1/5) reinstalling rsync                                                 [#######################################] 100%
(2/5) reinstalling zip                                                   [#######################################] 100%
(3/5) reinstalling bison                                                 [#######################################] 100%
(4/5) reinstalling flex                                                  [#######################################] 100%
(5/5) reinstalling git                                                   [#######################################] 100%
:: Running post-transaction hooks...
(1/1) Updating the info directory file...
error: command failed to execute correctly
Collecting package metadata (current_repodata.json): done
Solving environment: done

I looked into the log of msys2. The process of msys2 ends at

[2024-10-28T14:39:02+0800] [ALPM] reinstalled zip (3.0-4)
[2024-10-28T14:39:04+0800] [ALPM] reinstalled bison (3.8.2-5)
[2024-10-28T14:39:04+0800] [ALPM] reinstalled flex (2.6.4-3)
[2024-10-28T14:39:08+0800] [ALPM] reinstalled git (2.45.2-1)
[2024-10-28T14:39:08+0800] [ALPM] transaction completed
[2024-10-28T14:39:08+0800] [ALPM] running 'texinfo-install.hook'...

Maybe the reason lies in the dependent libraries installation in msys2. It seems like an Internet issue.

Hi @wong, the error concerning msys2 is not a failure. It is actually occurring as a regular part of the build process:
https://ci.appveyor.com/project/devsim/devsim/builds/50877767

This error is safe to ignore.

Unfortunately the results are sensitive to the machine running the tests. For example, the windows version, or the actual CPU.

If you have access to a diff tool, you can compare the differences between these directories:

diff goldenresults/testing/info.out devsim_win64_2.9.0/devsim_data/testing

I suggest downloading the .whl file for a previous release and comparing those results.
https://pypi.org/project/devsim/2.9.0/#files