diff --git a/dobuildntest.sh b/dobuildntest.sh index 001a8c87c8b..4ab318184bb 100755 --- a/dobuildntest.sh +++ b/dobuildntest.sh @@ -397,40 +397,30 @@ if [ $run_build -eq 1 ]; then cd $buildFolder extra_opts="" + if [ -n "$SW_VERSION" ]; then extra_opts+=" -DSW_VERSION=${SW_VERSION}" fi - # Add build options based on variant + if [ -n "$AIMET_VARIANT" ]; then + # Add build options based on variant if [[ "$AIMET_VARIANT" == *"gpu"* ]]; then extra_opts+=" -DENABLE_CUDA=ON" - fi - if [[ "$AIMET_VARIANT" == *"cpu"* ]]; then + elif [[ "$AIMET_VARIANT" == *"cpu"* ]]; then extra_opts+=" -DENABLE_CUDA=OFF" fi - if [[ "$AIMET_VARIANT" == *"tf"* ]]; then - extra_opts+=" -DENABLE_TENSORFLOW=ON" - fi - if [[ "$AIMET_VARIANT" == *"torch"* ]]; then - extra_opts+=" -DENABLE_TORCH=ON" - fi - if [[ "$AIMET_VARIANT" == *"onnx"* ]]; then - extra_opts+=" -DENABLE_ONNX=ON" - fi - if [[ "$AIMET_VARIANT" != *"tf"* ]]; then - extra_opts+=" -DENABLE_TENSORFLOW=OFF" - fi - if [[ "$AIMET_VARIANT" != *"torch"* ]] && [[ "$AIMET_VARIANT" != *"onnx"* ]]; then - extra_opts+=" -DENABLE_TORCH=OFF" - fi - if [[ "$AIMET_VARIANT" != *"onnx"* ]]; then - extra_opts+=" -DENABLE_ONNX=OFF" - fi if [[ "$AIMET_VARIANT" == "${variant_docs}" ]]; then - #TODO For doc variant, cmake "test" targets are NOT supported at this time - extra_opts+=" -DENABLE_TESTS=OFF" - # explicitly enable ONNX for docs variant since it is not present in variant string - extra_opts+=" -DENABLE_ONNX=ON" + # For doc variant, cmake "test" targets are NOT supported AND we need to enable all frameworks. + extra_opts+=" -DENABLE_TESTS=OFF -DENABLE_TENSORFLOW=ON -DENABLE_TORCH=ON -DENABLE_ONNX=ON" + elif [[ "$AIMET_VARIANT" == *"tf"* ]]; then + extra_opts+=" -DENABLE_TENSORFLOW=ON -DENABLE_TORCH=OFF -DENABLE_ONNX=OFF" + elif [[ "$AIMET_VARIANT" == *"torch"* ]]; then + extra_opts+=" -DENABLE_TENSORFLOW=OFF -DENABLE_TORCH=ON -DENABLE_ONNX=OFF" + elif [[ "$AIMET_VARIANT" == *"onnx"* ]]; then + extra_opts+=" -DENABLE_TENSORFLOW=OFF -DENABLE_TORCH=OFF -DENABLE_ONNX=ON" + else + echo -e "ERROR: Invalid variant string!" + exit 3 fi fi # Do not exit on failure by default from this point forward diff --git a/packaging/docker_install.md b/packaging/docker_install.md index 020bfeb6ce5..f9e1ad7f347 100644 --- a/packaging/docker_install.md +++ b/packaging/docker_install.md @@ -77,7 +77,9 @@ mkdir build && cd build # To include torch, use -DENABLE_TORCH=ON. To exclude torch, use -DENABLE_TORCH=OFF. # To include tensorflow, use -DENABLE_TENSORFLOW=ON. To exclude tensorflow, use -DENABLE_TENSORFLOW=OFF. # To include onnx, use -DENABLE_ONNX=ON. To exclude onnx, use -DENABLE_ONNX=OFF. -cmake .. -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DENABLE_CUDA=ON -DENABLE_TORCH=ON -DENABLE_TENSORFLOW=ON -DENABLE_ONNX=ON +# Add a installation location -DCMAKE_INSTALL_PREFIX="" +# Following is an example command for the Torch GPU variant with installation within the current build path. Please modify it as appropriate. +cmake .. -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DENABLE_CUDA=ON -DENABLE_TORCH=ON -DENABLE_TENSORFLOW=OFF -DENABLE_ONNX=OFF -DCMAKE_INSTALL_PREFIX="./staging/universal" make -j8 ```