forked from llvm/torch-mlir
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generate files per configuration & change build output directories (l…
…lvm#616) * Generate files per configuration & refer to them as such This is a step towards fully supporting multi-config generators such as VS and Xcode. Right now, the generated files as well as path to files in the project point to a single location which often does not exist unless CMAKE_BUILD_TYPE was specified on the command line which defeats the purpose of multi-config. This change does a few things: 1) Files that are generated by the build now reside in the config directory when using a multi-config generator. For example, instead of: src/ExternalUtil.hpp, when using VS or Xcode, we have: src/Debug/ExternalUtil.hpp, etc. 2) The targets that use the generated files now have an explicit dependency 3) The lit configuration now correctly refers to the binaries in the onnx-mlir build tree per configuration 4) The paths to onnx-mlir and the build directories are correct in the generated files 5) Executables now have the right extensions when they are referenced in tools and scripts 6) A couple of unnecessary variables are removed Bonus: move the CTest includes where they are needed After this change, the path to LLVM_PROJ_BIN is still not correct always since it still refers to CMAKE_BUILD_TYPE which is not always known at configuration time. This can be fixed by using find_package(LLVM) or find_package(MLIR). Using find_package is optimal, but it is a bigger change, so I am splitting it from the file generation for simplicity. The find_package(MLIR) change will be sent for review after this change (and maybe a couple more simple ones) is in. Signed-off-by: Stella Stamenova <stilis@microsoft.com> * Correctly generate the files for single generators as well Signed-off-by: Stella Stamenova <stilis@microsoft.com> * Unfortunately, generator expressions are not enough to make this work and we have to do it the hard way Signed-off-by: Stella Stamenova <stilis@microsoft.com> * Fix a copy-paste error Signed-off-by: Stella Stamenova <stilis@microsoft.com> * Fix another copy-paste error because apparently I need to learn how to copy-paste Signed-off-by: Stella Stamenova <stilis@microsoft.com> * Make all python string raw strings - on (windows) systems where the path contains short directories such as a, \a ends up being treated as a special character causing failures Signed-off-by: Stella Stamenova <stilis@microsoft.com> * Add comments to explain the usage of CMAKE_CFG_INTDIR and add it for lit as well for consistency Signed-off-by: Stella Stamenova <stilis@microsoft.com> * Don't move the ctest include It is not pertinent to the multiconfig changes and it is causing a weird issue with test generation on some platforms Signed-off-by: Stella Stamenova <stilis@microsoft.com> * After thinking through the problem some more, we can simplify the logic for the generation of the files by using generator expressions in a couple of more places including the CMAKE_*_OUTPUT_DIRECTORY properties which support generator expressions. This allows the files to be generated for each config option and then we can always reference them in that location by using CMAKE_BUILD_TYPE when dealing with a single-config generator. By making this change this way, the CMAKE_*_OUTPUT_DIRECTORY set now fully controls where all of the outputs are located which means that if we wanted to align with LLVM for the binary layout, it is a simple 3-line change. Signed-off-by: Stella Stamenova <stilis@microsoft.com> * Add comment in runtime/jni/cmakelists.txt to explain why we need to copy the file. Signed-off-by: Stella Stamenova <stilis@microsoft.com> * Set the build path for both single- and multi-config generators to contain the build mode. For example, build_dir/bin/release and build_dir/lib_release Signed-off-by: Stella Stamenova <stilis@microsoft.com> * Change the build paths for onnx-mlir from build_dir/bin/release to build_dir/release/bin Signed-off-by: Stella Stamenova <stilis@microsoft.com> Co-authored-by: Kevin O'Brien <caomhin@us.ibm.com>
- Loading branch information
1 parent
be95705
commit 24fb3a8
Showing
12 changed files
with
184 additions
and
121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
TEST_DRIVER_BUILD_PATH = "@TEST_DRIVER_BUILD_PATH@" | ||
TEST_DRIVER_COMMAND = "@TEST_DRIVER_COMMAND@" | ||
LLVM_PROJ_BUILD_PATH = "@LLVM_PROJ_BUILD@" | ||
CXX_PATH = "@CMAKE_CXX_COMPILER@" | ||
CXX_PATH = r"@CMAKE_CXX_COMPILER@" | ||
LLC_PATH = r"@LLVM_PROJ_BIN@/llc@CMAKE_EXECUTABLE_SUFFIX@" | ||
TEST_DRIVER_PATH = r"$<TARGET_FILE:onnx-mlir>" | ||
TEST_DRIVER_RUNTIME_PATH = r"@ONNX_MLIR_LIBRARY_PATH@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.