{"action":"created","issue":{"url":"https://api.github.com/repos/soumith/torch-android/issues/3","labels_url":"https://api.github.com/repos/soumith/torch-android/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/soumith/torch-android/issues/3/comments","events_url":"https://api.github.com/repos/soumith/torch-android/issues/3/events","html_url":"https://github.com/soumith/torch-android/issues/3","id":57914941,"number":3,"title":"Issue building torch-android","user":{"login":"julj","id":380531,"avatar_url":"https://avatars.githubusercontent.com/u/380531?v=3","gravatar_id":"","url":"https://api.github.com/users/julj","html_url":"https://github.com/julj","followers_url":"https://api.github.com/users/julj/followers","following_url":"https://api.github.com/users/julj/following{/other_user}","gists_url":"https://api.github.com/users/julj/gists{/gist_id}","starred_url":"https://api.github.com/users/julj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/julj/subscriptions","organizations_url":"https://api.github.com/users/julj/orgs","repos_url":"https://api.github.com/users/julj/repos","events_url":"https://api.github.com/users/julj/events{/privacy}","received_events_url":"https://api.github.com/users/julj/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2015-02-17T11:50:16Z","updated_at":"2015-06-30T14:30:51Z","closed_at":null,"body":"Hi,\r\n\r\nI'm trying to compile torch-android and get some issues.\r\n\r\nFirst I installed Torch using the instructions given [here](http://torch.ch/docs/getting-started.html#_).\r\n\r\nThen I followed the instructions given for torch-android [here](https://github.com/soumith/torch-android/blob/master/README.md).\r\n\r\nI set ANDROID_NDK_TOOLCHAIN_ROOT to my android ndk path, as specified in the instructions:\r\n\r\n```\r\n$ echo $ANDROID_NDK_TOOLCHAIN_ROOT \r\n/home/jul/Development/android-ndk-r10d\r\n```\r\n\r\nBut when running `sh build.sh` I get:\r\n\r\n`Torch-7 not found on system. Installing`\r\n\r\nprobably because the install script recommended installed Torch locally. If I remove it and let your script install it, but I get:\r\n\r\n```\r\n$sh build.sh \r\nTorch-7 not found on system. Installing.\r\nbuild.sh: 16: build.sh: [[: not found\r\nbuild.sh: 18: build.sh: [[: not found\r\nAndroid NDK found at: \r\nrm: cannot remove ‘build/CMakeCache.txt’: Permission denied\r\nrm: cannot remove ‘build/CMakeFiles/cmake.check_cache’: Permission denied\r\nCMake Warning at cmake/android.toolchain.cmake:404 (message):\r\n  Using value of obsolete variable ANDROID_NDK_TOOLCHAIN_ROOT as initial\r\n  value for ANDROID_STANDALONE_TOOLCHAIN.  Please note, that\r\n  ANDROID_NDK_TOOLCHAIN_ROOT can be completely removed in future versions of\r\n  the toolchain.\r\nCall Stack (most recent call first):\r\n  cmake/android.toolchain.cmake:506 (__INIT_VARIABLE)\r\n  /usr/share/cmake-2.8/Modules/CMakeDetermineSystem.cmake:90 (include)\r\n  CMakeLists.txt:2 (PROJECT)\r\n\r\n\r\nCMake Error at cmake/android.toolchain.cmake:429 (FILE):\r\n  file STRINGS file\r\n  \"/home/jul/Development/android-ndk-r10d/sysroot/usr/include/android/api-level.h\"\r\n  cannot be read.\r\nCall Stack (most recent call first):\r\n  cmake/android.toolchain.cmake:619 (__DETECT_NATIVE_API_LEVEL)\r\n  /usr/share/cmake-2.8/Modules/CMakeDetermineSystem.cmake:90 (include)\r\n  CMakeLists.txt:2 (PROJECT)\r\n\r\n\r\nCMake Warning at cmake/android.toolchain.cmake:444 (message):\r\n  Could not determine machine name for compiler from\r\n  /home/jul/Development/android-ndk-r10d\r\nCall Stack (most recent call first):\r\n  cmake/android.toolchain.cmake:622 (__DETECT_TOOLCHAIN_MACHINE_NAME)\r\n  /usr/share/cmake-2.8/Modules/CMakeDetermineSystem.cmake:90 (include)\r\n  CMakeLists.txt:2 (PROJECT)\r\n\r\n\r\nCMake Error at cmake/android.toolchain.cmake:624 (message):\r\n  Could not determine machine name of your toolchain.  Probably your Android\r\n  standalone toolchain is broken.\r\nCall Stack (most recent call first):\r\n  /usr/share/cmake-2.8/Modules/CMakeDetermineSystem.cmake:90 (include)\r\n  CMakeLists.txt:2 (PROJECT)\r\n\r\n\r\nCMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.\r\nMissing variable is:\r\nCMAKE_C_COMPILER_ENV_VAR\r\nCMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.\r\nMissing variable is:\r\nCMAKE_C_COMPILER\r\nCMake Error: Could not find cmake module file: /home/jul/Development/torch-android/src/build/CMakeFiles/2.8.12.2/CMakeCCompiler.cmake\r\nCMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.\r\nMissing variable is:\r\nCMAKE_CXX_COMPILER_ENV_VAR\r\nCMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.\r\nMissing variable is:\r\nCMAKE_CXX_COMPILER\r\nCMake Error: Could not find cmake module file: /home/jul/Development/torch-android/src/build/CMakeFiles/2.8.12.2/CMakeCXXCompiler.cmake\r\nCMake Error: CMAKE_C_COMPILER not set, after EnableLanguage\r\nCMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage\r\n-- Configuring incomplete, errors occurred!\r\nCMake Error: Cannot open file for write: /home/jul/Development/torch-android/src/build/CMakeCache.txt.tmp\r\nCMake Error: : System Error: Permission denied\r\nCMake Error: Unable to open cache file for save. /home/jul/Development/torch-android/src/build/CMakeCache.txt\r\nCMake Error: : System Error: Permission denied\r\nCMake error. Exiting.\r\n```\r\n\r\n\r\nand if I run it with sudo I get\r\n\r\n```\r\n$ sudo sh build.sh \r\n[sudo] password for jul: \r\nTorch-7 not found on system. Installing.\r\nbuild.sh: 16: build.sh: [[: not found\r\nbuild.sh: 18: build.sh: [[: not found\r\nAndroid NDK found at: \r\nCMake Error at cmake/android.toolchain.cmake:562 (message):\r\n  Could not find neither Android NDK nor Android standalone toolchain.\r\n\r\n      You should either set an environment variable:\r\n        export ANDROID_NDK=~/my-android-ndk\r\n      or\r\n        export ANDROID_STANDALONE_TOOLCHAIN=~/my-android-toolchain\r\n      or put the toolchain or NDK in the default path:\r\n        sudo ln -s ~/my-android-ndk /opt/android-ndk\r\n        sudo ln -s ~/my-android-toolchain /opt/android-toolchain\r\nCall Stack (most recent call first):\r\n  /usr/share/cmake-2.8/Modules/CMakeDetermineSystem.cmake:90 (include)\r\n  CMakeLists.txt:2 (PROJECT)\r\n\r\n\r\nCMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.\r\nMissing variable is:\r\nCMAKE_C_COMPILER_ENV_VAR\r\nCMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.\r\nMissing variable is:\r\nCMAKE_C_COMPILER\r\nCMake Error: Could not find cmake module file: /home/jul/Development/torch-android/src/build/CMakeFiles/2.8.12.2/CMakeCCompiler.cmake\r\nCMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.\r\nMissing variable is:\r\nCMAKE_CXX_COMPILER_ENV_VAR\r\nCMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.\r\nMissing variable is:\r\nCMAKE_CXX_COMPILER\r\nCMake Error: Could not find cmake module file: /home/jul/Development/torch-android/src/build/CMakeFiles/2.8.12.2/CMakeCXXCompiler.cmake\r\nCMake Error: CMAKE_C_COMPILER not set, after EnableLanguage\r\nCMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage\r\n-- Configuring incomplete, errors occurred!\r\nCMake error. Exiting.\r\n```\r\n\r\nCan you help?\r\n\r\nThank you"},"comment":{"url":"https://api.github.com/repos/soumith/torch-android/issues/comments/117207656","html_url":"https://github.com/soumith/torch-android/issues/3#issuecomment-117207656","issue_url":"https://api.github.com/repos/soumith/torch-android/issues/3","id":117207656,"user":{"login":"chwangaa","id":4862905,"avatar_url":"https://avatars.githubusercontent.com/u/4862905?v=3","gravatar_id":"","url":"https://api.github.com/users/chwangaa","html_url":"https://github.com/chwangaa","followers_url":"https://api.github.com/users/chwangaa/followers","following_url":"https://api.github.com/users/chwangaa/following{/other_user}","gists_url":"https://api.github.com/users/chwangaa/gists{/gist_id}","starred_url":"https://api.github.com/users/chwangaa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chwangaa/subscriptions","organizations_url":"https://api.github.com/users/chwangaa/orgs","repos_url":"https://api.github.com/users/chwangaa/repos","events_url":"https://api.github.com/users/chwangaa/events{/privacy}","received_events_url":"https://api.github.com/users/chwangaa/received_events","type":"User","site_admin":false},"created_at":"2015-06-30T14:30:51Z","updated_at":"2015-06-30T14:30:51Z","body":"Yeah, the ``bash`` and ``sh`` thing might worth a mention in the README, could save some painful time :D"}}