-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rewrite building system using CMake #2154
Comments
Just one reminder that we also need to have |
Just went over a PR of hybrid Go and C code #2172 by @helinwang . In addition to a suggestion of source tree structure in my comment, I also suggest that we make sure that the generated tree in |
I am moving the content here to a Design Doc PR. |
A few months ago when we were trying to replace CMake with Bazel, @emailweixu suggested that we rewrite those handy Bazel functions using CMake. Now it seems that it's the right time to get this done, as we are facing problems from the porting of Majel and the development of new the parameter server using Go and C++.
Here are some initial thoughts. Your comments are welcome!
Required CMake Function
I think we need only the following few CMake functions to make a project description mean and clean:
_library
functions generate .a files from source code._binary
functions generate executable binary files._test
functions generate executable unit test files. They work like_binary
but links-lgtest
and-lgtest_main
.The difference between
nv_
functions andcc_
functions is that the former usenvcc
instead of the system-default C++ compiler.Both
nv_
andcc_
functions enables C++11 (-std=c++11).In addition,
external_library
.shared_library
.An Example Project
Suppose that we have aforementioned functions defined in our
/cmake
directory. The following exampleCMakeLists.txt
describes a project including the following source files:Suppose that ops.cu depends on CUDNN.
Implementation
As above example CMakeLists.txt executes, each function invocation adds "nodes" to a dependency graph. It also use this graph to generate CMake commands including
add_executable
,add_dependencies
,target_link_libraries
, andadd_test
.The text was updated successfully, but these errors were encountered: