-
Notifications
You must be signed in to change notification settings - Fork 171
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
Bolt Python wrapper doesn't build on some systems #4
Comments
I could build the code on redhat with this modifications:
now my problem is when I try to import bolt I get this error: >>> import bolt
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "~/.local/lib/python2.7/site-packages/pybolt-0.1.4-py2.7-linux-x86_64.egg/bolt/__init__.py", line 5, in <module>
from bolt_api import * # noqa
File "~/.local/lib/python2.7/site-packages/pybolt-0.1.4-py2.7-linux-x86_64.egg/bolt/bolt_api.py", line 6, in <module>
import bolt # inner bolt because of SWIG
File "~/.local/lib/python2.7/site-packages/pybolt-0.1.4-py2.7-linux-x86_64.egg/bolt/bolt.py", line 17, in <module>
_bolt = swig_import_helper()
File "~/.local/lib/python2.7/site-packages/pybolt-0.1.4-py2.7-linux-x86_64.egg/bolt/bolt.py", line 16, in swig_import_helper
return importlib.import_module('_bolt')
File "~/anaconda2/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
ImportError: ~/.local/lib/python2.7/site-packages/pybolt-0.1.4-py2.7-linux-x86_64.egg/_bolt.so: undefined symbol: _ZNKSt3__120__vector_base_commonILb1EE20__throw_length_errorEv |
setting the environment variable LDFLAGS to -lc++ solved the problem. (adding os.environ['LDFLAGS'] = '-lc++' to setup.py) |
I marked this as closed by adding your changes as per our email exchange. Thanks for your help in getting to the bottom of this. For those seeing this in the future, I'm not 100% certain this fix will work on all systems and so would be happy to reopen this if you have problems. |
I miss another problem look like this |
This might be an issue with the stdlib that you're using. Can you build the following simple program? main.cpp:
with the command:
I also just removed the duplicate |
i got this by using clang++ ,and g++ is ok
|
Great. Now what happens when you instead use a different stdlib? I.e.:
or
Also, what do you get when you do:
|
hello,when i follow those two command,
I got the same error
|
Hmm. Based on what's here, can you compile a one-line cpp file that just contains:
Also, if I'm counting the
Also, for the sake of others seeing this thread, I edited your post so the error messages appear as code and the "include" doesn't look like a header. Hope that's okay. (The backticks didn't work across the line boundaries.) |
Tried to get this to work on Colab, but got "unterminated string constant" build error from swig after
My minimal Colab example link is here: https://colab.research.google.com/drive/1ATN8-R4xqghk9faNBqxFoE28iKd7WCZp?usp=sharing |
I encounter this error with my Ubuntu likewise. |
I guess the folder Then, I struggle with the issue "command clang not exist" on Ubuntu. To solve this, I turn to run this code on Mac. Also, in exclude_file_ext = ['.cxxlist','.cu','.cmake','.in','.css','.entry','.evaluator','.expression','.main','.preamble','.traits']
srcFiles += [x for x in files if not any(x.endswith(y) for y in exclude_file_ext)] After all above, it seems start to build the project, but fail agian...... The error is like below and I have no idea now... In file included from cpp/src/external/eigen-trimmed/unsupported/doc/examples/PolynomialSolver1.cpp:1:
In file included from cpp/src/external/eigen-trimmed/unsupported/Eigen/Polynomials:40:
cpp/src/external/eigen-trimmed/unsupported/Eigen/src/Polynomials/PolynomialSolver.h:365:43: error: no member named 'abs' in namespace 'Eigen::numext'; did you mean simply 'abs'?
if( internal::isMuchSmallerThan(numext::abs(numext::imag(m_roots[i])),
^~~~~~~~~~~
abs
cpp/src/external/eigen-trimmed/Eigen/src/Core/GlobalFunctions.h:58:36: note: 'abs' declared here
EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(abs,scalar_abs_op)
^
In file included from cpp/src/external/eigen-trimmed/unsupported/doc/examples/PolynomialSolver1.cpp:1:
In file included from cpp/src/external/eigen-trimmed/unsupported/Eigen/Polynomials:40:
cpp/src/external/eigen-trimmed/unsupported/Eigen/src/Polynomials/PolynomialSolver.h:366:43: error: no member named 'abs' in namespace 'Eigen::numext'; did you mean simply 'abs'?
numext::abs(numext::real(m_roots[i])),
^~~~~~~~~~~
abs
cpp/src/external/eigen-trimmed/Eigen/src/Core/GlobalFunctions.h:58:36: note: 'abs' declared here
EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(abs,scalar_abs_op)
^
In file included from cpp/src/external/eigen-trimmed/unsupported/doc/examples/PolynomialSolver1.cpp:1:
In file included from cpp/src/external/eigen-trimmed/unsupported/Eigen/Polynomials:40: |
On Ubuntu, after following @husisy's advice and removing
^on Colab, and on my Pop_OS (Ubuntu variant) laptop I get:
EDIT: After modifying
Colab link is the same as before: https://colab.research.google.com/drive/1ATN8-R4xqghk9faNBqxFoE28iKd7WCZp?usp=sharing#scrollTo=ks4orqb0Sxrs |
Update: Above Colab goes significantly further than before but still fails.
@dblalock Let us know when we can try this out! Looking forward to it. Until then, 👋 |
Hello, when I install the bolt on my macbook, I follow the installing process but meet the following problem. |
Thanks for everyone's feedback and work on this (special thanks to @drscotthawley, as well as @husisy and @calvinmccarter, who've put a bunch of time into helping to get all this working). I'm looking into this, but it's kind of slow going at the moment (especially since I'm doing about 70h/week at my day job and don't have much time left over). I appreciate everyone's enthusiasm and patience. |
@dblalock With a bit more documentation around the C++ API, I'd be happy to write a basic command-line interface. Obviously getting and returning matrices via file i/o is slow, but it would be sufficient for me. |
FWIW - I have a branch that has changes so that things can be built and run on Linux and Mac. The changes basically add a CMakeLists.txt to build with cmake, add a kmc2 submodule that works with python3 and setup.py changes so the python package builds. There is a build.sh that was tested to work on Debian 11 and Mac OS X 10.14.6. https://github.com/mneilly/bolt/tree/mneilly/fixes |
Now it works for me! Good job thank you
|
@mneilly this is awesome, thanks! I'll be happy to merge it if you open a PR. |
@dblalock I opened the PR. |
Finally, I could install Bolt perfectly, with kmc2 install
Thanks to @mneilly for the PR ^^ |
Yes, big thanks to mneilly! For any future readers, I actually merged this branch into Bolt, so in theory you should get the same results in the main repo now. That said, I would never bet on the robustness of mostly-unmaintained code spanning two languages with legacy FFI interfaces and x86-specific libraries, so worth giving mneilly's branch a try if this repo doesn't work. The docker container he wrote (see BUILD.md should be more reliable. |
At present, Bolt's python code doesn't appear to be building on Ubuntu and hasn't been tested on Windows. It may also have issues building on other systems.
The text was updated successfully, but these errors were encountered: