You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2021/03/17 06:56:32 UTC

[GitHub] [tvm] new-TonyWang opened a new pull request #7680: [BugFix][Android RPC] fix build bugs and improve android_rpc experience

new-TonyWang opened a new pull request #7680:
URL: https://github.com/apache/tvm/pull/7680


   Fix the following bugs:
   1. gradle build fail due to Execution failed for` task ':app:buildJni'. Process 'command 'sh'' finished with non-zero exit value 2`
   2. run python android_rpc_test.py and wait for so long but finally got a `Connect to x.x.x.x:5001 `failed
   3. RPCActivity may starts up not once but twice
   
   @yzhliu @eqy @tqchen 
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] liangfu commented on a change in pull request #7680: [BugFix][Android RPC] fix build bugs and improve android_rpc experience

Posted by GitBox <gi...@apache.org>.
liangfu commented on a change in pull request #7680:
URL: https://github.com/apache/tvm/pull/7680#discussion_r602141479



##########
File path: apps/android_rpc/app/src/main/jni/CMakeLists.txt
##########
@@ -0,0 +1,51 @@
+cmake_minimum_required(VERSION 3.4.1)
+
+add_library(
+        tvm4j_runtime_packed
+     
+        SHARED
+
+        IMPORTED
+        )
+
+if(${ANDROID_ABI} STREQUAL "arm64-v8a")
+    set_target_properties(
+        tvm4j_runtime_packed
+
+            PROPERTIES IMPORTED_LOCATION
+
+        ${CMAKE_SOURCE_DIR}/../obj/local/arm64-v8a/libtvm4j_runtime_packed.so
+
+)
+
+elseif(${ANDROID_ABI} STREQUAL "armeabi-v7a")
+    set_target_properties(
+            tvm4j_runtime_packed
+
+            PROPERTIES IMPORTED_LOCATION
+
+            ${CMAKE_SOURCE_DIR}/../obj/local/armeabi-v7a/libtvm4j_runtime_packed.so
+
+    )
+
+elseif(${ANDROID_ABI} STREQUAL "x86")
+set_target_properties(
+        tvm4j_runtime_packed
+
+        PROPERTIES IMPORTED_LOCATION
+
+        ${CMAKE_SOURCE_DIR}/../obj/local/x86/libtvm4j_runtime_packed.so
+
+)    
+
+elseif(${ANDROID_ABI} STREQUAL "x86_64")
+    set_target_properties(
+            tvm4j_runtime_packed

Review comment:
       please keep indentation consistent.

##########
File path: apps/android_rpc/app/build.gradle
##########
@@ -35,17 +35,31 @@ android {
         versionCode 1
         versionName "1.0"
         testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
+
+        externalNativeBuild{
+            cmake {
+                abiFilters "arm64-v8a", "armeabi-v7a","x86","x86_64"
+            }
+        }
+    

Review comment:
       please remove extra blank lines.

##########
File path: apps/android_rpc/app/src/main/jni/CMakeLists.txt
##########
@@ -0,0 +1,51 @@
+cmake_minimum_required(VERSION 3.4.1)
+
+add_library(
+        tvm4j_runtime_packed
+     
+        SHARED
+
+        IMPORTED
+        )
+
+if(${ANDROID_ABI} STREQUAL "arm64-v8a")
+    set_target_properties(
+        tvm4j_runtime_packed
+
+            PROPERTIES IMPORTED_LOCATION
+
+        ${CMAKE_SOURCE_DIR}/../obj/local/arm64-v8a/libtvm4j_runtime_packed.so
+
+)
+
+elseif(${ANDROID_ABI} STREQUAL "armeabi-v7a")
+    set_target_properties(
+            tvm4j_runtime_packed
+
+            PROPERTIES IMPORTED_LOCATION
+
+            ${CMAKE_SOURCE_DIR}/../obj/local/armeabi-v7a/libtvm4j_runtime_packed.so
+
+    )
+
+elseif(${ANDROID_ABI} STREQUAL "x86")
+set_target_properties(
+        tvm4j_runtime_packed
+
+        PROPERTIES IMPORTED_LOCATION
+
+        ${CMAKE_SOURCE_DIR}/../obj/local/x86/libtvm4j_runtime_packed.so
+
+)    
+
+elseif(${ANDROID_ABI} STREQUAL "x86_64")
+    set_target_properties(
+            tvm4j_runtime_packed
+
+            PROPERTIES IMPORTED_LOCATION
+
+            ${CMAKE_SOURCE_DIR}/../obj/local/x86_64/libtvm4j_runtime_packed.so
+
+    )
+
+endif()

Review comment:
       please add newline at EOF

##########
File path: apps/android_rpc/app/src/main/jni/CMakeLists.txt
##########
@@ -0,0 +1,51 @@
+cmake_minimum_required(VERSION 3.4.1)
+
+add_library(
+        tvm4j_runtime_packed
+     

Review comment:
       please remove extra blank lines, and some similar ones in the following.

##########
File path: apps/android_rpc/app/src/main/java/org/apache/tvm/tvmrpc/MainActivity.java
##########
@@ -69,6 +69,7 @@ public Intent updateRPCPrefs() {
     editor.putString("input_key", key);
     editor.putBoolean("input_switch", isChecked);
     editor.commit();
+    

Review comment:
       remove extra blank lines.

##########
File path: apps/android_rpc/app/.gitignore
##########
@@ -1 +1,7 @@
 /build
+/.externalNativeBuild
+/src/main/jni/org_apache_tvm_native_c_api.h
+/src/main/jni/org_apache_tvm_native_c_api.cc
+/src/main/jni/jni_helper_func.h
+/src/main/obj
+/libs

Review comment:
       please add newline at EOF

##########
File path: apps/android_rpc/app/build.gradle
##########
@@ -35,17 +35,31 @@ android {
         versionCode 1
         versionName "1.0"
         testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
+
+        externalNativeBuild{
+            cmake {
+                abiFilters "arm64-v8a", "armeabi-v7a","x86","x86_64"
+            }
+        }
+    
+
     }
     buildTypes {
         release {
             minifyEnabled false
             proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
         }
     }
-    sourceSets {
-        main {
-            jni.srcDirs = []
-            jniLibs.srcDirs = ['src/main/libs']
+    externalNativeBuild{
+        cmake {
+                path "src/main/jni/CMakeLists.txt"
+            }
+    
+        sourceSets {
+            main {
+                jni.srcDirs = []
+                //jniLibs.srcDirs = ['src/main/libs']

Review comment:
       please remove unused code.

##########
File path: apps/android_rpc/.gitignore
##########
@@ -6,4 +6,7 @@
 .DS_Store
 /build
 /captures
-.externalNativeBuild
+/.idea
+/gradlew
+/gradlew.bat
+/gradle

Review comment:
       please add newline at EOF




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] new-TonyWang commented on pull request #7680: [BugFix][Android RPC] fix build bugs and improve android_rpc experience

Posted by GitBox <gi...@apache.org>.
new-TonyWang commented on pull request #7680:
URL: https://github.com/apache/tvm/pull/7680#issuecomment-800850534


   There still remains some maven errors in jvm due to the incompatible java version and lack of jni head file paths in 'jvm/native/linux-x86_64', maybe the windows have the same error but I have no windows pc to test it. I think one  way is to require user to set a $JAVA_HOME in path, then we are able to set the jni head file paths easily.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] jroesch commented on pull request #7680: [BugFix][Android RPC] fix build bugs and improve android_rpc experience

Posted by GitBox <gi...@apache.org>.
jroesch commented on pull request #7680:
URL: https://github.com/apache/tvm/pull/7680#issuecomment-1016839369


   This PR appears to be out of date, please feel free to reopen it if this is not the case.
   
   As part of the new year we are attempting to triage the project's open pull requests to ensure that code which
   is ready for review and/or merging receives adequate attention.
   
   Thanks again for your contribution, and feel free to reach out to discuss these changes.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] jroesch closed pull request #7680: [BugFix][Android RPC] fix build bugs and improve android_rpc experience

Posted by GitBox <gi...@apache.org>.
jroesch closed pull request #7680:
URL: https://github.com/apache/tvm/pull/7680


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org