kpeeters / cadabra2

A field-theory motivated approach to computer algebra.
https://cadabra.science/
GNU General Public License v3.0
228 stars 37 forks source link

No package 'glibmm-2.4' found #136

Closed TCodina closed 5 years ago

TCodina commented 5 years ago

I'm trying to build Cadabra2 from source (cloning the repository, making the build directory and using the commands cd build cmake ..) but when I do it, I get the following errors:

-- Git found: /usr/bin/git


Building Cadabra version 2.2.6 (64-bit)

-- Build id '2029.06bba296b8' dated 2019-03-03 -- Build mode is set to '' -- Install directory set to /home/tomaco/miniconda3 -- This is an Ubuntu 18.04 system -- Building normal version (no tweak) -- Building in user mode -- Building tests -- Building the Jupyter kernel


Configuring Mathematica

-- Could NOT find Mathematica_WSTP (missing: Mathematica_WSTP_LIBRARY Mathematica_WSTP_INCLUDE_DIR) (found version "") -- Could NOT find Mathematica (missing: Mathematica_ROOT_DIR Mathematica_KERNEL_EXECUTABLE Mathematica_FRONTEND_EXECUTABLE Mathematica_WSTP_LIBRARY Mathematica_WSTP_INCLUDE_DIR) (found version "")


Configuring Python

-- Building for use with Python 3 (good!) -- pybind11 v2.3.dev0 -- Found python /home/tomaco/miniconda3/lib/libpython3.7m.so


Configuring client-server

-- Checking for module 'glibmm-2.4' -- No package 'glibmm-2.4' found CMake Error at /home/tomaco/miniconda3/share/cmake-3.13/Modules/FindPkgConfig.cmake:452 (message): A required package was not found Call Stack (most recent call first): /home/tomaco/miniconda3/share/cmake-3.13/Modules/FindPkgConfig.cmake:622 (_pkg_check_modules_internal) cmake/modules/FindGLIBMM.cmake:8 (pkg_check_modules) client_server/CMakeLists.txt:18 (find_package)

-- Configuring incomplete, errors occurred! See also "/home/tomaco/Tomaco/Hobbies/Programacion/Cadabra/cadabra2/build/CMakeFiles/CMakeOutput.log".

I'm using python3.7 from miniconda3 because after solving this problem I'd like to use Cadabra2 inside Jupyter Notebook and so I had followed the procedure described in https://github.com/kpeeters/cadabra2/blob/master/JUPYTER.rst.

How can I solve this problem?

kpeeters commented 5 years ago

If you want to build as a Jupyter kernel you need to follow the instructions there completely, that is, use the extended cmake line which configures for a Jupyter kernel build. Otherwise you get a weird mixture of packages that will not work.

TCodina commented 5 years ago

Thank you so much for the quick response! But unfortunately I get the same error when I do it in that way:

cmake -DENABLE_JUPYTER=ON -DENABLE_FRONTEND=OFF -DCMAKE_INCLUDE_PATH=${HOME}/miniconda3/include -DCMAKE_LIBRARY_PATH=${HOME}/miniconda3/lib -DCMAKE_INSTALL_PREFIX=${HOME}/miniconda3 ..

-- Git found: /usr/bin/git


Building Cadabra version 2.2.6 (64-bit)

-- Build id '2029.06bba296b8' dated 2019-03-03 -- Build mode is set to '' -- Install directory set to /home/tomaco/miniconda3 -- This is an Ubuntu 18.04 system -- Building normal version (no tweak) -- Building in user mode -- Building tests -- Building the Jupyter kernel


Configuring Mathematica

-- Could NOT find Mathematica_WSTP (missing: Mathematica_WSTP_LIBRARY Mathematica_WSTP_INCLUDE_DIR) (found version "") -- Could NOT find Mathematica (missing: Mathematica_ROOT_DIR Mathematica_KERNEL_EXECUTABLE Mathematica_FRONTEND_EXECUTABLE Mathematica_WSTP_LIBRARY Mathematica_WSTP_INCLUDE_DIR) (found version "")


Configuring Python

-- Building for use with Python 3 (good!) -- pybind11 v2.3.dev0 -- Found python /home/tomaco/miniconda3/lib/libpython3.7m.so


Configuring client-server

-- Checking for module 'glibmm-2.4' -- No package 'glibmm-2.4' found CMake Error at /home/tomaco/miniconda3/share/cmake-3.13/Modules/FindPkgConfig.cmake:452 (message): A required package was not found Call Stack (most recent call first): /home/tomaco/miniconda3/share/cmake-3.13/Modules/FindPkgConfig.cmake:622 (_pkg_check_modules_internal) cmake/modules/FindGLIBMM.cmake:8 (pkg_check_modules) client_server/CMakeLists.txt:18 (find_package)

-- Configuring incomplete, errors occurred! See also "/home/tomaco/Tomaco/Hobbies/Programacion/Cadabra/cadabra2/build/CMakeFiles/CMakeOutput.log".

kpeeters commented 5 years ago

I have added two extra bits to the instructions:

Then erase the build directory, create it from scratch, and do the cmake step again.

TCodina commented 5 years ago

Great, that did solve the problem from Cmake! However, now I'm facing another one when I run the make command at the for_previous_users part:

[ 92%] Creating gauge_theory/init.py... [ 92%] Built target gauge_theory_init [ 92%] Creating gauge_theory/instantons.py... [ 92%] Built target gauge_theory_instantons [ 92%] Creating for_previous_users notebook... /bin/sh: 1: cadabra2cadabra: not found tests/CMakeFiles/for_previous_users_test.dir/build.make:63: recipe for target 'tests/for_previous_users.cdb' failed make[2]: [tests/for_previous_users.cdb] Error 127 CMakeFiles/Makefile2:642: recipe for target 'tests/CMakeFiles/for_previous_users_test.dir/all' failed make[1]: [tests/CMakeFiles/for_previous_users_test.dir/all] Error 2 Makefile:162: recipe for target 'all' failed make: *** [all] Error 2

kpeeters commented 5 years ago

Pull again, I have disabled those tests now when building a Jupyter kernel.

TCodina commented 5 years ago

Perfect, now I could build Cadabra2 entirely! However, I have one last issue:

Cadabra2 is built for python 3.6 version (which is the default one from Linux) and so I can not use it in python3.7 (the one from miniconda3).This fact let me use cadabra inside python3.6 but not inside jupyter notebook or open the "cadabra" notebook inside jupyter. How could this happen?

TCodina commented 5 years ago

I realized what the problem was! I had another version of cadabra2 as a module for python3.6.

I removed it, I installed cadabra2 all again and finally I had to add the module direction to the PYTHONPATH

export PYTHONPATH=${HOME}/miniconda3/share/cadabra2/python/:${PYTHONPATH}

This worked for me and now I can use Cadabra2 inside python3.7, the miniconda version.

However, I'm not sure how to use the "cadabra notebook" which can be produced while you are inside jupyter notebook.

kpeeters commented 5 years ago

If you are running Jupyter that came with conda the above path settings should not be necessary. You should then, when creating a new notebook, have the option of creating a Cadabra notebook session.

You are probably using a Jupyter which did not come from conda.

TCodina commented 5 years ago

Following your advice I thought that it might was a problem of an old version of conda and jupyter notebook that I had from anaconda3 before and they were not removed properly. Therefore, I remove all the anaconda3 trash that I had in my system and I uninstall mininconda3 and did the same (remove all the .conda .condarc .jupyter files from my home directory and I eliminated the line from anaconda an miniconda in the .bashrc file. Then, when my system was completely clean from anaconda and miniconda I started the whole procedure again. Now everything went fine until I want to begin a python or cadabra kernel inside Jupyter notebook. Ipython, python and cadabra2 work fine on the command promp but jupyter notebook doesn't work! Every time I try to open a new kernel (python3 or cadabra) I recieve the following message:

[I 11:11:12.550 NotebookApp] The port 8888 is already in use, trying another port. [I 11:11:12.557 NotebookApp] Serving notebooks from local directory: /home/tomaco [I 11:11:12.557 NotebookApp] The Jupyter Notebook is running at: [I 11:11:12.558 NotebookApp] http://localhost:8889/?token=abb367c1742e0679835356570c38dbfb8bef969848f381d5 [I 11:11:12.558 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation). [C 11:11:12.632 NotebookApp]

Copy/paste this URL into your browser when you connect for the first time,
to login with a token:
    http://localhost:8889/?token=abb367c1742e0679835356570c38dbfb8bef969848f381d5

[I 11:11:12.843 NotebookApp] Accepting one-time-token-authenticated connection from 127.0.0.1 [I 11:11:18.162 NotebookApp] Creating new file in [I 11:11:26.754 NotebookApp] New terminal with automatic name: 1 [I 11:11:32.579 NotebookApp] Creating new notebook in [E 11:11:33.076 NotebookApp] Uncaught exception GET /notebooks/Untitled13.ipynb?kernel_name=python3 (127.0.0.1) HTTPServerRequest(protocol='http', host='localhost:8889', method='GET', uri='/notebooks/Untitled13.ipynb?kernel_name=python3', version='HTTP/1.1', remote_ip='127.0.0.1') Traceback (most recent call last): File "/home/tomaco/miniconda3/lib/python3.7/site-packages/tornado/web.py", line 1697, in _execute result = method(*self.path_args, self.path_kwargs) File "/home/tomaco/miniconda3/lib/python3.7/site-packages/tornado/web.py", line 3174, in wrapper return method(self, args, kwargs) File "/home/tomaco/miniconda3/lib/python3.7/site-packages/notebook/notebook/handlers.py", line 59, in get get_custom_frontend_exporters=get_custom_frontend_exporters File "/home/tomaco/miniconda3/lib/python3.7/site-packages/notebook/base/handlers.py", line 467, in render_template return template.render(ns) File "/home/tomaco/miniconda3/lib/python3.7/site-packages/jinja2/asyncsupport.py", line 76, in render return original_render(self, args, kwargs) File "/home/tomaco/miniconda3/lib/python3.7/site-packages/jinja2/environment.py", line 1008, in render return self.environment.handle_exception(exc_info, True) File "/home/tomaco/miniconda3/lib/python3.7/site-packages/jinja2/environment.py", line 780, in handle_exception reraise(exc_type, exc_value, tb) File "/home/tomaco/miniconda3/lib/python3.7/site-packages/jinja2/_compat.py", line 37, in reraise raise value.with_traceback(tb) File "/home/tomaco/miniconda3/lib/python3.7/site-packages/notebook/templates/notebook.html", line 1, in top-level template code {% extends "page.html" %} File "/home/tomaco/miniconda3/lib/python3.7/site-packages/notebook/templates/page.html", line 154, in top-level template code {% block header %} File "/home/tomaco/miniconda3/lib/python3.7/site-packages/notebook/templates/notebook.html", line 120, in block "header" {% for exporter in get_custom_frontend_exporters() %} File "/home/tomaco/miniconda3/lib/python3.7/site-packages/notebook/notebook/handlers.py", line 19, in get_custom_frontend_exporters from nbconvert.exporters.base import get_export_names, get_exporter File "/home/tomaco/miniconda3/lib/python3.7/site-packages/nbconvert/init.py", line 7, in from . import postprocessors File "/home/tomaco/miniconda3/lib/python3.7/site-packages/nbconvert/postprocessors/init.py", line 5, in from .serve import ServePostProcessor File "/home/tomaco/miniconda3/lib/python3.7/site-packages/nbconvert/postprocessors/serve.py", line 19, in class ProxyHandler(web.RequestHandler): File "/home/tomaco/miniconda3/lib/python3.7/site-packages/nbconvert/postprocessors/serve.py", line 21, in ProxyHandler @web.asynchronous AttributeError: module 'tornado.web' has no attribute 'asynchronous' [E 11:11:33.088 NotebookApp] { "Host": "localhost:8889", "User-Agent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:65.0) Gecko/20100101 Firefox/65.0", "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/;q=0.8", "Accept-Language": "en-US,en;q=0.5", "Accept-Encoding": "gzip, deflate", "Referer": "http://localhost:8889/tree", "Connection": "keep-alive", "Cookie": "username-localhost-8888=\"2|1:0|10:1551794579|23:username-localhost-8888|44:ZTk1MzkwOTllMDE4NGUzNzgzZDY5ZjgwOGNmNjViZTE=|7f62a00df85547b5b42cac6db98d77289922cfb4a8755cc795135a73d006bf05\"; _xsrf=2|137a4b91|1c0aaae8808bc56ccf4a1c8baa098486|1550987614; username-localhost-8889=\"2|1:0|10:1551795072|23:username-localhost-8889|44:OTBiNTIzNDE0NWRiNDU3MWFkMWVkNDIwZjUxMmU2NzY=|c6be722c2cb2458ea4d172e681d21f7e7465bc0c58f2176da5bd4b47fb03dcab\"; username-localhost-8890=\"2|1:0|10:1551746819|23:username-localhost-8890|44:NmFkODI0M2EyMjdhNDI2ZWIwNTJjZmNlZTRhZmFjYWU=|10d43e2ebad9ea3f4f776ce73ea197f4587945b37a0a89abfa0410926bc5f801\"; username-localhost-8891=\"2|1:0|10:1551746844|23:username-localhost-8891|44:Y2M2YmU5OGNmMmRlNGYzOGI0YmExYmUxNGY2MDgxNDc=|ff69e0c76d350cb35513a66102fc10c3dfe92f88841c622ecc88fa38ab9a2d1d\"", "Upgrade-Insecure-Requests": "1" } [E 11:11:33.088 NotebookApp] 500 GET /notebooks/Untitled13.ipynb?kernel_name=python3 (127.0.0.1) 188.11ms referer=http://localhost:8889/tree [E 11:11:57.495 NotebookApp] Exception in callback <bound method WebSocketMixin.send_ping of <notebook.terminal.handlers.TermSocket object at 0x7f91946c5668>> Traceback (most recent call last): File "/home/tomaco/miniconda3/lib/python3.7/site-packages/tornado/ioloop.py", line 907, in _run return self.callback() File "/home/tomaco/miniconda3/lib/python3.7/site-packages/notebook/base/zmqhandlers.py", line 175, in send_ping if self.stream.closed() and self.ping_callback is not None: AttributeError: 'NoneType' object has no attribute 'closed' [E 11:12:27.513 NotebookApp] Exception in callback <bound method WebSocketMixin.send_ping of <notebook.terminal.handlers.TermSocket object at 0x7f91946c5668>> Traceback (most recent call last): File "/home/tomaco/miniconda3/lib/python3.7/site-packages/tornado/ioloop.py", line 907, in _run return self.callback() File "/home/tomaco/miniconda3/lib/python3.7/site-packages/notebook/base/zmqhandlers.py", line 175, in send_ping if self.stream.closed() and self.ping_callback is not None: AttributeError: 'NoneType' object has no attribute 'closed' [E 11:12:57.523 NotebookApp] Exception in callback <bound method WebSocketMixin.send_ping of <notebook.terminal.handlers.TermSocket object at 0x7f91946c5668>> Traceback (most recent call last): File "/home/tomaco/miniconda3/lib/python3.7/site-packages/tornado/ioloop.py", line 907, in _run return self.callback() File "/home/tomaco/miniconda3/lib/python3.7/site-packages/notebook/base/zmqhandlers.py", line 175, in send_ping if self.stream.closed() and self.ping_callback is not None: AttributeError: 'NoneType' object has no attribute 'closed'

kpeeters commented 5 years ago

That first line shows that there is still a jupyter server running. Kill all jupyter related processes and then try to start a fresh one.

TCodina commented 5 years ago

Great, now the errors decreased at least :) But I still get the following error with tornado:

[I 11:49:36.965 NotebookApp] Serving notebooks from local directory: /home/tomaco [I 11:49:36.965 NotebookApp] The Jupyter Notebook is running at: [I 11:49:36.965 NotebookApp] http://localhost:8888/?token=f99d04dcf326fd3384ca71c2ccf3d276f7611e6781606ce3 [I 11:49:36.965 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation). [C 11:49:37.041 NotebookApp]

Copy/paste this URL into your browser when you connect for the first time,
to login with a token:
    http://localhost:8888/?token=f99d04dcf326fd3384ca71c2ccf3d276f7611e6781606ce3

[I 11:49:37.254 NotebookApp] Accepting one-time-token-authenticated connection from 127.0.0.1 [I 11:49:44.486 NotebookApp] Creating new notebook in [E 11:49:44.941 NotebookApp] Uncaught exception GET /notebooks/Untitled14.ipynb?kernel_name=python3 (127.0.0.1) HTTPServerRequest(protocol='http', host='localhost:8888', method='GET', uri='/notebooks/Untitled14.ipynb?kernel_name=python3', version='HTTP/1.1', remote_ip='127.0.0.1') Traceback (most recent call last): File "/home/tomaco/miniconda3/lib/python3.7/site-packages/tornado/web.py", line 1697, in _execute result = method(*self.path_args, self.path_kwargs) File "/home/tomaco/miniconda3/lib/python3.7/site-packages/tornado/web.py", line 3174, in wrapper return method(self, args, kwargs) File "/home/tomaco/miniconda3/lib/python3.7/site-packages/notebook/notebook/handlers.py", line 59, in get get_custom_frontend_exporters=get_custom_frontend_exporters File "/home/tomaco/miniconda3/lib/python3.7/site-packages/notebook/base/handlers.py", line 467, in render_template return template.render(ns) File "/home/tomaco/miniconda3/lib/python3.7/site-packages/jinja2/asyncsupport.py", line 76, in render return original_render(self, args, kwargs) File "/home/tomaco/miniconda3/lib/python3.7/site-packages/jinja2/environment.py", line 1008, in render return self.environment.handle_exception(exc_info, True) File "/home/tomaco/miniconda3/lib/python3.7/site-packages/jinja2/environment.py", line 780, in handle_exception reraise(exc_type, exc_value, tb) File "/home/tomaco/miniconda3/lib/python3.7/site-packages/jinja2/_compat.py", line 37, in reraise raise value.with_traceback(tb) File "/home/tomaco/miniconda3/lib/python3.7/site-packages/notebook/templates/notebook.html", line 1, in top-level template code {% extends "page.html" %} File "/home/tomaco/miniconda3/lib/python3.7/site-packages/notebook/templates/page.html", line 154, in top-level template code {% block header %} File "/home/tomaco/miniconda3/lib/python3.7/site-packages/notebook/templates/notebook.html", line 120, in block "header" {% for exporter in get_custom_frontend_exporters() %} File "/home/tomaco/miniconda3/lib/python3.7/site-packages/notebook/notebook/handlers.py", line 19, in get_custom_frontend_exporters from nbconvert.exporters.base import get_export_names, get_exporter File "/home/tomaco/miniconda3/lib/python3.7/site-packages/nbconvert/init.py", line 7, in from . import postprocessors File "/home/tomaco/miniconda3/lib/python3.7/site-packages/nbconvert/postprocessors/init.py", line 5, in from .serve import ServePostProcessor File "/home/tomaco/miniconda3/lib/python3.7/site-packages/nbconvert/postprocessors/serve.py", line 19, in class ProxyHandler(web.RequestHandler): File "/home/tomaco/miniconda3/lib/python3.7/site-packages/nbconvert/postprocessors/serve.py", line 21, in ProxyHandler @web.asynchronous AttributeError: module 'tornado.web' has no attribute 'asynchronous' [E 11:49:44.955 NotebookApp] { "Host": "localhost:8888", "User-Agent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:65.0) Gecko/20100101 Firefox/65.0", "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/;q=0.8", "Accept-Language": "en-US,en;q=0.5", "Accept-Encoding": "gzip, deflate", "Referer": "http://localhost:8888/tree", "Connection": "keep-alive", "Cookie": "username-localhost-8888=\"2|1:0|10:1551797377|23:username-localhost-8888|44:ZDc5OWU4NDFhNmI0NDVjNWE3YjkzMzk0NDRmMTkzMzY=|851786911a4f63b45f1e09e1557a89d9a472955a440c8e9e1bee36541bca676d\"; _xsrf=2|137a4b91|1c0aaae8808bc56ccf4a1c8baa098486|1550987614; username-localhost-8889=\"2|1:0|10:1551795072|23:username-localhost-8889|44:OTBiNTIzNDE0NWRiNDU3MWFkMWVkNDIwZjUxMmU2NzY=|c6be722c2cb2458ea4d172e681d21f7e7465bc0c58f2176da5bd4b47fb03dcab\"; username-localhost-8891=\"2|1:0|10:1551797013|23:username-localhost-8891|44:MmNmMWFkNGU0ZTZiNGIyZTg5ZWMyMzFjY2RlOTIyMGQ=|233aad6377b67251082c48e2552b8ad291287ba0d14867861b23ac6413d88830\"; username-localhost-8892=\"2|1:0|10:1551797270|23:username-localhost-8892|44:M2I0ZTczMWZhM2FmNDExMmEyNDFhMWU1YWVkODdiNzM=|6329346a8532f60ca039bdccb5d41052c6e0906e10200648ee2b791c834a1e2b\"", "Upgrade-Insecure-Requests": "1" } [E 11:49:44.955 NotebookApp] 500 GET /notebooks/Untitled14.ipynb?kernel_name=python3 (127.0.0.1) 179.55ms referer=http://localhost:8888/tree

kpeeters commented 5 years ago

Bizarre. It has nothing to do with Cadabra though, as it already fails on a normal Python3 kernel. You may want to post this on the Jupyter issue tracker to see if anyone there has an idea. A quick google for AttributeError: module 'tornado.web' has no attribute 'asynchronous' did not lead to anything very useful.

TCodina commented 5 years ago

Exactly, The problem seems to be from jupyter notebook itself. I opened a new issue at jupyter notebook github. When I manage to solve this problem I'll check if cadabra2 works inside the notebook! I read something about downgrading tornado from version 6.0 to 5.x, if that was the solution... Should I install cadabra2 from source again?

TCodina commented 5 years ago

Finally the problem was the last version of tornado (6), I fixed it just using

pip uninstall tornado; pip install tornado==5.1.1

That let me use jupyter notebook with python3 and now I have the Cadabra kernel working properly!! I just tried the schwarzschild.ipynb file and everything worked fine! Thank you so much for the help. Should I close the Issue?

kpeeters commented 5 years ago

It's still weird. Even with tornado 6 installed via pip, your conda distribution should have installed tornado 5 (which is what happened for me) and the jupyter notebook installed by conda should have picked up that version, not the one from pip. I suspect you have some paths mixed up which led to this.

But in any case, it is good that you have it working now. The Jupyter kernel is still rough around the edges, so any feedback is welcome. I'll close this issue.