View Issue Details

IDProjectCategoryView StatusLast Update
0027152Open CASCADEOCCT:Configurationpublic2017-08-18 12:37
Reporterapn Assigned Toabv  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Target Version7.0.0Fixed in Version7.0.0 
Summary0027152: Undefined symbols in library TKernel.so using clang compiler
Descriptionundefined symbol: dlopen (./libTKernel.so)
undefined symbol: dlclose (./libTKernel.so)
undefined symbol: dlerror (./libTKernel.so)
undefined symbol: dlsym (./libTKernel.so)

clang --version
Ubuntu clang version 3.6.2-1 (tags/RELEASE_362/final) (based on LLVM 3.6.2)
Steps To ReproduceOn Linux:

- build without TBB
- run:
  ldd -r libTKernel.so
- check for undefined symbols
TagsNo tags attached.
Test case numberNot needed

Relationships

parent of 0029016 closedbugmaster Configuration, genproj.tcl - add missing definition of CSF_dl 

Activities

git

2016-02-10 18:11

administrator   ~0050596

Branch CR27152 has been created by apn.

SHA-1: ef221ddc9c628cc91f2c8057f6919e6b465ae3a1


Detailed log of new commits:

Author: apn
Date: Wed Feb 10 18:11:36 2016 +0300

    0027152: Undefined symbols in library TKernel.so using clang compiler
    
    Added llvm library dependency when clang compiler is used

apn

2016-02-10 18:12

administrator   ~0050597

Dear ibs, could you please review CR27152.

abv

2016-02-11 09:15

manager   ~0050607

I have the same configuration (VirtualBox VM with Ubuntu 5.10 and CLang 3.6.2) and it builds and works just fine using CMake on current master. Please re-check this.

apn

2016-02-15 16:49

administrator   ~0050763

There are errors in PRODUCTS during linking OCCLicenseGen and XtSchemaParser (vm-U1510-01 clang version 3.6.2-1):

Linking CXX executable ../../lin64/clang/bin/OCCLicenseGen
/U1510-64-clang-opt/OCCT/lin64/clang/lib/libTKernel.so: undefined reference to `dlopen'
/U1510-64-clang-opt/OCCT/lin64/clang/lib/libTKernel.so: undefined reference to `dlclose'
/U1510-64-clang-opt/OCCT/lin64/clang/lib/libTKernel.so: undefined reference to `dlerror'
/U1510-64-clang-opt/OCCT/lin64/clang/lib/libTKernel.so: undefined reference to `dlsym'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
src/OCCLicenseGen/CMakeFiles/OCCLicenseGen.dir/build.make:89
make[2]: *** [lin64/clang/bin/OCCLicenseGen-7.0.0] Error 1

Linking CXX executable ../../lin64/clang/bin/XtSchemaParser
/U1510-64-clang-opt/OCCT/lin64/clang/lib/libTKernel.so: undefined reference to `dlclose'
/U1510-64-clang-opt/OCCT/lin64/clang/lib/libTKernel.so: undefined reference to `dlsym'
/U1510-64-clang-opt/OCCT/lin64/clang/lib/libTKernel.so: undefined reference to `dlopen'
/U1510-64-clang-opt/OCCT/lin64/clang/lib/libTKernel.so: undefined reference to `dlerror'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
src/XtSchemaParser/CMakeFiles/XtSchemaParser.dir/build.make:104
make[2]: *** [lin64/clang/bin/XtSchemaParser-7.0.0] Error 1

Problem is solved by adding LLVM dependency to OCCLicenseGen and XtSchemaParser.
Dear abv, could you please review products branch CR27152.

git

2016-02-16 14:25

administrator   ~0050811

Branch CR27152 has been updated forcibly by apn.

SHA-1: 5090030b5cf209e68870d7b6b7952068f2faee1f

apn

2016-02-16 17:38

administrator   ~0050831

Added dl library dependency for TKernel in occt_toolkit.cmake instead of CSF_dl in TKernel's EXTERNLIB.

abv

2016-02-16 22:16

manager   ~0050850

I seem to be able to reproduce this problem (ldd on TKernel.so does not list libdl.so) when building without TBB, can you confirm if you also building without TBB?

abv

2016-02-17 07:23

manager   ~0050852

I propose adding an option "-z defs" in CMake on Linux to force linker errors if some symbol cannot be found during toolkit building. Additional flag "-lm" must be added to link to math library (for all toolkits, since we should be able to use C math functions from any place). Flag "-ldl" can be added for TKernel only, but can be also necessary for other libs -- this is to be checked.

apn

2016-02-17 12:37

administrator   ~0050864

Last edited: 2016-02-17 14:29

There is no undefined symbols in library TKernel.so when building with TBB. Also it's reproduced on Debian without TBB.

git

2016-02-17 15:59

administrator   ~0050887

Branch CR27152_1 has been created by apn.

SHA-1: 2923aaf328f989b9bb56c27fe5bb4a82c8849db6


Detailed log of new commits:

Author: apn
Date: Wed Feb 17 15:59:12 2016 +0300

    0027152: Undefined symbols in library TKernel.so using clang compiler
    
    Added ldl dependency for TKernel only (other toolkits were checked, no undefined symbols)
    Added option "-z defs" for linking on Linux
    Added lm dependency for all toolkits

git

2016-02-17 16:18

administrator   ~0050890

Branch CR27152_1 has been updated forcibly by apn.

SHA-1: 1a5cfe9f6edc78bb56c9e65e07df200e33fc80d8

abv

2016-02-17 16:24

manager   ~0050891

No remarks, please integrate

git

2016-04-17 13:27

administrator   ~0052871

Branch CR27152 has been deleted by kgv.

SHA-1: 5090030b5cf209e68870d7b6b7952068f2faee1f

git

2016-04-17 13:27

administrator   ~0052872

Branch CR27152_1 has been deleted by kgv.

SHA-1: 1a5cfe9f6edc78bb56c9e65e07df200e33fc80d8

Related Changesets

occt: master c2c9890c

2016-02-17 12:59:12

abv


Committer: abv Details Diff
0027152: Undefined symbols in library TKernel.so using clang compiler

Added ldl dependency for TKernel only (other toolkits were checked, no undefined symbols)
Added option "-z defs" for linking on Linux
Added lm dependency for all toolkits
Affected Issues
0027152
mod - adm/cmake/occt_csf.cmake Diff File
mod - adm/cmake/occt_defs_flags.cmake Diff File
mod - src/TKernel/EXTERNLIB Diff File

Issue History

Date Modified Username Field Change
2016-02-10 16:41 apn New Issue
2016-02-10 16:41 apn Assigned To => bugmaster
2016-02-10 18:11 git Note Added: 0050596
2016-02-10 18:12 apn Note Added: 0050597
2016-02-10 18:12 apn Test case number => Not needed
2016-02-10 18:12 apn Assigned To bugmaster => ibs
2016-02-10 18:12 apn Status new => resolved
2016-02-11 09:14 apn Status resolved => assigned
2016-02-11 09:14 apn Assigned To ibs => apn
2016-02-11 09:15 abv Note Added: 0050607
2016-02-15 16:49 apn Note Added: 0050763
2016-02-15 17:38 apn Assigned To apn => abv
2016-02-15 17:38 apn Status assigned => resolved
2016-02-16 14:25 git Note Added: 0050811
2016-02-16 17:38 apn Note Added: 0050831
2016-02-16 22:16 abv Note Added: 0050850
2016-02-17 07:23 abv Note Added: 0050852
2016-02-17 07:24 abv Assigned To abv => apn
2016-02-17 07:24 abv Status resolved => assigned
2016-02-17 07:24 abv Target Version 7.1.0 => 7.0.0
2016-02-17 07:25 abv Steps to Reproduce Updated
2016-02-17 12:37 apn Note Added: 0050864
2016-02-17 14:29 apn Note Edited: 0050864
2016-02-17 15:59 git Note Added: 0050887
2016-02-17 16:18 git Note Added: 0050890
2016-02-17 16:18 apn Assigned To apn => abv
2016-02-17 16:18 apn Status assigned => resolved
2016-02-17 16:24 abv Note Added: 0050891
2016-02-17 16:24 abv Assigned To abv => bugmaster
2016-02-17 16:24 abv Status resolved => reviewed
2016-02-19 10:43 bugmaster Status reviewed => tested
2016-02-21 08:52 abv Changeset attached => occt master c2c9890c
2016-02-21 08:52 abv Assigned To bugmaster => abv
2016-02-21 08:52 abv Status tested => verified
2016-02-21 08:52 abv Resolution open => fixed
2016-04-17 13:27 git Note Added: 0052871
2016-04-17 13:27 git Note Added: 0052872
2016-04-20 15:43 aiv Fixed in Version => 7.0.0
2016-04-20 15:50 aiv Status verified => closed
2017-08-18 12:37 kgv Relationship added parent of 0029016