{"action":"created","issue":{"url":"https://api.github.com/repos/flow123d/flow123d/issues/183","labels_url":"https://api.github.com/repos/flow123d/flow123d/issues/183/labels{/name}","comments_url":"https://api.github.com/repos/flow123d/flow123d/issues/183/comments","events_url":"https://api.github.com/repos/flow123d/flow123d/issues/183/events","html_url":"https://github.com/flow123d/flow123d/issues/183","id":33755413,"number":183,"title":"self-conteined package with shared libraries","user":{"login":"jbrezmorf","id":326204,"avatar_url":"https://avatars.githubusercontent.com/u/326204?v=3","gravatar_id":"","url":"https://api.github.com/users/jbrezmorf","html_url":"https://github.com/jbrezmorf","followers_url":"https://api.github.com/users/jbrezmorf/followers","following_url":"https://api.github.com/users/jbrezmorf/following{/other_user}","gists_url":"https://api.github.com/users/jbrezmorf/gists{/gist_id}","starred_url":"https://api.github.com/users/jbrezmorf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbrezmorf/subscriptions","organizations_url":"https://api.github.com/users/jbrezmorf/orgs","repos_url":"https://api.github.com/users/jbrezmorf/repos","events_url":"https://api.github.com/users/jbrezmorf/events{/privacy}","received_events_url":"https://api.github.com/users/jbrezmorf/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/flow123d/flow123d/labels/Todo","name":"Todo","color":"009800"}],"state":"open","locked":false,"assignee":{"login":"x3mSpeedy","id":894428,"avatar_url":"https://avatars.githubusercontent.com/u/894428?v=3","gravatar_id":"","url":"https://api.github.com/users/x3mSpeedy","html_url":"https://github.com/x3mSpeedy","followers_url":"https://api.github.com/users/x3mSpeedy/followers","following_url":"https://api.github.com/users/x3mSpeedy/following{/other_user}","gists_url":"https://api.github.com/users/x3mSpeedy/gists{/gist_id}","starred_url":"https://api.github.com/users/x3mSpeedy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/x3mSpeedy/subscriptions","organizations_url":"https://api.github.com/users/x3mSpeedy/orgs","repos_url":"https://api.github.com/users/x3mSpeedy/repos","events_url":"https://api.github.com/users/x3mSpeedy/events{/privacy}","received_events_url":"https://api.github.com/users/x3mSpeedy/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/flow123d/flow123d/milestones/2","html_url":"https://github.com/flow123d/flow123d/milestones/release%202.0.0","labels_url":"https://api.github.com/repos/flow123d/flow123d/milestones/2/labels","id":466057,"number":2,"title":"release 2.0.0","description":"Alpha version for SUJB certification.\r\nMajor change in input interface and input file structure.\r\n* new input interface (YAML, major changes)\r\n* integration tests:\r\n\t- new structure of tests, detailed tests of all equations and their combinations\r\n\t- tests for non-physical functionalities\r\n \r\n* Physics:\r\n\t- Richards equation\r\n\t- AtmoBC\r\n* TransportDG - Reactions coupling\r\n* Heat can run with transport\r\n* fixed input structure for this major version\r\n\r\n\r\n\r\n* Library\r\n\t- parallel and block VTK output\r\n\t- continuous dofhandlers\r\n\t- improved input library\r\n\t- fixed input structure\r\n\r\n\r\n\r\n","creator":{"login":"jbrezmorf","id":326204,"avatar_url":"https://avatars.githubusercontent.com/u/326204?v=3","gravatar_id":"","url":"https://api.github.com/users/jbrezmorf","html_url":"https://github.com/jbrezmorf","followers_url":"https://api.github.com/users/jbrezmorf/followers","following_url":"https://api.github.com/users/jbrezmorf/following{/other_user}","gists_url":"https://api.github.com/users/jbrezmorf/gists{/gist_id}","starred_url":"https://api.github.com/users/jbrezmorf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbrezmorf/subscriptions","organizations_url":"https://api.github.com/users/jbrezmorf/orgs","repos_url":"https://api.github.com/users/jbrezmorf/repos","events_url":"https://api.github.com/users/jbrezmorf/events{/privacy}","received_events_url":"https://api.github.com/users/jbrezmorf/received_events","type":"User","site_admin":false},"open_issues":24,"closed_issues":69,"state":"open","created_at":"2013-10-27T17:43:09Z","updated_at":"2016-01-07T16:10:31Z","due_on":"2016-01-07T23:00:00Z","closed_at":null},"comments":4,"created_at":"2014-05-18T16:56:08Z","updated_at":"2016-01-07T16:34:05Z","closed_at":null,"body":"Make a self-contined package for Linux is problematic. We can not simply make everything static \r\n1) some libraries (python) are only shared in standard distributions\r\n2) system (gcc) libraries are shared\r\n\r\nCurrent state:\r\nWe detect shared libraries of the linked binary using 'ldd' command. \"system libraries\" determined by experimenting are put to lib/system, while other libraries are put into lib directory of the package. Moreover, we add \"$ORIGIN/../lib\" into RPATH of the flow123d binary, so the loader can find non-system libraries placed relative to the binary. If the target system has libgfortran everything seems to run smoothly as system libraries from target system are used. If libgfortran is not available we must switch to libraries placed into lib/system including loader \"ld-linux-*.so\". Then we can run binary as follows:\r\n\r\n```LD_LIBRARY_PATH=`pwd`/lib/system lib/system/ld-linux-x86-64.so bin/flow123d ```\r\n\r\n TODO:\r\n1) reconsider static linking, it could be possible with our own python build and\r\nwithout gfortran (NO OPTION)\r\n2) in order to robustly support dynamic linking we should have wrapper script of binary to run provided loader as mentioned above\r\n3) make our own build of python as a constant and controled package containing what we may need e.g. NumPy etc. (NO OPTION)"},"comment":{"url":"https://api.github.com/repos/flow123d/flow123d/issues/comments/169719748","html_url":"https://github.com/flow123d/flow123d/issues/183#issuecomment-169719748","issue_url":"https://api.github.com/repos/flow123d/flow123d/issues/183","id":169719748,"user":{"login":"jbrezmorf","id":326204,"avatar_url":"https://avatars.githubusercontent.com/u/326204?v=3","gravatar_id":"","url":"https://api.github.com/users/jbrezmorf","html_url":"https://github.com/jbrezmorf","followers_url":"https://api.github.com/users/jbrezmorf/followers","following_url":"https://api.github.com/users/jbrezmorf/following{/other_user}","gists_url":"https://api.github.com/users/jbrezmorf/gists{/gist_id}","starred_url":"https://api.github.com/users/jbrezmorf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbrezmorf/subscriptions","organizations_url":"https://api.github.com/users/jbrezmorf/orgs","repos_url":"https://api.github.com/users/jbrezmorf/repos","events_url":"https://api.github.com/users/jbrezmorf/events{/privacy}","received_events_url":"https://api.github.com/users/jbrezmorf/received_events","type":"User","site_admin":false},"created_at":"2016-01-07T16:34:04Z","updated_at":"2016-01-07T16:34:04Z","body":"Well, having ./lib/usr/lib/python* and ./lib/usr/lib64/python*\nis ugly and there is a pitfall that windows packaging tool NSIS have\nquite limited maximal path length, which was probably reason why I\nrather remove the prefix. However it seems  simple to remove /usr/lib*\nfrom every path in PYTHON_PATH, isn't it? Moreover we can not leave\nPYTHON_PATH as it is anyway, since it contains absolute paths like\n/usr/lib64/, but we need paths relative to $FLOWDIR/lib.\n\nH.\n\nOn 01/07/2016 04:03 PM, Jan Hybš wrote:\n> Issue seems to be that we are copying wrong python location.\n> CMakeLists.txt does copy\n> \n> /usr/*lib*/python2.7\n> \n> but we mainly want to copy\n> \n> /usr/*lib64*/python2.7\n> \n> The most correct way to copy *entire* python would be to copy each entry\n> from python path\n> \n> import sys\n> print '\\n'.join([path for p in sys.path if path])\n> \n> will produce list of all path *required* for python correct behavior. It\n> is also important to keep sys.path since later on we need to supply\n> correct PYTHONPATH in wrapper script.\n> Result from python call looks like this:\n> \n> |/usr/lib64/python27.zip /usr/lib64/python2.7\n> /usr/lib64/python2.7/plat-linux2 /usr/lib64/python2.7/lib-tk\n> /usr/lib64/python2.7/lib-old /usr/lib64/python2.7/lib-dynload\n> /usr/lib64/python2.7/site-packages /usr/lib/python2.7/site-packages |\n> \n> I suggest to copy every location from this list to |lib| or other folder\n> dedicated to python but keep structure to PYTHONPATH can be set\n> correctly. Structure would look like this:\n> \n> |bin | -- flow123d (wrapper) | -- flow123dbin (binary file) tests (not\n> changed) | -- ... | -- ... include (not changed) | -- deal.II | --\n> python2.7 lib | -- usr | -- lib | | -- python2.7 | | | -- site-packages\n> | -- lib64 | -- python2.7 | | -- site-packages | | -- lib-dynload | | --\n> lib-tk | | -- lib-old |\n> \n> In wrapper we would simply prepend each path entry. What do you think\n> @jbrezmorf <https://github.com/jbrezmorf> ?\n> \n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/flow123d/flow123d/issues/183#issuecomment-169687643>.\n> \n\n-- \n------------------------\nMgr. Jan Brezina, Ph. D.\nTechnical University in Liberec, New technologies institute\nhttp://www.nti.tul.cz/cz/WikiUser:Jan.Brezina\n"}}