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

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

avinashs
Novo colaborador I
782 Visualizações

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 Respostas
avinashs
Novo colaborador I
776 Visualizações

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

andrew_4619
Colaborador honorário III
753 Visualizações

The directives will override the compiler options.

Steve_Lionel
Colaborador honorário III
745 Visualizações

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.

Responder