feat(physics): wire physx sdk into build

This commit is contained in:
2026-04-15 12:22:15 +08:00
parent 5bf258df6d
commit 31f40e2cbb
2044 changed files with 752623 additions and 1 deletions

View File

@@ -0,0 +1,419 @@
import sys
import os
import glob
import os.path
import shutil
import subprocess
import xml.etree.ElementTree
def cmakeExt():
if sys.platform == 'win32':
return '.exe'
return ''
def filterPreset(presetPath):
# If this is a file path, extract the actual preset name from XML or filename
if os.path.isfile(presetPath):
try:
presetXml = xml.etree.ElementTree.parse(presetPath).getroot()
presetName = presetXml.get('name')
except:
# Fall back to just using the basename without extension if XML parsing fails
basename = os.path.basename(presetPath)
presetName = os.path.splitext(basename)[0]
else:
# If not a file path, assume it's already a preset name
presetName = presetPath
# Platform-specific filtering
winPresetFilter = ['win','switch','crosscompile']
if sys.platform == 'win32':
# On Windows, include presets that contain win, switch, or crosscompile
# (but not windows-crosscompile)
if any((presetName.find(elem) != -1 and 'windows-crosscompile' not in presetName) for elem in winPresetFilter):
return True
else:
# On non-Windows, include Linux presets and windows-crosscompile
# Check for Linux or other Unix/macOS presets (those not containing Windows-specific terms)
# Special case: include windows-crosscompile, which is for cross-compiling Windows targets
if 'linux' in presetName.lower() or 'mac' in presetName.lower() or 'windows-crosscompile' in presetName:
return True
if all(presetName.find(elem) == -1 for elem in ['win', 'switch']):
return True
return False
def noPresetProvided(physx_root_dir):
global input
print('Preset parameter required, available presets:')
presets_dir = os.path.join(physx_root_dir, "buildtools", "presets")
internal_presets = os.path.join(presets_dir, "*.xml")
public_presets = os.path.join(presets_dir, "public", "*.xml")
# Get all XML files in the presets directory
internal_preset_files = glob.glob(internal_presets)
# Check if we have any non-directory XML files directly in presets folder
presetfiles = []
for file in internal_preset_files:
if not os.path.isdir(file): # Make sure it's a file, not a directory
basename = os.path.basename(file)
dirname = os.path.dirname(file)
if os.path.basename(dirname) != "public": # Skip files in public subdirectory
presetfiles.append(file)
# If no XML files in main presets directory, we're in public distribution
# So use the files from public directory
if len(presetfiles) == 0:
print("No presets in main folder, using public presets")
presetfiles = glob.glob(public_presets)
if len(presetfiles) == 0:
print("Error: No preset files found. Make sure the directory structure is correct.")
exit(1)
counter = 0
presetList = []
for preset in presetfiles:
if filterPreset(preset):
try:
presetXml = xml.etree.ElementTree.parse(preset).getroot()
if preset.find('user') == -1:
print('(' + str(counter) + ') ' + presetXml.get('name') +
' <--- ' + presetXml.get('comment'))
presetList.append(presetXml.get('name'))
else:
print('(' + str(counter) + ') ' + presetXml.get('name') +
'.user <--- ' + presetXml.get('comment'))
presetList.append(presetXml.get('name') + '.user')
counter = counter + 1
except Exception as e:
print(f"Warning: Could not parse preset file {preset}: {e}")
continue
if counter == 0:
print("Error: No valid presets found for this platform.")
exit(1)
# Fix Python 2.x.
try:
input = raw_input
except NameError:
pass
mode = int(eval(input('Enter preset number: ')))
return presetList[mode]
class CMakePreset:
presetName = ''
targetPlatform = ''
compiler = ''
generator = ''
cmakeSwitches = []
cmakeParams = []
def __init__(self, presetName, physx_root_dir):
xmlPath = os.path.join(physx_root_dir, "buildtools", "presets", f"{presetName}.xml")
if os.path.isfile(xmlPath):
print('Using preset xml: '+xmlPath)
else:
xmlPath = os.path.join(physx_root_dir, "buildtools", "presets", "public", f"{presetName}.xml")
if os.path.isfile(xmlPath):
print('Using preset xml: '+xmlPath)
else:
print('Preset xml file: '+xmlPath+' not found')
exit()
# get the xml
presetNode = xml.etree.ElementTree.parse(xmlPath).getroot()
self.presetName = presetNode.attrib['name']
for platform in presetNode.findall('platform'):
self.targetPlatform = platform.attrib['targetPlatform']
self.compiler = platform.attrib['compiler']
self.generator = platform.get('generator')
print('Target platform: ' + self.targetPlatform +
' using compiler: ' + self.compiler)
if self.generator is not None:
print(' using generator: ' + self.generator)
for cmakeSwitch in presetNode.find('CMakeSwitches'):
cmSwitch = '-D' + \
cmakeSwitch.attrib['name'] + '=' + \
cmakeSwitch.attrib['value'].upper()
self.cmakeSwitches.append(cmSwitch)
for cmakeParam in presetNode.find('CMakeParams'):
if cmakeParam.attrib['name'] == 'CMAKE_INSTALL_PREFIX' or cmakeParam.attrib['name'] == 'PX_OUTPUT_LIB_DIR' or cmakeParam.attrib['name'] == 'PX_OUTPUT_EXE_DIR' or cmakeParam.attrib['name'] == 'PX_OUTPUT_DLL_DIR':
cmParam = '-D' + cmakeParam.attrib['name'] + '=\"' + \
os.environ['PHYSX_ROOT_DIR'] + '/' + \
cmakeParam.attrib['value'] + '\"'
else:
cmParam = '-D' + \
cmakeParam.attrib['name'] + '=' + \
cmakeParam.attrib['value']
self.cmakeParams.append(cmParam)
pass
def isMultiConfigPlatform(self):
if self.targetPlatform == 'linux':
return False
elif self.targetPlatform == 'linuxAarch64':
return False
elif self.compiler == 'x86_64-w64-mingw32-g++':
return False
return True
def getCMakeSwitches(self):
outString = ''
# We need to check both GPU-related switches
gpuProjectsEnabled = False
gpuProjectsOnlyEnabled = False
# Define the switch names for clarity and consistency
GPU_PROJECTS_SWITCH = 'PX_GENERATE_GPU_PROJECTS'
GPU_PROJECTS_ONLY_SWITCH = 'PX_GENERATE_GPU_PROJECTS_ONLY'
# First pass: Check the state of GPU-related switches
gpu_projects_found = False
gpu_projects_only_found = False
for cmakeSwitch in self.cmakeSwitches:
# Format of cmakeSwitch is "-DSWITCH_NAME=VALUE"
# Use a more flexible approach to match switches
if f'-D{GPU_PROJECTS_SWITCH}=' in cmakeSwitch:
gpu_projects_found = True
gpuProjectsEnabled = cmakeSwitch.endswith('=TRUE')
elif f'-D{GPU_PROJECTS_ONLY_SWITCH}=' in cmakeSwitch:
gpu_projects_only_found = True
gpuProjectsOnlyEnabled = cmakeSwitch.endswith('=TRUE')
# Log the state of GPU switches for debugging
if not gpu_projects_found:
print(f"Warning: {GPU_PROJECTS_SWITCH} switch not found in preset. Defaulting to disabled.")
if not gpu_projects_only_found:
print(f"Warning: {GPU_PROJECTS_ONLY_SWITCH} switch not found in preset. Defaulting to disabled.")
# Determine if we need to add CUDA paths
gpuEnabled = gpuProjectsEnabled or gpuProjectsOnlyEnabled
# Log GPU status
print(f"GPU projects enabled: {gpuEnabled} ({GPU_PROJECTS_SWITCH}={gpuProjectsEnabled}, {GPU_PROJECTS_ONLY_SWITCH}={gpuProjectsOnlyEnabled})")
# Second pass: Add all switches to output
for cmakeSwitch in self.cmakeSwitches:
outString = outString + ' ' + cmakeSwitch
# Only add CUDA paths if GPU is enabled
if gpuEnabled:
if os.environ.get('PM_CUDA_PATH') is not None:
if os.environ.get('PM_CUDA_PATH') is not None:
outString = outString + ' -DCUDAToolkit_ROOT_DIR=' + \
os.environ['PM_CUDA_PATH']
if self.compiler in ['vc15', 'vc16', 'vc17'] and self.generator != 'ninja':
outString = outString + ' -T cuda=' + os.environ['PM_CUDA_PATH']
# TODO: Need to do the same for gcc (aarch64) when we package it with Packman
elif self.compiler == 'clang':
if os.environ.get('PM_clang_PATH') is not None:
outString = outString + ' -DCMAKE_CUDA_HOST_COMPILER=' + \
os.environ['PM_clang_PATH'] + '/bin/clang++'
return outString
def getCMakeParams(self):
outString = ''
for cmakeParam in self.cmakeParams:
outString = outString + ' ' + cmakeParam # + ' --trace'
return outString
def getPlatformCMakeParams(self):
cmake_modules_root = os.environ['PHYSX_ROOT_DIR'] + '/source/compiler/cmake/modules'
outString = ' '
vs_versions = {
'vc15': '\"Visual Studio 15 2017\"',
'vc16': '\"Visual Studio 16 2019\"',
'vc17': '\"Visual Studio 17 2022\"'
}
# Visual studio
if self.compiler in vs_versions:
generator = '-G \"Ninja Multi-Config\"' if self.generator == 'ninja' else '-G ' + vs_versions[self.compiler]
outString += generator
# Windows crosscompile
elif self.compiler == 'x86_64-w64-mingw32-g++':
outString = outString + '-G \"Ninja\"'
# mac
elif self.compiler == 'xcode':
outString = outString + '-G Xcode'
# Linux
elif self.targetPlatform in ['linux', 'linuxAarch64']:
if self.generator is not None and self.generator == 'ninja':
outString = outString + '-G \"Ninja\"'
outString = outString + ' -DCMAKE_MAKE_PROGRAM=' + os.environ['PM_ninja_PATH'] + '/ninja'
else:
outString = outString + '-G \"Unix Makefiles\"'
if self.targetPlatform == 'win64':
if self.generator != 'ninja':
outString = outString + ' -Ax64'
outString = outString + ' -DTARGET_BUILD_PLATFORM=windows'
outString = outString + ' -DPX_OUTPUT_ARCH=x86'
if self.compiler == 'x86_64-w64-mingw32-g++':
outString = outString + ' -DCMAKE_TOOLCHAIN_FILE=' + \
cmake_modules_root + '/linux/WindowsCrossToolchain.linux-unknown-x86_64.cmake'
return outString
elif self.targetPlatform == 'switch64':
outString = outString + ' -DTARGET_BUILD_PLATFORM=switch'
outString = outString + ' -DCMAKE_TOOLCHAIN_FILE=' + \
cmake_modules_root + '/switch/NX64Toolchain.txt'
outString = outString + ' -DCMAKE_GENERATOR_PLATFORM=NX64'
return outString
elif self.targetPlatform == 'linux':
outString = outString + ' -DTARGET_BUILD_PLATFORM=linux'
outString = outString + ' -DPX_OUTPUT_ARCH=x86'
if self.compiler == 'clang-crosscompile':
outString = outString + ' -DCMAKE_TOOLCHAIN_FILE=' + \
cmake_modules_root + '/linux/LinuxCrossToolchain.x86_64-unknown-linux-gnu.cmake'
outString = outString + ' -DCMAKE_MAKE_PROGRAM=' + os.environ.get('PM_MinGW_PATH') + '/bin/mingw32-make.exe'
elif self.compiler == 'clang':
if os.environ.get('PM_clang_PATH') is not None:
outString = outString + ' -DCMAKE_C_COMPILER=' + \
os.environ['PM_clang_PATH'] + '/bin/clang'
outString = outString + ' -DCMAKE_CXX_COMPILER=' + \
os.environ['PM_clang_PATH'] + '/bin/clang++'
else:
outString = outString + ' -DCMAKE_C_COMPILER=clang'
outString = outString + ' -DCMAKE_CXX_COMPILER=clang++'
return outString
elif self.targetPlatform == 'linuxAarch64':
outString = outString + ' -DTARGET_BUILD_PLATFORM=linux'
outString = outString + ' -DPX_OUTPUT_ARCH=arm'
if self.compiler == 'clang-crosscompile':
outString = outString + ' -DCMAKE_TOOLCHAIN_FILE=' + \
cmake_modules_root + '/linux/LinuxCrossToolchain.aarch64-unknown-linux-gnueabihf.cmake'
outString = outString + ' -DCMAKE_MAKE_PROGRAM=' + os.environ.get('PM_MinGW_PATH') + '/bin/mingw32-make.exe'
elif self.compiler == 'gcc':
# TODO: To change so it uses Packman's compiler. Then add it as
# host compiler for CUDA above.
outString = outString + ' -DCMAKE_TOOLCHAIN_FILE=\"' + \
cmake_modules_root + '/linux/LinuxAarch64.cmake\"'
elif self.compiler == 'clang':
if os.environ.get('PM_clang_PATH') is not None:
outString = outString + ' -DCMAKE_C_COMPILER=' + \
os.environ['PM_clang_PATH'] + '/bin/clang'
outString = outString + ' -DCMAKE_CXX_COMPILER=' + \
os.environ['PM_clang_PATH'] + '/bin/clang++'
else:
outString = outString + ' -DCMAKE_C_COMPILER=clang'
outString = outString + ' -DCMAKE_CXX_COMPILER=clang++'
return outString
elif self.targetPlatform == 'mac64':
outString = outString + ' -DTARGET_BUILD_PLATFORM=mac'
outString = outString + ' -DPX_OUTPUT_ARCH=x86'
return outString
return ''
def getCommonParams():
outString = '--no-warn-unused-cli'
outString = outString + ' -DCMAKE_PREFIX_PATH=\"' + os.environ['PM_PATHS'] + '\"'
outString = outString + ' -DPHYSX_ROOT_DIR=\"' + \
os.environ['PHYSX_ROOT_DIR'] + '\"'
outString = outString + ' -DPX_OUTPUT_LIB_DIR=\"' + \
os.environ['PHYSX_ROOT_DIR'] + '\"'
outString = outString + ' -DPX_OUTPUT_BIN_DIR=\"' + \
os.environ['PHYSX_ROOT_DIR'] + '\"'
if os.environ.get('GENERATE_SOURCE_DISTRO') == '1':
outString = outString + ' -DPX_GENERATE_SOURCE_DISTRO=1'
return outString
def cleanupCompilerDir(compilerDirName):
if os.path.exists(compilerDirName):
if sys.platform == 'win32':
os.system('rmdir /S /Q ' + compilerDirName)
else:
shutil.rmtree(compilerDirName, True)
if os.path.exists(compilerDirName) == False:
os.makedirs(compilerDirName)
def presetProvided(pName, physx_root_dir):
parsedPreset = CMakePreset(pName, physx_root_dir)
print('PM_PATHS: ' + os.environ['PM_PATHS'])
if os.environ.get('PM_cmake_PATH') is not None:
cmakeExec = os.environ['PM_cmake_PATH'] + '/bin/cmake' + cmakeExt()
else:
cmakeExec = 'cmake' + cmakeExt()
print('Cmake: ' + cmakeExec)
# gather cmake parameters
cmakeParams = parsedPreset.getPlatformCMakeParams()
cmakeParams = cmakeParams + ' ' + getCommonParams()
cmakeParams = cmakeParams + ' ' + parsedPreset.getCMakeSwitches()
cmakeParams = cmakeParams + ' ' + parsedPreset.getCMakeParams()
# print(cmakeParams)
if os.path.isfile(physx_root_dir + '/compiler/internal/CMakeLists.txt'):
cmakeMasterDir = 'internal'
else:
cmakeMasterDir = 'public'
if parsedPreset.isMultiConfigPlatform():
# cleanup and create output directory
outputDir = os.path.join(physx_root_dir, 'compiler', parsedPreset.presetName)
cleanupCompilerDir(outputDir)
# run the cmake script
#print('Cmake params:' + cmakeParams)
os.chdir(outputDir)
os.system(cmakeExec + ' \"' +
physx_root_dir + '/compiler/' + cmakeMasterDir + '\"' + cmakeParams)
os.chdir(physx_root_dir)
else:
configs = ['debug', 'checked', 'profile', 'release']
for config in configs:
# cleanup and create output directory
outputDir = os.path.join(physx_root_dir, 'compiler', parsedPreset.presetName + '-' + config)
cleanupCompilerDir(outputDir)
# run the cmake script
#print('Cmake params:' + cmakeParams)
os.chdir(outputDir)
# print(cmakeExec + ' \"' + physx_root_dir + '/compiler/' + cmakeMasterDir + '\"' + cmakeParams + ' -DCMAKE_BUILD_TYPE=' + config)
os.system(cmakeExec + ' \"' + physx_root_dir + '/compiler/' +
cmakeMasterDir + '\"' + cmakeParams + ' -DCMAKE_BUILD_TYPE=' + config)
os.chdir(physx_root_dir)
pass
def main():
if (sys.version_info[0] < 3) or (sys.version_info[0] == 3 and sys.version_info[1] < 5):
print("You are using Python {}. You must use Python 3.5 and up. Please read README.md for requirements.").format(sys.version)
exit()
physx_root_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir))
os.environ['PHYSX_ROOT_DIR'] = physx_root_dir.replace("\\", "/")
if len(sys.argv) != 2:
presetName = noPresetProvided(physx_root_dir) # Ensure this function returns the preset name
if sys.platform == 'win32':
print('Running generate_projects.bat ' + presetName)
cmd_path = os.path.join(physx_root_dir, 'generate_projects.bat')
cmd = f'"{cmd_path}" {presetName}'
result = subprocess.run(cmd, cwd=physx_root_dir, check=True, shell=True, universal_newlines=True)
# TODO: catch exception and add capture errors
else:
print('Running generate_projects.sh ' + presetName)
cmd_path = os.path.join(physx_root_dir, 'generate_projects.sh')
cmd = [cmd_path, presetName]
result = subprocess.run(cmd, cwd=physx_root_dir, check=True, universal_newlines=True)
# TODO: catch exception and add capture errors
else:
presetName = sys.argv[1]
if filterPreset(presetName):
presetProvided(presetName, physx_root_dir)
else:
print('Preset not supported on this build platform.')
main()

View File

@@ -0,0 +1,169 @@
:: Copyright 2019-2025 NVIDIA CORPORATION
::
:: Licensed under the Apache License, Version 2.0 (the "License");
:: you may not use this file except in compliance with the License.
:: You may obtain a copy of the License at
::
:: http://www.apache.org/licenses/LICENSE-2.0
::
:: Unless required by applicable law or agreed to in writing, software
:: distributed under the License is distributed on an "AS IS" BASIS,
:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
:: See the License for the specific language governing permissions and
:: limitations under the License.
set PM_PACKMAN_VERSION=7.23.1
:: Specify where packman command is rooted
set PM_INSTALL_PATH=%~dp0..
:: The external root may already be configured and we should do minimal work in that case
if defined PM_PACKAGES_ROOT goto ENSURE_DIR
:: If the folder isn't set we assume that the best place for it is on the drive that we are currently
:: running from
set PM_DRIVE=%CD:~0,2%
set PM_PACKAGES_ROOT=%PM_DRIVE%\packman-repo
:: We use *setx* here so that the variable is persisted in the user environment
echo Setting user environment variable PM_PACKAGES_ROOT to %PM_PACKAGES_ROOT%
setx PM_PACKAGES_ROOT %PM_PACKAGES_ROOT%
if %errorlevel% neq 0 ( goto ERROR )
:: The above doesn't work properly from a build step in VisualStudio because a separate process is
:: spawned for it so it will be lost for subsequent compilation steps - VisualStudio must
:: be launched from a new process. We catch this odd-ball case here:
if defined PM_DISABLE_VS_WARNING goto ENSURE_DIR
if not defined VSLANG goto ENSURE_DIR
echo The above is a once-per-computer operation. Unfortunately VisualStudio cannot pick up environment change
echo unless *VisualStudio is RELAUNCHED*.
echo If you are launching VisualStudio from command line or command line utility make sure
echo you have a fresh launch environment (relaunch the command line or utility).
echo If you are using 'linkPath' and referring to packages via local folder links you can safely ignore this warning.
echo You can disable this warning by setting the environment variable PM_DISABLE_VS_WARNING.
echo.
:: Check for the directory that we need. Note that mkdir will create any directories
:: that may be needed in the path
:ENSURE_DIR
if not exist "%PM_PACKAGES_ROOT%" (
echo Creating packman packages cache at %PM_PACKAGES_ROOT%
mkdir "%PM_PACKAGES_ROOT%"
)
if %errorlevel% neq 0 ( goto ERROR_MKDIR_PACKAGES_ROOT )
:: The Python interpreter may already be externally configured
if defined PM_PYTHON_EXT (
set PM_PYTHON=%PM_PYTHON_EXT%
goto PACKMAN
)
set PM_PYTHON_VERSION=3.10.5-1-windows-x86_64
set PM_PYTHON_BASE_DIR=%PM_PACKAGES_ROOT%\python
set PM_PYTHON_DIR=%PM_PYTHON_BASE_DIR%\%PM_PYTHON_VERSION%
set PM_PYTHON=%PM_PYTHON_DIR%\python.exe
if exist "%PM_PYTHON%" goto PACKMAN
if not exist "%PM_PYTHON_BASE_DIR%" call :CREATE_PYTHON_BASE_DIR
set PM_PYTHON_PACKAGE=python@%PM_PYTHON_VERSION%.cab
for /f "delims=" %%a in ('powershell -ExecutionPolicy ByPass -NoLogo -NoProfile -File "%~dp0\generate_temp_file_name.ps1"') do set TEMP_FILE_NAME=%%a
set TARGET=%TEMP_FILE_NAME%.zip
call "%~dp0fetch_file_from_packman_bootstrap.cmd" %PM_PYTHON_PACKAGE% "%TARGET%"
if %errorlevel% neq 0 (
echo !!! Error fetching python from CDN !!!
goto ERROR
)
for /f "delims=" %%a in ('powershell -ExecutionPolicy ByPass -NoLogo -NoProfile -File "%~dp0\generate_temp_folder.ps1" -parentPath "%PM_PYTHON_BASE_DIR%"') do set TEMP_FOLDER_NAME=%%a
echo Unpacking Python interpreter ...
"%SystemRoot%\system32\expand.exe" -F:* "%TARGET%" "%TEMP_FOLDER_NAME%" 1> nul
del "%TARGET%"
:: Failure during extraction to temp folder name, need to clean up and abort
if %errorlevel% neq 0 (
echo !!! Error unpacking python !!!
call :CLEAN_UP_TEMP_FOLDER
goto ERROR
)
:: If python has now been installed by a concurrent process we need to clean up and then continue
if exist "%PM_PYTHON%" (
call :CLEAN_UP_TEMP_FOLDER
goto PACKMAN
) else (
if exist "%PM_PYTHON_DIR%" ( rd /s /q "%PM_PYTHON_DIR%" > nul )
)
:: Perform atomic move (allowing overwrite, /y)
move /y "%TEMP_FOLDER_NAME%" "%PM_PYTHON_DIR%" 1> nul
:: Verify that python.exe is now where we expect
if exist "%PM_PYTHON%" goto PACKMAN
:: Wait a second and try again (can help with access denied weirdness)
timeout /t 1 /nobreak 1> nul
move /y "%TEMP_FOLDER_NAME%" "%PM_PYTHON_DIR%" 1> nul
if %errorlevel% neq 0 (
echo !!! Error moving python %TEMP_FOLDER_NAME% -> %PM_PYTHON_DIR% !!!
call :CLEAN_UP_TEMP_FOLDER
goto ERROR
)
:PACKMAN
:: The packman module may already be externally configured
if defined PM_MODULE_DIR_EXT (
set PM_MODULE_DIR=%PM_MODULE_DIR_EXT%
) else (
set PM_MODULE_DIR=%PM_PACKAGES_ROOT%\packman-common\%PM_PACKMAN_VERSION%
)
set PM_MODULE=%PM_MODULE_DIR%\run.py
if exist "%PM_MODULE%" goto END
:: Clean out broken PM_MODULE_DIR if it exists
if exist "%PM_MODULE_DIR%" ( rd /s /q "%PM_MODULE_DIR%" > nul )
set PM_MODULE_PACKAGE=packman-common@%PM_PACKMAN_VERSION%.zip
for /f "delims=" %%a in ('powershell -ExecutionPolicy ByPass -NoLogo -NoProfile -File "%~dp0\generate_temp_file_name.ps1"') do set TEMP_FILE_NAME=%%a
set TARGET=%TEMP_FILE_NAME%
call "%~dp0fetch_file_from_packman_bootstrap.cmd" %PM_MODULE_PACKAGE% "%TARGET%"
if %errorlevel% neq 0 (
echo !!! Error fetching packman from CDN !!!
goto ERROR
)
echo Unpacking ...
"%PM_PYTHON%" -S -s -u -E "%~dp0\install_package.py" "%TARGET%" "%PM_MODULE_DIR%"
if %errorlevel% neq 0 (
echo !!! Error unpacking packman !!!
goto ERROR
)
del "%TARGET%"
goto END
:ERROR_MKDIR_PACKAGES_ROOT
echo Failed to automatically create packman packages repo at %PM_PACKAGES_ROOT%.
echo Please set a location explicitly that packman has permission to write to, by issuing:
echo.
echo setx PM_PACKAGES_ROOT {path-you-choose-for-storing-packman-packages-locally}
echo.
echo Then launch a new command console for the changes to take effect and run packman command again.
exit /B %errorlevel%
:ERROR
echo !!! Failure while configuring local machine :( !!!
exit /B %errorlevel%
:CLEAN_UP_TEMP_FOLDER
rd /S /Q "%TEMP_FOLDER_NAME%"
exit /B
:CREATE_PYTHON_BASE_DIR
:: We ignore errors and clean error state - if two processes create the directory one will fail which is fine
md "%PM_PYTHON_BASE_DIR%" > nul 2>&1
exit /B 0
:END

View File

@@ -0,0 +1,53 @@
<#
Copyright 2019 NVIDIA CORPORATION
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
#>
param(
[Parameter(Mandatory=$true)][string]$source=$null,
[string]$output="out.exe"
)
$filename = $output
$triesLeft = 4
$delay = 2
do
{
$triesLeft -= 1
try
{
Write-Host "Downloading from bootstrap.packman.nvidia.com ..."
$wc = New-Object net.webclient
$wc.Downloadfile($source, $fileName)
exit 0
}
catch
{
Write-Host "Error downloading $source!"
Write-Host $_.Exception|format-list -force
if ($triesLeft)
{
Write-Host "Retrying in $delay seconds ..."
Start-Sleep -seconds $delay
}
$delay = $delay * $delay
}
} while ($triesLeft -gt 0)
# We only get here if the retries have been exhausted, remove any left-overs:
if (Test-Path $fileName)
{
Remove-Item $fileName
}
exit 1

View File

@@ -0,0 +1,35 @@
:: Copyright 2019 NVIDIA CORPORATION
::
:: Licensed under the Apache License, Version 2.0 (the "License");
:: you may not use this file except in compliance with the License.
:: You may obtain a copy of the License at
::
:: http://www.apache.org/licenses/LICENSE-2.0
::
:: Unless required by applicable law or agreed to in writing, software
:: distributed under the License is distributed on an "AS IS" BASIS,
:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
:: See the License for the specific language governing permissions and
:: limitations under the License.
:: You need to specify <package-name> <target-path> as input to this command
@setlocal
@set PACKAGE_NAME=%1
@set TARGET_PATH=%2
@echo Fetching %PACKAGE_NAME% ...
@powershell -ExecutionPolicy ByPass -NoLogo -NoProfile -File "%~dp0download_file_from_url.ps1" ^
-source "http://bootstrap.packman.nvidia.com/%PACKAGE_NAME%" -output %TARGET_PATH%
:: A bug in powershell prevents the errorlevel code from being set when using the -File execution option
:: We must therefore do our own failure analysis, basically make sure the file exists:
@if not exist %TARGET_PATH% goto ERROR_DOWNLOAD_FAILED
@endlocal
@exit /b 0
:ERROR_DOWNLOAD_FAILED
@echo Failed to download file from S3
@echo Most likely because endpoint cannot be reached or file %PACKAGE_NAME% doesn't exist
@endlocal
@exit /b 1

View File

@@ -0,0 +1,161 @@
<#
Copyright 2019 NVIDIA CORPORATION
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
#>
$out = [System.IO.Path]::GetTempFileName()
Write-Host $out
# SIG # Begin signature block
# MIIaVwYJKoZIhvcNAQcCoIIaSDCCGkQCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# Bg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KERpZ2lDZXJ0IFNIQTIgQXNzdXJlZCBJRCBUaW1lc3RhbXBpbmcgQ0ECEA1C
# SuC+Ooj/YEAhzhQA8N0wDQYJYIZIAWUDBAIBBQCggZgwGgYJKoZIhvcNAQkDMQ0G
# CyqGSIb3DQEJEAEEMBwGCSqGSIb3DQEJBTEPFw0yMTA0MDgwOTExMDlaMCsGCyqG
# SIb3DQEJEAIMMRwwGjAYMBYEFOHXgqjhkb7va8oWkbWqtJSmJJvzMC8GCSqGSIb3
# DQEJBDEiBCCHEAmNNj2zWjWYRfEi4FgzZvrI16kv/U2b9b3oHw6UVDANBgkqhkiG
# 9w0BAQEFAASCAQCdefEKh6Qmwx7xGCkrYi/A+/Cla6LdnYJp38eMs3fqTTvjhyDw
# HffXrwdqWy5/fgW3o3qJXqa5o7hLxYIoWSULOCpJRGdt+w7XKPAbZqHrN9elAhWJ
# vpBTCEaj7dVxr1Ka4NsoPSYe0eidDBmmvGvp02J4Z1j8+ImQPKN6Hv/L8Ixaxe7V
# mH4VtXIiBK8xXdi4wzO+A+qLtHEJXz3Gw8Bp3BNtlDGIUkIhVTM3Q1xcSEqhOLqo
# PGdwCw9acxdXNWWPjOJkNH656Bvmkml+0p6MTGIeG4JCeRh1Wpqm1ZGSoEcXNaof
# wOgj48YzI+dNqBD9i7RSWCqJr2ygYKRTxnuU
# SIG # End signature block

View File

@@ -0,0 +1,167 @@
<#
Copyright 2019 NVIDIA CORPORATION
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
#>
param(
[Parameter(Mandatory=$true)][string]$parentPath=$null
)
[string] $name = [System.Guid]::NewGuid()
$out = Join-Path $parentPath $name
New-Item -ItemType Directory -Path ($out) | Out-Null
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DVQQK
# EwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xMTAvBgNV
# BAMTKERpZ2lDZXJ0IFNIQTIgQXNzdXJlZCBJRCBUaW1lc3RhbXBpbmcgQ0ECEA1C
# SuC+Ooj/YEAhzhQA8N0wDQYJYIZIAWUDBAIBBQCggZgwGgYJKoZIhvcNAQkDMQ0G
# CyqGSIb3DQEJEAEEMBwGCSqGSIb3DQEJBTEPFw0yMTA0MDgwOTExMDlaMCsGCyqG
# SIb3DQEJEAIMMRwwGjAYMBYEFOHXgqjhkb7va8oWkbWqtJSmJJvzMC8GCSqGSIb3
# DQEJBDEiBCDvFxQ6lYLr8vB+9czUl19rjCw1pWhhUXw/SqOmvIa/VDANBgkqhkiG
# 9w0BAQEFAASCAQB9ox2UrcUXQsBI4Uycnhl4AMpvhVXJME62tygFMppW1l7QftDy
# LvfPKRYm2YUioak/APxAS6geRKpeMkLvXuQS/Jlv0kY3BjxkeG0eVjvyjF4SvXbZ
# 3JCk9m7wLNE+xqOo0ICjYlIJJgRLudjWkC5Skpb1NpPS8DOaIYwRV+AWaSOUPd9P
# O5yVcnbl7OpK3EAEtwDrybCVBMPn2MGhAXybIHnth3+MFp1b6Blhz3WlReQyarjq
# 1f+zaFB79rg6JswXoOTJhwICBP3hO2Ua3dMAswbfl+QNXF+igKLJPYnaeSVhBbm6
# VCu2io27t4ixqvoD0RuPObNX/P3oVA38afiM
# SIG # End signature block

View File

@@ -0,0 +1,172 @@
# Copyright 2019 NVIDIA CORPORATION
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import logging
import zipfile
import tempfile
import sys
import os
import stat
import time
import hashlib
from typing import Any, Callable, Union
RENAME_RETRY_COUNT = 100
RENAME_RETRY_DELAY = 0.1
logging.basicConfig(level=logging.WARNING, format="%(message)s")
logger = logging.getLogger("install_package")
def remove_directory_item(path):
if os.path.islink(path) or os.path.isfile(path):
try:
os.remove(path)
except PermissionError:
# make sure we have access and try again:
os.chmod(path, stat.S_IRWXU)
os.remove(path)
else:
# try first to delete the dir because this will work for folder junctions, otherwise we would follow the junctions and cause destruction!
clean_out_folder = False
try:
# make sure we have access preemptively - this is necessary because recursing into a directory without permissions
# will only lead to heart ache
os.chmod(path, stat.S_IRWXU)
os.rmdir(path)
except OSError:
clean_out_folder = True
if clean_out_folder:
# we should make sure the directory is empty
names = os.listdir(path)
for name in names:
fullname = os.path.join(path, name)
remove_directory_item(fullname)
# now try to again get rid of the folder - and not catch if it raises:
os.rmdir(path)
class StagingDirectory:
def __init__(self, staging_path):
self.staging_path = staging_path
self.temp_folder_path = None
os.makedirs(staging_path, exist_ok=True)
def __enter__(self):
self.temp_folder_path = tempfile.mkdtemp(prefix="ver-", dir=self.staging_path)
return self
def get_temp_folder_path(self):
return self.temp_folder_path
# this function renames the temp staging folder to folder_name, it is required that the parent path exists!
def promote_and_rename(self, folder_name):
abs_dst_folder_name = os.path.join(self.staging_path, folder_name)
os.rename(self.temp_folder_path, abs_dst_folder_name)
def __exit__(self, type, value, traceback):
# Remove temp staging folder if it's still there (something went wrong):
path = self.temp_folder_path
if os.path.isdir(path):
remove_directory_item(path)
def rename_folder(staging_dir: StagingDirectory, folder_name: str):
try:
staging_dir.promote_and_rename(folder_name)
except OSError as exc:
# if we failed to rename because the folder now exists we can assume that another packman process
# has managed to update the package before us - in all other cases we re-raise the exception
abs_dst_folder_name = os.path.join(staging_dir.staging_path, folder_name)
if os.path.exists(abs_dst_folder_name):
logger.warning(
f"Directory {abs_dst_folder_name} already present, package installation already completed"
)
else:
raise
def call_with_retry(
op_name: str, func: Callable, retry_count: int = 3, retry_delay: float = 20
) -> Any:
retries_left = retry_count
while True:
try:
return func()
except (OSError, IOError) as exc:
logger.warning(f"Failure while executing {op_name} [{str(exc)}]")
if retries_left:
retry_str = "retry" if retries_left == 1 else "retries"
logger.warning(
f"Retrying after {retry_delay} seconds"
f" ({retries_left} {retry_str} left) ..."
)
time.sleep(retry_delay)
else:
logger.error("Maximum retries exceeded, giving up")
raise
retries_left -= 1
def rename_folder_with_retry(staging_dir: StagingDirectory, folder_name):
dst_path = os.path.join(staging_dir.staging_path, folder_name)
call_with_retry(
f"rename {staging_dir.get_temp_folder_path()} -> {dst_path}",
lambda: rename_folder(staging_dir, folder_name),
RENAME_RETRY_COUNT,
RENAME_RETRY_DELAY,
)
def generate_sha256_for_file(file_path: Union[str, os.PathLike]) -> str:
"""Returns the SHA-256 hex digest for the file at `file_path`"""
hash = hashlib.sha256()
# Read the file in binary mode and update the hash object with data
with open(file_path, "rb") as file:
for chunk in iter(lambda: file.read(4096), b""):
hash.update(chunk)
return hash.hexdigest()
def install_common_module(package_path, install_path):
COMMON_SHA256 = "0a2064434cca0170411c86f23349f9618556dc380d3589a2361db38ffeea9cac"
package_sha256 = generate_sha256_for_file(package_path)
if package_sha256 != COMMON_SHA256:
raise RuntimeError(
f"Package at '{package_path}' must have a sha256 of '{COMMON_SHA256}' "
f"but was found to have '{package_sha256}'"
)
staging_path, version = os.path.split(install_path)
with StagingDirectory(staging_path) as staging_dir:
output_folder = staging_dir.get_temp_folder_path()
with zipfile.ZipFile(package_path, allowZip64=True) as zip_file:
zip_file.extractall(output_folder)
# attempt the rename operation
rename_folder_with_retry(staging_dir, version)
print(f"Package successfully installed to {install_path}")
if __name__ == "__main__":
executable_paths = os.getenv("PATH")
paths_list = executable_paths.split(os.path.pathsep) if executable_paths else []
target_path_np = os.path.normpath(sys.argv[2])
target_path_np_nc = os.path.normcase(target_path_np)
for exec_path in paths_list:
if os.path.normcase(os.path.normpath(exec_path)) == target_path_np_nc:
raise RuntimeError(f"packman will not install to executable path '{exec_path}'")
install_common_module(sys.argv[1], target_path_np)

View File

@@ -0,0 +1,9 @@
<config remotes="cloudfront urm">
<remote2 name="cloudfront">
<transport actions="download" protocol="https" packageLocation="d4i3qtqj3r0z5.cloudfront.net/${name}@${version}" />
</remote2>
<remote2 name="urm">
<transport actions="download" protocol="https" packageLocation="urm.nvidia.com/artifactory/ct-omniverse-generic/pkgs/${name}/${name}@${version}" />
<transport actions="list" protocol="http" packageLocation="omnipackages.nvidia.com/api/v1/list/artifactory" />
</remote2>
</config>

View File

@@ -0,0 +1,192 @@
#!/bin/bash
# Copyright 2019-2025 NVIDIA CORPORATION
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
SAVED_SETTINGS="$-"
set -eu
if echo ${PM_VERBOSITY-} | grep -i "debug" > /dev/null ; then
set -x
PM_CURL_SILENT=""
PM_WGET_QUIET=""
else
PM_CURL_SILENT="-s -S"
PM_WGET_QUIET="--quiet"
fi
export PM_PACKMAN_VERSION=7.23.1
# This is necessary for newer macOS
if [ `uname` == 'Darwin' ]; then
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
fi
# We cannot rely on realpath, it isn't installed on macOS and some Linux distros
get_abs_filename() {
echo "$(cd "$(dirname "$1")" && pwd)/$(basename "$1")"
}
# Specify where packman command exists
export PM_INSTALL_PATH="$(get_abs_filename "$(dirname "${BASH_SOURCE}")")"
# The packages root may already be configured by the user
if [ -z "${PM_PACKAGES_ROOT:-}" ]; then
# Set variable temporarily in this process so that the following execution will work
if [ `uname` == 'Darwin' ]; then
export PM_PACKAGES_ROOT="${HOME}/Library/Application Support/packman-cache"
else
if [ -z "${XDG_CACHE_HOME:-}" ]; then
export PM_PACKAGES_ROOT="${HOME}/.cache/packman"
else
export PM_PACKAGES_ROOT="${XDG_CACHE_HOME}/packman"
fi
fi
fi
# Ensure the packages root path exists:
if [ ! -d "$PM_PACKAGES_ROOT" ]; then
echo "Creating packman packages cache at $PM_PACKAGES_ROOT"
mkdir -p -m a+rwx "$PM_PACKAGES_ROOT"
fi
fetch_file_from_s3()
{
SOURCE=$1
SOURCE_URL=http://bootstrap.packman.nvidia.com/$SOURCE
TARGET=$2
echo "Fetching $SOURCE from bootstrap.packman.nvidia.com ..."
if command -v wget >/dev/null 2>&1; then
wget $PM_WGET_QUIET -O$TARGET $SOURCE_URL
else
curl -o $TARGET $SOURCE_URL $PM_CURL_SILENT
fi
}
generate_temp_file_name()
{
if [ `uname` == "Darwin" ]; then
local tmpfile=`mktemp -t packman`
else
local tmpfile=`mktemp -t packman.XXXXXXXX`
fi
echo "$tmpfile"
}
install_python()
{
PLATFORM=`uname`
PROCESSOR=`uname -m`
PYTHON_VERSION=3.10.5-1
if [ $PLATFORM == 'Darwin' ]; then
PYTHON_PACKAGE=$PYTHON_VERSION-macos-x86_64
elif [ $PLATFORM == 'Linux' ] && [ $PROCESSOR == 'x86_64' ]; then
PYTHON_PACKAGE=$PYTHON_VERSION-linux-x86_64
elif [ $PLATFORM == 'Linux' ] && [ $PROCESSOR == 'aarch64' ]; then
PYTHON_PACKAGE=$PYTHON_VERSION-linux-aarch64
else
echo "Operating system not supported"
exit 1
fi
PYTHON_INSTALL_FOLDER="$PM_PACKAGES_ROOT/python/$PYTHON_PACKAGE"
if [ ! -d "$PYTHON_INSTALL_FOLDER" ]; then
mkdir -p "$PYTHON_INSTALL_FOLDER"
fi
export PM_PYTHON="$PYTHON_INSTALL_FOLDER/python"
if [ ! -f "$PM_PYTHON" ]; then
PYTHON_PACKAGE_TMP=$(generate_temp_file_name)
fetch_file_from_s3 "python@$PYTHON_PACKAGE.tar.gz" "$PYTHON_PACKAGE_TMP"
if [ "$?" -eq "0" ]; then
echo "Unpacking python"
tar -xf "$PYTHON_PACKAGE_TMP" -C "$PYTHON_INSTALL_FOLDER"
rm "$PYTHON_PACKAGE_TMP"
else
echo "Failed downloading the Python interpreter"
exit $?
fi
fi
}
# Ensure python is available:
if [ -z "${PM_PYTHON_EXT:-}" ]; then
install_python
else
PM_PYTHON="$PM_PYTHON_EXT"
fi
# The packman module may be externally configured
if [ -z "${PM_MODULE_DIR_EXT:-}" ]; then
PM_MODULE_DIR="$PM_PACKAGES_ROOT/packman-common/$PM_PACKMAN_VERSION"
else
PM_MODULE_DIR="$PM_MODULE_DIR_EXT"
fi
export PM_MODULE="$PM_MODULE_DIR/run.py"
# Ensure the packman package exists:
if [ ! -f "$PM_MODULE" ]; then
# Remove a previously corrupt packman-common if it's there
if [ -d "$PM_MODULE_DIR" ]; then
rm -rf "$PM_MODULE_DIR"
fi
PM_MODULE_PACKAGE="packman-common@$PM_PACKMAN_VERSION.zip"
TARGET=$(generate_temp_file_name)
# We always fetch packman from S3:
fetch_file_from_s3 "$PM_MODULE_PACKAGE" "$TARGET"
if [ "$?" -eq "0" ]; then
echo "Unpacking ..."
"$PM_PYTHON" -S -s -u -E "$PM_INSTALL_PATH/bootstrap/install_package.py" "$TARGET" "$PM_MODULE_DIR"
rm "$TARGET"
else
echo "Failure while fetching packman module from S3!"
exit 1
fi
fi
# Generate temporary file name for environment variables:
PM_VAR_PATH=`mktemp -u -t tmp.$$.pmvars.XXXXXX`
if [ $# -ne 0 ]
then
PM_VAR_PATH_ARG=--var-path="$PM_VAR_PATH"
fi
"$PM_PYTHON" -S -s -u -E "$PM_MODULE" "$@" ${PM_VAR_PATH_ARG:-}
exit_code=$?
# Export the variables if the file was used and remove the file:
if [ -f "$PM_VAR_PATH" ]; then
while read -r line
do
if [ ${#line} -gt 0 ]; then
export "$line"
fi
done < "$PM_VAR_PATH"
rm -f "$PM_VAR_PATH"
fi
# avoid leaking -e and -u into the host script if they weren't originally set
if [[ ! ( "$SAVED_SETTINGS" =~ e ) ]]; then
set +e
fi
if [[ ! ( "$SAVED_SETTINGS" =~ u ) ]]; then
set +u
fi
# Return the exit code from python
if [ "$exit_code" != 0 ]; then
exit "$exit_code"
fi

View File

@@ -0,0 +1,89 @@
:: RUN_PM_MODULE must always be at the same spot for packman update to work (batch reloads file during update!)
:: [xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx]
:: Reset errorlevel status (don't inherit from caller)
@call :ECHO_AND_RESET_ERROR
:: You can remove this section if you do your own manual configuration of the dev machines
call :CONFIGURE
if %errorlevel% neq 0 ( exit /b %errorlevel% )
:: Everything below is mandatory
if not defined PM_PYTHON goto :PYTHON_ENV_ERROR
if not defined PM_MODULE goto :MODULE_ENV_ERROR
set PM_VAR_PATH_ARG=
if "%1"=="pull" goto :SET_VAR_PATH
if "%1"=="install" goto :SET_VAR_PATH
:RUN_PM_MODULE
"%PM_PYTHON%" -S -s -u -E "%PM_MODULE%" %* %PM_VAR_PATH_ARG%
if %errorlevel% neq 0 ( exit /b %errorlevel% )
:: Marshall environment variables into the current environment if they have been generated and remove temporary file
if exist "%PM_VAR_PATH%" (
for /F "usebackq tokens=*" %%A in ("%PM_VAR_PATH%") do set "%%A"
)
if %errorlevel% neq 0 ( goto :VAR_ERROR )
if exist "%PM_VAR_PATH%" (
del /F "%PM_VAR_PATH%"
)
if %errorlevel% neq 0 ( goto :VAR_ERROR )
set PM_VAR_PATH=
goto :eof
:: Subroutines below
:PYTHON_ENV_ERROR
@echo User environment variable PM_PYTHON is not set! Please configure machine for packman or call configure.bat.
exit /b 1
:MODULE_ENV_ERROR
@echo User environment variable PM_MODULE is not set! Please configure machine for packman or call configure.bat.
exit /b 1
:VAR_ERROR
@echo Error while processing and setting environment variables!
exit /b 1
:: pad [xxxx]
:ECHO_AND_RESET_ERROR
@echo off
if /I "%PM_VERBOSITY%"=="debug" (
@echo on
)
exit /b 0
:SET_VAR_PATH
:: Generate temporary path for variable file
for /f "delims=" %%a in ('%PM_PYTHON% -S -s -u -E -c "import tempfile;file = tempfile.NamedTemporaryFile(mode='w+t', delete=False);print(file.name)"') do (set PM_VAR_PATH=%%a)
set PM_VAR_PATH_ARG=--var-path="%PM_VAR_PATH%"
goto :RUN_PM_MODULE
:CONFIGURE
:: Must capture and set code page to work around issue #279, powershell invocation mutates console font
:: This issue only happens in Windows CMD shell when using 65001 code page. Some Git Bash implementations
:: don't support chcp so this workaround is a bit convoluted.
:: Test for chcp:
chcp > nul 2>&1
if %errorlevel% equ 0 (
for /f "tokens=2 delims=:" %%a in ('chcp') do (set PM_OLD_CODE_PAGE=%%a)
) else (
call :ECHO_AND_RESET_ERROR
)
:: trim leading space (this is safe even when PM_OLD_CODE_PAGE has not been set)
set PM_OLD_CODE_PAGE=%PM_OLD_CODE_PAGE:~1%
if "%PM_OLD_CODE_PAGE%" equ "65001" (
chcp 437 > nul
set PM_RESTORE_CODE_PAGE=1
)
call "%~dp0\bootstrap\configure.bat"
set PM_CONFIG_ERRORLEVEL=%errorlevel%
if defined PM_RESTORE_CODE_PAGE (
:: Restore code page
chcp %PM_OLD_CODE_PAGE% > nul
)
set PM_OLD_CODE_PAGE=
set PM_RESTORE_CODE_PAGE=
exit /b %PM_CONFIG_ERRORLEVEL%

View File

@@ -0,0 +1,32 @@
:: Copyright 2019-2025 NVIDIA CORPORATION
::
:: Licensed under the Apache License, Version 2.0 (the "License");
:: you may not use this file except in compliance with the License.
:: You may obtain a copy of the License at
::
:: http://www.apache.org/licenses/LICENSE-2.0
::
:: Unless required by applicable law or agreed to in writing, software
:: distributed under the License is distributed on an "AS IS" BASIS,
:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
:: See the License for the specific language governing permissions and
:: limitations under the License.
@echo off
setlocal enableextensions
call "%~dp0\packman" init
set "PYTHONPATH=%PM_MODULE_DIR%;%PYTHONPATH%"
if not defined PYTHONNOUSERSITE (
set PYTHONNOUSERSITE=1
)
REM For performance, default to unbuffered; however, allow overriding via
REM PYTHONUNBUFFERED=0 since PYTHONUNBUFFERED on windows can truncate output
REM when printing long strings
if not defined PYTHONUNBUFFERED (
set PYTHONUNBUFFERED=1
)
"%PM_PYTHON%" %*

View File

@@ -0,0 +1,42 @@
#!/bin/bash
# Copyright 2019-2025 NVIDIA CORPORATION
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set -e
PACKMAN_CMD="$(dirname "${BASH_SOURCE}")/packman"
if [ ! -f "$PACKMAN_CMD" ]; then
PACKMAN_CMD="${PACKMAN_CMD}.sh"
fi
source "$PACKMAN_CMD" init
export PYTHONPATH="${PM_MODULE_DIR}:${PYTHONPATH}"
if [ -z "${PYTHONNOUSERSITE:-}" ]; then
export PYTHONNOUSERSITE=1
fi
# For performance, default to unbuffered; however, allow overriding via
# PYTHONUNBUFFERED=0 since PYTHONUNBUFFERED on windows can truncate output
# when printing long strings
if [ -z "${PYTHONUNBUFFERED:-}" ]; then
export PYTHONUNBUFFERED=1
fi
# workaround for our python not shipping with certs
if [[ -z ${SSL_CERT_DIR:-} ]]; then
export SSL_CERT_DIR=/etc/ssl/certs/
fi
"${PM_PYTHON}" "$@"

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<preset name="linux-aarch64-clang-cpu-only" comment="Linux-aarch64 clang PhysX SDK general settings (cpu only)">
<platform targetPlatform="linuxAarch64" compiler="clang" />
<CMakeSwitches>
<cmakeSwitch name="PX_BUILDSNIPPETS" value="True" comment="Generate the snippets" />
<cmakeSwitch name="PX_BUILDPVDRUNTIME" value="True" comment="Generate the OmniPVD project" />
<cmakeSwitch name="PX_GENERATE_STATIC_LIBRARIES" value="True" comment="Generate static libs" />
</CMakeSwitches>
<CMakeParams>
<cmakeParam name="CMAKE_INSTALL_PREFIX" value="install/linux-aarch64-clang-cpu-only/PhysX" comment="Install path relative to PhysX SDK root" />
</CMakeParams>
</preset>

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<preset name="linux-aarch64-clang" comment="Linux-aarch64 clang PhysX SDK general settings">
<platform targetPlatform="linuxAarch64" compiler="clang" />
<CMakeSwitches>
<cmakeSwitch name="PX_BUILDSNIPPETS" value="True" comment="Generate the snippets" />
<cmakeSwitch name="PX_BUILDPVDRUNTIME" value="True" comment="Generate the OmniPVD project" />
<cmakeSwitch name="PX_GENERATE_STATIC_LIBRARIES" value="True" comment="Generate static libs" />
<cmakeSwitch name="PX_GENERATE_GPU_PROJECTS" value="True" comment="Generate the GPU projects, if possible." />
<cmakeSwitch name="PX_GENERATE_GPU_PROJECTS_ONLY" value="False" comment="Generate ONLY the GPU projects, if possible." />
<cmakeSwitch name="PX_SCALAR_MATH" value="False" comment="Disable SIMD math" />
<cmakeSwitch name="NV_USE_STATIC_WINCRT" value="True" comment="Use the statically linked windows CRT" />
<cmakeSwitch name="NV_USE_DEBUG_WINCRT" value="True" comment="Use the debug version of the CRT" />
<cmakeSwitch name="PX_FLOAT_POINT_PRECISE_MATH" value="False" comment="Float point precise math" />
<cmakeSwitch name="PX_GENERATE_GPU_STATIC_LIBRARIES" value="False" comment="Generate PhysXGPU static libraries" />
<cmakeSwitch name="PX_GENERATE_GPU_REDUCED_ARCHITECTURES" value="False" comment="Generate only a reduced number of GPU architectures for faster compilation" />
</CMakeSwitches>
<CMakeParams>
<cmakeParam name="CMAKE_INSTALL_PREFIX" value="install/linux-aarch64-clang/PhysX" comment="Install path relative to PhysX SDK root" />
</CMakeParams>
</preset>

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<preset name="linux-aarch64-gcc-cpu-only" comment="Linux-aarch64 gcc PhysX SDK general settings (cpu only)">
<platform targetPlatform="linuxAarch64" compiler="gcc" />
<CMakeSwitches>
<cmakeSwitch name="PX_BUILDSNIPPETS" value="True" comment="Generate the snippets" />
<cmakeSwitch name="PX_BUILDPVDRUNTIME" value="True" comment="Generate the OmniPVD project" />
<cmakeSwitch name="PX_GENERATE_STATIC_LIBRARIES" value="True" comment="Generate static libs" />
</CMakeSwitches>
<CMakeParams>
<cmakeParam name="CMAKE_INSTALL_PREFIX" value="install/linux-aarch64-gcc-cpu-only/PhysX" comment="Install path relative to PhysX SDK root" />
</CMakeParams>
</preset>

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<preset name="linux-aarch64-gcc" comment="Linux-aarch64 gcc PhysX SDK general settings">
<platform targetPlatform="linuxAarch64" compiler="gcc" />
<CMakeSwitches>
<cmakeSwitch name="PX_BUILDSNIPPETS" value="True" comment="Generate the snippets" />
<cmakeSwitch name="PX_BUILDPVDRUNTIME" value="True" comment="Generate the OmniPVD project" />
<cmakeSwitch name="PX_GENERATE_STATIC_LIBRARIES" value="True" comment="Generate static libs" />
<cmakeSwitch name="PX_GENERATE_GPU_PROJECTS" value="True" comment="Generate the GPU projects, if possible." />
<cmakeSwitch name="PX_GENERATE_GPU_PROJECTS_ONLY" value="False" comment="Generate ONLY the GPU projects, if possible." />
<cmakeSwitch name="PX_SCALAR_MATH" value="False" comment="Disable SIMD math" />
<cmakeSwitch name="NV_USE_STATIC_WINCRT" value="True" comment="Use the statically linked windows CRT" />
<cmakeSwitch name="NV_USE_DEBUG_WINCRT" value="True" comment="Use the debug version of the CRT" />
<cmakeSwitch name="PX_FLOAT_POINT_PRECISE_MATH" value="False" comment="Float point precise math" />
<cmakeSwitch name="PX_GENERATE_GPU_STATIC_LIBRARIES" value="False" comment="Generate PhysXGPU static libraries" />
<cmakeSwitch name="PX_GENERATE_GPU_REDUCED_ARCHITECTURES" value="False" comment="Generate only a reduced number of GPU architectures for faster compilation" />
</CMakeSwitches>
<CMakeParams>
<cmakeParam name="CMAKE_INSTALL_PREFIX" value="install/linux-aarch64-gccPhysX" comment="Install path relative to PhysX SDK root" />
</CMakeParams>
</preset>

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<preset name="linux-clang-cpu-only" comment="Linux clang PhysX SDK general settings (cpu only)">
<platform targetPlatform="linux" compiler="clang" />
<CMakeSwitches>
<cmakeSwitch name="PX_BUILDSNIPPETS" value="True" comment="Generate the snippets" />
<cmakeSwitch name="PX_BUILDPVDRUNTIME" value="True" comment="Generate the OmniPVD project" />
<cmakeSwitch name="PX_GENERATE_STATIC_LIBRARIES" value="True" comment="Generate static libs" />
</CMakeSwitches>
<CMakeParams>
<cmakeParam name="CMAKE_INSTALL_PREFIX" value="install/linux-clang-cpu-only/PhysX" comment="Install path relative to PhysX SDK root" />
</CMakeParams>
</preset>

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<preset name="linux-clang" comment="Linux clang PhysX SDK general settings">
<platform targetPlatform="linux" compiler="clang" />
<CMakeSwitches>
<cmakeSwitch name="PX_BUILDSNIPPETS" value="True" comment="Generate the snippets" />
<cmakeSwitch name="PX_BUILDPVDRUNTIME" value="True" comment="Generate the OmniPVD project" />
<cmakeSwitch name="PX_GENERATE_STATIC_LIBRARIES" value="True" comment="Generate static libs" />
<cmakeSwitch name="PX_GENERATE_GPU_PROJECTS" value="True" comment="Generate the GPU projects, if possible." />
<cmakeSwitch name="PX_GENERATE_GPU_PROJECTS_ONLY" value="False" comment="Generate ONLY the GPU projects, if possible." />
<cmakeSwitch name="PX_SCALAR_MATH" value="False" comment="Disable SIMD math" />
<cmakeSwitch name="NV_USE_STATIC_WINCRT" value="True" comment="Use the statically linked windows CRT" />
<cmakeSwitch name="NV_USE_DEBUG_WINCRT" value="True" comment="Use the debug version of the CRT" />
<cmakeSwitch name="PX_FLOAT_POINT_PRECISE_MATH" value="False" comment="Float point precise math" />
<cmakeSwitch name="PX_GENERATE_GPU_STATIC_LIBRARIES" value="False" comment="Generate PhysXGPU static libraries" />
<cmakeSwitch name="PX_GENERATE_GPU_REDUCED_ARCHITECTURES" value="False" comment="Generate only a reduced number of GPU architectures for faster compilation" />
</CMakeSwitches>
<CMakeParams>
<cmakeParam name="CMAKE_INSTALL_PREFIX" value="install/linux-clang/PhysX" comment="Install path relative to PhysX SDK root" />
</CMakeParams>
</preset>

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<preset name="linux-gcc-cpu-only" comment="Linux gcc PhysX SDK general settings (cpu only)">
<platform targetPlatform="linux" compiler="gcc" />
<CMakeSwitches>
<cmakeSwitch name="PX_BUILDSNIPPETS" value="True" comment="Generate the snippets" />
<cmakeSwitch name="PX_BUILDPVDRUNTIME" value="True" comment="Generate the OmniPVD project" />
<cmakeSwitch name="PX_GENERATE_STATIC_LIBRARIES" value="True" comment="Generate static libs" />
</CMakeSwitches>
<CMakeParams>
<cmakeParam name="CMAKE_INSTALL_PREFIX" value="install/linux-gcc-cpu-only/PhysX" comment="Install path relative to PhysX SDK root" />
</CMakeParams>
</preset>

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<preset name="linux-gcc" comment="Linux gcc PhysX SDK general settings">
<platform targetPlatform="linux" compiler="gcc" />
<CMakeSwitches>
<cmakeSwitch name="PX_BUILDSNIPPETS" value="True" comment="Generate the snippets" />
<cmakeSwitch name="PX_BUILDPVDRUNTIME" value="True" comment="Generate the OmniPVD project" />
<cmakeSwitch name="PX_GENERATE_STATIC_LIBRARIES" value="True" comment="Generate static libs" />
<cmakeSwitch name="PX_GENERATE_GPU_PROJECTS" value="True" comment="Generate the GPU projects, if possible." />
<cmakeSwitch name="PX_GENERATE_GPU_PROJECTS_ONLY" value="False" comment="Generate ONLY the GPU projects, if possible." />
<cmakeSwitch name="PX_SCALAR_MATH" value="False" comment="Disable SIMD math" />
<cmakeSwitch name="NV_USE_STATIC_WINCRT" value="True" comment="Use the statically linked windows CRT" />
<cmakeSwitch name="NV_USE_DEBUG_WINCRT" value="True" comment="Use the debug version of the CRT" />
<cmakeSwitch name="PX_FLOAT_POINT_PRECISE_MATH" value="False" comment="Float point precise math" />
<cmakeSwitch name="PX_GENERATE_GPU_STATIC_LIBRARIES" value="False" comment="Generate PhysXGPU static libraries" />
<cmakeSwitch name="PX_GENERATE_GPU_REDUCED_ARCHITECTURES" value="False" comment="Generate only a reduced number of GPU architectures for faster compilation" />
</CMakeSwitches>
<CMakeParams>
<cmakeParam name="CMAKE_INSTALL_PREFIX" value="install/linux-gcc/PhysX" comment="Install path relative to PhysX SDK root" />
</CMakeParams>
</preset>

View File

@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<preset name="vc16win64-cpu-only" comment="VC16 Win64 PhysX general settings (cpu only)">
<platform targetPlatform="win64" compiler="vc16" />
<CMakeSwitches>
<cmakeSwitch name="PX_BUILDSNIPPETS" value="True" comment="Generate the snippets" />
<cmakeSwitch name="PX_BUILDPVDRUNTIME" value="True" comment="Generate the OmniPVD project" />
<cmakeSwitch name="PX_GENERATE_STATIC_LIBRARIES" value="False" comment="Generate static libraries" />
<cmakeSwitch name="NV_USE_STATIC_WINCRT" value="True" comment="Use the statically linked windows CRT" />
<cmakeSwitch name="NV_USE_DEBUG_WINCRT" value="True" comment="Use the debug version of the CRT" />
<cmakeSwitch name="PX_FLOAT_POINT_PRECISE_MATH" value="False" comment="Float point precise math" />
</CMakeSwitches>
<CMakeParams>
<cmakeParam name="CMAKE_INSTALL_PREFIX" value="install/vc16win64-cpu-only/PhysX" comment="Install path relative to PhysX SDK root" />
</CMakeParams>
</preset>

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<preset name="vc16win64" comment="VC16 Win64 PhysX general settings">
<platform targetPlatform="win64" compiler="vc16" />
<CMakeSwitches>
<cmakeSwitch name="PX_BUILDSNIPPETS" value="True" comment="Generate the snippets" />
<cmakeSwitch name="PX_BUILDPVDRUNTIME" value="True" comment="Generate the OmniPVD project" />
<cmakeSwitch name="PX_GENERATE_STATIC_LIBRARIES" value="False" comment="Generate static libraries" />
<cmakeSwitch name="PX_GENERATE_GPU_PROJECTS" value="True" comment="Generate the GPU projects, if possible." />
<cmakeSwitch name="PX_GENERATE_GPU_PROJECTS_ONLY" value="False" comment="Generate ONLY the GPU projects, if possible." />
<cmakeSwitch name="PX_SCALAR_MATH" value="False" comment="Disable SIMD math" />
<cmakeSwitch name="NV_USE_STATIC_WINCRT" value="True" comment="Use the statically linked windows CRT" />
<cmakeSwitch name="NV_USE_DEBUG_WINCRT" value="True" comment="Use the debug version of the CRT" />
<cmakeSwitch name="PX_FLOAT_POINT_PRECISE_MATH" value="False" comment="Float point precise math" />
<cmakeSwitch name="PX_GENERATE_GPU_STATIC_LIBRARIES" value="False" comment="Generate PhysXGPU static libraries" />
<cmakeSwitch name="PX_GENERATE_GPU_REDUCED_ARCHITECTURES" value="False" comment="Generate only a reduced number of GPU architectures for faster compilation" />
</CMakeSwitches>
<CMakeParams>
<cmakeParam name="CMAKE_INSTALL_PREFIX" value="install/vc16win64/PhysX" comment="Install path relative to PhysX SDK root" />
</CMakeParams>
</preset>

View File

@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<preset name="vc17win64-cpu-only" comment="VC17 Win64 PhysX general settings (cpu only)">
<platform targetPlatform="win64" compiler="vc17" />
<CMakeSwitches>
<cmakeSwitch name="PX_BUILDSNIPPETS" value="True" comment="Generate the snippets" />
<cmakeSwitch name="PX_BUILDPVDRUNTIME" value="True" comment="Generate the OmniPVD project" />
<cmakeSwitch name="PX_GENERATE_STATIC_LIBRARIES" value="False" comment="Generate static libraries" />
<cmakeSwitch name="NV_USE_STATIC_WINCRT" value="True" comment="Use the statically linked windows CRT" />
<cmakeSwitch name="NV_USE_DEBUG_WINCRT" value="True" comment="Use the debug version of the CRT" />
<cmakeSwitch name="PX_FLOAT_POINT_PRECISE_MATH" value="False" comment="Float point precise math" />
</CMakeSwitches>
<CMakeParams>
<cmakeParam name="CMAKE_INSTALL_PREFIX" value="install/vc17win64-cpu-only/PhysX" comment="Install path relative to PhysX SDK root" />
</CMakeParams>
</preset>

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<preset name="vc17win64" comment="VC17 Win64 PhysX general settings">
<platform targetPlatform="win64" compiler="vc17" />
<CMakeSwitches>
<cmakeSwitch name="PX_BUILDSNIPPETS" value="True" comment="Generate the snippets" />
<cmakeSwitch name="PX_BUILDPVDRUNTIME" value="True" comment="Generate the OmniPVD project" />
<cmakeSwitch name="PX_GENERATE_STATIC_LIBRARIES" value="False" comment="Generate static libraries" />
<cmakeSwitch name="PX_GENERATE_GPU_PROJECTS" value="True" comment="Generate the GPU projects, if possible." />
<cmakeSwitch name="PX_GENERATE_GPU_PROJECTS_ONLY" value="False" comment="Generate ONLY the GPU projects, if possible." />
<cmakeSwitch name="PX_SCALAR_MATH" value="False" comment="Disable SIMD math" />
<cmakeSwitch name="NV_USE_STATIC_WINCRT" value="True" comment="Use the statically linked windows CRT" />
<cmakeSwitch name="NV_USE_DEBUG_WINCRT" value="True" comment="Use the debug version of the CRT" />
<cmakeSwitch name="PX_FLOAT_POINT_PRECISE_MATH" value="False" comment="Float point precise math" />
<cmakeSwitch name="PX_GENERATE_GPU_STATIC_LIBRARIES" value="False" comment="Generate PhysXGPU static libraries" />
<cmakeSwitch name="PX_GENERATE_GPU_REDUCED_ARCHITECTURES" value="False" comment="Generate only a reduced number of GPU architectures for faster compilation" />
</CMakeSwitches>
<CMakeParams>
<cmakeParam name="CMAKE_INSTALL_PREFIX" value="install/vc17win64/PhysX" comment="Install path relative to PhysX SDK root" />
</CMakeParams>
</preset>

View File

@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<preset name="vc17win64-cpu-only" comment="VC17 Win64 PhysX general settings (cpu only, dynamic CRT)">
<platform targetPlatform="win64" compiler="vc17" />
<CMakeSwitches>
<cmakeSwitch name="PX_BUILDSNIPPETS" value="True" comment="Generate the snippets" />
<cmakeSwitch name="PX_BUILDPVDRUNTIME" value="True" comment="Generate the OmniPVD project" />
<cmakeSwitch name="PX_GENERATE_STATIC_LIBRARIES" value="False" comment="Generate static libraries" />
<cmakeSwitch name="NV_USE_STATIC_WINCRT" value="False" comment="Use the dynamically linked windows CRT" />
<cmakeSwitch name="NV_USE_DEBUG_WINCRT" value="True" comment="Use the debug version of the CRT" />
<cmakeSwitch name="PX_FLOAT_POINT_PRECISE_MATH" value="False" comment="Float point precise math" />
</CMakeSwitches>
<CMakeParams>
<cmakeParam name="CMAKE_INSTALL_PREFIX" value="install/vc17win64-cpu-only/PhysX" comment="Install path relative to PhysX SDK root" />
</CMakeParams>
</preset>

View File

@@ -0,0 +1,113 @@
#!/bin/bash +x
set -e
# Function to display an error and exit
error_exit() {
echo "$1" 1>&2
exit 1
}
# Check if two arguments are passed
if [ "$#" -ne 2 ]; then
error_exit "Usage: $0 <preset> <build_config>. Example: $0 linux-aarch64-gcc debug"
fi
# Assign arguments
PRESET="$1"
BUILD_CONFIG="$2"
# Validate build configuration
if [[ ! "checked debug profile release all" =~ (^|[[:space:]])$BUILD_CONFIG($|[[:space:]]) ]]; then
error_exit "Invalid build configuration. Use one of: checked, debug, profile, release, all."
fi
# Get number of CPU cores
if [ -f /proc/cpuinfo ]; then
CPUS=$(grep processor /proc/cpuinfo | wc -l)
else
CPUS=1
fi
# Stackoverflow suggests jobs count of (CPU cores + 1) as a good number!
JOBS=$(expr $CPUS + 1)
# Define build function for presets other than linux-carbonite and linux-aarch64-carbonite (no install)
build() {
CONFIG=$1
BUILD_DIR="$(dirname "$0")/../../compiler/$PRESET-$CONFIG"
pushd "$BUILD_DIR" || error_exit "Directory not found for build: $BUILD_DIR"
make -j$JOBS || error_exit "Build failed for $PRESET-$CONFIG"
popd
}
# Function to handle file copying for linux-aarch64-carbonite and linux-carbonite debug builds
copy_vhacd_files() {
CONFIG=$1
if [[ "$CONFIG" == "debug" ]]; then
if [[ "$PRESET" == "linux-aarch64-carbonite" ]]; then
TARGET_PATH="install/$PRESET/VHACD/bin/linux.aarch64/debug/"
SRC_PATH="bin/linux.aarch64/debug/"
elif [[ "$PRESET" == "linux-carbonite" ]]; then
TARGET_PATH="install/$PRESET/VHACD/bin/linux.x86_64/debug/"
SRC_PATH="bin/linux.x86_64/debug/"
fi
mkdir -p "$TARGET_PATH" || error_exit "Failed to create directory $TARGET_PATH"
# Check if VHACD files exist before attempting to copy
if ls "$SRC_PATH"*VHACD* 1> /dev/null 2>&1; then
cp "$SRC_PATH"*VHACD* "$TARGET_PATH" || error_exit "Failed to copy VHACD files"
else
echo "Warning: No VHACD files found in $SRC_PATH. Skipping copy operation."
fi
fi
}
# Define build function for linux-aarch64-carbonite and linux-carbonite (with install)
build_with_install() {
CONFIG=$1
BUILD_DIR="$(dirname "$0")/../../compiler/$PRESET-$CONFIG"
pushd "$BUILD_DIR" || error_exit "Directory not found for build: $BUILD_DIR"
make -j$JOBS install || error_exit "Build and install failed for $PRESET-$CONFIG"
popd
copy_vhacd_files $CONFIG
}
# Build process based on the preset and configuration
if [[ "$PRESET" == "linux-aarch64-carbonite" || "$PRESET" == "linux-carbonite" ]]; then
# Build with install for linux-aarch64-carbonite and linux-carbonite
if [ "$BUILD_CONFIG" = "all" ]; then
build_with_install debug
build_with_install checked
build_with_install profile
build_with_install release
else
build_with_install $BUILD_CONFIG
fi
# Additional installations not specific to any build
INSTALL_PATH="install/$PRESET"
pushd "$(dirname "$0")/../.." || error_exit "Failed to enter base directory"
mkdir -p "$INSTALL_PATH/PhysX/PACKAGE-LICENSES/" "$INSTALL_PATH/VHACD/" "$INSTALL_PATH/VHACD/include/" "$INSTALL_PATH/VHACD/PACKAGE-LICENSES/" || error_exit "Failed to create installation directories"
cp "documentation/license/PACKAGE-LICENSES/LICENSE.md" "$INSTALL_PATH/PhysX/PACKAGE-LICENSES/physxsdk-LICENSE.md" || error_exit "Failed to copy PhysX license"
cp "documentation/license/PACKAGE-LICENSES/vhacd-LICENSE.md" "$INSTALL_PATH/VHACD/PACKAGE-LICENSES/vhacd-LICENSE.md" || error_exit "Failed to copy VHACD license"
cp "documentation/license/physxsdk-PACKAGE-INFO.yaml" "$INSTALL_PATH/PhysX/PACKAGE-INFO.yaml" || error_exit "Failed to copy PhysX package info"
cp "documentation/license/vhacd-PACKAGE-INFO.yaml" "$INSTALL_PATH/VHACD/PACKAGE-INFO.yaml" || error_exit "Failed to copy VHACD package info"
cp "externals/VHACD/public/"* "$INSTALL_PATH/VHACD/include/" || error_exit "Failed to copy VHACD include files"
popd
else
# Build without install for other presets
if [ "$BUILD_CONFIG" = "all" ]; then
build checked
build debug
build profile
build release
else
build $BUILD_CONFIG
fi
fi

View File

@@ -0,0 +1,189 @@
@echo off
SETLOCAL EnableDelayedExpansion
:: Check if at least one argument is provided (preset)
if "%~1"=="" (
echo You must specify a preset: e.g. vc17win64...
exit /B 1
)
:: Set the preset based on the argument
set "PRESET=%1"
:: Extract the Visual Studio version from the preset
set "VS_PREFIX=%PRESET:~0,4%" :: Get the first 4 characters (vc15, vc16, vc17)
:: Determine the correct Visual Studio version based on the preset prefix
if "%VS_PREFIX%" == "vc15" (
set "VS_VERSION=[15.0,16.0)"
) else if "%VS_PREFIX%" == "vc16" (
set "VS_VERSION=[16.0,17.0)"
) else if "%VS_PREFIX%" == "vc17" (
set "VS_VERSION=[17.0,18.0)"
) else (
echo Unsupported Visual Studio version in preset: %PRESET%
exit /B 1
)
:: Check if a build configuration is provided, default to 'all' if not
if "%~2" == "" (
set "BUILD_CONFIG=all"
) else (
set "BUILD_CONFIG=%2"
)
:: Validate BUILD_CONFIG
if not "%BUILD_CONFIG%"=="debug" if not "%BUILD_CONFIG%"=="release" if not "%BUILD_CONFIG%"=="checked" if not "%BUILD_CONFIG%"=="profile" if not "%BUILD_CONFIG%"=="all" (
echo Invalid build configuration. Use one of: debug, release, checked, profile, all.
exit /B 1
)
:: Locate Visual Studio using vswhere
IF EXIST "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer" (
set "VS_INSTALLER_DIR=%ProgramFiles(x86)%\Microsoft Visual Studio\Installer"
echo VS_INSTALLER_DIR: "!VS_INSTALLER_DIR!"
:: Check if VS_INSTALLER_DIR is already in PATH
echo !PATH! | findstr /i /c:"!VS_INSTALLER_DIR!" >nul
if errorlevel 1 (
set "PATH=!PATH!;!VS_INSTALLER_DIR!"
echo Updated PATH: !PATH!
) else (
echo VS_INSTALLER_DIR is already in PATH
)
)
:: Use vswhere to locate the specified Visual Studio installation
for /f "usebackq tokens=*" %%i in (`vswhere -version "%VS_VERSION%" -latest -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath`) do (
set "VSINSTALLPATH=%%i"
echo VSINSTALLPATH: "!VSINSTALLPATH!"
)
:: Check if VSINSTALLPATH is set
if not defined VSINSTALLPATH (
echo Visual Studio installation not found.
exit /B 1
)
:: Set COMNTOOLS to point to the correct path
set "COMNTOOLS=!VSINSTALLPATH!\VC\Auxiliary\Build\vcvarsx86_amd64.bat"
echo COMNTOOLS: "!COMNTOOLS!"
call "!COMNTOOLS!"
if errorlevel 1 (
echo Failed to initialize Visual Studio environment.
exit /B 1
)
:: Safely handle directory changes
pushd "%~dp0\..\..\compiler"
set "ROOT_PATH=%CD%"
popd
:: Build configurations
if "%BUILD_CONFIG%" == "all" (
call :BUILD debug
if errorlevel 1 goto ERROR
call :BUILD release
if errorlevel 1 goto ERROR
call :BUILD checked
if errorlevel 1 goto ERROR
call :BUILD profile
if errorlevel 1 goto ERROR
) else (
call :BUILD %BUILD_CONFIG%
if errorlevel 1 goto ERROR
)
:: Success
echo Build completed successfully.
exit /B 0
:ERROR
echo Failure while building *Windows %VS_PREFIX%* targets!
exit /B 1
:: Build subroutine
:BUILD
echo ** Building %PRESET% %1 ... **
:: Check if PRESET ends with -carbonite using string manipulation
setlocal enabledelayedexpansion
set "SUFFIX=-carbonite"
set "PRESET_LENGTH=!PRESET:~-10!"
if "%PRESET_LENGTH%" == "%SUFFIX%" (
:: Build INSTALL.vcxproj when the preset ends with -carbonite
msbuild /property:configuration=%1 "%ROOT_PATH%\%PRESET%\INSTALL.vcxproj" /maxcpucount /t:Rebuild /v:m
) else (
:: Build PhysXSDK.sln when the preset does not end with -carbonite
msbuild /property:configuration=%1 "%ROOT_PATH%\%PRESET%\PhysXSDK.sln" /maxcpucount /t:Rebuild /v:m
)
if errorlevel 1 (
echo Build failed for %1.
exit /B 1
)
echo ** End of %PRESET% %1 **
echo.
goto :EOF
@REM This is for binary distro only (carbonite). Keeping it here in case we need it.
@REM However if we need the licenses and the logic below, it will be probably better to do that in the zipup script not here
:: Copying licenses and files directly, similar to individual scripts
:: Ensure that destination directories exist by creating them before copying
@REM echo Copying LICENSE.md to PhysX...
@REM mkdir "%ROOT_PATH%\..\install\%INSTALL_PATH%\PhysX\PACKAGE-LICENSES" 2>nul
@REM echo f | xcopy /S /Y /I "%ROOT_PATH%\..\documentation\license\PACKAGE-LICENSES\LICENSE.md" "%ROOT_PATH%\..\install\%INSTALL_PATH%\PhysX\PACKAGE-LICENSES\physxsdk-LICENSE.md"
@REM if errorlevel 1 (
@REM echo Failed to copy LICENSE.md to PhysX.
@REM goto ERROR
@REM )
@REM echo Copying vhacd-LICENSE.md to VHACD...
@REM mkdir "%ROOT_PATH%\..\install\%INSTALL_PATH%\VHACD\PACKAGE-LICENSES" 2>nul
@REM echo f | xcopy /S /Y /I "%ROOT_PATH%\..\documentation\license\PACKAGE-LICENSES\vhacd-LICENSE.md" "%ROOT_PATH%\..\install\%INSTALL_PATH%\VHACD\PACKAGE-LICENSES\vhacd-LICENSE.md"
@REM if errorlevel 1 (
@REM echo Failed to copy vhacd-LICENSE.md to VHACD.
@REM goto ERROR
@REM )
@REM echo Copying physxsdk-PACKAGE-INFO.yaml to PhysX...
@REM mkdir "%ROOT_PATH%\..\install\%INSTALL_PATH%\PhysX" 2>nul
@REM echo f | xcopy /S /Y /I "%ROOT_PATH%\..\documentation\license\physxsdk-PACKAGE-INFO.yaml" "%ROOT_PATH%\..\install\%INSTALL_PATH%\PhysX\PACKAGE-INFO.yaml"
@REM if errorlevel 1 (
@REM echo Failed to copy physxsdk-PACKAGE-INFO.yaml to PhysX.
@REM goto ERROR
@REM )
@REM echo Copying vhacd-PACKAGE-INFO.yaml to VHACD...
@REM mkdir "%ROOT_PATH%\..\install\%INSTALL_PATH%\VHACD" 2>nul
@REM echo f | xcopy /S /Y /I "%ROOT_PATH%\..\documentation\license\vhacd-PACKAGE-INFO.yaml" "%ROOT_PATH%\..\install\%INSTALL_PATH%\VHACD\PACKAGE-INFO.yaml"
@REM if errorlevel 1 (
@REM echo Failed to copy vhacd-PACKAGE-INFO.yaml to VHACD.
@REM goto ERROR
@REM )
@REM :: Copying VHACD binaries and includes
@REM echo Copying VHACD debug binaries...
@REM mkdir "%ROOT_PATH%\..\install\%INSTALL_PATH%\VHACD\bin\%BINARY_PATH%\debug" 2>nul
@REM xcopy /Y "%ROOT_PATH%\..\bin\%BINARY_PATH%\debug\VHACD*.*" "%ROOT_PATH%\..\install\%INSTALL_PATH%\VHACD\bin\%BINARY_PATH%\debug\"
@REM if errorlevel 1 (
@REM echo Failed to copy VHACD debug binaries.
@REM goto ERROR
@REM )
@REM echo Copying VHACD includes...
@REM mkdir "%ROOT_PATH%\..\install\%INSTALL_PATH%\VHACD\include" 2>nul
@REM xcopy /Y "%ROOT_PATH%\..\externals\VHACD\public\*.*" "%ROOT_PATH%\..\install\%INSTALL_PATH%\VHACD\include\"
@REM if errorlevel 1 (
@REM echo Failed to copy VHACD includes.
@REM goto ERROR
@REM )

View File

@@ -0,0 +1,8 @@
${BOILERPLATE_CONTENT}
#ifndef PX_${HEADER_GUARD_NAME}
#define PX_${HEADER_GUARD_NAME}
${HEADER_CONTENT}
#endif // PX_${HEADER_GUARD_NAME}

View File

@@ -0,0 +1,25 @@
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
// * Neither the name of NVIDIA CORPORATION nor the names of its
// contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Copyright (c) 2008-2025 NVIDIA Corporation. All rights reserved.