{"action":"closed","issue":{"url":"https://api.github.com/repos/root-mirror/cling/issues/10","repository_url":"https://api.github.com/repos/root-mirror/cling","labels_url":"https://api.github.com/repos/root-mirror/cling/issues/10/labels{/name}","comments_url":"https://api.github.com/repos/root-mirror/cling/issues/10/comments","events_url":"https://api.github.com/repos/root-mirror/cling/issues/10/events","html_url":"https://github.com/root-mirror/cling/issues/10","id":138369131,"number":10,"title":"libclingJupyter is installed in wrong directory by CMake","user":{"login":"dabro","id":9028933,"avatar_url":"https://avatars.githubusercontent.com/u/9028933?v=3","gravatar_id":"","url":"https://api.github.com/users/dabro","html_url":"https://github.com/dabro","followers_url":"https://api.github.com/users/dabro/followers","following_url":"https://api.github.com/users/dabro/following{/other_user}","gists_url":"https://api.github.com/users/dabro/gists{/gist_id}","starred_url":"https://api.github.com/users/dabro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dabro/subscriptions","organizations_url":"https://api.github.com/users/dabro/orgs","repos_url":"https://api.github.com/users/dabro/repos","events_url":"https://api.github.com/users/dabro/events{/privacy}","received_events_url":"https://api.github.com/users/dabro/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-03-04T03:51:48Z","updated_at":"2016-07-18T20:30:06Z","closed_at":"2016-07-18T20:30:06Z","body":"After troubleshooting the following:\r\n```\r\nTraceback (most recent call last):\r\n  File \"/usr/local/bin/jupyter-cling-kernel\", line 6, in <module>\r\n    exec(compile(open(__file__).read(), __file__, 'exec'))\r\n  File \"/Users/browneej/workspace/cling/src/tools/cling/tools/Jupyter/kernel/scripts/jupyter-cling-kernel\", line 4, in <module>\r\n    main()\r\n  File \"/Users/browneej/workspace/cling/src/tools/cling/tools/Jupyter/kernel/clingkernel.py\", line 290, in main\r\n    ClingKernelApp.launch_instance()\r\n  File \"/usr/local/lib/python3.5/site-packages/traitlets/config/application.py\", line 588, in launch_instance\r\n    app.initialize(argv)\r\n  File \"<decorator-gen-122>\", line 2, in initialize\r\n  File \"/usr/local/lib/python3.5/site-packages/traitlets/config/application.py\", line 74, in catch_config_error\r\n    return method(app, *args, **kwargs)\r\n  File \"/usr/local/lib/python3.5/site-packages/ipykernel/kernelapp.py\", line 421, in initialize\r\n    self.init_kernel()\r\n  File \"/usr/local/lib/python3.5/site-packages/ipykernel/kernelapp.py\", line 360, in init_kernel\r\n    user_ns=self.user_ns,\r\n  File \"/usr/local/lib/python3.5/site-packages/traitlets/config/configurable.py\", line 404, in instance\r\n    inst = cls(*args, **kwargs)\r\n  File \"/Users/browneej/workspace/cling/src/tools/cling/tools/Jupyter/kernel/clingkernel.py\", line 87, in __init__\r\n    if not self.libclingJupyter:\r\nAttributeError: 'ClingKernel' object has no attribute 'libclingJupyter'\r\n```\r\nI found libclingJupyter.dylib in `/usr/local/lib/clang/lib/ ` instead of  `/usr/local/lib/cling/lib`, where the system expected it:\r\n```\r\ndef __init__(self, **kwargs):\r\n        super(ClingKernel, self).__init__(**kwargs)\r\n        whichCling = shutil.which('cling')\r\n        if whichCling:\r\n            clingInstDir = os.path.dirname(os.path.dirname(whichCling))\r\n            llvmResourceDir = clingInstDir\r\n        else:\r\n            raise RuntimeError('Cannot find cling in $PATH. No cling, no fun.')\r\n\r\n        for ext in ['so', 'dylib', 'dll']:\r\n            libFilename = clingInstDir + \"/lib/libclingJupyter.\" + ext\r\n            if os.access(libFilename, os.X_OK):\r\n                self.libclingJupyter = ctypes.CDLL(clingInstDir + \"/lib/libclingJupyter.\" + ext,\r\n                                                   mode = ctypes.RTLD_GLOBAL)\r\n                break\r\n\r\n        if not self.libclingJupyter:\r\n            raise RuntimeError('Cannot find ' + clingInstDir + '/lib/libclingJupyter.{so,dylib,dll}')\r\n```\r\nhttps://github.com/root-mirror/cling/blob/master/tools/Jupyter/kernel/clingkernel.py\r\nhttps://github.com/root-mirror/cling/commit/cc2ca03981c993a432942afbc31803fc8a5dc2dd\r\n\r\nfor me, either `which cling` in bash or `whichCling = shutil.which('cling')` in python return `/usr/local/lib/cling`.\r\n\r\nI installed using cmake:\r\n```\r\ncmake -DCMAKE_INSTALL_PREFIX=/usr/local/lib/cling -DLLVM_TARGETS_TO_BUILD=CppBackend\\;X86 -DCMAKE_BUILD_TYPE=Debug ../src\r\n```\r\nafter removing `CBackend\\;`\r\n"}}
{"actor":{"display_login":"karies"}}