TRIQS/TRIQS — Issue #9: MKL linking
Author: A32167
Created: 2011-11-14 13:07:04+00:00
State: open

Hi, everyone.
I still try to get TRIQS installed to a machine with MKL. The mpi compiler is GNU mpic++, g++ and gcc are used as CXX and CC.
From the FindBLAS.Cmake I got that TRIQS actually looks for an "mkl" string in LAPACKLIBS and if it exists, replaces cblas with mkl_cblas etc.
After some playing I got string "You are using mkl" during configuration and finally everything went smooth and I got no errors or warnings during generating CMakeCache.
Here are the lines, that I have put in ccmake (CMakeCache.txt is attached):

LAPACK_64_BIT OFF
MKL_INCLUDE_DIR /usr/local/intel/composerxe/2011.7.256/mkl/include
LAPACK_LIBRARY /usr/local/intel/composerxe/2011.7.256/mkl/lib/intel64
LAPACK_LIBS /usr/local/intel/composerxe/2011.7.256/mkl/lib/intel64/libmkl_core.so;/usr/local/intel/composerxe/2011.7.256/mkl/lib/intel64/libmkl_intel_ilp64.so; /usr/local/intel/composerxe/2011.7.256/mkl/lib/intel64/libmkl_sequential.so;/usr/local/intel/composerxe/2011.7.256/mkl/lib/intel64/libmkl_gnu_thread.so

CmakeCache - http://gist.github.com/1363901

The problem occurs during linking CXX executable a_x_ty_nopy. The log is in the bottom.
To me it looks like there's some dependencies on pthreads and openmp (libgomp) for GNU case.
There were some more mistakes with linking but they have passed after I included more libraries in LAPACK_LIBS.
So this suggests that some additional flags should be passed when linking. I tried to pass "-fopenmp -lpthread" in CMAKE_MODULE_LINKER_FLAGS but it didn't help.

Thanks for the support!

Build log:

[ 39%] Built target boost_for_triqs
Linking CXX shared module mpi.so
[ 45%] Built target mpi
[ 48%] Built target triqs
Linking CXX executable a_x_ty_nopy
../../../../foreignlibs/boost/libboost_for_triqs.so: undefined reference to `gm_destroy_hash'
/usr/local/intel/composerxe/2011.7.256/mkl/lib/intel64/libmkl_gnu_thread.so: undefined reference to `omp_get_nested'
../../../../foreignlibs/boost/libboost_for_triqs.so: undefined reference to `gm_provide_receive_buffer'
../../../../foreignlibs/boost/libboost_for_triqs.so: undefined reference to `gm_hash_compare_ptrs'
/usr/local/intel/composerxe/2011.7.256/mkl/lib/intel64/libmkl_gnu_thread.so: undefined reference to `GOMP_sections_start'
../../../../foreignlibs/boost/libboost_for_triqs.so: undefined reference to `gm_num_send_tokens'
/usr/local/intel/composerxe/2011.7.256/mkl/lib/intel64/libmkl_gnu_thread.so: undefined reference to `GOMP_parallel_start'
/usr/local/intel/composerxe/2011.7.256/mkl/lib/intel64/libmkl_gnu_thread.so: undefined reference to `GOMP_ordered_start'
/usr/local/intel/composerxe/2011.7.256/mkl/lib/intel64/libmkl_gnu_thread.so: undefined reference to `GOMP_loop_ordered_dynamic_next'
../../../../foreignlibs/boost/libboost_for_triqs.so: undefined reference to `gm_bcopy'
../../../../foreignlibs/boost/libboost_for_triqs.so: undefined reference to `gm_get_node_id'
/usr/local/intel/composerxe/2011.7.256/mkl/lib/intel64/libmkl_gnu_thread.so: undefined reference to `GOMP_atomic_end'
/usr/local/intel/composerxe/2011.7.256/mkl/lib/intel64/libmkl_gnu_thread.so: undefined reference to `GOMP_single_start'
../../../../foreignlibs/boost/libboost_for_triqs.so: undefined reference to `gm_set_acceptable_sizes'
/usr/local/intel/composerxe/2011.7.256/mkl/lib/intel64/libmkl_gnu_thread.so: undefined reference to `GOMP_critical_start'
/usr/local/intel/composerxe/2011.7.256/mkl/lib/intel64/libmkl_gnu_thread.so: undefined reference to `GOMP_critical_name_end'
../../../../foreignlibs/boost/libboost_for_triqs.so: undefined reference to `gm_open'
../../../../foreignlibs/boost/libboost_for_triqs.so: undefined reference to `gm_crc'
../../../../foreignlibs/boost/libboost_for_triqs.so: undefined reference to `gm_hash_hash_ptr'
../../../../foreignlibs/boost/libboost_for_triqs.so: undefined reference to `gm_blocking_receive_no_spin'
../../../../foreignlibs/boost/libboost_for_triqs.so: undefined reference to `gm_create_hash'
../../../../foreignlibs/boost/libboost_for_triqs.so: undefined reference to `gm_close'
../../../../foreignlibs/boost/libboost_for_triqs.so: undefined reference to `gm_deregister_memory'
/usr/local/intel/composerxe/2011.7.256/mkl/lib/intel64/libmkl_gnu_thread.so: undefined reference to `GOMP_loop_end'
/usr/local/intel/composerxe/2011.7.256/mkl/lib/intel64/libmkl_gnu_thread.so: undefined reference to `GOMP_loop_ordered_static_next'
/usr/local/intel/composerxe/2011.7.256/mkl/lib/intel64/libmkl_gnu_thread.so: undefined reference to `GOMP_barrier'
../../../../foreignlibs/boost/libboost_for_triqs.so: undefined reference to `gm_dma_free'
../../../../foreignlibs/boost/libboost_for_triqs.so: undefined reference to `gm_drop_sends'
/usr/local/intel/composerxe/2011.7.256/mkl/lib/intel64/libmkl_gnu_thread.so: undefined reference to `GOMP_atomic_start'
/usr/local/intel/composerxe/2011.7.256/mkl/lib/intel64/libmkl_gnu_thread.so: undefined reference to `GOMP_loop_dynamic_start'
/usr/local/intel/composerxe/2011.7.256/mkl/lib/intel64/libmkl_gnu_thread.so: undefined reference to `omp_get_num_procs'
../../../../foreignlibs/boost/libboost_for_triqs.so: undefined reference to `gm_directed_send_with_callback'
../../../../foreignlibs/boost/libboost_for_triqs.so: undefined reference to `gm_num_receive_tokens'
/usr/local/intel/composerxe/2011.7.256/mkl/lib/intel64/libmkl_gnu_thread.so: undefined reference to `GOMP_critical_end'
../../../../foreignlibs/boost/libboost_for_triqs.so: undefined reference to `gm_hash_remove'
../../../../foreignlibs/boost/libboost_for_triqs.so: undefined reference to `gm_dma_malloc'
../../../../foreignlibs/boost/libboost_for_triqs.so: undefined reference to `gm_node_id_to_host_name'
/usr/local/intel/composerxe/2011.7.256/mkl/lib/intel64/libmkl_gnu_thread.so: undefined reference to `omp_get_max_threads'
../../../../foreignlibs/boost/libboost_for_triqs.so: undefined reference to `gm_unknown'
../../../../foreignlibs/boost/libboost_for_triqs.so: undefined reference to `gm_create_lookaside'
../../../../foreignlibs/boost/libboost_for_triqs.so: undefined reference to `gm_get_host_name'
../../../../foreignlibs/boost/libboost_for_triqs.so: undefined reference to `gm_allow_remote_memory_access'
../../../../foreignlibs/boost/libboost_for_triqs.so: undefined reference to `gm_strerror'
/usr/local/intel/composerxe/2011.7.256/mkl/lib/intel64/libmkl_gnu_thread.so: undefined reference to `GOMP_loop_ordered_dynamic_start'
../../../../foreignlibs/boost/libboost_for_triqs.so: undefined reference to `gm_hash_insert'
../../../../foreignlibs/boost/libboost_for_triqs.so: undefined reference to `_gm_assertion_failed'
../../../../foreignlibs/boost/libboost_for_triqs.so: undefined reference to `gm_blocking_receive'
../../../../foreignlibs/boost/libboost_for_triqs.so: undefined reference to `gm_bzero'
/usr/local/intel/composerxe/2011.7.256/mkl/lib/intel64/libmkl_gnu_thread.so: undefined reference to `omp_set_nested'
/usr/local/intel/composerxe/2011.7.256/mkl/lib/intel64/libmkl_gnu_thread.so: undefined reference to `GOMP_sections_end_nowait'
/usr/local/intel/composerxe/2011.7.256/mkl/lib/intel64/libmkl_gnu_thread.so: undefined reference to `GOMP_ordered_end'
/usr/local/intel/composerxe/2011.7.256/mkl/lib/intel64/libmkl_gnu_thread.so: undefined reference to `omp_in_parallel'
/usr/local/intel/composerxe/2011.7.256/mkl/lib/intel64/libmkl_gnu_thread.so: undefined reference to `GOMP_critical_name_start'
/usr/local/intel/composerxe/2011.7.256/mkl/lib/intel64/libmkl_gnu_thread.so: undefined reference to `GOMP_loop_end_nowait'
/usr/local/intel/composerxe/2011.7.256/mkl/lib/intel64/libmkl_gnu_thread.so: undefined reference to `GOMP_loop_ordered_static_start'
../../../../foreignlibs/boost/libboost_for_triqs.so: undefined reference to `gm_lookaside_free'
../../../../foreignlibs/boost/libboost_for_triqs.so: undefined reference to `gm_perror'
../../../../foreignlibs/boost/libboost_for_triqs.so: undefined reference to `gm_provide_receive_buffer_with_tag'
../../../../foreignlibs/boost/libboost_for_triqs.so: undefined reference to `gm_hash_find'
/usr/local/intel/composerxe/2011.7.256/mkl/lib/intel64/libmkl_gnu_thread.so: undefined reference to `omp_get_thread_num'
../../../../foreignlibs/boost/libboost_for_triqs.so: undefined reference to `gm_destroy_lookaside'
/usr/local/intel/composerxe/2011.7.256/mkl/lib/intel64/libmkl_gnu_thread.so: undefined reference to `GOMP_loop_dynamic_next'
/usr/local/intel/composerxe/2011.7.256/mkl/lib/intel64/libmkl_gnu_thread.so: undefined reference to `GOMP_sections_next'
/usr/local/intel/composerxe/2011.7.256/mkl/lib/intel64/libmkl_gnu_thread.so: undefined reference to `GOMP_parallel_end'
../../../../foreignlibs/boost/libboost_for_triqs.so: undefined reference to `gm_lookaside_alloc'
../../../../foreignlibs/boost/libboost_for_triqs.so: undefined reference to `GM_PAGE_LEN'
../../../../foreignlibs/boost/libboost_for_triqs.so: undefined reference to `gm_receive'
/usr/local/intel/composerxe/2011.7.256/mkl/lib/intel64/libmkl_gnu_thread.so: undefined reference to `omp_get_num_threads'
../../../../foreignlibs/boost/libboost_for_triqs.so: undefined reference to `gm_node_id_to_unique_id'
../../../../foreignlibs/boost/libboost_for_triqs.so: undefined reference to `gm_send_with_callback'
../../../../foreignlibs/boost/libboost_for_triqs.so: undefined reference to `gm_register_memory'
../../../../foreignlibs/boost/libboost_for_triqs.so: undefined reference to `gm_host_name_to_node_id'
../../../../foreignlibs/boost/libboost_for_triqs.so: undefined reference to `gm_unique_id_to_node_id'
/usr/local/intel/composerxe/2011.7.256/mkl/lib/intel64/libmkl_gnu_thread.so: undefined reference to `GOMP_parallel_sections_start'
collect2: ld returned 1 exit status
make[2]: *** [triqs/arrays/test/C++/a_x_ty_nopy] Error 1
make[1]: *** [triqs/arrays/test/C++/CMakeFiles/a_x_ty_nopy.dir/all] Error 2
make: *** [all] Error 2