I'm having some trouble compiling in release and dev mode with \--gc:refc 
--opt:speed. I can only compile it when I disable optimization with nim c 
-d:release --gc:refc --opt:none myprogram.

I have tested it in combination with -d:danger, \--assertions:on/off and 
\--checks:on/off, but it makes no difference. But if I change the gc to 
\--gc:markAndSweep, it'll compile fine. As shown in output below, the compiling 
takes very looong.

The only nimble installed wrapper gcc includes is 
[nimlibxlsxwriter](https://github.com/KeepCoolWithCoolidge/nimlibxlsxwriter).

**Questions:**

  1. I would like to be able to compile the \--gc:refc, so I'm looking for some 
hints on why the compiling fails?
  2. Is there a profiling tool, which can show why the compile time is so long 
(e.g. due to macro XYZ)?



**System:**

  * Nim: 20.2/20.99
  * GCC: 9.1.0
  * OS: Linux
  * i5-4200U
  * 12 Gi ram



**Compile output:**
    
    
    # Release
    $ nim c -d:release -d:ssl --gc:refc myprogram
    
    Error: execution of an external compiler program 'gcc -c  -w 
-I"/home/user/.nimble/pkgs/nimlibxlsxwriter-0.1.1/nimlibxlsxwriter" 
-I"/home/user/.nimble/pkgs/nimlibxlsxwriter-0.1.1/nimlibxlsxwriter/include" 
-I"/home/user/.nimble/pkgs/nimlibxlsxwriter-0.1.1/nimlibxlsxwriter/include/xlsxwriter"
 -O3 -fno-strict-aliasing  -I/home/user/.choosenim/toolchains/nim-0.20.2/lib 
-I/home/user//nim/myprogram -o 
/home/user/.cache/nim/myprogram_r/myprogram.nim.c.o 
/home/user/.cache/nim/myprogram_r/myprogram.nim.c' failed with exit code: 1
    gcc: fatal error: Killed signal terminated program cc1
    compilation terminated.
    
    
    # Release danger
    $ nim c -d:release -d:danger -d:ssl --gc:refc myprogram
    
    Error: execution of an external compiler program 'gcc -c  -w 
-I"/home/user/.nimble/pkgs/nimlibxlsxwriter-0.1.1/nimlibxlsxwriter" 
-I"/home/user/.nimble/pkgs/nimlibxlsxwriter-0.1.1/nimlibxlsxwriter/include" 
-I"/home/user/.nimble/pkgs/nimlibxlsxwriter-0.1.1/nimlibxlsxwriter/include/xlsxwriter"
 -O3 -fno-strict-aliasing  -I/home/user/.choosenim/toolchains/nim-0.20.2/lib 
-I/home/user//nim/myprogram -o 
/home/user/.cache/nim/myprogram_r/myprogram.nim.c.o 
/home/user/.cache/nim/myprogram_r/myprogram.nim.c' failed with exit code: 1
    gcc: fatal error: Killed signal terminated program cc1
    compilation terminated.
    
    
    # Release danger with disable optimization
    $ nim c -d:release -d:danger -d:ssl --gc:refc --opt:none myprogram
    
    Hint: operation successful (1522671 lines compiled; 414.037 sec total; 
784.523MiB peakmem; Dangerous Release Build) [SuccessX]
    
    
    # Release with disable optimization
    $ nim c -d:release -d:ssl --gc:refc --opt:none myprogram
    
    Hint: operation successful (1522671 lines compiled; 354.494 sec total; 
975.84MiB peakmem; Release Build) [SuccessX]
    
    
    # Release markAndSweep danger
    $ nim c -d:release -d:danger -d:ssl --gc:markAndSweep myprogram
    
    Hint: operation successful (1577789 lines compiled; 1162.975 sec total; 
776.039MiB peakmem; Dangerous Release Build) [SuccessX]
    
    
    # Release markAndSweep
    $ nim c -d:release -d:ssl --gc:markAndSweep myprogram
    
    Hint: operation successful (1577808 lines compiled; 1241.317 sec total; 
776.383MiB peakmem; Release Build) [SuccessX]
    
    
    Run

Reply via email to