From 931e1f367ecd3bc454b8842b1a8babb3435980e6 Mon Sep 17 00:00:00 2001 From: archibate <1931127624@qq.com> Date: Tue, 14 Jul 2020 21:05:59 +0800 Subject: [PATCH 1/5] [cli] Remove never used 'tid' entry script --- cmake/PythonNumpyPybind11.cmake | 2 -- python/taichi/main.py | 10 +--------- setup.py | 1 - 3 files changed, 1 insertion(+), 12 deletions(-) diff --git a/cmake/PythonNumpyPybind11.cmake b/cmake/PythonNumpyPybind11.cmake index 82622c1ce247b..2e20ab3919464 100644 --- a/cmake/PythonNumpyPybind11.cmake +++ b/cmake/PythonNumpyPybind11.cmake @@ -58,9 +58,7 @@ endif() # Creating python enters file(MAKE_DIRECTORY bin) file(WRITE ${CMAKE_SOURCE_DIR}/bin/ti "#!${PYTHON_EXECUTABLE_PATH}\nimport taichi\nexit(taichi.main())") -file(WRITE ${CMAKE_SOURCE_DIR}/bin/tid "#!${PYTHON_EXECUTABLE_PATH}\nimport taichi\nexit(taichi.main(debug=True))") execute_process(COMMAND chmod +x ${CMAKE_SOURCE_DIR}/bin/ti) -execute_process(COMMAND chmod +x ${CMAKE_SOURCE_DIR}/bin/tid) execute_process(COMMAND cp ${CMAKE_SOURCE_DIR}/bin/ti ${CMAKE_SOURCE_DIR}/bin/taichi) diff --git a/python/taichi/main.py b/python/taichi/main.py index b55e32e348cbb..44613f830ad7c 100644 --- a/python/taichi/main.py +++ b/python/taichi/main.py @@ -50,7 +50,7 @@ def register(func): @registerableCLI class TaichiMain: - def __init__(self, debug: bool = False, test_mode: bool = False): + def __init__(self, test_mode: bool = False): self.banner = f"\n{'*' * 43}\n** Taichi Programming Language **\n{'*' * 43}" print(self.banner) @@ -62,9 +62,6 @@ def __init__(self, debug: bool = False, test_mode: bool = False): raise ValueError( "Environment variable TI_DEBUG can only have value 0 or 1." ) - if debug: - print(f"\n{'*' * 17} Debug Mode {'*' * 17}\n") - os.environ['TI_DEBUG'] = '1' parser = argparse.ArgumentParser(description="Taichi CLI", usage=self._usage()) @@ -1012,10 +1009,5 @@ def main(): return cli() -def main_debug(): - cli = TaichiMain(debug=True) - return cli() - - if __name__ == "__main__": sys.exit(main()) diff --git a/setup.py b/setup.py index c17629fa11bbd..de2d278084567 100644 --- a/setup.py +++ b/setup.py @@ -40,7 +40,6 @@ entry_points={ 'console_scripts': [ 'ti=taichi.main:main', - 'tid=taichi.main:main_debug', ], }, classifiers=classifiers, From cd9535ae99672edd3d8cf56518879891dc8e16af Mon Sep 17 00:00:00 2001 From: archibate <1931127624@qq.com> Date: Tue, 14 Jul 2020 21:08:04 +0800 Subject: [PATCH 2/5] /usr/bin/env python3 --- cmake/PythonNumpyPybind11.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/PythonNumpyPybind11.cmake b/cmake/PythonNumpyPybind11.cmake index 2e20ab3919464..6d32259dd7a23 100644 --- a/cmake/PythonNumpyPybind11.cmake +++ b/cmake/PythonNumpyPybind11.cmake @@ -57,7 +57,7 @@ endif() # Creating python enters file(MAKE_DIRECTORY bin) -file(WRITE ${CMAKE_SOURCE_DIR}/bin/ti "#!${PYTHON_EXECUTABLE_PATH}\nimport taichi\nexit(taichi.main())") +file(WRITE ${CMAKE_SOURCE_DIR}/bin/ti "#!/usr/bin/env python3\nimport taichi\nexit(taichi.main())") execute_process(COMMAND chmod +x ${CMAKE_SOURCE_DIR}/bin/ti) execute_process(COMMAND cp ${CMAKE_SOURCE_DIR}/bin/ti ${CMAKE_SOURCE_DIR}/bin/taichi) From 350765f6903ebf12d6ea30f7f01ad035096cc277 Mon Sep 17 00:00:00 2001 From: archibate <1931127624@qq.com> Date: Tue, 14 Jul 2020 21:22:59 +0800 Subject: [PATCH 3/5] [skip ci] why-cannot-a-non-CUDA use-ti-dist --- python/build.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/python/build.py b/python/build.py index 67399ebeb9293..d0ea9b4c24c56 100644 --- a/python/build.py +++ b/python/build.py @@ -49,10 +49,6 @@ def get_python_executable(): print('Only the wheel with clang will be released to PyPI.') sys.exit(-1) - if not gpu: - print('Linux release must ship with the CUDA backend.') - sys.exit(-1) - with open('../setup.py') as fin: with open('setup.py', 'w') as fout: project_name = 'taichi' From 4120e81fa46555241f9c135a862cdbf5ea25ea65 Mon Sep 17 00:00:00 2001 From: archibate <1931127624@qq.com> Date: Tue, 14 Jul 2020 21:58:51 +0800 Subject: [PATCH 4/5] revert to PYTHON_EXECUTABLE since it's only for dev mode --- cmake/PythonNumpyPybind11.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/PythonNumpyPybind11.cmake b/cmake/PythonNumpyPybind11.cmake index 6d32259dd7a23..24c2d799f6185 100644 --- a/cmake/PythonNumpyPybind11.cmake +++ b/cmake/PythonNumpyPybind11.cmake @@ -57,7 +57,7 @@ endif() # Creating python enters file(MAKE_DIRECTORY bin) -file(WRITE ${CMAKE_SOURCE_DIR}/bin/ti "#!/usr/bin/env python3\nimport taichi\nexit(taichi.main())") +file(WRITE ${CMAKE_SOURCE_DIR}/bin/ti "#!${PYTHON_EXECUTABLE}\nimport taichi\nexit(taichi.main())") execute_process(COMMAND chmod +x ${CMAKE_SOURCE_DIR}/bin/ti) execute_process(COMMAND cp ${CMAKE_SOURCE_DIR}/bin/ti ${CMAKE_SOURCE_DIR}/bin/taichi) From 8052909cc0d74cdbe4c6102003ff88d411eaa7c9 Mon Sep 17 00:00:00 2001 From: archibate <1931127624@qq.com> Date: Tue, 14 Jul 2020 23:46:20 +0800 Subject: [PATCH 5/5] fix typo --- cmake/PythonNumpyPybind11.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/PythonNumpyPybind11.cmake b/cmake/PythonNumpyPybind11.cmake index 24c2d799f6185..2e20ab3919464 100644 --- a/cmake/PythonNumpyPybind11.cmake +++ b/cmake/PythonNumpyPybind11.cmake @@ -57,7 +57,7 @@ endif() # Creating python enters file(MAKE_DIRECTORY bin) -file(WRITE ${CMAKE_SOURCE_DIR}/bin/ti "#!${PYTHON_EXECUTABLE}\nimport taichi\nexit(taichi.main())") +file(WRITE ${CMAKE_SOURCE_DIR}/bin/ti "#!${PYTHON_EXECUTABLE_PATH}\nimport taichi\nexit(taichi.main())") execute_process(COMMAND chmod +x ${CMAKE_SOURCE_DIR}/bin/ti) execute_process(COMMAND cp ${CMAKE_SOURCE_DIR}/bin/ti ${CMAKE_SOURCE_DIR}/bin/taichi)