Skip to content

undefined symbol: pthread_attr_setscope when using certain VTK libraries #247

@swederik

Description

@swederik

Hello,

For Project Week 31 I am trying to build the PolySeg library for the web. PolySeg is used in Slicer to manage segmentations and convert between different representations (contour / ribbon / lablemap) of segmentation maps.

I've run into an issue which I believe is related to multithreading used by VTK (or perhaps ITK?). When I build I get this:

error: undefined symbol: pthread_attr_setscope

I'm posting to see if anyone has run into this issue or has any ideas on how to fix it.

Under the assumption that this is pthread in VTK, I'm trying to set CMAKE_USE_PTHREADS_INIT to False for VTK when building the dockcross image.

https://github.com/Kitware/VTK/blob/2345d908224ae8f2999f7a8783cefd32cd48f2cf/Common/Core/CMakeLists.txt#L328

I see that @thewtex has set some environment variable (ITK_GLOBAL_DEFAULT_THREADER) in the past that also deals with multithreading, so maybe this is related, or maybe there's a VTK equivalent?

https://github.com/InsightSoftwareConsortium/itk-js/pull/143/files#diff-389705e038e06cfe5a0459474146ee35R3

My in-progress PR is here: PerkLab/PolySeg#4

If I skip importing things from PolySeg and just use simple things like e.g. vtkSphereSource, everything builds and runs properly.

Quite possibly related:

https://github.com/Kitware/VTK/blob/6b559c65bb90614fb02eb6d1b9e3f0fca3fe4b0b/Common/Core/vtkConditionVariable.cxx#L25

Update: It looks like you can avoid the issue by adding -s ERROR_ON_UNDEFINED_SYMBOLS=0 to ITKBridgeJavaScript.cmake and rebuilding the docker image. I don't know yet if this actually impacts the functionality.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions