Opened 7 years ago

Closed 6 years ago

#55180 closed defect (fixed)

tbb @2017_U8 does not build on Snow Leopard, Mac OS X 10.6.8, because of missing members

Reported by: ballapete (Peter "Pete" Dyballa) Owned by: sean@…
Priority: Normal Milestone:
Component: ports Version: 2.4.2
Keywords: snowleopard Cc:
Port: tbb

Description

sh ../../build/generate_tbbvars.sh DY
/opt/local/bin/clang++-mp-3.9 -E -x c++ ../../src/tbb/mac64-tbb-export.def -g -O2 -DUSE_PTHREAD -stdlib=libc++ -m64 -mrtm  -fPIC  -D__TBB_BUILD=1 -Wall -Wno-non-virtual-dtor -Wno-dangling-else  -I../../src -I../../src/rml/include -I../../include > tbb.def
/opt/local/bin/clang++-mp-3.9 -o tbb_misc.o -c -MMD -g -O2 -DUSE_PTHREAD -stdlib=libc++ -m64 -mrtm  -fPIC  -D__TBB_BUILD=1 -Wall -Wno-non-virtual-dtor -Wno-dangling-else    -I../../src -I../../src/rml/include -I../../include -I. ../../src/tbb/tbb_misc.cpp
/opt/local/bin/clang++-mp-3.9 -fPIC -o libtbb.dylib concurrent_hash_map.o concurrent_queue.o concurrent_vector.o dynamic_link.o itt_notify.o cache_aligned_allocator.o pipeline.o queuing_mutex.o queuing_rw_mutex.o reader_writer_lock.o spin_rw_mutex.o x86_rtm_rw_mutex.o spin_mutex.o critical_section.o mutex.o recursive_mutex.o condition_variable.o tbb_thread.o concurrent_monitor.o semaphore.o private_server.o rml_tbb.o tbb_misc.o tbb_misc_ex.o task.o task_group_context.o governor.o market.o arena.o scheduler.o observer_proxy.o tbb_statistics.o tbb_main.o concurrent_vector_v2.o concurrent_queue_v2.o spin_rw_mutex_v2.o task_v2.o   -ldl -lpthread -dynamiclib -install_name @rpath/libtbb.dylib -install_name /opt/local/lib/libtbb.dylib -stdlib=libc++ -m64  -Wl,-exported_symbols_list,tbb.def
ld: warning: target OS does not support re-exporting symbol std::invalid_argument::~invalid_argument() from /usr/lib/libc++abi.dylib

ld: warning: target OS does not support re-exporting symbol std::length_error::~length_error() from /usr/lib/libc++abi.dylib

ld: warning: target OS does not support re-exporting symbol std::runtime_error::~runtime_error() from /usr/lib/libc++abi.dylib

ld: warning: target OS does not support re-exporting symbol std::range_error::~range_error() from /usr/lib/libc++abi.dylib

ld: warning: target OS does not support re-exporting symbol std::out_of_range::~out_of_range() from /usr/lib/libc++abi.dylib

ld: warning: target OS does not support re-exporting symbol typeinfo for std::invalid_argument from /usr/lib/libc++abi.dylib

ld: warning: target OS does not support re-exporting symbol typeinfo for std::length_error from /usr/lib/libc++abi.dylib

ld: warning: target OS does not support re-exporting symbol typeinfo for std::runtime_error from /usr/lib/libc++abi.dylib

ld: warning: target OS does not support re-exporting symbol typeinfo for std::range_error from /usr/lib/libc++abi.dylib

ld: warning: target OS does not support re-exporting symbol typeinfo for std::out_of_range from /usr/lib/libc++abi.dylib

ld: warning: target OS does not support re-exporting symbol typeinfo name for std::runtime_error from /usr/lib/libc++abi.dylib

ld: warning: target OS does not support re-exporting symbol typeinfo name for std::invalid_argument from /usr/lib/libc++abi.dylib

ld: warning: target OS does not support re-exporting symbol typeinfo name for std::range_error from /usr/lib/libc++abi.dylib

ld: warning: target OS does not support re-exporting symbol typeinfo name for std::length_error from /usr/lib/libc++abi.dylib

ld: warning: target OS does not support re-exporting symbol typeinfo name for std::out_of_range from /usr/lib/libc++abi.dylib

make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_devel_tbb/tbb/work/tbb-2017_U8/build/macports_release'
/usr/bin/make -C "./build/macports_debug"  -r -f ../../build/Makefile.tbbmalloc cfg=debug malloc
make[1]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_devel_tbb/tbb/work/tbb-2017_U8/build/macports_debug'
/opt/local/bin/clang++-mp-3.9 -c -MMD -g -O0 -DTBB_USE_DEBUG -DUSE_PTHREAD -stdlib=libc++ -m64 -mrtm    -fno-rtti -fno-exceptions -D__TBBMALLOC_BUILD=1  -Wno-non-virtual-dtor -Wno-dangling-else -fPIC  -I../../src -I../../src/rml/include -I../../include -I../../src/tbbmalloc -I../../src/tbbmalloc ../../src/tbbmalloc/backend.cpp
/opt/local/bin/clang++-mp-3.9 -c -MMD -g -O0 -DTBB_USE_DEBUG -DUSE_PTHREAD -stdlib=libc++ -m64 -mrtm    -fno-rtti -fno-exceptions -D__TBBMALLOC_BUILD=1  -Wno-non-virtual-dtor -Wno-dangling-else -fPIC  -I../../src -I../../src/rml/include -I../../include -I../../src/tbbmalloc -I../../src/tbbmalloc ../../src/tbbmalloc/large_objects.cpp
/opt/local/bin/clang++-mp-3.9 -c -MMD -g -O0 -DTBB_USE_DEBUG -DUSE_PTHREAD -stdlib=libc++ -m64 -mrtm    -fno-rtti -fno-exceptions -D__TBBMALLOC_BUILD=1  -Wno-non-virtual-dtor -Wno-dangling-else -fPIC  -I../../src -I../../src/rml/include -I../../include -I../../src/tbbmalloc -I../../src/tbbmalloc ../../src/tbbmalloc/backref.cpp
/opt/local/bin/clang++-mp-3.9 -c -MMD -g -O0 -DTBB_USE_DEBUG -DUSE_PTHREAD -stdlib=libc++ -m64 -mrtm    -fno-rtti -fno-exceptions -D__TBBMALLOC_BUILD=1  -Wno-non-virtual-dtor -Wno-dangling-else -fPIC  -I../../src -I../../src/rml/include -I../../include -I../../src/tbbmalloc -I../../src/tbbmalloc ../../src/tbbmalloc/tbbmalloc.cpp
/opt/local/bin/clang++-mp-3.9 -c -MMD -g -O0 -DTBB_USE_DEBUG -DUSE_PTHREAD -stdlib=libc++ -m64 -mrtm    -fno-rtti -fno-exceptions -D__TBBMALLOC_BUILD=1  -Wno-non-virtual-dtor -Wno-dangling-else -fPIC  -o itt_notify_malloc.o -I../../src -I../../src/rml/include -I../../include ../../src/tbb/itt_notify.cpp
/opt/local/bin/clang++-mp-3.9 -c -MMD -g -O0 -DTBB_USE_DEBUG -DUSE_PTHREAD -stdlib=libc++ -m64 -mrtm    -fno-rtti -fno-exceptions -D__TBBMALLOC_BUILD=1  -Wno-non-virtual-dtor -Wno-dangling-else -fPIC  -I../../src -I../../src/rml/include -I../../include -I../../src/tbbmalloc -I../../src/tbbmalloc -I. ../../src/tbbmalloc/frontend.cpp
/opt/local/bin/clang++-mp-3.9 -E -x c++ ../../src/tbbmalloc/mac64-tbbmalloc-export.def -g -O0 -DTBB_USE_DEBUG -DUSE_PTHREAD -stdlib=libc++ -m64 -mrtm    -fno-rtti -fno-exceptions -D__TBBMALLOC_BUILD=1  -Wno-non-virtual-dtor -Wno-dangling-else -I../../src -I../../src/rml/include -I../../include > tbbmalloc.def
/opt/local/bin/clang++-mp-3.9 -c -MMD -g -O0 -DTBB_USE_DEBUG -DUSE_PTHREAD -stdlib=libc++ -m64 -mrtm  -Wall   -Wno-non-virtual-dtor -Wno-dangling-else -fPIC  -D__TBBMALLOC_BUILD=1 -I../../src -I../../src/rml/include -I../../include -I../../src/tbbmalloc -I../../src/tbbmalloc ../../src/tbbmalloc/proxy.cpp
/opt/local/bin/clang++-mp-3.9 -c -MMD -g -O0 -DTBB_USE_DEBUG -DUSE_PTHREAD -stdlib=libc++ -m64 -mrtm  -Wall   -Wno-non-virtual-dtor -Wno-dangling-else -fPIC  -D__TBBMALLOC_BUILD=1 -I../../src -I../../src/rml/include -I../../include -I../../src/tbbmalloc -I../../src/tbbmalloc ../../src/tbbmalloc/tbb_function_replacement.cpp
In file included from ../../src/tbbmalloc/proxy.cpp:67:
../../src/tbbmalloc/proxy_overload_osx.h:142:20: error: no member named 'enable_discharge_checking' in 'malloc_introspection_t'
        introspect.enable_discharge_checking = &impl_zone_enable_discharge_checking;
        ~~~~~~~~~~ ^
../../src/tbbmalloc/proxy_overload_osx.h:143:20: error: no member named 'disable_discharge_checking' in 'malloc_introspection_t'
        introspect.disable_discharge_checking = &impl_zone_disable_discharge_checking;
        ~~~~~~~~~~ ^
../../src/tbbmalloc/proxy_overload_osx.h:144:20: error: no member named 'discharge' in 'malloc_introspection_t'
        introspect.discharge = &impl_zone_discharge;
        ~~~~~~~~~~ ^
../../src/tbbmalloc/proxy_overload_osx.h:158:14: error: no member named 'pressure_relief' in '_malloc_zone_t'
        zone.pressure_relief = &impl_pressure_relief;
        ~~~~ ^
4 errors generated.
make[1]: *** [proxy.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_devel_tbb/tbb/work/tbb-2017_U8/build/macports_debug'
make: *** [tbbmalloc] Error 2

Attachments (1)

main.log (100.7 KB) - added by ballapete (Peter "Pete" Dyballa) 7 years ago.
main.log from Snow Leopard

Download all attachments as: .zip

Change History (12)

Changed 7 years ago by ballapete (Peter "Pete" Dyballa)

Attachment: main.log added

main.log from Snow Leopard

comment:1 Changed 7 years ago by kencu (Ken)

Looks very similar to identical to 44941. Probably fixable, if you follow the advice in that other ticket.

comment:2 Changed 7 years ago by kencu (Ken)

Try this: <https://github.com/macports/macports-ports/pull/964>

If you know how to test tbb better than I, please tell me if this is actually useful on 10.6 with this fix.

comment:3 Changed 7 years ago by kencu (Ken)

Cc: sean@… removed
Owner: set to sean@…
Status: newassigned

comment:4 in reply to:  2 Changed 7 years ago by ballapete (Peter "Pete" Dyballa)

Replying to kencu:

Try this: <https://github.com/macports/macports-ports/pull/964>

With this patch tbb builds at least.

If you know how to test tbb better than I, please tell me if this is actually useful on 10.6 with this fix.

Well, C++ is not my language. At least opencv starts to build with it. It has some hick-ups I'll report later…

comment:5 Changed 7 years ago by kencu (Ken)

opencv doesn't require tbb; it's an optional variant. If you have trouble, disable it. I built open cv on 10.6.8 not long ago -- as you know -- 53562

comment:6 Changed 7 years ago by ballapete (Peter "Pete" Dyballa)

opencv built successfully, quite a bit slowed down because of warnings about dirty (?) programming tricks à la:

#if __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__
    #define __TBB_IOS 1
#endif

Clang 3.9 complains:

In file included from /opt/local/var/macports/build/_Users_pete_Quellen_MacPorts_graphics_opencv/opencv/work/opencv-3.2.0/modules/core/src/algorithm.cpp:43:
In file included from /opt/local/var/macports/build/_Users_pete_Quellen_MacPorts_graphics_opencv/opencv/work/opencv-3.2.0/modules/core/src/precomp.hpp:55:
In file included from /opt/local/var/macports/build/_Users_pete_Quellen_MacPorts_graphics_opencv/opencv/work/opencv-3.2.0/modules/core/include/opencv2/core/private.hpp:63:
In file included from /opt/local/include/tbb/tbb.h:35:
In file included from /opt/local/include/tbb/aligned_space.h:24:
In file included from /opt/local/include/tbb/tbb_stddef.h:95:
/opt/local/include/tbb/tbb_config.h:64:5: warning: '__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__' is not defined, evaluates to 0 [-Wundef]
#if __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__
    ^

Proper code should be:

#ifdef __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__
    #define __TBB_IOS 1
#endif

or instead of

#if _WIN32||_WIN64

better

#if defined(_WIN32) || defined(_WIN64)

Is it worth patching these C header files to accelerate the build of software using TBB without thousands of warnings?

Last edited 7 years ago by ballapete (Peter "Pete" Dyballa) (previous) (diff)

comment:7 in reply to:  5 Changed 7 years ago by ballapete (Peter "Pete" Dyballa)

Replying to kencu:

opencv doesn't require tbb; it's an optional variant. If you have trouble, disable it. I built open cv on 10.6.8 not long ago -- as you know -- 53562

And me too. TBB offers certainly some improvements when build with TBB on a multi-core CPU. So I decided to make this variant my default.

comment:8 in reply to:  6 Changed 7 years ago by ballapete (Peter "Pete" Dyballa)

Replying to ballapete:

Is it worth patching these C header files to accelerate the build of software using TBB without thousands of warnings?

The advantage would be half a million lines of output less…

comment:9 Changed 7 years ago by kencu (Ken)

I think you might look into -Wno-undef which might fix that for you.

comment:10 in reply to:  9 Changed 7 years ago by ballapete (Peter "Pete" Dyballa)

Replying to kencu:

I think you might look into -Wno-undef which might fix that for you.

If so then it needs to be set instead of -Wundef which is active all the time. Or this setting being removed:

cmake/OpenCVCompilerOptions.cmake:120:  add_extra_compiler_option(-Wundef)

This patch silences Clang:

--- cmake/OpenCVCompilerOptions.cmake~	2017-10-27 21:29:41.000000000 +0200
+++ cmake/OpenCVCompilerOptions.cmake	2017-10-27 21:38:25.000000000 +0200
@@ -117,7 +117,6 @@
   add_extra_compiler_option(-Wmissing-declarations)
   add_extra_compiler_option(-Wmissing-prototypes)
   add_extra_compiler_option(-Wstrict-prototypes)
-  add_extra_compiler_option(-Wundef)
   add_extra_compiler_option(-Winit-self)
   add_extra_compiler_option(-Wpointer-arith)
   add_extra_compiler_option(-Wshadow)

Can it be added to this line in Portfile?

195:        reinplace "/-Werror=sequence-point/d" ${worksrcpath}/cmake/OpenCVCompilerOptions.cmake

comment:11 Changed 6 years ago by kencu (Ken)

Resolution: fixed
Status: assignedclosed

In 3e6414902dba8fc5cfa0c69066df92fe21cd1de7/macports-ports:

tbb: add fixes for snowleopard and earlier

block malloc functions missing prior to 10.7
closes #44941
closes #55180

Note: See TracTickets for help on using tickets.