Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
The Intel sign-in experience has changed to support enhanced security controls. If you sign in, click here for more information.
27796 Discussions

.dll compiled from .bat file is not running probably

Omran
Novice
892 Views

I am relatively new to Fortran.

 

I am trying to compile several .for files into one .dll using a .bat (see attached).

previously i used to simply double click the .bat file and the .dll is generated. Now a black window popup and closes fast. Then by trying to force the run using oneAPI cmd the .dll does not work as supposed to be.

PS: i used the reguler cmd and and error appears always saying "ifort is not recognized as an internal or external command" although  I have up to date Fortran compiler (classic and beta) from Intel oneAPI

Your help is highly appreciated 

files are attached

0 Kudos
1 Solution
Steve_Lionel
Black Belt Retired Employee
884 Views

Several things here... First, you can't run a DLL - it's a library that is used by an EXE. Second, to use the compiler from a command prompt you must invoke the setvars.bat script found in C:\Program Files (x86)\Intel\oneAPI  . This is done automatically by the shortcuts added to the start menu, but you can invoke it yourself, like this:

C:\Users\steve>C":\Program Files (x86)\Intel\oneAPI\setvars.bat" intel64

 

Note this part of your .bat:

Here, it is assumed the environment is correctly set for 64-bit Intel(R) Visual Fortran compiler

If you just double-click on it, that won't happen.  Add the line:\

call C":\Program Files (x86)\Intel\oneAPI\setvars.bat" intel64

and it should work.

View solution in original post

7 Replies
Steve_Lionel
Black Belt Retired Employee
885 Views

Several things here... First, you can't run a DLL - it's a library that is used by an EXE. Second, to use the compiler from a command prompt you must invoke the setvars.bat script found in C:\Program Files (x86)\Intel\oneAPI  . This is done automatically by the shortcuts added to the start menu, but you can invoke it yourself, like this:

C:\Users\steve>C":\Program Files (x86)\Intel\oneAPI\setvars.bat" intel64

 

Note this part of your .bat:

Here, it is assumed the environment is correctly set for 64-bit Intel(R) Visual Fortran compiler

If you just double-click on it, that won't happen.  Add the line:\

call C":\Program Files (x86)\Intel\oneAPI\setvars.bat" intel64

and it should work.

Omran
Novice
877 Views

Thanks for your fast response, excuse my ignorance,

- I am running the DLL through an .exe program already

- I did what's required and still receiving the same error (see picture attached)

-I have checked and mine is 64-bit

-I added the line to the .bat it did not work

Steve_Lionel
Black Belt Retired Employee
865 Views

It's odd that you didn't see any output from setvars.bat. Here's what it should look like:

Screenshot 2021-05-18 140652.png

What happens if do the "call" first?

Omran
Novice
825 Views

Nothing is shown in both ways, I will uninstall and reinstall all oneAPI toolkits (Base and HPC) and will try once again

Omran_0-1621433633150.png

 

Omran
Novice
820 Views

@Steve_Lionel  I have uninstalled oneAPI Base and HPC and Fortran compiler, Then only installed the Fortran compiler,

and then followed the steps you provided. It worked perfectly! Thank you for your time!. 

Omran
Novice
812 Views

For keywording " Plaxis " " compile " " soil mode " " udsm " " fortran " " .dll " " .for "

Steve_Lionel
Black Belt Retired Employee
815 Views

Glad to hear it. An uninstall/reinstall seems to help a lot of problems with build environments.

Reply