Closed bpalmintier closed 6 years ago
I think I know what the problem is. It should be python3-config
instead of python-config
. The instructions on the develop
branch are not up to date. They have been updated on add-install-target-for-swig-python
. python-config
by default defaults to python2-config
which is why this does not work.
That got the compilation to work, but still unable to run python extension. It seems the file directories don't match the install directions in two ways:
After running (output suppressed, no errors):
$ cmake -DCMAKE_INSTALL_PREFIX=~/helics_install -DBUILD_PYTHON=ON -DPYTHON_LIBRARY=$(python3-config --prefix)/lib/libpython3.6m.dylib -DPYTHON_INCLUDE_DIR=$(python3-config --prefix)/include/python3.6m ../
$ make -j4
$ make
$ make install
There is no python folder under ~/helics_install
$ ls ~/helics_install/
bin/ cmake/ include/ lib/
And there are no pireceiver.py
or pisender.py
in .../repos/HELICS-src/build-osx/swig/python
:
(python36) bpalmint-31532s:python bpalmint$ pwd
/Users/bpalmint/repos/HELICS-src/build-osx/swig/python
(python36) bpalmint-31532s:python bpalmint$ ls
CMakeFiles/ Makefile cmake_install.cmake helicsPYTHON_wrap.c
CTestTestfile.cmake _helics.so* helics.py
And not sure if still a valid test, but trying to run helics.py
still produces the abort trap:
(python36) bpalmint-31532s:python bpalmint$ export PYTHONPATH="~/helics_install/python"
(python36) bpalmint-31532s:python bpalmint$ python helics.py
Fatal Python error: PyThreadState_Get: no current thread
Abort trap: 6
@bpalmintier Thanks for following up on this and keeping us honest. The changes were on the branch that hadn't been merged to develop
yet, I just merged it this morning. See the README.md in develop. I still need to update the Python examples pireceiver.py
and pisender.py
though. I will do that and comment here again.
I tested these examples now and they work. You can follow the README.md on the latest commit of develop
.
@kdheepak can we close this issue?
I'm waiting for @bpalmintier to confirm this is resolved. I think with the new changes + brew installation steps we should be good. I'll confirm and close by tomorrow.
Closing. Current develop
branch works. I also updated the python README.md to fully explain the steps for testing (including starting the broker). See 3952052
Note: Tested via README.md
steps, not using brew install
Thanks testing and for making the README.md more thorough! On a related note, I'm going move all documentation to the docs folder along with how to run the examples, since users are more likely to check the website than check the README.md in a folder or on github.
Great idea. Strongly like moving them out of their currently buried position.
Following the latest
swig\python\README.md
directions on Mac from within an anaconda 3.64 virtual environment and got the following error (Note on: develop 50fd510311)