nrc-cnrc / EGSnrc

Toolkit for Monte Carlo simulation of ionizing radiation — Trousse d'outils logiciels pour la simulation Monte Carlo du rayonnement ionisant
http://nrc-cnrc.github.io/EGSnrc
GNU Affero General Public License v3.0
216 stars 144 forks source link

'undefined reference to lnblnk1_' with gfortran 5.1.0 #196

Open fribert opened 7 years ago

fribert commented 7 years ago

Installing EGSnrc on a Windows 10 machine with the TDM-GCC MinGW-64, make 3.82.90 and gfortran 5.1.0 with tags '-O3 -ffast-math'. The install goes on fine, until an error is generated:

> ===> Compiling Mortran3 ...
> 
> "Compiling mortran3.f C:\EGSnrc\HEN_HOUSE\lib\win6432\machine.f"
> 
> "Making mortran3.dat"
> 
> Program received signal SIGSEGV: Segmentation fault - invalid memory
> reference.
> 
> Backtrace for this error:
>  #0  ffffffffffffffff
>  #1  ffffffffffffffff
>  #2  ffffffffffffffff
>  #3  ffffffffffffffff
>  #4  ffffffffffffffff
>  #5  ffffffffffffffff
>  #6  ffffffffffffffff
>  #7  ffffffffffffffff
>  #8  ffffffffffffffff
>  #9  ffffffffffffffff
>  #10  ffffffffffffffff
>  #11  ffffffffffffffff
>  #12  ffffffffffffffff
>  #13  ffffffffffffffff
>  #14  ffffffffffffffff
>  #15  ffffffffffffffff
>  #16  ffffffffffffffff
>  #17  ffffffffffffffff
>  #18  ffffffffffffffff
>  #19  ffffffffffffffff
>  #20  ffffffffffffffff

Running *gfortran -g -fcheck=all -Wall machine.f* 

> machine.f:668:49:
> 
> subroutine egs_print_canonical_system(ounit)
> 1 Warning: Unused dummy >argument 'ounit' at (1) [-Wunused-dummy-argument]
> machine.f:732:51:
> 
> subroutine egs_print_configuration_name(ounit)
> 1 Warning: Unused dummy argument 'ounit' at (1) [-Wunused-dummy-argument]
> 
> C:\Users\tapio\AppData\Local\Temp\ccPpk2Dp.o: In function
> egs_get_canonical_system_:
> C:\EGSnrc\HEN_HOUSE\lib\win6432/machine.f:684: undefined reference to
> lnblnk1_ 
> 
> C:\Users\tapio\AppData\Local\Temp\ccPpk2Dp.o: In function
> 'egs_get_configuration_name_':
> C:\EGSnrc\HEN_HOUSE\lib\win6432/machine.f:748: undefined reference to
> `lnblnk1_'
>
> C:\Users\tapio\AppData\Local\Temp\ccPpk2Dp.o: In function
> `egs_print_hostnm_': 
> C:\EGSnrc\HEN_HOUSE\lib\win6432/machine.f:805:
> undefined reference to `lnblnk1_'
> 
> C:\Users\tapio\AppData\Local\Temp\ccPpk2Dp.o: In function
> `egs_get_hostnm_':
> C:\EGSnrc\HEN_HOUSE\lib\win6432/machine.f:824:
> undefined reference to `lnblnk1_'
>
> C:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/lib/../lib/libmingw32.a(lib64_libmingw32_a-crt0_c.o):
> In function `main':
> C:/crossdev/src/mingw-w64-v4-git/mingw-w64-crt/crt/crt0_c.c:18:
> undefined reference to `WinMain' collect2.exe: error: ld returned 1
> exit status

The installation works fine on the same machine after a switch from the TDM-gcc 5.10 to cygwin gcc 5.40

crcrewso commented 7 years ago

I could have sworn I had commented on a similar issue before. TDM-gcc 5.1.0 is incomplete and as such is failing to find something that it expects on the gfortran library side of things. I tried to troubleshoot this further last time but my notes are lost to the aether, sorry.