Community
cancel
Showing results for 
Search instead for 
Did you mean: 
psing51
Beginner
451 Views

Error using MKL: lib64/crt1.o: In function `_start': (.text+0x20): undefined reference to `main'

Hi All,
I am trying to configure a software with intel MKL 2015.
I had used link lines(inplicit,explicit linking) :  -liomp5 -lpthread -lm -ldl , as well as  -L${MKLROOT}/lib/intel64 -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -liomp5 -lpthread -lm -ldl
and -mkl=parallel , -I${MKLROOT}/include.

i am currently stuck with following configure error(implicit linking MKL):

checking for MKL BLAS
configure:21747: mpiicpc -o conftest -std=c99 -fms-extensions -funsigned-char -pedantic -W -Wall -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wunused -Wfloat-equal -fPIC  -mkl=parallel    -D_POSIX_SOURCE -DNDEBUG    -O -Wl,-export-dynamic -L conftest.c   -liomp5 -lpthread -lm -ldl

icpc: command line warning #10006: ignoring unknown option '-Wnested-externs'
icpc: warning #10315: specifying -lm before files may supersede the Intel(R) math library and affect performance
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../lib64/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
configure:21747: $? = 1
configure: failed program was:

..........| #define HAVE_LIBXML_PARSER_H 1
| #define HAVE_LIBXML2 1
| /* end confdefs.h.  */
| #include <mkl_blas.h>
| int
| main ()
| {
|  cblas_ddot(0, 0, 0, 0, 0);
|   ;
|   return 0;
| }
configure:21757: result: no
configure:21979: error: in `/home/user/CODESATURNE/code_saturne-4.0.6':
configure:21981: error: BLAS support is requested, but test for BLAS failed!
See `config.log' for more details

also the logs with explicir MKL linking:

 mpiicpc -o conftest -std=c99 -fms-extensions -funsigned-char -pedantic -W -Wall -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wunused -Wfloat-equal -fPIC  -I/home/soft/intel2015/composer_xe_2015.3.187/mkl/include     -D_POSIX_SOURCE -DNDEBUG    -O -Wl,-export-dynamic -L conftest.c   -L/home/soft/intel2015/composer_xe_2015.3.187/mkl/lib/intel64 -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -liomp5 -lpthread -lm -ldl   >&5
icpc: command line warning #10006: ignoring unknown option '-fms-extensions'
icpc: command line warning #10006: ignoring unknown option '-Wcast-align'
icpc: command line warning #10006: ignoring unknown option '-Wnested-externs'
icpc: warning #10315: specifying -lm before files may supersede the Intel(R) math library and affect performance
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../lib64/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
configure:21747: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "code_saturne"
| #define PACKAGE_TARNAME "code_saturne"
| #define PACKAGE_VERSION "4.0.6"
| #define PACKAGE_STRING "code_saturne 4.0.6"
| #define PACKAGE_BUGREPORT "saturne-support@edf.fr"
| #define PACKAGE_URL "http://code-saturne.org"
| #define PACKAGE "code_saturne"
| #define VERSION "4.0.6"
| #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_DLFCN_H 1
| #define LT_OBJDIR ".libs/"
| #define TIME_WITH_SYS_TIME 1
| #define HAVE_STDBOOL_H 1
| #define HAVE_LONG_LONG 1
| #define HAVE_UNSIGNED_LONG_LONG 1
| #define HAVE_INT32_T 1
| #define HAVE_INT64_T 1
| #define HAVE_UINT32_T 1
| #define HAVE_UINT64_T 1
| #define HAVE_PTRDIFF_T 1
| #define SIZEOF_VOID_P 8
| #define SIZEOF_SHORT 2
| #define SIZEOF_INT 4
| #define SIZEOF_LONG 8
| #define SIZEOF_LONG_LONG 8
| #define SIZEOF_FLOAT 4
| #define SIZEOF_DOUBLE 8
| #define HAVE_LONG_GNUM 1
| #define CS_REVISION "4.0.6"
| #define HAVE_LIBXML_PARSER_H 1
| #define HAVE_LIBXML2 1
| /* end confdefs.h.  */
| #include <mkl_blas.h>
| int
| main ()
| {
|  cblas_ddot(0, 0, 0, 0, 0);
|   ;
|   return 0;
| }
configure:21757: result: no
configure:21979: error: in `/home/user/CODESATURNE/code_saturne-4.0.6':
configure:21981: error: BLAS support is requested, but test for BLAS failed!
See `config.log' for more details


Any help/hint will be very useful.

0 Kudos
1 Reply
Shaojuan_Z_Intel
Employee
451 Views

Hi Puneet,

Could you check the online link tool https://software.intel.com/en-us/articles/intel-mkl-link-line-advisor, or, run C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_*.*.*\windows\mkl\tools\mkl_link_tool.exe to see if the needed libraries are linked for your application?

Reply