{"action":"created","issue":{"url":"https://api.github.com/repos/Theano/Theano/issues/3556","labels_url":"https://api.github.com/repos/Theano/Theano/issues/3556/labels{/name}","comments_url":"https://api.github.com/repos/Theano/Theano/issues/3556/comments","events_url":"https://api.github.com/repos/Theano/Theano/issues/3556/events","html_url":"https://github.com/Theano/Theano/issues/3556","id":113354350,"number":3556,"title":"Compilation problem in virtualenv \"cannot find -lInclude\"","user":{"login":"dudheit314","id":5411942,"avatar_url":"https://avatars.githubusercontent.com/u/5411942?v=3","gravatar_id":"","url":"https://api.github.com/users/dudheit314","html_url":"https://github.com/dudheit314","followers_url":"https://api.github.com/users/dudheit314/followers","following_url":"https://api.github.com/users/dudheit314/following{/other_user}","gists_url":"https://api.github.com/users/dudheit314/gists{/gist_id}","starred_url":"https://api.github.com/users/dudheit314/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dudheit314/subscriptions","organizations_url":"https://api.github.com/users/dudheit314/orgs","repos_url":"https://api.github.com/users/dudheit314/repos","events_url":"https://api.github.com/users/dudheit314/events{/privacy}","received_events_url":"https://api.github.com/users/dudheit314/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-10-26T13:26:44Z","updated_at":"2015-10-26T14:52:09Z","closed_at":null,"body":"Lacking root permissions on Ubuntu 12.04 I compiled the recent Python 3.5 from source, setup a virtualenv and pip-ed Theano. \r\nWhen running ``import theano`` I get an error: ``/usr/bin/ld: cannot find -lInclude`. The flag is attached to the following compile statement:\r\n\r\n```\r\nProblem occurred during compilation with the command line below:\r\n/usr/bin/g++ -shared -g -march=corei7-avx -mcx16 -msahf -mno-movbe -maes -mpclmul -mpopcnt -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-tbm -mavx -msse4.2 -msse4.1 -mno-rdrnd -mno-f16c -mno-fsgsbase --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=20480 -mtune=generic -D NPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -m64 -fPIC -I/path/to/virtualenv/venv/lib/python3.5/site-packages/numpy/core/include -I/path/to/virtualenv/Python-3.5.0/Include -I/path/to/virtualenv/Python-3.5.0 -o /home/fgressmann/.theano/compiledir_Linux-3.2--generic-x86_64-with-debian-wheezy-sid-x86_64-3.5.0-64/lazylinker_ext/lazylinker_ext.so /home/fgressmann/.theano/compiledir_Linux-3.2--generic-x86_64-with-debian-wheezy-sid-x86_64-3.5.0-64/lazylinker_ext/mod.cpp -L/usr/local/lib -lInclude\r\n```\r\nAny ideas how to fix it?\r\n\r\nThe complete traceback:\r\n```\r\nImportError                               Traceback (most recent call last)\r\n/path/to/virtualenv/venv/lib/python3.5/site-packages/theano/gof/lazylinker_c.py in <module>()\r\n     63         if version != getattr(lazylinker_ext, '_version', None):\r\n---> 64             raise ImportError()\r\n     65 except ImportError:\r\n\r\nImportError: \r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nImportError                               Traceback (most recent call last)\r\n/path/to/virtualenv/venv/lib/python3.5/site-packages/theano/gof/lazylinker_c.py in <module>()\r\n     80             if version != getattr(lazylinker_ext, '_version', None):\r\n---> 81                 raise ImportError()\r\n     82         except ImportError:\r\n\r\nImportError: \r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nException                                 Traceback (most recent call last)\r\n<ipython-input-1-1a165bb0dd56> in <module>()\r\n      1 \r\n----> 2 import theano\r\n\r\n/path/to/virtualenv/venv/lib/python3.5/site-packages/theano/__init__.py in <module>()\r\n     53     object2, utils\r\n     54 \r\n---> 55 from theano.compile import \\\r\n     56     SymbolicInput, In, \\\r\n     57     SymbolicOutput, Out, \\\r\n\r\n/path/to/virtualenv/venv/lib/python3.5/site-packages/theano/compile/__init__.py in <module>()\r\n      7         SpecifyShape, specify_shape, register_specify_shape_c_code)\r\n      8 \r\n----> 9 from theano.compile.function_module import *\r\n     10 \r\n     11 from theano.compile.mode import *\r\n\r\n/path/to/virtualenv/venv/lib/python3.5/site-packages/theano/compile/function_module.py in <module>()\r\n     16 from theano import gof\r\n     17 from theano.compat.python2x import partial\r\n---> 18 import theano.compile.mode\r\n     19 from theano.compile.io import (\r\n     20     In, SymbolicInput, SymbolicInputKit, SymbolicOutput)\r\n\r\n/path/to/virtualenv/venv/lib/python3.5/site-packages/theano/compile/mode.py in <module>()\r\n      9 import  theano\r\n     10 from theano import gof\r\n---> 11 import theano.gof.vm\r\n     12 from theano.configparser import config, AddConfigVar, StrParam\r\n     13 from theano.compile.ops import register_view_op_c_code, _output_guard\r\n\r\n/path/to/virtualenv/venv/lib/python3.5/site-packages/theano/gof/vm.py in <module>()\r\n    566 \r\n    567 try:\r\n--> 568     from . import lazylinker_c\r\n    569 \r\n    570     class CVM(lazylinker_c.CLazyLinker, VM):\r\n\r\n/path/to/virtualenv/venv/lib/python3.5/site-packages/theano/gof/lazylinker_c.py in <module>()\r\n    114             args = cmodule.GCC_compiler.compile_args()\r\n    115             cmodule.GCC_compiler.compile_str(dirname, code, location=loc,\r\n--> 116                                              preargs=args)\r\n    117             # Save version into the __init__.py file.\r\n    118             init_py = os.path.join(loc, '__init__.py')\r\n\r\n/path/to/virtualenv/venv/lib/python3.5/site-packages/theano/gof/cmodule.py in compile_str(module_name, src_code, location, include_dirs, lib_dirs, libs, preargs, py_module)\r\n   2008             # difficult to read.\r\n   2009             raise Exception('Compilation failed (return status=%s): %s' %\r\n-> 2010                             (status, compile_stderr.replace('\\n', '. ')))\r\n   2011         elif config.cmodule.compilation_warning and compile_stderr:\r\n   2012             # Print errors just below the command line.\r\n\r\nException: Compilation failed (return status=1): /usr/bin/ld: cannot find -lInclude. collect2: ld returned 1 exit status. \r\n```\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/Theano/Theano/issues/comments/151163180","html_url":"https://github.com/Theano/Theano/issues/3556#issuecomment-151163180","issue_url":"https://api.github.com/repos/Theano/Theano/issues/3556","id":151163180,"user":{"login":"dudheit314","id":5411942,"avatar_url":"https://avatars.githubusercontent.com/u/5411942?v=3","gravatar_id":"","url":"https://api.github.com/users/dudheit314","html_url":"https://github.com/dudheit314","followers_url":"https://api.github.com/users/dudheit314/followers","following_url":"https://api.github.com/users/dudheit314/following{/other_user}","gists_url":"https://api.github.com/users/dudheit314/gists{/gist_id}","starred_url":"https://api.github.com/users/dudheit314/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dudheit314/subscriptions","organizations_url":"https://api.github.com/users/dudheit314/orgs","repos_url":"https://api.github.com/users/dudheit314/repos","events_url":"https://api.github.com/users/dudheit314/events{/privacy}","received_events_url":"https://api.github.com/users/dudheit314/received_events","type":"User","site_admin":false},"created_at":"2015-10-26T14:52:09Z","updated_at":"2015-10-26T14:52:09Z","body":"The problem seems to come from ``std_lib_dirs_and_libs()`` in ``theano/gof/cmodule.py:1567``: At line 1628 \r\n```\r\nlibname = os.path.basename(python_inc)\r\n```\r\npython_inc holds ``/path/to/local/compiled/Python-3.5.0/Include`` and therefore adds an Include"}}