From 2d8b1cf9d07f2af0a34da8bca20418c20a317a52 Mon Sep 17 00:00:00 2001 From: Nabil Ghodbane Date: Tue, 16 Mar 2021 16:30:54 +0100 Subject: [PATCH] openturns windows - use MinGW instead of MSBuild --- products/compil_scripts/openturns.bat | 83 ++++++++++++++++++++------- products/openturns.pyconf | 2 +- 2 files changed, 64 insertions(+), 21 deletions(-) diff --git a/products/compil_scripts/openturns.bat b/products/compil_scripts/openturns.bat index b229e3b..ea2eca6 100644 --- a/products/compil_scripts/openturns.bat +++ b/products/compil_scripts/openturns.bat @@ -18,47 +18,90 @@ REM clean BUILD directory if exist "%BUILD_DIR%" rmdir /Q /S %BUILD_DIR% mkdir %BUILD_DIR% cd %BUILD_DIR% - -SET CMAKE_OPTIONS=-DCMAKE_INSTALL_PREFIX:STRING=%PRODUCT_INSTALL:\=/% +set path=%MINGW_ROOT_DIR%\bin;%path% +set CMAKE_OPTIONS= +SET CMAKE_OPTIONS=%CMAKE_OPTIONS% -DCMAKE_INSTALL_PREFIX:STRING=%PRODUCT_INSTALL:\=/% SET CMAKE_OPTIONS=%CMAKE_OPTIONS% -DCMAKE_BUILD_TYPE:STRING=%PRODUCT_BUILD_TYPE% SET CMAKE_OPTIONS=%CMAKE_OPTIONS% -DPYTHON_EXECUTABLE=%PYTHON_ROOT_DIR:\=/%/python.exe -SET CMAKE_OPTIONS=%CMAKE_OPTIONS% -DCMAKE_GENERATOR="Visual Studio 15 2017 Win64" +SET CMAKE_OPTIONS=%CMAKE_OPTIONS% -DLAPACK_LIBRARIES=%LAPACK_ROOT_DIR:\=/%/lib/liblapack.dll +SET CMAKE_OPTIONS=%CMAKE_OPTIONS% -DBLAS_LIBRARIES=%LAPACK_ROOT_DIR:\=/%/lib/libblas.dll +REM SET CMAKE_OPTIONS=%CMAKE_OPTIONS% -DCMAKE_GENERATOR="Visual Studio 15 2017 Win64" +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DCMAKE_SIZEOF_VOID_P=8 +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DCMAKE_Fortran_COMPILER=%MINGW_ROOT_DIR:\=/%/bin/gfortran.exe +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DCMAKE_EXE_LINKER_FLAGS="-Wl,--allow-multiple-definition" +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DCMAKE_SH="CMAKE_SH-NOTFOUND" +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DCMAKE_GENERATOR="MinGW Makefiles" cd %BUILD_DIR% echo. -echo -------------------------------------------------------------------------- -echo *** %CMAKE_ROOT%\bin\cmake %CMAKE_OPTIONS% %SOURCE_DIR% -echo -------------------------------------------------------------------------- - +echo ********************************************************************* +echo *** cmake %CMAKE_OPTIONS}% +echo ********************************************************************* %CMAKE_ROOT%\bin\cmake %CMAKE_OPTIONS% %SOURCE_DIR% if NOT %ERRORLEVEL% == 0 ( - echo ERROR on CMake + echo "ERROR on cmake" exit 1 ) echo. -echo -------------------------------------------------------------------------- -echo *** msbuild %MAKE_OPTIONS% ALL_BUILD.vcxproj /p:Configuration=%PRODUCT_BUILD_TYPE% /p:Platform=x64 -echo -------------------------------------------------------------------------- - -msbuild %MAKE_OPTIONS% ALL_BUILD.vcxproj /p:Configuration=%PRODUCT_BUILD_TYPE% /p:Platform=x64 +echo ********************************************************************* +echo *** mingw32-make +echo ********************************************************************* +echo. +mingw32-make if NOT %ERRORLEVEL% == 0 ( - echo ERROR on msbuild ALL_BUILD.vcxproj + echo ERROR on mingw32-make exit 2 ) echo. -echo -------------------------------------------------------------------------- -echo *** msbuild %MAKE_OPTIONS% INSTALL.vcxproj /p:Configuration=%PRODUCT_BUILD_TYPE% /p:Platform=x64 -echo -------------------------------------------------------------------------- - -msbuild %MAKE_OPTIONS% INSTALL.vcxproj /p:Configuration=%PRODUCT_BUILD_TYPE% /p:Platform=x64 +echo ********************************************************************* +echo *** installation... +echo ********************************************************************* +echo. +mingw32-make install if NOT %ERRORLEVEL% == 0 ( - echo ERROR on msbuild INSTALL.vcxproj + echo ERROR on mingw32-make install exit 3 ) + + + +REM echo. +REM echo -------------------------------------------------------------------------- +REM echo *** %CMAKE_ROOT%\bin\cmake %CMAKE_OPTIONS% %SOURCE_DIR% +REM echo -------------------------------------------------------------------------- + +REM %CMAKE_ROOT%\bin\cmake %CMAKE_OPTIONS% %SOURCE_DIR% +REM if NOT %ERRORLEVEL% == 0 ( + REM echo ERROR on CMake + REM exit 1 +REM ) + +REM echo. +REM echo -------------------------------------------------------------------------- +REM echo *** msbuild %MAKE_OPTIONS% ALL_BUILD.vcxproj /p:Configuration=%PRODUCT_BUILD_TYPE% /p:Platform=x64 +REM echo -------------------------------------------------------------------------- + +REM msbuild %MAKE_OPTIONS% ALL_BUILD.vcxproj /p:Configuration=%PRODUCT_BUILD_TYPE% /p:Platform=x64 +REM if NOT %ERRORLEVEL% == 0 ( + REM echo ERROR on msbuild ALL_BUILD.vcxproj + REM exit 2 +REM ) + +REM echo. +REM echo -------------------------------------------------------------------------- +REM echo *** msbuild %MAKE_OPTIONS% INSTALL.vcxproj /p:Configuration=%PRODUCT_BUILD_TYPE% /p:Platform=x64 +REM echo -------------------------------------------------------------------------- + +REM msbuild %MAKE_OPTIONS% INSTALL.vcxproj /p:Configuration=%PRODUCT_BUILD_TYPE% /p:Platform=x64 +REM if NOT %ERRORLEVEL% == 0 ( + REM echo ERROR on msbuild INSTALL.vcxproj + REM exit 3 +REM ) + taskkill /F /IM "mspdbsrv.exe" echo. diff --git a/products/openturns.pyconf b/products/openturns.pyconf index 3c33339..d12cf87 100644 --- a/products/openturns.pyconf +++ b/products/openturns.pyconf @@ -8,7 +8,7 @@ default : { env_script : $name + ".py" } - depend : ['Python', 'lapack', 'hdf5', 'tbb', 'nlopt', 'libxml2', 'eigen'] + depend : ['Python', 'lapack', 'hdf5', 'tbb', 'nlopt', 'libxml2', 'eigen','pthreads'] build_depend : ["cmake", "swig"] patches : [] source_dir : $APPLICATION.workdir + $VARS.sep + 'SOURCES' + $VARS.sep + $name -- 2.39.2