Quantcast
Channel: Recent posts
Viewing all articles
Browse latest Browse all 415

Compiling a Fortran code by linking C object in command prompt

$
0
0

Hi,

I have been handed a code to execute on Windows environment, where the same code ran without any problem on LINUX.

Here is an outline of the code execution plan:

  1. Compile a C code (hapsug.c) to create an object (hapsug.obj) file.
  2. Compile a Fortran(findhap4_c.f90) code which uses the C object to run.

Command to run a C Code:

C:\Gitlabstuff\FindhapScript1>icl -c hapsug.c
Intel(R) C++ Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 17.0.1.143 Build 20161005
Copyright (C) 1985-2016 Intel Corporation.  All rights reserved.

hapsug.c

Command to run a Fortran Code:

#Once the above compilation has produced a hapsug.obj then run:
ifort -debug -O0 kinds.f90 findhap4_c.f90 nhash.f90 hapsug.obj -o findhap4 -static -openmp -C -ftrapuv -fpe1 -traceback -warn -reentrancy -D _MYMKL=.TRUE. -L$MKLPATH -verbose #-heap-arrays

Error:

findhap4_c.f90(337): error #8110: The module file for compiler-generated interface was generated for a different platform or by an incompatible compiler or compiler release. It cannot be read. Use -gen-interfaces option.   [NHASH__GENMOD]

  nn = nhash(0,-1,ids,maxped2,maxn)

^

findhap4_c.f90(337): error #7977: The type of the function reference does not match the type of the function definition.   [NHASH]

  nn = nhash(0,-1,ids,maxped2,maxn)

^

findhap4_c.f90(337): internal error: Please visit 'http://www.intel.com/software/products/support' for assistance.

  nn = nhash(0,-1,ids,maxped2,maxn)

^

[ Aborting due to internal error. ]

compilation aborted for findhap4_c.f90 (code 1)

 

Specs:

Compiling all in Intel Parallel Studio XE 2017 > Compiler and Performance Libraries > Command Prompt > IA-32 Visual Studio 2015 environment

 


Viewing all articles
Browse latest Browse all 415

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>