primitiv: [FreeBSD] Python runtime error: "Default object is null."
Steps to reproduce:
Install primitiv in FreeBSD 11.1 by the following commands (root):
pkg install protobuf cmake git googletest python3
python3 -m ensurepip
pip3 install numpy cython
git clone https://github.com/odashi/primitiv.git
cd primitiv
cmake . -DPRIMITIV_BUILD_TESTS=ON
make
make test
make install
cd python-primitiv
env CPLUS_INCLUDE_PATH=/usr/local/include ./setup.py build
The following python code throws an error:
>>> from primitiv import *
>>> dev = devices.Naive()
>>> Device.set_default(dev)
>>> g = Graph()
>>> Graph.set_default(g)
>>> dev == Device.get_default()
True
>>> g == Graph.get_default()
True
>>> node = operators.ones([2,3])
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "primitiv/_operator.pyx", line 226, in primitiv._operator._operators.ones
return wrapNode(op_ones[CppNode](normShape(shape).wrapped, device.wrapped[0]))
RuntimeError: /root/primitiv/primitiv/mixins.h: 69: Default object is null.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 30 (30 by maintainers)
Build OK?
Symbol type of
default_obj_Instead of -lprimitiv could you please pass the full path to .so file, like:
That’s actually would be a bit more robust, but the variant above may do as well.
@odashi Yes. Two addresses (
&default_obj_in_graph.soand&default_obj_inlibprimitiv.so) are different value.