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

creating fortran exec

terryha
Beginner
3,032 Views

with visual studio 19, i built and debugged. 

moved the fortran exe to other pc.

didn't work, with an error msg: some .dll file is missing.

how to create .exe that is transferable?

Labels (1)
0 Kudos
1 Solution
DavidWhite
Valued Contributor II
2,552 Views

The Visual Studio option is found under 

Project / Properties / Configuration Properties / Fortran / Libraries.

 

Just a reminder that if you are using DLL libraries (instead of the Static ones as below), that the Debug DLL libraries are not distributable to other users, only the Release version libraries.

 

DavidWhite_0-1633149163160.png

 

View solution in original post

0 Kudos
20 Replies
mecej4
Honored Contributor III
3,006 Views

Name the DLL(s) that the error message complained about.

Two options:

  1. Build using the /MT or /libs:static compiler option (there is a corresponding option to choose in Visual Studio)
  2. Install the runtime package for the Intel Fortran compiler that you are using on the "other" PC.

 

0 Kudos
DavidWhite
Valued Contributor II
2,651 Views

I always use the static libraries option -- this ensures that the correct version of the libraries is included with the application, and it is then portable anywhere without the other user needing to install something.

 

It avoids complications caused by different default libraries, albeit at the cost of a larger .exe file.  It makes it easier for the end user, and easier for me because I don't have to debug their setup problems.

0 Kudos
terryha
Beginner
2,564 Views

I agree with you if I knew I was unknowingly using non-static libraries option in MS Visual Studio19

My original post was about how to find static libraries option in MS VS19.

The default link in MS VS19 is not static libraries option. 

As a result, .exe is not portable. This prompted me to post the question.

( I don't recall if I had this 'non-portable .exe' problem in MS VS08. And before, the default was always portable .exe.)

Someone suggested that there was a corresponding option to choose in Visual Studio, which I couldn't find.

As you pointed out, certain .dll's are needed for the other user to run the VS19-linked .exe.  

0 Kudos
DavidWhite
Valued Contributor II
2,553 Views

The Visual Studio option is found under 

Project / Properties / Configuration Properties / Fortran / Libraries.

 

Just a reminder that if you are using DLL libraries (instead of the Static ones as below), that the Debug DLL libraries are not distributable to other users, only the Release version libraries.

 

DavidWhite_0-1633149163160.png

 

0 Kudos
terryha
Beginner
2,524 Views

You are my Savior !

i could run the .exe on a separate laptop w/out VS.

thank you.

 

0 Kudos
DavidWhite
Valued Contributor II
2,516 Views

I'm not, but there is One who is!

0 Kudos
terryha
Beginner
2,988 Views

Thank you.

It was ucrtbased.dll that was not found. But, I neither could find that .dll.

I knew I had to look for static link. Are you suggesting I should not take ‘debug’ (default) but choose ‘release’ for solution configuration, which I just noticed is shown in the tool bar?

Let me try.

Let me try.

0 Kudos
JohnNichols
Valued Contributor III
2,954 Views

@mecej4 provided two good solutions, as someone who transfers programs to many other computers, but only infrequently, as VS and IF are free just load them on the other computer, it is not a long load process, of course @mecej4 option 1 is the best, but IF turned that off as default a long time ago.  I like lib rather than dll, but that is a personal opinion.  

Of course this does not apply if you want the source secret.  

0 Kudos
terryha
Beginner
2,559 Views

Thank you.

I compiled in MS Visual Studio 19. It would be the best if there were static-link option in VS19. 

0 Kudos
DavidWhite
Valued Contributor II
2,548 Views

See my reply below about where to find the Static Linking in VS under Project / Properties

0 Kudos
terryha
Beginner
2,924 Views

No, choosing "Release" did not work. .exe was created that I couldn't run w/out some .dll's.

i don't see any .dll's in the Release folder.

So, what is the corresponding option to choose in Visual Studio? 

i hope there should be.

Thanks for your inputs.

 

0 Kudos
mecej4
Honored Contributor III
2,867 Views

You wrote, "I don't see any .dll's in the Release folder."

Windows PCs can contain thousands of DLLs. Some of those come with the OS, some with Visual Studio, some with a Fortran compiler package, and others with third party applications that you install. None of these DLLs should be expected in any user-created folders, let alone the Release or Debug folders of a project. We cannot help you if you do not name the missing DLL.

When an EXE or DLL fails to run because a needed DLL is not present, you should note the name of the DLL, and search the Web to look for a package that it is associated with. You might then find the associated package, such as this for ucrtbased.dll .

0 Kudos
terryha
Beginner
2,797 Views

thanks,

libmmd.dll and libifcoremd.dll, they were.

it's quite amazing that such a mundane or simple compilation gets so convolved. in the good old days (?), i could compile, copy, and run .exe with the PC without the compilar itself. 

now  going to look for the packages.

0 Kudos
Arjen_Markus
Honored Contributor I
2,858 Views

A tool like "dependency walker" (https://github.com/lucasg/Dependencies) is very useful to determine which DLLs are required for a particular program and where they can be found on your system.

0 Kudos
terryha
Beginner
2,578 Views
0 Kudos
terryha
Beginner
2,738 Views

A friend found the identical topic in FEAP (whatever iut is) user forum: Re: Executable not running on other computers without compiler or visual studio.  Apparetntly the forum couldn't help him. However, the person solved the problem by installing the following package: 
https://software.intel.com/en-us/articles/redistributable-libraries-for-intel-c-and-fortran-2018-compilers-for-windows

Let me try.

I should post this after I install the package and see it works, but i cannot get to the link: i  have to start an approval process however benign they may be. 

On the other hand, why did the Visual Studio want to make this so difficult? it's a regress. .exe should run whether the computer has VS or not. This package should be in the standard installation.

No, I don't think there is a corresponding option to choose in Visual Studio.

 

0 Kudos
terryha
Beginner
2,695 Views

Mecej4 wrote earlier: Build using the /MT or /libs:static compiler option.

Which fortran compiler has  /libs:static compiler option? 

0 Kudos
mecej4
Honored Contributor III
2,685 Views

Look up the compiler options documentation for whichever Fortran compiler you are using. For the OneAPI compilers, for example, the options are described here.

I think that some of your confusion is caused by not understanding the roles played by Visual Studio, the Intel compiler and the Microsoft VC tools and libraries. Visual Studio, by itself, is just an IDE. When you use that IDE and build a Fortran program, many of the underlying tools and libraries may be used. Some of these come from Microsoft, some from Intel. Similarly, a subset of the runtime DLLs will need to be present on your client's PC on which you want to deploy your EXE. That subset is provided by installing compatible versions of the VC and OneAPI redistributable packages on your client's PC. Intel's installation guides for the compiler version that you installed contains the information needed to do this.

The "good old days" are gone. So are the really good old days, when we could calculate everything using just a slide rule.

0 Kudos
terryha
Beginner
2,573 Views

you mean with ten fingers? 

thanks for your help.

 

0 Kudos
JohnNichols
Valued Contributor III
2,470 Views

1. You have ten toes as well - or usually unless you have been outside in the very cold without shoes.  Not recommended. 

2. One of our professors does not allow calculators - when pressed he said to the student - get  a slide rule.  

3. The problem with modern computing languages, is the language and the environment evolve quite quickly,  but you have always had the option to create a lib file.  LIB files are useful for sharing common code.  Picture is from VS 2019 Community. 

4. Finally, to learn something new, it is often best to read some before you ask a question.  

JohnNichols_0-1633193942542.png

In about 1985 my mother went to Hong Kong.  She asked what I wanted, I said a new HP calculator.  Mum got me a 16C, instead of a 12 C.  She said she thought the higher number was better.  A 16C is a computer science calculator without sin cos tan etc..  

Mum died shortly after that and so I used her calculator for many years.  To overcome the lack of trig functions, I memorized the sin cos and tan for 30, 60 and 45 degrees. As an engineer everything I designed used those angles.  It was also useful in teaching class to remember those numbers. 

A person has to deal with their limitations.  I still have the 16 C , but I prefer my 35S. It is like a 41C, but without the reader.  

 

My apologies to intel for mentioning HP, but everyone on this forum who is over 50 will remember the days of the HP.  

Finally RPN lives. 

 

0 Kudos
Reply