Skip to content
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

Workaround weird build issue on manylinux docker image (centos 5) #841

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ofrei
Copy link
Contributor

@ofrei ofrei commented Sep 3, 2017

The -lrt flag must be the last in linker command, that's why I'm adding it into target_link_libary.
I've tried to add into CMAKE_EXE_LINKER_FLAGS, but then it is prepended somewhere in the middle of link command, and has no effect.

Without hacking around librt I used to get these errors:

[ 98%] Linking CXX executable ../../bin/bigartm
/usr/local/lib/libboost_thread.a(thread.o): In function `boost::this_thread::no_interruption_point::hiden::sleep_until(timespec const&)':
thread.cpp:(.text+0x41c): undefined reference to `clock_gettime'
thread.cpp:(.text+0x4a1): undefined reference to `clock_gettime'
/usr/local/lib/libboost_thread.a(thread.o): In function `boost::this_thread::hiden::sleep_for(timespec const&)':
thread.cpp:(.text+0x13de): undefined reference to `clock_gettime'
collect2: error: ld returned 1 exit status
make[2]: *** [bin/bigartm] Error 1
make[1]: *** [src/bigartm/CMakeFiles/bigartm.dir/all] Error 2
make: *** [all] Error 2

And, for `libartm.so``, this:

root@08bc0b3dbc30:/usr/local/lib/python2.7/dist-packages/artm# python
Python 2.7.3 (default, Oct 26 2016, 21:01:49)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import ctypes
>>> ctypes.CDLL('/usr/local/lib/python2.7/dist-packages/artm/libartm.so')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/ctypes/__init__.py", line 365, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: /usr/local/lib/python2.7/dist-packages/artm/libartm.so: undefined symbol: clock_gettime

The ``-lrt`` flag must be the last in linker command, that's why I'm adding it into target_link_libary.
I've tried to add into CMAKE_EXE_LINKER_FLAGS, but then it is prepended somewhere in the middle of link command, and has no effect.

Without hacking around librt I used to get these errors:
```
[ 98%] Linking CXX executable ../../bin/bigartm
/usr/local/lib/libboost_thread.a(thread.o): In function `boost::this_thread::no_interruption_point::hiden::sleep_until(timespec const&)':
thread.cpp:(.text+0x41c): undefined reference to `clock_gettime'
thread.cpp:(.text+0x4a1): undefined reference to `clock_gettime'
/usr/local/lib/libboost_thread.a(thread.o): In function `boost::this_thread::hiden::sleep_for(timespec const&)':
thread.cpp:(.text+0x13de): undefined reference to `clock_gettime'
collect2: error: ld returned 1 exit status
make[2]: *** [bin/bigartm] Error 1
make[1]: *** [src/bigartm/CMakeFiles/bigartm.dir/all] Error 2
make: *** [all] Error 2
```

And, for `libartm.so``, this:
```
root@08bc0b3dbc30:/usr/local/lib/python2.7/dist-packages/artm# python
Python 2.7.3 (default, Oct 26 2016, 21:01:49)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import ctypes
>>> ctypes.CDLL('/usr/local/lib/python2.7/dist-packages/artm/libartm.so')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/ctypes/__init__.py", line 365, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: /usr/local/lib/python2.7/dist-packages/artm/libartm.so: undefined symbol: clock_gettime
```
@ofrei ofrei mentioned this pull request Oct 21, 2017
8 tasks
@ofrei
Copy link
Contributor Author

ofrei commented Feb 14, 2018

Keep this PR open because it is related to pip install feature - which has highest priority among all users requests to BigARTM.

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.

None yet

1 participant