{"action":"created","issue":{"url":"https://api.github.com/repos/kripken/emscripten/issues/3580","labels_url":"https://api.github.com/repos/kripken/emscripten/issues/3580/labels{/name}","comments_url":"https://api.github.com/repos/kripken/emscripten/issues/3580/comments","events_url":"https://api.github.com/repos/kripken/emscripten/issues/3580/events","html_url":"https://github.com/kripken/emscripten/issues/3580","id":91109430,"number":3580,"title":"Boost::python module issue","user":{"login":"ZengruiWang","id":11024711,"avatar_url":"https://avatars.githubusercontent.com/u/11024711?v=3","gravatar_id":"","url":"https://api.github.com/users/ZengruiWang","html_url":"https://github.com/ZengruiWang","followers_url":"https://api.github.com/users/ZengruiWang/followers","following_url":"https://api.github.com/users/ZengruiWang/following{/other_user}","gists_url":"https://api.github.com/users/ZengruiWang/gists{/gist_id}","starred_url":"https://api.github.com/users/ZengruiWang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ZengruiWang/subscriptions","organizations_url":"https://api.github.com/users/ZengruiWang/orgs","repos_url":"https://api.github.com/users/ZengruiWang/repos","events_url":"https://api.github.com/users/ZengruiWang/events{/privacy}","received_events_url":"https://api.github.com/users/ZengruiWang/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-06-26T00:15:06Z","updated_at":"2015-06-26T21:34:03Z","closed_at":null,"body":"Hi, I have a weird problem with the boost::python.\r\nWhat I am trying to do now is I create a module and call the function in the module.\r\n```javascript\r\nvoid foo(){ printf(\"foo!\"); }\r\nBOOST_PYTHON_MODULE(myfoo)\r\n{\r\n\tboost::python::def(\"foo\", foo, \"call foo!\");\r\n}\r\nint main(int argc, char** argv)\r\n{\r\n\tPy_NoSiteFlag = 1;\r\n\tPy_SetPythonHome(\"/data/Python-2.7.6/..\");\r\n\tPy_InitializeEx(0);\r\n\tboost::python::object module = boost::python::import(\"__main__\");\r\n\tprintf(\"After boost::python::import'__main__'\\n\");\r\n\tboost::python::object dict  = module.attr(\"__dict__\");\r\n\tprintf(\"After boost::python::attr'__dict__'\\n\");\r\n\tinitmyfoo();\r\n\tPyRun_SimpleString(\"import myfoo\\nmyfoo.foo()\");\r\n\treturn 0;\r\n}\r\n```\r\n\r\nI mounted the Python2.7.6 Libs into the FS which contains the following sub-directories:\r\n/include (contains `pyconfig.h`)\r\n/Lib(copied from Python-2.7.6 source code which contains a bunch of `.py` files)\r\n/libs(contains the python LLVM biccode static library)\r\n\r\nThe problem is if I don't mount the Python2.7.6 into the file system, everything is fine. It could import the myfoo module and call the foo function. But if I mount the file into the file system, it exits and shows the following message:\r\n<b>\r\npre-main prep time: 2039 ms\r\nAfter boost::python::import'__main__'\r\nAfter boost::python::attr'__dict__'\r\nexit(0) called, but noExitRuntime, so not exiting (you can use emscripten_force_exit, \r\nif you want to force a true shutdown)\r\nModule.printErr @ BoostPython.html:1245\r\nexit \t\t\t@ BoostPython.js:548143\r\ncallMain \t\t@ BoostPython.js:548090\r\ndoRun \t\t\t@ BoostPython.js:548125\r\n(anonymous function) @ BoostPython.js:548134\r\n\r\nWhat have I done wrong of mounting the python library into the file system?\r\nThank you!"},"comment":{"url":"https://api.github.com/repos/kripken/emscripten/issues/comments/115893591","html_url":"https://github.com/kripken/emscripten/issues/3580#issuecomment-115893591","issue_url":"https://api.github.com/repos/kripken/emscripten/issues/3580","id":115893591,"user":{"login":"ZengruiWang","id":11024711,"avatar_url":"https://avatars.githubusercontent.com/u/11024711?v=3","gravatar_id":"","url":"https://api.github.com/users/ZengruiWang","html_url":"https://github.com/ZengruiWang","followers_url":"https://api.github.com/users/ZengruiWang/followers","following_url":"https://api.github.com/users/ZengruiWang/following{/other_user}","gists_url":"https://api.github.com/users/ZengruiWang/gists{/gist_id}","starred_url":"https://api.github.com/users/ZengruiWang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ZengruiWang/subscriptions","organizations_url":"https://api.github.com/users/ZengruiWang/orgs","repos_url":"https://api.github.com/users/ZengruiWang/repos","events_url":"https://api.github.com/users/ZengruiWang/events{/privacy}","received_events_url":"https://api.github.com/users/ZengruiWang/received_events","type":"User","site_admin":false},"created_at":"2015-06-26T21:34:03Z","updated_at":"2015-06-26T21:34:03Z","body":"Hmm, I could make a standalone issue but since our project heavily relies on boost::python, I still hope that boost::python could work.\r\n"}}