View Issue Details

IDProjectCategoryView StatusLast Update
0029317Open CASCADEOCCT:Configurationpublic2018-06-29 21:19
Reporterkgv Assigned Tobugmaster  
PrioritylowSeveritytrivial 
Status closedResolutionfixed 
Product Version7.0.0 
Target Version7.3.0Fixed in Version7.3.0 
Summary0029317: Configuration, CMake - CSF_d3d9 should be processed for building TKD3DHost using MinGW
DescriptionCSF_d3d9 is required for building TKD3DHost, but it is not processed by CMake scripts (D3D9.lib). This is not an issue for MSVC builds, because pragma extension is supported:
#ifdef _MSC_VER
  #pragma comment (lib, "D3D9.lib")
#endif

But for MinGW builds, D3D9.lib should be specified explicitly:
CMakeFiles\TKD3DHost.dir/objects.a(D3DHost_View.cxx.obj):D3DHost_View.cxx:(.text+0x93c): undefined reference to `Direct3DCreate9'
collect2.exe: error: ld returned 1 exit status
mingw32-make[2]: *** [src\TKD3DHost\CMakeFiles\TKD3DHost.dir\build.make:165: win64/gcc/bin/libTKD3DHost.dll] Error 1
mingw32-make[1]: *** [CMakeFiles\Makefile2:1461: src/TKD3DHost/CMakeFiles/TKD3DHost.dir/all] Error 2
mingw32-make[1]: *** Waiting for unfinished jobs....
mingw32-make: *** [Makefile:129: all] Error 2
Steps To Reproduce
@echo OFF

rem Auxiliary script for semi-automated building of OCCT for Mingw-w64 platform.
rem Script should be placed into root of OCCT repository, edited with paths to CMake and 3rd-parties.

set "aCasSrc=%~dp0"
set aNbJobs=%NUMBER_OF_PROCESSORS%

call c:\mingw-7.1.0-win32-sjlj\mingwvars.bat
set "PATH=c:\CMake\bin;%PATH%"

set "aFreeType=c:/3rdparty/mingw/freetype-2.6.3-mingw-64"
set "aTclTk=c:/3rdparty/mingw/tcltk-8.6.4-mingw-64"
set "aFreeImage=c:/3rdparty/mingw/freeimage-3.17-0-mingw-64"

call :cmakeGenerate

pause

goto :eof

:cmakeGenerate
set "aPlatformAndCompiler=mingw64"
set "aWorkDir=work\%aPlatformAndCompiler%-make"
set "aLogFile=%~dp0build-%aPlatformAndCompiler%.log"
if not exist "%aWorkDir%" ( mkdir "%aWorkDir%" )
if     exist "%aLogFile%" ( del   "%aLogFile%" )

pushd "%aWorkDir%"

set STARTTIME=%TIME%
echo Configuring OCCT for MinGW-w64...
cmake -G "MinGW Makefiles" ^
 -D CMAKE_BUILD_TYPE:STRING="Release" ^
 -D BUILD_LIBRARY_TYPE:STRING="Shared" ^
 -D BUILD_MODULE_Draw:BOOL="ON" ^
 -D BUILD_MODULE_MfcSamples:BOOL="OFF" ^
 -D INSTALL_DIR:PATH="%~dp0work/%aPlatformAndCompiler%" ^
 -D INSTALL_DIR_INCLUDE:STRING="inc" ^
 -D INSTALL_DIR_RESOURCE:STRING="src" ^
 -D 3RDPARTY_FREETYPE_DIR:PATH="%aFreeType%" ^
 -D 3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2:FILEPATH="%aFreeType%/include" ^
 -D 3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build:FILEPATH="%aFreeType%/include" ^
 -D 3RDPARTY_FREETYPE_LIBRARY_DIR:PATH="%aFreeType%/lib" ^
 -D 3RDPARTY_TCL_DIR:PATH="%aTclTk%" ^
 -D 3RDPARTY_TCL_INCLUDE_DIR:FILEPATH="%aTclTk%/include" ^
 -D 3RDPARTY_TCL_LIBRARY_DIR:PATH="%aTclTk%/lib" ^
 -D 3RDPARTY_TCL_DLL_DIR:PATH="%aTclTk%/bin" ^
 -D 3RDPARTY_TK_DIR:PATH="%aTclTk%" ^
 -D 3RDPARTY_TK_INCLUDE_DIR:FILEPATH="%aTclTk%/include" ^
 -D 3RDPARTY_TK_LIBRARY_DIR:PATH="%aTclTk%/lib" ^
 -D 3RDPARTY_TK_DLL_DIR:PATH="%aTclTk%/bin" ^
 -D USE_D3D:BOOL="ON" ^
 -D USE_FREEIMAGE:BOOL="ON" ^
 -D 3RDPARTY_FREEIMAGE_DIR:PATH="%aFreeImage%" ^
 -D 3RDPARTY_FREEIMAGE_INCLUDE_DIR:FILEPATH="%aFreeImage%/include" ^
 -D 3RDPARTY_FREEIMAGE_LIBRARY_DIR:PATH="%aFreeImage%/lib" ^
 "%aCasSrc%"

if errorlevel 1 (
  popd
  pause
  exit /B
  goto :eof
)

mingw32-make clean

echo Building OCCT...
mingw32-make -j %aNbJobs% 2>> %aLogFile%
type %aLogFile%
if errorlevel 1 (
  popd
  pause
  exit /B
  goto :eof
)
echo Installing OCCT into %~dp0work/%aPlatformAndCompiler%...
mingw32-make install 2>> %aLogFile%

set ENDTIME=%TIME%
rem handle time before 10AM (win10 - remove empty space at the beginning)
if "%STARTTIME:~0,1%"==" " set "STARTTIME=%STARTTIME:~1%"
if   "%ENDTIME:~0,1%"==" " set   "ENDTIME=%ENDTIME:~1%"
rem handle time before 10AM (win7 - add 0 at the beginning)
if "%STARTTIME:~1,1%"==":" set "STARTTIME=0%STARTTIME%"
if   "%ENDTIME:~1,1%"==":" set   "ENDTIME=0%ENDTIME%"
rem convert hours:minutes:seconds:ms into duration
set /A STARTTIME=(1%STARTTIME:~0,2%-100)*360000 + (1%STARTTIME:~3,2%-100)*6000 + (1%STARTTIME:~6,2%-100)*100 + (1%STARTTIME:~9,2%-100)
set /A   ENDTIME=  (1%ENDTIME:~0,2%-100)*360000 +   (1%ENDTIME:~3,2%-100)*6000 +   (1%ENDTIME:~6,2%-100)*100 +   (1%ENDTIME:~9,2%-100)
set /A DURATION=%ENDTIME%-%STARTTIME%
if %ENDTIME% LSS %STARTTIME% set set /A DURATION=%STARTTIME%-%ENDTIME%
set /A DURATIONH=%DURATION% / 360000
set /A DURATIONM=(%DURATION% - %DURATIONH%*360000) / 6000
set /A DURATIONS=(%DURATION% - %DURATIONH%*360000 - %DURATIONM%*6000) / 100
if %DURATIONH% LSS 10 set DURATIONH=0%DURATIONH%
if %DURATIONM% LSS 10 set DURATIONM=0%DURATIONM%
if %DURATIONS% LSS 10 set DURATIONS=0%DURATIONS%
echo Building time: %DURATIONH%:%DURATIONM%:%DURATIONS% for %anAbi%
echo Building time: %DURATIONH%:%DURATIONM%:%DURATIONS% >> %aLogFile%

popd
goto :eof
TagsNo tags attached.
Test case numberNot required

Relationships

related to 0027197 closedabv Open CASCADE Configuration - fix compilation issues when using mingw 

Activities

git

2017-11-14 11:38

administrator   ~0072236

Branch CR29317 has been created by kgv.

SHA-1: b8db47d1e520cffd32e0deff1a62285deab6a876


Detailed log of new commits:

Author: kgv
Date: Tue Nov 14 11:38:31 2017 +0300

    0029317: Configuration, CMake - CSF_d3d9 should be processed for building TKD3DHost using MinGW

kgv

2017-11-14 13:38

developer   ~0072238

Please test the patch (OCCT building, no need in regression testing).

bugmaster

2017-11-14 15:46

administrator   ~0072244

Combination -
OCCT branch: CR29317 SHA: b8db47d1e520cffd32e0deff1a62285deab6a876
Products branch: master
was compiled on Linux, MacOS and Windows platforms .

Number of compiler warnings:
No new/fixed warnings.

git

2017-12-07 21:08

administrator   ~0072816

Branch CR29317 has been deleted by kgv.

SHA-1: b8db47d1e520cffd32e0deff1a62285deab6a876

Related Changesets

occt: master 2c26e60b

2017-11-14 08:38:31

kgv


Committer: bugmaster Details Diff
0029317: Configuration, CMake - CSF_d3d9 should be processed for building TKD3DHost using MinGW Affected Issues
0029317
mod - adm/cmake/occt_csf.cmake Diff File

Issue History

Date Modified Username Field Change
2017-11-14 10:55 kgv New Issue
2017-11-14 10:55 kgv Assigned To => bugmaster
2017-11-14 10:57 kgv Priority normal => low
2017-11-14 10:57 kgv Product Version 7.2.0 => 7.0.0
2017-11-14 10:57 kgv Severity minor => trivial
2017-11-14 10:57 kgv Relationship added related to 0027197
2017-11-14 10:59 kgv Description Updated
2017-11-14 11:01 kgv Description Updated
2017-11-14 11:01 kgv Steps to Reproduce Updated
2017-11-14 11:38 git Note Added: 0072236
2017-11-14 13:38 kgv Note Added: 0072238
2017-11-14 13:38 kgv Status new => resolved
2017-11-14 13:38 kgv Status resolved => reviewed
2017-11-14 15:46 bugmaster Test case number => Not required
2017-11-14 15:46 bugmaster Note Added: 0072244
2017-11-14 15:46 bugmaster Status reviewed => tested
2017-11-17 16:10 bugmaster Changeset attached => occt master 2c26e60b
2017-11-17 16:10 bugmaster Status tested => verified
2017-11-17 16:10 bugmaster Resolution open => fixed
2017-12-07 21:08 git Note Added: 0072816
2018-02-18 00:08 abv Target Version 7.4.0 => 7.3.0
2018-06-29 21:15 aiv Fixed in Version => 7.3.0
2018-06-29 21:19 aiv Status verified => closed