Skip to content

Conversation

@massich
Copy link
Owner

@massich massich commented Jan 17, 2018

No description provided.

agramfort and others added 4 commits January 17, 2018 17:27
add static builds

add fixed FindBLAS to fix mac static build

add non sequential mkl to travis

add openblas on mac

make verbose

breww misc

install omp for parallel backend

debug

use intel thread + iomp even with GCC

remove broken builds

Add linux build static

Remove apple builds

cat cmake logs

[fix] add dynamic thread libraries to the target
@massich massich force-pushed the Intel10_64lp_static branch from 12eb8b0 to 55ce4a2 Compare January 17, 2018 17:05
@massich
Copy link
Owner Author

massich commented Jan 17, 2018

Here's the output of mkl_link_tool for Intel10_64lp ( with --parallel=yes) and Intel10_64lp_seq (--parallel=no). They differ in the fact that parallel adds -liomp5 to be linked dynamically.

${MKLROOT}/tools/mkl_link_tool -libs --parallel=yes --compiler=gnu_c --os=lnx --arch=intel64 --linking=static --interface=lp64

       Intel(R) Math Kernel Library (Intel(R) MKL) Link Tool v4.5
       ==========================================================

Output
======

Linking line:
 -Wl,--start-group $(MKLROOT)/lib/intel64/libmkl_intel_lp64.a $(MKLROOT)/lib/intel64/libmkl_intel_thread.a $(MKLROOT)/lib/intel64/libmkl_core.a -Wl,--end-group -liomp5 -lpthread -lm -ldl

~/Documents/code/random_thoughts/cpp-mkl-test/build_dynamic_noseq/CMakeFiles/CMakeTmp Intel10_64lp_static*${MKLROOT}/tools/mkl_link_tool -libs --parallel=no --compiler=gnu_c --os=lnx --arch=intel64 --linking=static --interface=lp64

       Intel(R) Math Kernel Library (Intel(R) MKL) Link Tool v4.5
       ==========================================================

Output
======

Linking line:
 -Wl,--start-group $(MKLROOT)/lib/intel64/libmkl_intel_lp64.a $(MKLROOT)/lib/intel64/libmkl_sequential.a $(MKLROOT)/lib/intel64/libmkl_core.a -Wl,--end-group -lpthread -lm -ldl

For the parallel case, my local system generates this:
CMAKE_REQUIRED_LIBRARIES : ${MKLROOT}/lib/intel64_lin/libmkl_intel_lp64.a;${MKLROOT}/lib/intel64_lin/libmkl_intel_thread.a;${MKLROOT}/lib/intel64_lin/libmkl_core.a;/opt/intel/compilers_and_libraries_2018.0.128/linux/compiler/lib/intel64_lin/libiomp5.a;-lpthread;-lm -ldl. Notice that libiomp is set to link statically and that is not the same as the one proposed by mkl_link_tool.
Even more, whatever CMake is picking up is not there. It has found the .so in /opt/intel/clk/... and change its extesnsion to .a. But is not there.

❯ locate libiomp5                           
/opt/intel/clck/2018.0.002/provider/share/common/lib/intel64/libiomp5.so
/opt/intel/compilers_and_libraries_2018.0.128/linux/compiler/lib/ia32_lin/libiomp5.a
/opt/intel/compilers_and_libraries_2018.0.128/linux/compiler/lib/ia32_lin/libiomp5.dbg
/opt/intel/compilers_and_libraries_2018.0.128/linux/compiler/lib/ia32_lin/libiomp5.so
/opt/intel/compilers_and_libraries_2018.0.128/linux/compiler/lib/intel64_lin/libiomp5.a
/opt/intel/compilers_and_libraries_2018.0.128/linux/compiler/lib/intel64_lin/libiomp5.dbg
/opt/intel/compilers_and_libraries_2018.0.128/linux/compiler/lib/intel64_lin/libiomp5.so

Other things that I don't understand are:
1 - why guide appears here if it is only set up for old versions (see here).
If that where not the case, guide should also appear here but is not the case.

2 - why both cmake test compilations pass (here for 64lp_seq and here for 64lp). they replicate on my system. Both compile with no problem. However 64lp case returns FALSE wheras 64lp_seq retruns TRUE.

3 - the cmake failure log shows that its looking for -lpthreads (ended with s instead of `lpthread) (see here). What I don't understand is why this appears on the log but not during the cmake run. This issue with cmake-3.7 + ubuntu-14 might bring something to the discussion

@massich
Copy link
Owner Author

massich commented Jan 17, 2018

ping @agramfort

@agramfort agramfort force-pushed the Intel10_64lp_static branch from 822e690 to c903f63 Compare January 19, 2018 14:56
@massich
Copy link
Owner Author

massich commented Jan 19, 2018

Based on this commend, I think we should do find_package(Threads) in CMakelists.txt and break execution is this is not done when doing FindBLA for Intel case.

But still, this only means that all those errors were normal. Even if we were ignoring them and hardcoding -lpthread which we should stop doing ! So not what we are looking for.
But then it makes no sense, 'cos the try_compile was already propely generated for sgemm_

@agramfort
Copy link
Collaborator

agramfort commented Jan 19, 2018 via email

@massich
Copy link
Owner Author

massich commented Jan 20, 2018

It does not. I think it should be related shomehow (see https://gitlab.kitware.com/cmake/cmake/issues/16221)

@massich massich requested a review from agramfort January 23, 2018 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants