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

.dll compiled from .bat file is not running probably

Omran
Novice
1,395 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
1,387 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
1,388 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
1,380 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

0 Kudos
Steve_Lionel
Black Belt
1,368 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?

0 Kudos
Omran
Novice
1,328 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

 

0 Kudos
Omran
Novice
1,323 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!. 

0 Kudos
Omran
Novice
1,315 Views

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

0 Kudos
Steve_Lionel
Black Belt
1,318 Views

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

Reply