I am EXTREMELY interested in hearing how you do combine the languages, as I know C/C++ much better than fortran, but I do need fortran at times to do some maths...
Like I said they can be linked fine. It's just with the intel compiler that I can't get it to compile. f77 and g77 work fine
>f77 -o mm mm.c mmult.c dgemm.o xerbla.o lsame.o
compiles just file.
how about compiling the fortran functions first?
Yeah I had actually compiled them all separately, but can you tell me how do the linking of all the files using the C compiler instead of the Fortran compiler - I was doing it the fortran way because apparently "...the fortran compiler knows where the C libraries are but the C compiler has to be told where the fortran libraries are...". And to be honest with you my compiler doesn't listen to me much anyway.
If its possible to compile a C file without a main then there must be something wrong with my code... or do i need to use a compiler arg?
Code:
//mmult.c
#include <stdlib.h>
#include <stdio.h>
#ifdef _OPENMP
#include <omp.h>
#endif /* OPENMP */
typedef enum
{
FALSE,
TRUE
} boolean;
int mmult_(char *transA, char *transB, int *m_rows, int *n_cols, int *k_common, double *alpha, double *matrixA, int *lda, double *matrixB, int *ldb, double *beta, double *matrixC, int *ldc);
int mmult_(char *transA, char *transB, int *m_rows, int *n_cols, int *k_common, double *alpha, double *matrixA, int *lda, double *matrixB, int *ldb, double *beta, double *matrixC, int *ldc)
{...
}
Code:
//mm.c (driver)
...
extern int mmult_(char *transA, char *transB, int *m_rows, int *n_cols, int *k_common, double *alpha, double *matrixA, int *lda, double *matrixB, int *ldb, double *beta, double *matrixC, int *ldc);
...
That's ok isn't it??
Thanks,
Colly