ukaea/parallel-preprocessor

compiling failed on MacOS-latest

qingfengxia opened this issue · 4 comments

I am looking forwards someone with mac os can fix the error caused by std::make_shared<T>

while I have created a new wiki page "BuildOnMacOS.md" to describe the procedure to install dependencies.

Here is the error message

In file included from /Users/runner/work/parallel-preprocessor/parallel-preprocessor/PPP/../PropertyContainer/PropertyContainer.hpp:3:
In file included from /Applications/Xcode_11.7.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iomanip:46:
In file included from /Applications/Xcode_11.7.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__string:56:
In file included from /Applications/Xcode_11.7.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm:643:
/Applications/Xcode_11.7.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:3709:5: warning: destructor called on non-final 'PPP::ConsoleOperator' that has virtual functions but non-virtual destructor [-Wdelete-non-abstract-non-virtual-dtor]
    __data_.second().~_Tp();
    ^
/Applications/Xcode_11.7.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:3665:5: note: in instantiation of member function 'std::__1::__shared_ptr_emplace<PPP::ConsoleOperator, std::__1::allocator<PPP::ConsoleOperator> >::__on_zero_shared' requested here
    __shared_ptr_emplace(_Alloc __a)
    ^
/Applications/Xcode_11.7.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:4330:26: note: in instantiation of member function 'std::__1::__shared_ptr_emplace<PPP::ConsoleOperator, std::__1::allocator<PPP::ConsoleOperator> >::__shared_ptr_emplace' requested here
    ::new(__hold2.get()) _CntrlBlk(__a2, _VSTD::forward<_Args>(__args)...);
                         ^
/Applications/Xcode_11.7.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:4709:29: note: in instantiation of function template specialization 'std::__1::shared_ptr<PPP::ConsoleOperator>::make_shared<>' requested here
    return shared_ptr<_Tp>::make_shared(_VSTD::forward<_Args>(__args)...);
                            ^
/Users/runner/work/parallel-preprocessor/parallel-preprocessor/PPP/PipelineController.cpp:138:57: note: in instantiation of function template specialization 'std::__1::make_shared<PPP::ConsoleOperator>' requested here
            std::shared_ptr<AbstractOperator> op = std::make_shared<ConsoleOperator>();
                                                        ^
/Applications/Xcode_11.7.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:3709:23: note: qualify call to silence this warning
    __data_.second().~_Tp();
                      ^
/Applications/Xcode_11.7.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:3657:7: error: exception specification of overriding function is more lax than base version
class __shared_ptr_emplace
      ^
/Applications/Xcode_11.7.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:4330:26: note: in instantiation of template class 'std::__1::__shared_ptr_emplace<tbb::task_group, std::__1::allocator<tbb::task_group> >' requested here
    ::new(__hold2.get()) _CntrlBlk(__a2, _VSTD::forward<_Args>(__args)...);
                         ^
/Applications/Xcode_11.7.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:4709:29: note: in instantiation of function template specialization 'std::__1::shared_ptr<tbb::task_group>::make_shared<>' requested here
    return shared_ptr<_Tp>::make_shared(_VSTD::forward<_Args>(__args)...);
                            ^
/Users/runner/work/parallel-preprocessor/parallel-preprocessor/PPP/PipelineController.cpp:298:32: note: in instantiation of function template specialization 'std::__1::make_shared<tbb::task_group>' requested here
        auto threadPool = std::make_shared<ThreadPoolType>();
                               ^
/Applications/Xcode_11.7.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:3566:13: note: overridden virtual function is here
    virtual ~__shared_weak_count();
            ^
7 warnings and 1 error generated.
make[2]: *** [PPP/CMakeFiles/MyApp.dir/PipelineController.cpp.o] Error 1
make[1]: *** [PPP/CMakeFiles/MyApp.dir/all] Error 2

std::make_sharedtbb::task_group() caused the error. same error for clang and g++ on macos 10.15

This has been fixed by a workaround.

packaging failed with

/Users/runner/work/parallel-preprocessor/parallel-preprocessor/build/_CPack_Packages/Darwin/DragNDrop/sla.r:1456: ### Rez - String spans lines.
/Users/runner/work/parallel-preprocessor/parallel-preprocessor/build/_CPack_Packages/Darwin/DragNDrop/sla.r: ### Rez - Since errors occurred, /Users/runner/work/parallel-preprocessor/parallel-preprocessor/build/_CPack_Packages/Darwin/DragNDrop/temp.dmg's resource fork was not completely updated.

CPack Error: Problem compressing the directory
CPack Error: Error when generating package: parallel-preprocessor_-10.15.7
make: *** [package] Error 1
Error: Process completed with exit code 2.

packaging is now working, the LICENCE file \n end of line cause error, do not use this license file on MacOS