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

Compiler directives vs compiler options in oneAPI for Fortran dlls to be invoked in VB.net

avinashs
New Contributor I
481 Views

I have created a Fortran DLL to be called in VB.net with two different sets of compiler options:

DLL compilation option #1
/nologo /O2 /iface:cvf /libs:static /threads /Qm64 /c

DLL compilation option #2
/nologo /O2 /iface:cref /libs:dll /threads /Qm64 /c

However, the compiler directives are the same in each case:

subroutine mydll(x, y)
   !DEC$ ATTRIBUTES DLLEXPORT, STDCALL, REFERENCE, ALIAS : 'mydll' :: mydll
   real(kind =   :: x, y
   y = 2*x
end subroutine mydll

When tested in VB.net, both dlls work as expected. In this case:

1. Do the compiler options matter given that the compiler directives are the same?

2. Eventually, the VB.net project will also be a dll distributed along with the Fortran dll. Will the /libs:static be preferred so as not to require the external users to have oneAPI and other prerequisite software installed on their machines?

0 Kudos
3 Replies
avinashs
New Contributor I
475 Views

I will note that in the Fortran code above kind = 8 is not being accepted in the post even after repeatedly editing it.

0 Kudos
andrew_4619
Honored Contributor II
452 Views

The directives will override the compiler options.

Steve_Lionel
Honored Contributor III
444 Views

This forum has the annoying issue of trying to create emoji out of certain sequences, and then not displaying the emoji. Sometimes you can bypass this by putting spaces before the parenthesis.

0 Kudos
Reply