Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

CVF DLL Example doesn't compile

lbrannma
Beginner
907 Views
Hi All,

I'm running CVF Pro 6.6a, purchased recently.

I need to write a Fortran DLL with exported functions that are callable from a C program. The DLL needs to have REALs as arguments. My C program will pass pointers to doubles to the Fortran DLL function.

The DLL example df98samplesdllDLLEXP1, that ships with CVF Pro 6.6a doesn't compile.

Any suggestions would be greatly appreciated.
0 Kudos
6 Replies
Steven_L_Intel1
Employee
907 Views
What error do you get?

Looking at this example, I see one problem in that the makefile provided (there isn't a workspace) tries to include dfinc.mak, but that file is two levels up in the folder hierarchy. So if you edit MAKEFILE and replace the line to read:

!include<....dfinc.mak>


it works (at least it does for me.) Are you having a different problem?

Steve
0 Kudos
lbrannma
Beginner
907 Views
Thanks Steve. I'll make from the command line.

I simply created a new Fortran DLL project and added dll1.for to the project. I compiled.. and VS created a default workspace for me. References to dll2 were not resolved so I removed offending lines from dll1.for. It still would not compile.

I'm returning to Fortran after a 30 year absence. Any tips you could provide for exporting a simple function with no name mangling and with reals as arguments (both input and output arguments ala C) would be greatly appreciated.

Lance
0 Kudos
lbrannma
Beginner
907 Views
Hi Steve,

I tried your suggestion...

nmake all

returns the following:

dll2.for
lib /def: dll2.obj
Microsoft Library Manager Version 6.00.8447
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.

LIB : fatal error LNK1104: cannot open file "dfordll.lib"

It looks like the path to dfordll.lib isn't made explicit in the dfinc.mak. Do I need to prepend the full path or is there an environment variable I can use?

Thanks,
Lance
0 Kudos
Steven_L_Intel1
Employee
907 Views
You need to start a "Fortran Command Prompt" session - this will define the right environment variables. That's all I did...

Steve
0 Kudos
lbrannma
Beginner
907 Views
Thanks Steve.. It works great! Now I need to figure out how to do the same from the CVF GUI.
0 Kudos
Steven_L_Intel1
Employee
907 Views
You use subprojects - make the DLL projects be subprojects of the executable (Project..Dependencies.). The other thing to do is change the path where the linker creates the DLLs to be the same as the folder where the EXE is built, so that you can run it.

Steve
0 Kudos
Reply