- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I am trying to build Calculix (for example here: https://github.com/prool/ccx_prool/tree/master/CalculiX/ccx_2.15/src) in Visual Studio 2015 with Intel Fortran. Normally it is built with gcc and gfortran. It mixes C and Fortran, and I am having troubles now with arrays dynamically allocated in C because in Fortran ifort expects a dimension.
subroutine calinput(kon) implicit none integer(C_LONG_LONG) kon(*)
But this is working:
subroutine calinput_c(kon, kons) bind(C) USE, INTRINSIC :: ISO_C_BINDING ! implicit none ! integer(C_LONG_LONG) kons integer(C_LONG_LONG), DIMENSION(kons) ::kon kon(1) = kon(1) return end
Is there a way to get the first variant to compile with ifort?
There was some work done previously to compile calculix, can I get the files?
https://software.intel.com/en-us/forums/intel-c-compiler/topic/536919
Thank you in advance!
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You don't say what isn't working in the first case. I am going to assume that your original code included "USE, INTRINSIC :: ISO_C_BINDING" as otherwise C_LONG_LONG would not be declared.
I will guess that one problem is that the C code assumes that the Fortran routine is named "callinput" in lowercase. Intel Fortran on Windows uses upper case for routine names, but gfortran does not. The addition of BIND(C) causes Intel Fortran to use lower case.
If neither of these are the problem, please provide more details, as the use of an assumed size array should work. The second code of course is also fine.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Oh, ok. This does work!
I think I mixed up the binding, thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Rechard, i am also working to compile CCX using Visual Studio and ifort, if you don't mind, may i ask whether you could share the VS projects with me? my email: tjumsl@outlook.com

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page