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 have moved to the Altera Community. Existing Intel Community members can sign in with their current credentials.

Call Fortran from C

lxh37
Beginner
1,025 Views

 

Hi, I have many codes in Fortran and I wrapped it by C to create .dylib in Mac and I can call it from Ruby On Rails. 

Recently we have lots of trouble with Mac Server and we want to transfer everything to Linux, but the Fortran code

will not compile in Linux, the error message is !!DEC$ ATTRIBUTES DLLEXPORT, C :: addsize is not supported

in this platform. Is there a way to get around this without having to rewrite Fortran codes using  ISO_C_BINDING?

Thanks!

Liz

 

 

 

0 Kudos
5 Replies
Steven_L_Intel1
Employee
1,025 Views

DLLEXPORT is not for Linux. Just take that out - nothing else needs to change.

0 Kudos
lxh37
Beginner
1,025 Views

 

 

Thanks! I have commented the line out and compiled the code, but doesn't work properly in Linux,

same code worked in Mac...

Liz

0 Kudos
Steven_L_Intel1
Employee
1,025 Views

See your other thread - if it's the same code it should not have worked on Mac either. You don't say how it "doesn't work", though. 

0 Kudos
lxh37
Beginner
1,025 Views

 

The error message I got from Ruby On Rails is error with external library, the other thread I tried to create a much simple code and use iso_c_binding to see if the error could be with Ruby On Rails...

0 Kudos
Steven_L_Intel1
Employee
1,025 Views

I can't help with the Ruby On Rails error. Let's see if we can get the Fortran-C version working first.

0 Kudos
Reply