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

finding the dll to EXECUTE_COMMAND_LINE

Scott_L_
New Contributor I
1,057 Views

I just am trying to use EXECUTE_COMMAND_LINE to replace non-standard system calls.   When I run my executable, I get an error that the function _execute_command_line is not found in the dll libifcoremd.dll.    How do I get the right ifort dll included with my executable so the exe runs on my local computer plus will run on my customers computers who do not have intel fortran installed?

I am building in Win32 (although trying to move to x64).   In ifort 15.0, MS VS 2012.   Building multithreaded dll exe.

subset of compile/link command line if it helps:

/nologo /O1 /Oy- /heap-arrays0
 /assume:nosource_include /Qsave /iface:cref /assume:underscore
  /Fd"Win32/Release\vc110.pdb" /traceback /libs:dll /threads /c
 
  /OUT:"..\..\..\bin\Win32/Release/ACSYSRUN.exe"
  /INCREMENTAL:NO
  /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /SUBSYSTEM:CONSOLE
  /STACK:5000000,5000000
 

0 Kudos
9 Replies
Scott_L_
New Contributor I
1,057 Views

 

By process of elimination, I have found the EXECUTE_COMMAND_LINE function lives in libifcorert.dll.    If I add this dll, then the executable runs, but without it, it fails.   Not sure how I would have known that was the right dll. 

 

thanks,

scott

 

0 Kudos
Lorri_M_Intel
Employee
1,057 Views

It is in libifcoremd.dll --- maybe you have an older one on your path?   This entry point was new with 15.0.

 

0 Kudos
Scott_L_
New Contributor I
1,057 Views

 

If I put the libifcoremd.dll from this location,

 

C:\Program Files (x86)\Intel\Composer XE 2015\redist\ia32\compiler

 

with the exe, the exe  fails to run.  It seems when I add libifcorert.dll form the same redist location, then it runs.

 

I have ifort 15.0.

Intel® Parallel Studio XE 2015 Composer Edition for Fortran Windows* Integration for Microsoft Visual Studio* 2012, Version 15.0.0107.11, Copyright © 2002-2014 Intel Corporation. All rights reserved.
* Other names and brands may be claimed as the property of others.

 

I will check this again.

thanks,

scott

 

 

0 Kudos
Steven_L_Intel1
Employee
1,057 Views

Your executable will use either libifcoremd.dll or libifcorert.dll, depending on the way it was built. They're not interchangeable. You don't want to add any files to the folder you mentioned as that's not typically on PATH unless you're in the command line build environment. The best approach is to supply the redistributables installer as mentioned above. You could also build the program to link against the static libraries (/libs:static /threads) and then you would not have a DLL dependency.

By the way, do you really need /assume:underscore and /iface:cref? What are you linking with that caused you to select these?

0 Kudos
Scott_L_
New Contributor I
1,057 Views

Steve,

I am not adding any files to C:\Program Files (x86)\Intel\Composer XE 2015\redist\ia32\compiler as I don't have write access there anyway.  But this is the location from where I believe I have to copy dlls from to package with the exe's so I can deleiver them to my customers who do not have ifort installed.   Its always a guessing game where to get the dlls (fortran, c, etc..) from and which is the smallest set of dlls adequate for our codes to run.   I have considered trying /static but when I did once, I could not get our solution to build.  we have 3 dozen ifort executables in our package.  We have 50 or so version releases we maintain for users.   Right or wrong,  Using dlls at least at one point made some sense.    This code is largely fortran 2008 but with some C++ to read/write xml and communicate via a pipe to tecplot.   The code used to be in compaq fortran.  Then it was ported to intel fortran but using the /cvf compaq stype interface.   The  /assume:underscore and /iface:cref was trying to get to a more vanilla build then /cvf but not break the C interfaces.   If assume:underscore and /iface:cref are not the best options, do you have a  recomendation?

thanks,

Scott

 

0 Kudos
Steven_L_Intel1
Employee
1,057 Views

/assume: underscore is generally used for Linux code. I would recommend the standard C interoperability features of Fortran 2003, especially BIND(C). But if it is working for you now, leave it.

If you are linked to the DLLs you need both the Intel redistributables and the Microsoft Visual C++ redistributables for your VS version. These should just be installed on the target system (either through installer add-ins or the executable installer).

0 Kudos
Scott_L_
New Contributor I
1,057 Views

 

Thank you Steve,

Our approach has been to put all ifort & c, dlls in the same directory as the exe's we provide to users.  Only the system admin's can install dlls on users computers and on batch windows servers.  I have asked the powers that be if intel fortran dlls could be installed on all computers.  There response was it might be nice, but intel fortran (in particular) dll's change very frequently.  They see it as a support issue.  I guess the compaq fortran dlls are not changing much anymore, so its OK to have them installed.  Oh well.

thanks

scott

 

0 Kudos
Steven_L_Intel1
Employee
1,057 Views

It's ok if you want to put our DLLs in the same folder as the EXE. You just need to find the right one (and you will also need the MSVC DLLs installed - you can't just put those in the EXE directory.) Use DependencyWalker to see what you need.

0 Kudos
Reply