-
Notifications
You must be signed in to change notification settings - Fork 419
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
Setup.py -- Argprase, Cmake Args, and caching #40
Conversation
…#39) The overloaded setHelp() function led to many accidents where option help was mistakenly set as global help (as seen here as well), the overload got renamed to setGlobalHelp() to avoid such mistakes.
…abitat-sim into setup-py-etw
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wonderful 👍 Tried locally with the suggested tiny change and the following command-line
python setup.py --cache-args --no-update-submodules --cmake-args="-DUSE_SYSTEM_PYBIND11=ON -DUSE_SYSTEM_ASSIMP=ON -DUSE_SYSTEM_GLFW=ON -DUSE_SYSTEM_MAGNUM=ON -DUSE_SYSTEM_EIGEN=ON" build_ext --build-temp=build-test --parallel=3
and everything went as expected. Caching for subsequent builds working well too, so the following invocation was enough next time:
python setup.py build_ext --build-temp=build-test --parallel=3
I assume the build_ext
options can't be cached that easily, right? This is already more than good enough, tho, thanks for that.
Fix builder args Co-Authored-By: Vladimír Vondruš <mosra@centrum.cz>
I’ll think about if there’s an easy way to cache the build_ext options. One thing you can do is add those to the setup.cfg as build_ext will read args from there also. |
Give that a try. I also made |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works wonders! Thank you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍 Should do wonders to improve the build experience!
* setup.py: option to don't run git submodule update if modules already exist. * setup.py: make it possible to *reduce* the amount of jobs. * Setup.py -- Argprase, Cmake Args, and caching (#40) * Argparse * --cmake-args * Caching of arguments to build_ext and argparse
* setup.py: option to don't run git submodule update if modules already exist. * setup.py: make it possible to *reduce* the amount of jobs. * Setup.py -- Argprase, Cmake Args, and caching (facebookresearch#40) * Argparse * --cmake-args * Caching of arguments to build_ext and argparse
Motivation and Context
See #38 and #36 for more context
Rewrite the arg parsing in setup.py to use
argparse
as this allows for easier extension in the future and gives a nice--help
message!Adds a command line flag for passing arguments to cmake. Note that due to
argparse
's parsing, cmake args must be assed as--cmake-args="...."
. Doing--cmake-args "...."
(no =) won't work :(This can be passed to pip via the
CMAKE_ARGS
environment variable.Adds caching of arguments passed to
setup.py
via a simplejson
file written into the build_temp dir. Arguments can be cached by adding--cache-args
to the invocation ofsetup.py
, any current argument cache is ignored. I have blacked listedforce_cmake
andcache_args
from the cache.@mosra I pointed this PR at your PR as we are both playing with things in setup.py
How Has This Been Tested
Running around and building things.
Types of changes