-
Notifications
You must be signed in to change notification settings - Fork 183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DNDEBUG flag in cmake doesn't link libtensorflow_cc.so file #58
Comments
Hi, this behavior is strange, but I don't really know what is wrong. Fortunately, you don't need to use |
Sorry, you are talking about the example CMakeLists, not the tensorflow_cc CMakeLists. That may cause some issues. Can you please try to build the example with |
Thanks! So, I did following steps
Then I did "ldd example" and I couldn't find the libtensorflow_cc.so file but it can find libtensorflow_framework.so. Moreover, the same error if I execute ./example.
I am not able to understand how -DNDEBUG flag affects the library linking part!? |
Hi, thank you. I was looking into it, but unfortunately, I have not been able to solve it. Tensorflow uses global register objects. I believe the problem is that without the Does anyone have a suggestion? Relevant issues: tensorflow/tensorflow#3308 tensorflow/tensorflow#6396 tensorflow/tensorflow#4242 |
@achalshah20 It appears that monolithic build solves the issue, can you please try #64, whether it helps you as well? |
Hi @FloopCZ , Yes it works. Thanks for the fix! |
Monolithic build merges all the libraries into a single library |
Hi,
In your example cmake file I just added this line
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNDEBUG")
and it breaks the program. I am getting error
"No session factory registered for the given session options: {target: "" config: } Registered factories are {}."
Then I did "ldd example", and here is the result:
linux-vdso.so.1 => (0x00007ffe679b1000) libtensorflow_framework.so => /usr/lib/tensorflow_cc/libtensorflow_framework.so (0x00007f3ccb5d8000) libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f3ccb256000) libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f3ccb040000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f3ccac76000) libcublas.so.9.1 => /usr/local/cuda-9.1/lib64/libcublas.so.9.1 (0x00007f3cc7555000) libcuda.so.1 => /usr/lib/x86_64-linux-gnu/libcuda.so.1 (0x00007f3cc69b5000) libcudnn.so.7 => /usr/lib/x86_64-linux-gnu/libcudnn.so.7 (0x00007f3cb5a24000) libcufft.so.9.1 => /usr/local/cuda-9.1/lib64/libcufft.so.9.1 (0x00007f3cae537000) libcurand.so.9.1 => /usr/local/cuda-9.1/lib64/libcurand.so.9.1 (0x00007f3caa5b4000) libcudart.so.9.1 => /usr/local/cuda-9.1/lib64/libcudart.so.9.1 (0x00007f3caa346000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f3caa142000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f3ca9e39000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f3ca9c1c000) /lib64/ld-linux-x86-64.so.2 (0x00007f3ccc511000) librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f3ca9a14000) libnvidia-fatbinaryloader.so.390.30 => /usr/lib/nvidia-390/libnvidia-fatbinaryloader.so.390.30 (0x00007f3ca97c8000)
libtensorflow_cc.so is missing and if I remove -DNDEBUG flag, it works as expected. It might be issue from tensorflow compilation thing but I am not entirely sure. Can you please help me understand why -DNDEBUG is causing this problem? Thanks!
The text was updated successfully, but these errors were encountered: