Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.

FFT Compilation Error

chetan_p_
Beginner
416 Views

Hi .

I am trying to run benchfft with linking Intel-mkl but I am getting error with ” undefined reference to `zfft1d_'

System Details:

OS: Ubuntu 16.04

GCC: gcc version 5.4.0 20160609

ICC: icc version 17.0.0

Note: File benchfftw_test_mkl.c is attached with this report

source /opt/intel/mkl/bin/mklvars.sh intel64

gcc -lmkl_core  -ldl -lpthread -lm benchfftw_test_mkl.c

 

Error:

/tmp/ccsL8FHu.o: In function `main':

benchfftw_test_mkl.c:(.text+0xa): undefined reference to `zfft1d_'

collect2: error: ld returned 1 exit status

 

Contents of benchfftw_test_mkl.c is as follows

#line 10867 "configure"
/* confdefs.h.  */

#define PACKAGE_NAME ""
#define PACKAGE_TARNAME ""
#define PACKAGE_VERSION ""
#define PACKAGE_STRING ""
#define PACKAGE_BUGREPORT ""
#define PACKAGE "benchfft"
#define VERSION "3.1"
#ifdef __cplusplus
#include <stdlib.h>
#endif
#define F77_FUNC(name,NAME) name ## _
#define F77_FUNC_(name,NAME) name ## _
#define STDC_HEADERS 1
#define HAVE_SYS_TYPES_H 1
#define HAVE_SYS_STAT_H 1
#define HAVE_STDLIB_H 1
#define HAVE_STRING_H 1
#define HAVE_MEMORY_H 1
#define HAVE_STRINGS_H 1
#define HAVE_INTTYPES_H 1
#define HAVE_STDINT_H 1
#define HAVE_UNISTD_H 1
#define HAVE_MALLOC_H 1
#define HAVE_SYS_TIME_H 1
#define HAVE_UNISTD_H 1
#define HAVE_STRING_H 1
#define HAVE_ALLOCA_H 1
#define HAVE_STDDEF_H 1
#define HAVE_LIBINTL_H 1
#define TIME_WITH_SYS_TIME 1
#define HAVE_ALLOCA_H 1
#define HAVE_ALLOCA 1
#define HAVE_STDLIB_H 1
#define HAVE_MALLOC 1
#define HAVE_VPRINTF 1
#define HAVE_LIBM 1
#define HAVE_GETTIMEOFDAY 1
#define HAVE_DRAND48 1
#define HAVE_HYPOT 1
#define HAVE_SQRT 1
#define HAVE_STRTOD 1
#define HAVE_MEMSET 1
#define HAVE_MEMALIGN 1
#define HAVE_DECL_DRAND48 1
#define HAVE_DECL_HYPOT 1
#define HAVE_LIBPTHREAD 1
#define HAVE_LIBDL 1
#define HAVE_FFTW3_H 1
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char zfft1d_ ();
#ifdef F77_DUMMY_MAIN
#  ifdef __cplusplus
     extern "C"
#  endif
   int F77_DUMMY_MAIN() { return 1; }
#endif
int
main ()
{
zfft1d_ ();
  ;
  return 0;

}

0 Kudos
2 Replies
Yuan_C_Intel
Employee
416 Views

Hi, Chetan

This does not look like an icc specific problem. I'm transferring this to Intel MKL forum where you will get MKL experts' help.

Thanks

 

0 Kudos
Ying_H_Intel
Employee
416 Views

Hi Chetan,

 The benchffw_test_mkl.c  seem out of date as the zfft1d_ inferface was removed from MKL for a while.  But MKL have FFTW interface support in latest version.  So maybe  you can try the example fftw fortran sample under MKL install folder : /opt/intel/mkl/examples directly.

 please use MKL link advisor https://software.intel.com/en-us/articles/intel-mkl-link-line-advisor/ to find wanted MKL library.

for example,  >gcc  test.c -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lm.

Best Regards,
Ying 

0 Kudos
Reply