{"action":"created","issue":{"url":"https://api.github.com/repos/Linuxbrew/linuxbrew/issues/875","repository_url":"https://api.github.com/repos/Linuxbrew/linuxbrew","labels_url":"https://api.github.com/repos/Linuxbrew/linuxbrew/issues/875/labels{/name}","comments_url":"https://api.github.com/repos/Linuxbrew/linuxbrew/issues/875/comments","events_url":"https://api.github.com/repos/Linuxbrew/linuxbrew/issues/875/events","html_url":"https://github.com/Linuxbrew/linuxbrew/issues/875","id":138019005,"number":875,"title":"Python not finding/compiling lots of \"necessary bits\".","user":{"login":"erigler-usgs","id":11222895,"avatar_url":"https://avatars.githubusercontent.com/u/11222895?v=3","gravatar_id":"","url":"https://api.github.com/users/erigler-usgs","html_url":"https://github.com/erigler-usgs","followers_url":"https://api.github.com/users/erigler-usgs/followers","following_url":"https://api.github.com/users/erigler-usgs/following{/other_user}","gists_url":"https://api.github.com/users/erigler-usgs/gists{/gist_id}","starred_url":"https://api.github.com/users/erigler-usgs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erigler-usgs/subscriptions","organizations_url":"https://api.github.com/users/erigler-usgs/orgs","repos_url":"https://api.github.com/users/erigler-usgs/repos","events_url":"https://api.github.com/users/erigler-usgs/events{/privacy}","received_events_url":"https://api.github.com/users/erigler-usgs/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Linuxbrew/linuxbrew/labels/build-error","name":"build-error","color":"e11d21"}],"state":"open","locked":false,"assignee":{"login":"sjackman","id":291551,"avatar_url":"https://avatars.githubusercontent.com/u/291551?v=3","gravatar_id":"","url":"https://api.github.com/users/sjackman","html_url":"https://github.com/sjackman","followers_url":"https://api.github.com/users/sjackman/followers","following_url":"https://api.github.com/users/sjackman/following{/other_user}","gists_url":"https://api.github.com/users/sjackman/gists{/gist_id}","starred_url":"https://api.github.com/users/sjackman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sjackman/subscriptions","organizations_url":"https://api.github.com/users/sjackman/orgs","repos_url":"https://api.github.com/users/sjackman/repos","events_url":"https://api.github.com/users/sjackman/events{/privacy}","received_events_url":"https://api.github.com/users/sjackman/received_events","type":"User","site_admin":false},"milestone":null,"comments":2,"created_at":"2016-03-02T22:56:54Z","updated_at":"2016-03-03T12:12:34Z","closed_at":null,"body":"This is related to my own #715, as well as #460, and similar issues...\r\n\r\nIn my attempts to (re)install Python, I quickly noticed that the zlib extension was once again failing to compile (pip won't even run without it, which is pretty much a show-stopper for me). After several unsuccessful attempts to fix this by playing with dependencies, I broke down and looked closely at the setup.py script included in the Python package. This is where Python  attempts to determine which \"necessary bits\" for building various extensions are available by looking for associated files.\r\n\r\nAs a brief explanation, Python's setup.py looks for associated header files to determine if \"necessary bits\" are available. Sometimes it also tries to ensure that the associated library file is available. It does this by parsing the CLAGS and LDFLAGS variables (not sure why the CPPFLAGS fix in #460 ever worked, but I assume it was some kind of makefile magic), and then looking for the .h or .so file in the generated list of inc_dirs and lib_dirs. Anyway, the setup.py section related to zlib was clearly looking for libz in its long list of lib_dirs, and not finding it, so it added zlib to its list of missing \"necessary bits\", which prevented it from getting compiled into Python.\r\n\r\nI was able to fix this by adding an appropriate value to ldflags in python.rb. What's more, several other previously missing \"necessary bits\" were found and compiled, including _ssl, bz2, _curses, readline, and gdbm. Python's setup.py also found _curses_panel, but failed when compiling, presumably because it couldn't find the panel.h file located in $(brew --prefix)/include/ncursesw/ (maybe this deserves a separate bug report, but I'm not currently motivated to teach myself what _curses_panel actually is...it's not something I use).\r\n\r\nLong story short, it seems necessary to define CFLAGS and/or CPPFLAGS **AND LDFLAGS** in python.rb to get many of Python's \"necessary bits\" to compile for many of its more popular extensions.\r\n"},"comment":{"url":"https://api.github.com/repos/Linuxbrew/linuxbrew/issues/comments/191728201","html_url":"https://github.com/Linuxbrew/linuxbrew/issues/875#issuecomment-191728201","issue_url":"https://api.github.com/repos/Linuxbrew/linuxbrew/issues/875","id":191728201,"user":{"login":"erigler-usgs","id":11222895,"avatar_url":"https://avatars.githubusercontent.com/u/11222895?v=3","gravatar_id":"","url":"https://api.github.com/users/erigler-usgs","html_url":"https://github.com/erigler-usgs","followers_url":"https://api.github.com/users/erigler-usgs/followers","following_url":"https://api.github.com/users/erigler-usgs/following{/other_user}","gists_url":"https://api.github.com/users/erigler-usgs/gists{/gist_id}","starred_url":"https://api.github.com/users/erigler-usgs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erigler-usgs/subscriptions","organizations_url":"https://api.github.com/users/erigler-usgs/orgs","repos_url":"https://api.github.com/users/erigler-usgs/repos","events_url":"https://api.github.com/users/erigler-usgs/events{/privacy}","received_events_url":"https://api.github.com/users/erigler-usgs/received_events","type":"User","site_admin":false},"created_at":"2016-03-03T12:12:34Z","updated_at":"2016-03-03T12:12:34Z","body":"Apologies for leaving out so much pertinent info.\r\n\r\n1) this is a fresh \"standalone\" Linuxbrew installation on a Scientific Linux 7 system (basically, CentOS);\r\n2) I am using Linux-brewed GCC (v5.3.0), with all Linux-brewed glibc, binutils, etc.;\r\n3) I do use a fake keg to access Xorg-related system libraries (a la #826);\r\n3) Here is the output from `brew config`:\r\n\r\n```\r\nHOMEBREW_VERSION: 0.9.5\r\nORIGIN: https://github.com/Linuxbrew/linuxbrew.git\r\nHEAD: 84012dc6ebdace816a086db2c851c8b25b4eefd8\r\nLast commit: 2 days ago\r\nHOMEBREW_PREFIX: /home/erigler/local\r\nHOMEBREW_REPOSITORY: /home/erigler/local/linuxbrew\r\nHOMEBREW_CELLAR: /home/erigler/local/linuxbrew/Cellar\r\nHOMEBREW_BOTTLE_DOMAIN: https://linuxbrew.bintray.com\r\nCPU: dual-core 64-bit ivybridge\r\nKernel: Linux 3.10.0-327.3.1.el7.x86_64 x86_64 GNU/Linux\r\nOS: Scientific Linux release 7.2 (Nitrogen)\r\nOS glibc: 2.17\r\nOS gcc: 4.8.5\r\nLinuxbrew glibc: 2.19\r\nLinuxbrew gcc: 5.3.0\r\nClang: N/A\r\nX11: 2.7.8 => /usr\r\nSystem Ruby: 2.3.0 => /home/erigler/local/linuxbrew/Cellar/ruby/2.3.0/bin/ruby\r\nPerl: /usr/bin/perl\r\nPython: /home/erigler/local/bin/python => /home/erigler/local/linuxbrew/Cellar/python/2.7.11/bin/python2.7\r\nRuby: /home/erigler/local/bin/ruby => /home/erigler/local/linuxbrew/Cellar/ruby/2.3.0/bin/ruby\r\nJava: openjdk version \"1.8.0_71\"\r\n```\r\n\r\nPerhaps it's already obvious to you, but the `configure` line generated by Linuxbrew contains the LDFLAGS value for `$(brew --prefix)/lib` when I set it in python.rb, and it does **NOT** contain this LDFLAGS value when I do not set it in python.rb. I can't speak to what is or is not picked up from std.rb.\r\n\r\nFinally, I am a real novice at Github. Can you guide me, or point me to some hints, on how to submit a useful PR?"}}