Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Problem compiling using a batch file (to create user subroutine for modelling software)

Csaba_W_
Beginner
1,423 Views

Hi,

In a university project I need to compile fortran codes to create user subroutines which are then used by a modelling software, called Cycle-tempo. Cycle-tempo provides a compile.bat file which can be used for compiling fortran codes and create a UserSub.exe, but certain modifications have to be made in it to set up the actual user environment (see my version attached). Two other files, WinTempo.lib and WinTempo.res, are also provided to be used for the compiling.

I use Parallel Studio XE 2015 Update 6 with VS 2015 running on 64 bit Windows 10. I called the modified batch file from IA-32 command prompt, but then got the following error message:
"WinTempo.lib(WinTempo.obj) : error LNK2019: unresolved external symbol _M_LICENSE_mp_CHECKLICENSE referenced in function _WinMain@16"

I also tried to modify the batch file to use the intel64 compiler and then call it from the intel64 command prompt:
"WinTempo.lib : warning LNK4272: library machine type 'X86' conflicts with target machine type 'x64' "

I looked up these error messages but could not figure out a solution. I was also going over the Cycle-tempo compiling instructions again, searched similar topics here, but the problem is still not solved. I am not even sure whether ia32 or intel64 I should use.
Please note that I am quite new to VS and Parallel Studio, any help/suggestions are welcome!

Thanks in advance!
Csaba

0 Kudos
1 Solution
Lorri_M_Intel
Employee
1,423 Views

Right - as mecej4 says, the undefined symbol is coming out of WinTempo.lib.  Perhaps one of the routines that you are calling from that library is looking for that symbol.  And, your colleagues aren't making that call   Possible?

View solution in original post

0 Kudos
9 Replies
jimdempseyatthecove
Honored Contributor III
1,423 Views

VS has solution platforms

Win32 - 32-bit Windows code
x64 - 64-fit Windows code
x86 - Blended or don't care platform

x86 platform is not compatible for Intel Visual Fortran. IOW choose either Win32 or x64 for your platform when building WinTempo.lib

Jim Dempsey

0 Kudos
Csaba_W_
Beginner
1,423 Views

The WinTempo.lib file was included in the modelling software. Also, some other students doing similar projects managed to compile with Intel Visual Fortran, but they could not help with this issue.
Is it possible to rebuild it in the desired platform? Any suggestions on that?

To be clear, the following files are included in the modelling software and should be used for compiling:
- compile.bat - should be modified according to the user environment (see attached in original thread)
- apsub.for - additional code is here which influences the software's calculations
- WinTempo.lib
- WinTempo.res
I found no instructions to modify these last two files.

Csaba

0 Kudos
Lorri_M_Intel
Employee
1,423 Views

First, are your colleagues using the *exact* same command line options in their .bat file?  This sounds like an external-name mismatch issue, and there are a number of command line options that can affect external names.

Second, let's figure out what the external name actually is in WinTempo.lib.  From your IA32 command window, please issue this command:

                  link /dump /symbols WinTempo.lib > temp.txt

Now, search your temporary file for the string "checklicense".   Do a case-insensitive search.   Post the results here.

                 thanks -

                                                 --Lorri

0 Kudos
Csaba_W_
Beginner
1,423 Views

Dear Lorri,

To the best of my knowledge, the command line options are the same, as we had the same initial .bat file. Only thing changed in the link command is the folder name which contains the WinTempo files (specific to user, in my case it is ..\CT\WinTempo.lib). No change has been made on the ifort command line.

Here is what I found in the temp file:
03D 00000000 UNDEF  notype ()    External     | _M_LICENSE_mp_CHECKLICENSE

Csaba

0 Kudos
mecej4
Honored Contributor III
1,423 Views

The undefined reference is to a routine called CHECKLICENSE in module M_LICENSE. You probably did not tell the linker to include the corresponding .OBJ file in its task.

0 Kudos
Lorri_M_Intel
Employee
1,424 Views

Right - as mecej4 says, the undefined symbol is coming out of WinTempo.lib.  Perhaps one of the routines that you are calling from that library is looking for that symbol.  And, your colleagues aren't making that call   Possible?

0 Kudos
Csaba_W_
Beginner
1,423 Views

One collegue who works with these user subroutines prepared step-by-step instructions (a few pages long) on this issue and it is quite straightforward, no word on modifying the .lib file, although we run different OS (32 bit Windows 10 vs my 64 bit Windows 10). 
I also contacted him before posting here but could not figure it out yet.

*Edit*
I just realized that the original WinTempo.lib and WinTempo.res files installed with the software have different 'last modified' dates in his and in my case. Maybe the .lib file was modified by the developer and the compiling instructions might not be fully suitable in this case. I will check on this.

0 Kudos
Csaba_W_
Beginner
1,423 Views

Thank you all for your replies!
Seems that really the .lib file caused the problem. I am now able to proceed with my work.
Csaba 

0 Kudos
balint__schon
Beginner
1,423 Views

Dear Csaba,

I have some problem with compile Cycle tempo subroutine. I have not the same problem as you have, but i am sure i will be able to help me. I am stoped at this step. I have no found this directory and compile command is not working.

CT compile.png

I really appritiate your help!

Could you please let me now, if you are able te provide me some good advise.

Anyway, where are you from? Hungary maybe :) Just because if your answear is yes, we can comminicate with our mother language. We can talk via facebook. My whole name is Schön Bálint.

Best regards

0 Kudos
Reply