mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-06 07:51:47 +00:00
Merge remote-tracking branch 'origin/v0.8.0' into tfk-rocksdb-storage
This commit is contained in:
+48
-23
@@ -87,6 +87,11 @@ IF %VS_VER%==2008 set PATH=C:\Windows\Microsoft.NET\Framework\v3.5;%PATH%
|
||||
|
||||
:: User-configurable build options
|
||||
IF NOT DEFINED IFCOS_INSTALL_PYTHON set IFCOS_INSTALL_PYTHON=TRUE
|
||||
set PYTHON_VERSION=3.11
|
||||
py -%PYTHON_VERSION% --version 2>&1>NUL
|
||||
IF %ERRORLEVEL%==0 set IFCOS_INSTALL_PYTHON=EXISTS
|
||||
set PYTHON_VERSION=%PYTHON_VERSION%.7
|
||||
|
||||
IF NOT DEFINED IFCOS_NUM_BUILD_PROCS set IFCOS_NUM_BUILD_PROCS=%NUMBER_OF_PROCESSORS%
|
||||
|
||||
:: For subroutines
|
||||
@@ -143,6 +148,8 @@ echo Defaults to Build if not specified. Rebuild/Clean also uninstalls Pytho
|
||||
call cecho.cmd 0 13 "* IFCOS_INSTALL_PYTHON`t= %IFCOS_INSTALL_PYTHON%"
|
||||
echo - Download and install Python.
|
||||
echo Set to something other than TRUE if you wish to use an already installed version of Python.
|
||||
echo EXISTS value is set automatically if same Python version is already found on the system
|
||||
echo and we won't be able to install it again.
|
||||
call cecho.cmd 0 13 "* IFCOS_NUM_BUILD_PROCS`t= %IFCOS_NUM_BUILD_PROCS%"
|
||||
echo - How many MSBuild.exe processes may be run in parallel.
|
||||
echo Defaults to NUMBER_OF_PROCESSORS. Used also by other IfcOpenShell build scripts.
|
||||
@@ -167,16 +174,16 @@ echo.
|
||||
cd "%DEPS_DIR%"
|
||||
|
||||
:: VERSIONS
|
||||
set HDF5_VERSION=1.8.22
|
||||
set HDF5_VERSION_MAJOR=1.8
|
||||
set HDF5_VERSION=1.12.1
|
||||
set HDF5_VERSION_MAJOR=1.12
|
||||
set OCCT_VERSION=7.8.1
|
||||
:: NOTE If updating the default Python version, change PY_VER_MAJOR_MINOR accordingly in run-cmake.bat
|
||||
set PYTHON_VERSION=3.11.7
|
||||
set PYTHON_VERSION=%PYTHON_VERSION%
|
||||
|
||||
:: VERSION DERIVATIONS
|
||||
set OCC_INCLUDE_DIR=%INSTALL_DIR%\opencascade-%OCCT_VERSION%\inc>>"%~dp0\%BUILD_DEPS_CACHE_PATH%"
|
||||
set OCC_LIBRARY_DIR=%INSTALL_DIR%\opencascade-%OCCT_VERSION%\win%ARCH_BITS%\lib>>"%~dp0\%BUILD_DEPS_CACHE_PATH%"
|
||||
for /f "tokens=1,2,3 delims=." %%a in ("%PYTHON_VERSION%") do (
|
||||
for /f "tokens=1,2,3 delims=." %%a in ("%PYTHON_VERSION%") do (
|
||||
set PY_VER_MAJOR_MINOR=%%a%%b
|
||||
)
|
||||
IF "%IFCOS_INSTALL_PYTHON%"=="TRUE" (
|
||||
@@ -253,7 +260,7 @@ git clean -fdx
|
||||
REM There probably need to be quotes here around the filename
|
||||
powershell -c "get-content %~dp0patches\mpir.patch | %%{$_ -replace \"sdk\",\"%UCRTVersion%\"} | %%{$_ -replace \"fn\",\"lib_mpir_cxx\"}" | git apply --unidiff-zero --ignore-whitespace
|
||||
IF NOT %ERRORLEVEL%==0 GOTO :Error
|
||||
powershell -c "get-content %~dp0patches\mpir.patch | %%{$_ -replace \"sdk\",\"%UCRTVersion%\"} | %%{$_ -replace \"fn\",\"lib_mpir_gc\"}" | git apply --unidiff-zero --ignore-whitespace
|
||||
powershell -c "get-content %~dp0patches\mpir.patch | %%{$_ -replace \"sdk\",\"%UCRTVersion%\"} | %%{$_ -replace \"fn\",\"lib_mpir_gc\"}" | git apply --unidiff-zero --ignore-whitespace
|
||||
IF NOT %ERRORLEVEL%==0 GOTO :Error
|
||||
if NOT "%USE_STATIC_RUNTIME%"=="FALSE" git apply "%~dp0patches\mpir_runtime.patch" --unidiff-zero --ignore-whitespace
|
||||
IF NOT %ERRORLEVEL%==0 GOTO :Error
|
||||
@@ -301,26 +308,33 @@ IF NOT %ERRORLEVEL%==0 GOTO :Error
|
||||
:HDF5
|
||||
|
||||
set DEPENDENCY_NAME=hdf5
|
||||
set DEPENDENCY_DIR=%DEPS_DIR%
|
||||
set DEPENDENCY_DIR=%DEPS_DIR%\hdf5-%HDF5_VERSION%
|
||||
cd "%DEPENDENCY_DIR%"
|
||||
set HDF5_CMAKE_ZIP=CMake-hdf5-%HDF5_VERSION%.zip
|
||||
set HDF5_INSTALL_ZIP_NAME=HDF5-%HDF5_VERSION%-win%ARCH_BITS%
|
||||
set HDF5_CMAKE_ZIP=hdf5-%HDF5_VERSION%.zip
|
||||
set HDF5_INSTALL_NAME=HDF5-%HDF5_VERSION%-win%ARCH_BITS%
|
||||
|
||||
IF EXIST "%INSTALL_DIR%\%HDF5_INSTALL_ZIP_NAME%" (
|
||||
echo Found existing "%INSTALL_DIR%\%HDF5_INSTALL_ZIP_NAME%", skipping
|
||||
IF EXIST "%INSTALL_DIR%\%HDF5_INSTALL_NAME%" (
|
||||
echo Found existing "%INSTALL_DIR%\%HDF5_INSTALL_NAME%", skipping
|
||||
goto :Boost
|
||||
)
|
||||
|
||||
if "%ARCH_BITS%"=="64" set ARCH_BITS_64=64
|
||||
call :DownloadFile http://support.hdfgroup.org/ftp/HDF5/releases/hdf5-%HDF5_VERSION_MAJOR%/hdf5-%HDF5_VERSION%/src/CMake-hdf5-%HDF5_VERSION%.zip "%DEPS_DIR%" %HDF5_CMAKE_ZIP%
|
||||
call :DownloadFile ^
|
||||
http://support.hdfgroup.org/ftp/HDF5/releases/hdf5-%HDF5_VERSION_MAJOR%/hdf5-%HDF5_VERSION%/src/%HDF5_CMAKE_ZIP% ^
|
||||
"%DEPS_DIR%" %HDF5_CMAKE_ZIP%
|
||||
IF NOT %ERRORLEVEL%==0 GOTO :Error
|
||||
call :ExtractArchive %HDF5_CMAKE_ZIP% "%DEPS_DIR%" "%DEPS_DIR%\CMake-hdf5-%HDF5_VERSION%"
|
||||
call :ExtractArchive %HDF5_CMAKE_ZIP% "%DEPS_DIR%" "%DEPS_DIR%\hdf5-%HDF5_VERSION%"
|
||||
IF NOT %ERRORLEVEL%==0 GOTO :Error
|
||||
pushd "%DEPS_DIR%\hdf5-%HDF5_VERSION%"
|
||||
call :RunCMake -DCMAKE_INSTALL_PREFIX="%INSTALL_DIR%\%HDF5_INSTALL_NAME%" ^
|
||||
-DHDF5_ENABLE_Z_LIB_SUPPORT=OFF -DBUILD_TESTING=OFF ^
|
||||
-DHDF5_BUILD_TOOLS=OFF -DHDF5_BUILD_EXAMPLES=OFF -DBUILD_SHARED_LIBS=OFF -DHDF5_BUILD_UTILS=OFF ^
|
||||
-DHDF5_BUILD_CPP_LIB=ON
|
||||
IF NOT %ERRORLEVEL%==0 GOTO :Error
|
||||
call :BuildSolution "%DEPENDENCY_DIR%\%BUILD_DIR%\HDF5.sln" %DEBUG_OR_RELEASE%
|
||||
IF NOT %ERRORLEVEL%==0 GOTO :Error
|
||||
call :InstallCMakeProject "%DEPENDENCY_DIR%\%BUILD_DIR%" %DEBUG_OR_RELEASE%
|
||||
IF NOT %ERRORLEVEL%==0 GOTO :Error
|
||||
pushd "%DEPS_DIR%\CMake-hdf5-%HDF5_VERSION%"
|
||||
git apply %~dp0patches\hdf5vs2022.patch --ignore-whitespace
|
||||
rem It is not checked whether this patch is applied successfully!
|
||||
ctest -S HDF5config.cmake,BUILD_GENERATOR=VS%VS_VER%%ARCH_BITS_64% -C %BUILD_CFG% -V -O hdf5.log
|
||||
call :ExtractArchive %HDF5_INSTALL_ZIP_NAME%.zip "%INSTALL_DIR%" "%INSTALL_DIR%\%HDF5_INSTALL_ZIP_NAME%"
|
||||
popd
|
||||
|
||||
:: Note all of the dependencies have appropriate label so that user can easily skip something if wanted
|
||||
@@ -360,7 +374,7 @@ call cecho.cmd 0 13 "Building %DEPENDENCY_NAME% %BOOST_LIBS% Please be patient,
|
||||
IF EXIST "%DEPENDENCY_DIR%\bin.v2\project-cache.jam" del "%DEPS_DIR%\boost\bin.v2\project-cache.jam"
|
||||
|
||||
call .\b2 toolset=%BOOST_TOOLSET% runtime-link=shared address-model=%ARCH_BITS% --abbreviate-paths -j%IFCOS_NUM_BUILD_PROCS% ^
|
||||
variant=%DEBUG_OR_RELEASE_LOWERCASE% %BOOST_WIN_API% %BOOST_LIBS% stage --stagedir=stage/%GEN_SHORTHAND%
|
||||
variant=%DEBUG_OR_RELEASE_LOWERCASE% %BOOST_WIN_API% %BOOST_LIBS% stage --stagedir=stage/%GEN_SHORTHAND%
|
||||
|
||||
IF NOT %ERRORLEVEL%==0 GOTO :Error
|
||||
|
||||
@@ -427,7 +441,7 @@ if not %ERRORLEVEL%==0 goto :Error
|
||||
call :BuildSolution "%DEPENDENCY_DIR%\%BUILD_DIR%\freetype.sln" %BUILD_CFG%
|
||||
if not %ERRORLEVEL%==0 goto :Error
|
||||
call :InstallCMakeProject "%DEPENDENCY_DIR%\%BUILD_DIR%" %BUILD_CFG%
|
||||
if not %ERRORLEVEL%==0 goto :Error
|
||||
if not %ERRORLEVEL%==0 goto :Error
|
||||
|
||||
set DEPENDENCY_NAME=Open CASCADE %OCCT_VERSION%
|
||||
set DEPENDENCY_DIR=%DEPS_DIR%\occt_git
|
||||
@@ -500,6 +514,12 @@ IF "%IFCOS_INSTALL_PYTHON%"=="TRUE" (
|
||||
IF NOT EXIST "%PYTHONHOME%". (
|
||||
call cecho.cmd 0 13 "Installing %DEPENDENCY_NAME%. Please be patient, this will take a while."
|
||||
start /w %PYTHON_INSTALLER% /quiet TargetDir="%PYTHONHOME%"
|
||||
if errorlevel 1 (
|
||||
:: Standard installer doesn't support installing same Python version twice,
|
||||
:: but we skip installation during IFCOS_INSTALL_PYTHON initialization.
|
||||
call cecho.cmd 0 12 "Failed to install Python. Error code: !ERRORLEVEL!."
|
||||
GOTO :Error
|
||||
)
|
||||
) ELSE (
|
||||
call cecho.cmd 0 13 "%DEPENDENCY_NAME% already installed. Skipping."
|
||||
)
|
||||
@@ -539,7 +559,7 @@ IF EXIST "%INSTALL_DIR%\cgal" (
|
||||
|
||||
set DEPENDENCY_NAME=cgal
|
||||
set DEPENDENCY_DIR=%DEPS_DIR%\cgal
|
||||
call :GitCloneAndCheckoutRevision https://github.com/CGAL/cgal.git "%DEPENDENCY_DIR%" v5.2.3
|
||||
call :GitCloneAndCheckoutRevision https://github.com/CGAL/cgal.git "%DEPENDENCY_DIR%" v5.5.5
|
||||
IF NOT %ERRORLEVEL%==0 GOTO :Error
|
||||
cd "%DEPENDENCY_DIR%"
|
||||
git reset --hard
|
||||
@@ -561,6 +581,11 @@ IF NOT %ERRORLEVEL%==0 GOTO :Error
|
||||
:Eigen
|
||||
set DEPENDENCY_NAME=Eigen
|
||||
set DEPENDENCY_DIR=%INSTALL_DIR%\%DEPENDENCY_NAME%
|
||||
|
||||
IF EXIST "%INSTALL_DIR%\%DEPENDENCY_NAME%" (
|
||||
echo Found existing "%INSTALL_DIR%\%DEPENDENCY_NAME%", skipping
|
||||
goto :Successful
|
||||
)
|
||||
call :GitCloneAndCheckoutRevision https://gitlab.com/libeigen/eigen.git "%DEPENDENCY_DIR%" 3.3.9
|
||||
|
||||
:rocksdb
|
||||
@@ -594,7 +619,7 @@ IF NOT %ERRORLEVEL%==0 GOTO :Error
|
||||
:: IF NOT %ERRORLEVEL%==0 GOTO :Error
|
||||
:: call :InstallCMakeProject "%DEPENDENCY_DIR%\%BUILD_DIR%" %BUILD_CFG%
|
||||
:: IF NOT %ERRORLEVEL%==0 GOTO :Error
|
||||
::
|
||||
::
|
||||
:: :usd
|
||||
:: set DEPENDENCY_NAME=usd
|
||||
:: set DEPENDENCY_DIR=%DEPS_DIR%\usd
|
||||
@@ -727,7 +752,7 @@ call git checkout %3
|
||||
set RET=%ERRORLEVEL%
|
||||
popd
|
||||
exit /b %RET%
|
||||
|
||||
|
||||
:: RunCMake - Runs CMake for a CMake-based project
|
||||
:: Params: %* cmakeOptions
|
||||
:: NOTE cd to root CMakeLists.txt folder before calling this if the CMakeLists.txt is not in the repo root.
|
||||
@@ -736,7 +761,7 @@ call cecho.cmd 0 13 "Running CMake for %DEPENDENCY_NAME%."
|
||||
IF NOT EXIST %BUILD_DIR%. mkdir %BUILD_DIR%
|
||||
IF NOT %ERRORLEVEL%==0 GOTO :Error
|
||||
pushd %BUILD_DIR%
|
||||
:: TODO make deleting cache a parameter for this subroutine? We probably want to delete the
|
||||
:: TODO make deleting cache a parameter for this subroutine? We probably want to delete the
|
||||
:: cache always e.g. when we've had new changes in the repository.
|
||||
IF %BUILD_TYPE%==Rebuild IF EXIST CMakeCache.txt. del CMakeCache.txt
|
||||
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
--- HDF5config.cmake 2021-02-05 14:38:05.000000000 +0000
|
||||
+++ HDF5config.cmake 2022-01-21 10:41:19.705646800 +0000
|
||||
@@ -110,7 +110,19 @@
|
||||
if (WIN32 AND NOT MINGW)
|
||||
set (SITE_OS_NAME "Windows")
|
||||
set (SITE_OS_VERSION "WIN10")
|
||||
- if (BUILD_GENERATOR STREQUAL "VS201964")
|
||||
+ if (BUILD_GENERATOR STREQUAL "VS202264")
|
||||
+ set (CTEST_CMAKE_GENERATOR "Visual Studio 17 2022")
|
||||
+ set (CMAKE_GENERATOR_ARCHITECTURE "x64")
|
||||
+ set (SITE_OS_BITS "64")
|
||||
+ set (SITE_COMPILER_NAME "vs2022")
|
||||
+ set (SITE_COMPILER_VERSION "17")
|
||||
+ elseif (BUILD_GENERATOR STREQUAL "VS2022")
|
||||
+ set (CTEST_CMAKE_GENERATOR "Visual Studio 17 2022")
|
||||
+ set (CMAKE_GENERATOR_ARCHITECTURE "Win32")
|
||||
+ set (SITE_OS_BITS "32")
|
||||
+ set (SITE_COMPILER_NAME "vs2022")
|
||||
+ set (SITE_COMPILER_VERSION "17")
|
||||
+ elseif (BUILD_GENERATOR STREQUAL "VS201964")
|
||||
set (CTEST_CMAKE_GENERATOR "Visual Studio 16 2019")
|
||||
set (CMAKE_GENERATOR_ARCHITECTURE "x64")
|
||||
set (SITE_OS_BITS "64")
|
||||
+12
-8
@@ -91,15 +91,14 @@ set OPENCOLLADA_INCLUDE_DIR=%INSTALL_DIR%\OpenCOLLADA\include\opencollada
|
||||
set OPENCOLLADA_LIBRARY_DIR=%INSTALL_DIR%\OpenCOLLADA\lib\opencollada
|
||||
set LIBXML2_INCLUDE_DIR=%DEPS_DIR%\OpenCOLLADA\Externals\LibXML\include
|
||||
set LIBXML2_LIBRARIES=%INSTALL_DIR%\OpenCOLLADA\lib\opencollada\xml.lib
|
||||
set HDF5_INCLUDE_DIR=%INSTALL_DIR%\HDF5-%HDF5_VERSION%-win%ARCH_BITS%\include
|
||||
set HDF5_LIBRARY_DIR=%INSTALL_DIR%\HDF5-%HDF5_VERSION%-win%ARCH_BITS%\lib
|
||||
set HDF5_INSTALL_DIR=%INSTALL_DIR%\HDF5-%HDF5_VERSION%-win%ARCH_BITS%
|
||||
if not defined PY_VER_MAJOR_MINOR set PY_VER_MAJOR_MINOR=311
|
||||
if not defined PYTHONHOME set PYTHONHOME=%INSTALL_DIR%\Python%PY_VER_MAJOR_MINOR%
|
||||
set PYTHON_INCLUDE_DIR=%PYTHONHOME%\include
|
||||
set PYTHON_LIBRARY=%PYTHONHOME%\libs\python%PY_VER_MAJOR_MINOR%.lib
|
||||
set PYTHON_EXECUTABLE=%PYTHONHOME%\python.exe
|
||||
set SWIG_DIR=%INSTALL_DIR%\swigwin
|
||||
set PATH=%PATH%;%SWIG_DIR%;%PYTHONHOME%
|
||||
set SWIG_EXECUTABLE=%SWIG_DIR%\swig.exe
|
||||
set PATH=%PATH%;%PYTHONHOME%
|
||||
set JSON_INCLUDE_DIR=%INSTALL_DIR%\json
|
||||
if not defined ADD_COMMIT_SHA set ADD_COMMIT_SHA=Off
|
||||
|
||||
@@ -133,8 +132,7 @@ echo OPENCOLLADA_INCLUDE_DIR = %OPENCOLLADA_INCLUDE_DIR%
|
||||
echo OPENCOLLADA_LIBRARY_DIR = %OPENCOLLADA_LIBRARY_DIR%
|
||||
echo LIBXML2_INCLUDE_DIR = %LIBXML2_INCLUDE_DIR%
|
||||
echo LIBXML2_LIBRARIES = %LIBXML2_LIBRARIES%
|
||||
echo HDF5_INCLUDE_DIR = %HDF5_INCLUDE_DIR%
|
||||
echo HDF5_LIBRARY_DIR = %HDF5_LIBRARY_DIR%
|
||||
echo HDF5_INSTALL_DIR = %HDF5_INSTALL_DIR%
|
||||
echo PYTHONHOME = %PYTHONHOME%
|
||||
echo PYTHON_INCLUDE_DIR = %PYTHON_INCLUDE_DIR%
|
||||
echo PYTHON_LIBRARY = %PYTHON_LIBRARY%
|
||||
@@ -163,9 +161,15 @@ if not (%1)==() if exist CMakeCache.txt. del /Q CMakeCache.txt
|
||||
call cecho.cmd 0 13 "Running CMake for %PROJECT_NAME%."
|
||||
|
||||
IF NOT "%VS_TOOLSET_HOST%"=="" (
|
||||
cmake.exe %CMAKELISTS_DIR% -G %GENERATOR% -A %VS_PLATFORM% -T %VS_TOOLSET_HOST% -DCMAKE_INSTALL_PREFIX="%CMAKE_INSTALL_PREFIX%" -DBoost_NO_BOOST_CMAKE=On -DADD_COMMIT_SHA=%ADD_COMMIT_SHA% %ARGUMENTS%
|
||||
cmake.exe %CMAKELISTS_DIR% -G %GENERATOR% -A %VS_PLATFORM% -T %VS_TOOLSET_HOST% ^
|
||||
-DCMAKE_INSTALL_PREFIX="%CMAKE_INSTALL_PREFIX%" -DBoost_NO_BOOST_CMAKE=ON ^
|
||||
-DCMAKE_PREFIX_PATH="%HDF5_INSTALL_DIR%" ^
|
||||
-DADD_COMMIT_SHA=%ADD_COMMIT_SHA% %ARGUMENTS%
|
||||
) ELSE (
|
||||
cmake.exe %CMAKELISTS_DIR% -G %GENERATOR% -A %VS_PLATFORM% -DCMAKE_INSTALL_PREFIX="%CMAKE_INSTALL_PREFIX%" -DBoost_NO_BOOST_CMAKE=On -DADD_COMMIT_SHA=%ADD_COMMIT_SHA% %ARGUMENTS%
|
||||
cmake.exe %CMAKELISTS_DIR% -G %GENERATOR% -A %VS_PLATFORM% ^
|
||||
-DCMAKE_INSTALL_PREFIX="%CMAKE_INSTALL_PREFIX%" -DBoost_NO_BOOST_CMAKE=ON ^
|
||||
-DCMAKE_PREFIX_PATH="%HDF5_INSTALL_DIR%" ^
|
||||
-DADD_COMMIT_SHA=%ADD_COMMIT_SHA% %ARGUMENTS%
|
||||
)
|
||||
|
||||
IF NOT %ERRORLEVEL%==0 GOTO :Error
|
||||
|
||||
+2
-1
@@ -110,7 +110,7 @@ IF "!GENERATOR!"=="" IF NOT "%VisualStudioVersion%"=="" (
|
||||
set GENERATOR_CHECK=%GENERATOR: Win64=%
|
||||
cmake --help | findstr /c:%GENERATOR_CHECK% >nul
|
||||
if not %ERRORLEVEL%==0 (
|
||||
call utils\cecho.cmd 0 12 "%~nx0: The used CMake version does not support '`"!GENERATOR!`'"- cannot proceed."
|
||||
call utils\cecho.cmd 0 12 "%~nx0: The used CMake version does not support generator '`"!GENERATOR!`'"- cannot proceed."
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
@@ -207,6 +207,7 @@ IF %VS_PLATFORM%==ARM64 (
|
||||
FOR /f "delims=" %%i in ('where cmake') DO set CMAKE_PATH=%%i
|
||||
IF NOT "%CMAKE_PATH%"=="" (
|
||||
FOR /f "delims=" %%i in ('cmake --version ^| findstr /C:"cmake version 3"') DO GOTO :CMake3AndNewer
|
||||
FOR /f "delims=" %%i in ('cmake --version ^| findstr /C:"cmake version 4"') DO GOTO :CMake3AndNewer
|
||||
)
|
||||
|
||||
:: reject older CMake, see also build-deps.cmd
|
||||
|
||||
Reference in New Issue
Block a user