swhalemwo / obvz

org-brain visualization via PyQt
70 stars 4 forks source link

Installation #14

Open bepolymathe opened 4 years ago

bepolymathe commented 4 years ago

I am not a python (or even dev) user but I would like to test obvz.

Since it's not a package yet I have a doubt about the installation (spacemacs in my case). I'm used to install with the following command (example with org-brain-export) but I think it won't work... I wouldn't want to break everything ;-)

(org-brain-export :location (recipe :fetcher github :repo "Kungsgeten/org-brain-export"))

Could you give me an example of a functional configuration ?

michaelsjackson commented 4 years ago

You might check this, https://github.com/swhalemwo/obvz/issues/6, I have step by step commands what I did, up to compiling the .cpp code, and it works this way, if you repeat this process it should work there as well, I guess. Worth trying my friend, good luck.

bepolymathe commented 4 years ago

Oh... that answers my question, but it's a little scary :scream: I'll try anyway ;-)

michaelsjackson commented 4 years ago

No, the solutions are also always there, just read thru, try the given solutions there, hope it will work, if not, you can write your scenario, or error messages here, I am not an expert, but there is always a way.

bepolymathe commented 4 years ago

Yes I know, you have to try ;-) Now I have the following error message...

image

michaelsjackson commented 4 years ago

This is now where the c++ part comes, you can recompile fruch_v3 in your machine, so getting a fresh .so, exactly for your computer. Very easy, try those steps I have written.

bepolymathe commented 4 years ago

Here It works for the first order. However, it blocks on the second one because the package doesn't have the same name in dnf (fedora) as in apt apparently.

image

bepolymathe commented 4 years ago

After installing this package

eigen3-devel-3.3.7-3.fc31.noarch I have this message again... image

michaelsjackson commented 4 years ago

Installed pybind: pip3 install pybind11 I tried compiling with eigen installation sudo apt install libeigen3-dev

So I am guessing you installed pybind11 and libeigen3-dev successfully.

Then, switching into directory where frucht_v3.cpp is in your computer, from terminal. In my case cd /home/mj/packages/obvz/layout_optim/cpp/

Then type whereis eigen3

Then, with its result, in above directory, type something like: Came further using, added -I /usr/include/eigen3: g++ -O3 -Wall -shared -std=c++17 -fPIC python3 -m pybind11 --includes -I /usr/include/eigen3 ./frucht_v3.cpp -o ./frucht_v3.so because in my case whereis eigen3 showed as result: /usr/include/eigen3

If this works, you have a fresh .so file, copy this over the original one, two directories above. If you can compile this .so you are kind of finished. Then it should work. Good luck.

bepolymathe commented 4 years ago

Thank you for that clarification.

[08:04:35]  ~/Applications/obvz/layout_optim/cpp : pip3 install pybind11
Requirement already satisfied: pybind11 in /home/manu/.local/lib/python3.8/site-packages (2.5.0)

It's amazing because I don't have a "libeigen3-dev" package on Fedora.

However I can go further. whereis eigen3 return

eigen3: /usr/include/eigen3 /usr/share/eigen3 but if i type

g++ -O3 -Wall -shared -std=c++17 -fPIC python3 -m pybind11 --include -I /usr/include/eigen3 ./frucht_v3.cpp -o ./frucht_v3.so

It return

g++: erreur: python3: Aucun fichier ou dossier de ce type
g++: erreur: pybind11: Aucun fichier ou dossier de ce type
g++: erreur: option « -m » non reconnue sur la ligne de commande
michaelsjackson commented 4 years ago

Do not type, do copy paste always, then modify, above stays --includes, you wrote --include , not sure if this is the reason, just saw this difference.

Copy paste in linux: Mark text, somewhere else hit middle mouse button.

bepolymathe commented 4 years ago

hi

I change for "include" because it's been offered to me...

[09:30:28]  ~/Applications/obvz/layout_optim/cpp : g++ -O3 -Wall -shared -std=c++17 -fPIC python3 -m pybind11 --includes -I /usr/include/eigen3 ./frucht_v3.cpp -o ./frucht_v3.so
g++: erreur: python3: Aucun fichier ou dossier de ce type
g++: erreur: pybind11: Aucun fichier ou dossier de ce type
g++: erreur: option « -m » non reconnue sur la ligne de commande
g++: erreur: option « --includes » non reconnue sur la ligne de commande, aviez-vous l'intention d'utiliser « --include » ?
michaelsjackson commented 4 years ago

Maybe this first: dnf group install 'Development Tools'

have it from: https://www.techinfected.net/2016/10/how-to-write-compile-run-c--program-fedora-linux-terminal.html

bepolymathe commented 4 years ago

Yes I already have that to install but I keep getting the same error message... :thinking:

bepolymathe commented 4 years ago

Maybe @swhalemwo have a idea ?

michaelsjackson commented 4 years ago

Well, I have no fedora, and I am not a linux expert, with all its variants, just google about compiling c++ in fedora, and with your error in Google, maybe you will find some ideas there. I did nothing extra, but in ubuntu 16.04, but not sure what other stuff I installed in the past, maybe those help here as well, who knows.

bepolymathe commented 4 years ago

Ok I'm going to look on my side but it's true that I'm not in my comfort zone when it comes to compiling C++.

Thanks for your help.

michaelsjackson commented 4 years ago

Somehow it seems it can not find pybind11 and python3, not sure why, here those did not complain, but google will help I hope, there is nothing to be uncomfortable, you do not do anything, just search which replies people gave to similar problems: google: fedora linux c++ compiling pybind11 python3 your_error_message , for example.

bepolymathe commented 4 years ago

Thanks, I wouldn't have thought to google it... More seriously, it is probably an interesting tool, but it will require a package in the long run (this is suggested in the README). I'll say here if I've found a solution when I'll have time to really search and play with compilation errors.

michaelsjackson commented 4 years ago

Good luck, I hope you will sort this out soon, nothing hurries, but this tool is worth the effort, very useful. Then one can forget other mind mapping or concept mapping tools, export as .svg, in case you want to beautify it even more, just edit in inkscape, for example.

bepolymathe commented 4 years ago

When I run the obvz-start command I get an error message about dbus.

cd ~/Applications/obvz && /usr/bin/python3 obvz.py dbus force: exited abnormally with code 1. [2 times]

michaelsjackson commented 4 years ago

So you could compile the .so file successfully? If yes, what did you do differently, for historic reasons you could mention it here, as a help for future users.

For obvz, start org-visualization first, and even there, add a few entries, in case you started a fresh brain with zero entries, 5..10 entries maybe, then you can run obvz-start. Then hitting in org-brain visualization n, so obvz can show something. Best is hit n a few times, just to be sure. You should see something visualized there, if all worked correctly.

bepolymathe commented 4 years ago

No, I still haven't been able to compile. That's the error message I get when I try to do it.

michaelsjackson commented 4 years ago

But before you finished you should not start obvz-start, of course this will not work without the .so file, as far as I know at least. Ok, if you would use not type force but dot, it might work, but I am using always force graphs here.

bepolymathe commented 4 years ago

Well then, a little progress. I have successfully compiled with the following command which points to the version of python on my machine.

g++ -O3 -Wall -shared -std=c++17 -fPIC -I /usr/include/eigen3/ -I /usr/include/python3.8 ./frucht_v3.cpp -o ./frucht_v3.so

I have the frucht_v3.so file but I keep getting the following error message if I run the obvz-start command

image

I feel like I've got too new a version of python? (but I need it for other programs). @swhalemwo