- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have tried to change my code to use all 64 bit integers and reals by using /integer_size:64 and /real_size:64 in my mixed-language program. It all seems to work fine and IVF seems to treat the string lengths passed via subroutines as 64 bit integers as well. But in my CVF version, I have trouble getting it to run correctly. It almost looks like it treats the lengths still as 32 bit variables. Can you tell me what size does each compiler use to pass the string lengths when the integer size is 64 bits?
Thanks,
Dave
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Why do you want to use 64-bit integers and reals by default?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mostly ease of conversion. There are lots and lots of places where we have equivalenced variables, keeping them the same size eliminates a lot of issues with equivalencing. It also allows us to go ahead and use larger integers for numbering, which is convient in our models.
Where I have some C routines calling Fortran, the CVF compiler is getting an undefined pointer for the second argument of a Fortran function. The first is a character string and the second is an integer.The code works fine on the 64 bit IVF version, but doesn't on the 32 bit CVF version. Passing a 32 bit string size after the string or a 64 bit size seems to do the same thing, the FORTRAN isn't getting the second argument which is a 64 bit integer in both the C and Fortran (based on the /integer_size:64 compiler argument for the FORTRAN).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What exactly doesn't work? Have you made sure to use ATTRIBUTES C in CVF to get the C calling convention? You might be mixing C and STDCALL conventions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Okay, when I went back and changed the C code to pass a 32 bit int, I didn't change the function prototype. Changed that too and now it runs. I'm not much of a C programmer. Thanks for your help.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page