View Issue Details

IDProjectCategoryView StatusLast Update
0027402CommunityOCCT:Configurationpublic2016-12-09 16:37
ReporterBenjaminBihler Assigned Tobugmaster  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
PlatformMinGwOSWindows 
Target Version7.1.0Fixed in Version7.1.0 
Summary0027402: Configuration, CMake - fix compilation with MinGw and additional libraries
DescriptionCompilation fails with the following error message:

[ 46%] Linking CXX shared library ../../win64/gcc/bin/libTKOpenGl.dll
CMakeFiles/TKOpenGl.dir/objects.a(OpenGl_Text.cxx.obj):OpenGl_Text.cxx:(.text+0x39b1): undefined reference to `gl2psTextOpt'
CMakeFiles/TKOpenGl.dir/objects.a(OpenGl_Workspace.cxx.obj):OpenGl_Workspace.cxx:(.text+0x2104): undefined reference to `gl2psPointSize'
CMakeFiles/TKOpenGl.dir/objects.a(OpenGl_Workspace.cxx.obj):OpenGl_Workspace.cxx:(.text+0x2ae6): undefined reference to `gl2psPointSize'
CMakeFiles/TKOpenGl.dir/objects.a(OpenGl_Workspace.cxx.obj):OpenGl_Workspace.cxx:(.text+0x2dd3): undefined reference to `gl2psPointSize'
CMakeFiles/TKOpenGl.dir/objects.a(OpenGl_Workspace.cxx.obj):OpenGl_Workspace.cxx:(.text+0x32d3): undefined reference to `gl2psPointSize'
CMakeFiles/TKOpenGl.dir/objects.a(OpenGl_View.cxx.obj):OpenGl_View.cxx:(.text+0x4ea): undefined reference to `gl2psEndPage'
CMakeFiles/TKOpenGl.dir/objects.a(OpenGl_View.cxx.obj):OpenGl_View.cxx:(.text+0x577): undefined reference to `gl2psBeginPage'
CMakeFiles/TKOpenGl.dir/objects.a(OpenGl_View.cxx.obj):OpenGl_View.cxx:(.text+0x71a): undefined reference to `gl2psEndPage'
CMakeFiles/TKOpenGl.dir/objects.a(OpenGl_View.cxx.obj):OpenGl_View.cxx:(.text+0x78c): undefined reference to `gl2psBeginPage'
CMakeFiles/TKOpenGl.dir/objects.a(OpenGl_Context.cxx.obj):OpenGl_Context.cxx:(.text+0xbc25): undefined reference to `gl2psDisable'
CMakeFiles/TKOpenGl.dir/objects.a(OpenGl_Context.cxx.obj):OpenGl_Context.cxx:(.text+0xbc36): undefined reference to `gl2psEnable'
CMakeFiles/TKOpenGl.dir/objects.a(OpenGl_Context.cxx.obj):OpenGl_Context.cxx:(.text+0x92f9): undefined reference to `gl2psLineWidth'
collect2.exe: error: ld returned 1 exit status
src/TKOpenGl/CMakeFiles/TKOpenGl.dir/build.make:1594: recipe for target `win64/gcc/bin/libTKOpenGl.dll' failed
make[2]: *** [win64/gcc/bin/libTKOpenGl.dll] Error 1
CMakeFiles/Makefile2:1326: recipe for target `src/TKOpenGl/CMakeFiles/TKOpenGl.dir/all' failed
make[1]: *** [src/TKOpenGl/CMakeFiles/TKOpenGl.dir/all] Error 2
Makefile:127: recipe for target `all' failed
make: *** [all] Error 2
TagsNo tags attached.
Test case number

Attached Files

  • gl2ps.png (14,449 bytes)

Relationships

related to 0027397 closedbugmaster Offer Precompiled Additional Libraries for MinGW 

Activities

git

2016-04-21 12:43

administrator   ~0053464

Branch CR27402 has been created by BenjaminBihler.

SHA-1: 1e96e056a54862e8f4f0c1131d1c45593390a16d


Detailed log of new commits:

Author: Benjamin Bihler
Date: Tue Apr 19 15:57:13 2016 +0200

    0027402: Fix Compilation with MinGw and Additional Libraries
    
    Added MinGw library suffix to a in 3rdparty_macro.cmake, freetype.cmake and tbb.cmake.

Author: Benjamin Bihler
Date: Tue Apr 19 15:03:03 2016 +0200

    0027402: Fix Compilation with MinGw and Additional Libraries
    
    Setting CSF_GL2PS in occt_csf.cmake in the same way as CSF_FREETYPE is set.

BenjaminBihler

2016-04-22 11:24

developer   ~0053492

Kirill, my compilation troubles are solved. I have posted a performance comparison to the forum.

In my opinion CMake is doing a bad job by proposing "-O3" as the default release optimization parameter for g++. The binaries become larger, but the speed is almost the same. (I have not done comparisons on Linux, there "-O3" might indeed be better than "-O2".) Also other build tools like qmake set the default optimization parameter to "-O2".

What would be your opinion about adding a line to CMakeLists.txt that sets the default release optimization parameter to "-O2", if the compiler is MinGW? I could do that. If you agree, should I add a commit to this branch before setting it to "fixed" or should I create another issue?

Thanks for the answer!

kgv

2016-04-22 12:16

developer   ~0053497

> What would be your opinion about adding a line to CMakeLists.txt that sets the default release optimization parameter to "-O2", if the compiler is MinGW?
> I could do that. If you agree, should I add a commit to this branch before setting it to "fixed" or should I create another issue?
I don't have much opinion about -O2/-O3 settings. The size might be increased due to greater inlining limits.

But anyway, this change would be unrelated to this bug and should be done in dedicated patch.

I switch the bug to resolved - as far as I understand current patch already solves the initial problem.

BenjaminBihler

2016-04-22 12:23

developer   ~0053498

You are right, this is definitely because of the inlining. I will create another issue. Thank you.

ibs

2016-04-25 10:52

developer  

gl2ps.png (14,449 bytes)

ibs

2016-04-25 11:01

developer   ~0053533

dear Benjamin,

I guess, the part of your fix is redundant for "non-android case". Could you see the attached screenshot please and share your thoughts?

git

2016-04-25 11:20

administrator   ~0053535

Branch CR27402 has been updated by BenjaminBihler.

SHA-1: 4ac4abcd2c0a538c1aaef47833e8523b7c8131fa


Detailed log of new commits:

Author: Benjamin Bihler
Date: Mon Apr 25 10:20:10 2016 +0200

    0027402: Fix Compilation with MinGw and Additional Libraries
    
    Removed redundant CSF_GL2PS definition for non-Win32 configurations

BenjaminBihler

2016-04-25 11:20

developer   ~0053536

ibs, you are right. The first set of inserts into the file within "if (WIN32)" is necessary, the second set of inserts is redundant. I have overlooked that the setting is already there.

I have fixed that.

ibs

2016-04-25 11:49

developer   ~0053538

Thank you for your rapid answer :)

ibs

2016-04-25 11:50

developer   ~0053539

dear bugmaster,
please integrate the fix

git

2016-05-20 12:22

administrator   ~0054205

Branch CR27402 has been deleted by inv.

SHA-1: 4ac4abcd2c0a538c1aaef47833e8523b7c8131fa

Related Changesets

occt: master eaffb01e

2016-04-19 13:03:03

BenjaminBihler


Committer: bugmaster Details Diff
0027402: Fix Compilation with MinGw and Additional Libraries

Setting CSF_GL2PS in occt_csf.cmake in the same way as CSF_FREETYPE is set.

Added MinGw library suffix to a in 3rdparty_macro.cmake, freetype.cmake and tbb.cmake.

Removed redundant CSF_GL2PS definition for non-Win32 configurations
Affected Issues
0027402
mod - adm/cmake/3rdparty_macro.cmake Diff File
mod - adm/cmake/freetype.cmake Diff File
mod - adm/cmake/occt_csf.cmake Diff File
mod - adm/cmake/tbb.cmake Diff File

Issue History

Date Modified Username Field Change
2016-04-19 15:36 BenjaminBihler New Issue
2016-04-19 15:36 BenjaminBihler Assigned To => BenjaminBihler
2016-04-19 15:37 BenjaminBihler Relationship added related to 0027397
2016-04-21 12:43 git Note Added: 0053464
2016-04-21 14:24 kgv Category OCCT:Application Framework => OCCT:Configuration
2016-04-21 14:24 kgv Summary Fix Compilation with MinGw and Additional Libraries => Configuration, CMake - fix compilation with MinGw and additional libraries
2016-04-22 11:24 BenjaminBihler Note Added: 0053492
2016-04-22 12:16 kgv Note Added: 0053497
2016-04-22 12:16 kgv Assigned To BenjaminBihler => ibs
2016-04-22 12:16 kgv Status new => resolved
2016-04-22 12:23 BenjaminBihler Note Added: 0053498
2016-04-25 10:52 ibs File Added: gl2ps.png
2016-04-25 11:01 ibs Note Added: 0053533
2016-04-25 11:01 ibs Assigned To ibs => BenjaminBihler
2016-04-25 11:01 ibs Status resolved => feedback
2016-04-25 11:20 git Note Added: 0053535
2016-04-25 11:20 BenjaminBihler Note Added: 0053536
2016-04-25 11:49 ibs Note Added: 0053538
2016-04-25 11:50 ibs Note Added: 0053539
2016-04-25 11:50 ibs Assigned To BenjaminBihler => bugmaster
2016-04-25 11:50 ibs Status feedback => reviewed
2016-04-29 16:10 bugmaster Changeset attached => occt master eaffb01e
2016-04-29 16:10 bugmaster Status reviewed => verified
2016-04-29 16:10 bugmaster Resolution open => fixed
2016-05-20 12:22 git Note Added: 0054205
2016-12-09 16:31 aiv Status verified => closed
2016-12-09 16:37 aiv Fixed in Version => 7.1.0