You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to build MKL-DNN in manylinux, which is CentOS 5 based build environment for Python wheel, to maximize binary portability. But it requires GNU OpenMP instead of Intel OpenMP at build time because iomp5 has a reference to sched_getcpu@GLIBC_2.6 which is not supported in CentOS 5's glibc (version 2.5).
# export LD_LIBRARY_PATH=/usr/local/gcc-4.9.4/lib64:/usr/local/gcc-4.9.4/lib:/usr/local/lib64:/usr/local/lib
# cmake28 -DCMAKE_C_COMPILER=/usr/local/gcc-4.9.4/bin/gcc -DCMAKE_CXX_COMPILER=/usr/local/gcc-4.9.4/bin/g++ ..
# make
Linking CXX shared library libmkldnn.so
...
[ 45%] Built target mkldnn
Scanning dependencies of target simple-net-c
[ 45%] Building C object examples/CMakeFiles/simple-net-c.dir/simple_net.c.o
Linking C executable simple-net-c
../../external/mklml_lnx_2019.0.20180710/lib/libiomp5.so: undefined reference to `sched_getcpu@GLIBC_2.6'
collect2: error: ld returned 1 exit status
make[2]: *** [examples/simple-net-c] Error 1
make[1]: *** [examples/CMakeFiles/simple-net-c.dir/all] Error 2
make: *** [all] Error 2
I'd like to:
Use gomp when building MKL-DNN
Use iomp5 at runtime
I digged into CMake files but I can't find an option to enable mklml_gnu and gomp at build time. Could you please tell me how to do it?
The text was updated successfully, but these errors were encountered:
The build system does not have a knob to build Intel MKL-DNN with libmklml_gnu. Probably the only option as of now is patching the CMake files. I'll consider this to be a feature request. If you decide to go through the exercise of adding the knob yourself we would appreciate a pull request.
You should be able to use libiom5 at runtime with the standard build. The libiomp5 and libgomp are ABI compatible and can be used interchangeably as long as only one is initialized.
I think here is another option to remove a tiny dependency to glibc 2.6 from iomp5. It makes easier to bundle MKL-DNN to Python wheel which standardized by PEP 513. What do you think?
Pass `-DMKLDNN_THREADING=OMP:COMP` to cmake for that.
This is one of the steps required to address #312 issue.
By chance, this fixes#313.
The reason: we used ?undocumented? cmake flag [1] to prevent linking
with compilers OMP RT. Apparently this flag stopped working for recent
cmake versions. The new workaround is: `-Wl,--as-needed` for GCC and
`/full/path/to/libiomp5.so` for clang. How tricky... :(
[1] CMAKE_CXX_CREATE_SHARED_LIBRARY_FORBIDDEN_FLAGS
f: build: allow using compiler's OpenMP RT
I tried to build MKL-DNN in manylinux, which is CentOS 5 based build environment for Python wheel, to maximize binary portability. But it requires GNU OpenMP instead of Intel OpenMP at build time because
iomp5
has a reference tosched_getcpu@GLIBC_2.6
which is not supported in CentOS 5's glibc (version2.5
).I'd like to:
gomp
when building MKL-DNNiomp5
at runtimeI digged into CMake files but I can't find an option to enable
mklml_gnu
andgomp
at build time. Could you please tell me how to do it?The text was updated successfully, but these errors were encountered: