jfriedlein / usrmat_LS-Dyna_Fortran

Basics to implement user-defined materials (usrmat, umat) in LS-Dyna with Fortran
52 stars 28 forks source link

Error in nmake file generation #6

Closed Sanketh-R closed 2 years ago

Sanketh-R commented 3 years ago

Hi @jfriedlein

Thanks a lot for the repository and detailed explanation.

I requested and received the object version of the LS-Dyna version from the LS-DYNA distributor. When I try to execute the nmake.exe to test the setup and compiler (Intel oneAPI with visual studio 2019) I am getting the following error

C:\ls-dyna_smp_d_R910_winx64_ifort131_lib>nmake.exe

Microsoft (R) Program Maintenance Utility Version 6.00.8168.0 Copyright (C) Microsoft Corp 1988-1998. All rights reserved.

    ifort -c -traceback  -4Yportlib -fp:precise -assume:byterecl,buffered_io -QxW -w -WB  -fpp -DPCWIN -DINTEL -DIA64 -DAMD64 -DWINX64 -DNET_SECURITY -DXEON64 -DLSTCODE -DLONGFORMAT -DOPENMP -Qopenmp -DAUTODOUBLE -4R8 -4I8 dyn21.F

Intel(R) Fortran Intel(R) 64 Compiler Classic for applications running on Intel(R) 64, Version 2021.1 Build 20201112_000000 Copyright (C) 1985-2020 Intel Corporation. All rights reserved.

dyn21.F(374): error #7614: A common block name may appear in an OpenMP THREADPRIVATE directive only after the last COMMON statement which specifies the same common block name. [AUX2LOC] common/aux2loc/e1(nlq),e2(nlq),d3(nlq),e4(nlq),e5(nlq),e6(nlq), -------------^ dyn21.F(376): error #7614: A common block name may appear in an OpenMP THREADPRIVATE directive only after the last COMMON statement which specifies the same common block name. [AUX8CLOC] common /aux8cloc/ --------------^ C:\User\AppData\Local\Temp\1342013.i(2035): catastrophic error: Too many errors, exiting compilation aborted for dyn21.F (code 1) NMAKE : fatal error U1077: 'ifort' : return code '0x1' Stop.

I am new to this and unable to generate the default ls_dyna.exe Any insight or suggestion will be helpful.

Thanks in advance!

jfriedlein commented 3 years ago

Hi @Sanketh-R,

LS-Dyna is very picky with respect to the Visual Studio and Intel Fortran Compiler versions, especially such older releases as R9. Look into the readme file that came with the object files (should be in the same folder as the nmake). In there you find the software requirements, which for R9 gathered some dust, for instance it might require VS10 and ifort13. Only with luck this is forward compatible.

Best regards, Johannes

rm12554 commented 2 years ago

For anyone facing the same problem, this is a fix?/workaround:

Replace every occurance of C_TASKCOMMON(...) with c TASKCOMMON(...) then it will run fine, the error messages point you to the problem files and lines. I have done this with the latest Intel oneAPI HPC and visual studio 2022 as of today (09/02/2022).

Cheers,

Ryan

bijbab commented 2 years ago

Hello Ryan (@rm12554),

Which version of Dyna did you use? I tried with R12.0.0, and this hack didn't help. I used Intel oneAPI HPC (2022.0) & VS2017.

I am pasting the error message below.

Regards, Bijish.

Microsoft (R) Program Maintenance Utility Version 6.00.8168.0 Copyright (C) Microsoft Corp 1988-1998. All rights reserved.

    ifort.exe -c -traceback  -4Yportlib -fp:precise -assume:byterecl,buffered_io -QxSSE2 -w -WB  -fpp -DPCWIN -DINTEL -DIA64 -DAMD64 -DWINX64 -DNET_SECURITY -DXEON64 -DLSTCODE -DLONGFORMAT -DOPENMP -Qopenmp -DDOUBLEXR dyn21cnt.F

Intel(R) Fortran Intel(R) 64 Compiler Classic for applications running on Intel(R) 64, Version 2021.5.0 Build 20211109_000000 Copyright (C) 1985-2021 Intel Corporation. All rights reserved.

dyn21cnt.F(1071): error #5082: Syntax error, found IDENTIFIER 'C$OMPTHREADPRIVATE' when expecting one of: :: , ; [ = / => real dn,tx,ty,tz,tt,TASKCOMMON(x) c$omp threadprivate (/x/),h ----------------------------------------^ dyn21cnt.F(1071): error #5082: Syntax error, found END-OF-STATEMENT when expecting one of: , : ] real dn,tx,ty,tz,tt,TASKCOMMON(x) c$omp threadprivate (/x/),h -------------------------------------------------------------------^ dyn21cnt.F(1087): error #5082: Syntax error, found IDENTIFIER 'C$OMPTHREADPRIVATE' when expecting one of: ) ( , : ; % [ . = / => TASKCOMMON(x) c$omp threadprivate (/x/)=wparm(1) -----------------------^ dyn21cnt.F(1087): error #5082: Syntax error, found '=' when expecting one of: :: ) , : ; . (/ + - ] /) ' / // > PRIVATE ... TASKCOMMON(x) c$omp threadprivate (/x/)=wparm(1) ------------------------------------------------^ dyn21cnt.F(1087): error #5082: Syntax error, found END-OF-STATEMENT when expecting one of: ) TASKCOMMON(x) c$omp threadprivate (/x/)=wparm(1) ---------------------------------------------------------^ dyn21cnt.F(1102): error #5082: Syntax error, found IDENTIFIER 'C$OMPTHREADPRIVATE' when expecting one of: :: ) ( , : * ; . % (/ + - [ ] /) . = ' * / ... call tabval(crv,nnpcrv,wparm(1),vt,TASKCOMMON(x) c$omp threadpr ----------------------------------------------------------^ dyn21cnt.F(1113): error #5082: Syntax error, found IDENTIFIER 'C$OMPTHREADPRIVATE' when expecting one of: :: ) ( , : ; . % (/ + - [ ] /) . = ' / ... wdepth=wdepth+TASKCOMMON(x) c$omp threadprivate (/x/)ttpress/h ----------------------------------^ dyn21cnt.F(1077): error #6404: This name does not have a type, and must have an explicit type. [DN] dn=dxnx+dyny+dznz ------^ dyn21cnt.F(1079): error #6404: This name does not have a type, and must have an explicit type. [TX] tx=dx-dnnx ------^ dyn21cnt.F(1080): error #6404: This name does not have a type, and must have an explicit type. [TY] ty=dy-dnny ------^ dyn21cnt.F(1081): error #6404: This name does not have a type, and must have an explicit type. [TZ] tz=dz-dnnz ------^ dyn21cnt.F(1083): error #6404: This name does not have a type, and must have an explicit type. [TT] tt=sqrt(tx2+ty2+tz2) ------^ dyn21cnt.F(1083): error #6404: This name does not have a type, and must have an explicit type. [SQRT] tt=sqrt(tx2+ty2+tz2) ---------^ dyn21cnt.F(1090): error #6404: This name does not have a type, and must have an explicit type. [H] h=wparm(2) ------------^ dyn21cnt.F(1102): error #6200: A colon (:) is not valid in this context. call tabval(crv,nnpcrv,wparm(1),vt,TASKCOMMON(x) c$omp threadpr --------------------------------------------^ dyn21cnt.F(1113): error #6404: This name does not have a type, and must have an explicit type. [TASKCOMMON] wdepth=wdepth+TASKCOMMON(x) c$omp threadprivate (/x/)ttpress/h --------------------^ dyn21cnt.F(1113): error #6404: This name does not have a type, and must have an explicit type. [X] wdepth=wdepth+TASKCOMMON(x) c$omp threadprivate (/x/)ttpress/h --------------------------------------------------------^ dyn21cnt.F(1113): error #6366: The shapes of the array expressions do not conform. [WDEPTH] wdepth=wdepth+TASKCOMMON(x) c$omp threadprivate (/x/)ttpress/h ------^ compilation aborted for dyn21cnt.F (code 1) NMAKE : fatal error U1077: 'ifort.exe' : return code '0x1' Stop.