Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tbb static not supported #3850

Closed
acgetchell opened this issue Jul 4, 2018 · 12 comments
Closed

tbb static not supported #3850

acgetchell opened this issue Jul 4, 2018 · 12 comments

Comments

@acgetchell
Copy link

Package: tbb:x64-osx
Vcpkg version: 0.0.113-unknownhash

┌─[adam][hapkido][±][master ✓][~/vcpkg]
└─▪ ./vcpkg install tbb
The following packages will be built and installed:
tbb[core]:x64-osx
Starting package 1/1: tbb:x64-osx
Building package tbb[core]:x64-osx...
-- Warning: Static building not supported yet. Building dynamic.
-- Downloading https://github.com/01org/tbb/archive/2018_U5.tar.gz...
-- Extracting source /Users/adam/vcpkg/downloads/01org-tbb-2018_U5.tar.gz
-- Using source at /Users/adam/vcpkg/buildtrees/tbb/src/2018_U5-94342757ca
-- Building /Users/adam/vcpkg/buildtrees/tbb/src/2018_U5-94342757ca/build/vs2013/makefile.sln for Release
CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:56 (message):
Command failed: msbuild;/Users/adam/vcpkg/buildtrees/tbb/src/2018_U5-94342757ca/build/vs2013/makefile.sln;/p:Configuration=Release;/t:Rebuild;/p:Platform=x64;/p:PlatformToolset=external;/p:VCPkgLocalAppDataDisabled=true;/p:UseIntelMKL=No;/p:WindowsTargetPlatformVersion=;/m
Working Directory: /Users/adam/vcpkg/buildtrees/tbb/x64-osx-rel
See logs for more information:

Call Stack (most recent call first):
scripts/cmake/vcpkg_build_msbuild.cmake:119 (vcpkg_execute_required_process)
ports/tbb/portfile.cmake:25 (vcpkg_build_msbuild)
scripts/ports.cmake:71 (include)

Error: Building package tbb:x64-osx failed with: BUILD_FAILED
Please ensure you're using the latest portfiles with .\vcpkg update, then
submit an issue at https://github.com/Microsoft/vcpkg/issues including:
Package: tbb:x64-osx
Vcpkg version: 0.0.113-unknownhash

Additionally, attach any relevant sections from the log files above.

@MVoz
Copy link
Contributor

MVoz commented Jul 5, 2018

CMake Error
Command failed: msbuild ... vs2013/makefile.sln

OSX - vs2013 ?

@degski
Copy link

degski commented Jul 5, 2018

@voskrese your problem is not (only) the static like below, but this #3771, the (manual fix) is in there.
I'm a win-dev, so you'd have to check my response, as I know nothing in relation to OSX. But this answer applies to both posts above mine. On Windows, this is not supported, in the sense that it's not supported by tbb. tbb (on windows) cannot be built statically at all (I tried, got it to build, eventually (after jumping through many hoops), just to find that it simply crashes your application on first usage). It appears jemalloc is like that as well (and probably for the same reason). Some function calls need to be into 1 binary only (and must be dynamic therefor), i.o.w. there is some state, which is a singleton.

@MVoz
Copy link
Contributor

MVoz commented Jul 5, 2018

@degski static port assembly and should not collect, judging by the message

https://github.com/Microsoft/vcpkg/blob/master/ports/tbb/portfile.cmake

message(STATUS "Warning: Static building not supported yet. Building dynamic.")

then, the 2013 msvc project implies VC 2013, without the normal conversion of the project, the assembly is not always successful

https://github.com/01org/tbb/blob/tbb_2018/build/vs2013/makefile.sln
https://github.com/01org/tbb/blob/tbb_2018/build/vs2013/tbb.vcxproj

для OSX

the project is completely different

https://github.com/01org/tbb/blob/tbb_2018/build/ios.macos.inc

and by the way, you use the latest toolchain 14.14, I had problems with it, try 14.12

@degski
Copy link

degski commented Jul 5, 2018

#@voskrese My senses tell me that the problem is the same on windows, linux and osx.

I did some more checking on the web, there seem to be some people (in 2009) that got it to work (but we don't' know what "work" means). You can use the same approach that I took to solve issue #3771 and open up the .sln file and change the settings from /MD and /MDd to /MT and /MTd. Then start the build again. Iff tbb(code) doesn't object, it will work.

With vcpkg alone (out-of-the-box), it's not gonna work, the message is clear "Warning: Static building not supported yet. Building dynamic.", and the devs are not saying that gratuitously or to just make you have a bad afternoon. There is (must be) a good reason and it has got to do with singleton states.

tbb is an open source library, I'm sure there is demand for static tbb (I'm one of them). If it was possible, it would exist, because someone would have contributed a patch to make this happen. Linking into both static and dynamic libraries to all intents and purposes is not supported on common platforms and needs to be scrutinized closely. There was a discussion on the Boost mailing list just recently discussing this issue extensively and with great expertise, it comes down to, yes it's possible, but there is a shopping list of caveats. So don't go up that road.

@degski
Copy link

degski commented Jul 5, 2018

@voskrese It looks like you put some Russian through google translate. I can gauge to some extent what you're trying to say, but it's really quite hard to understand, properly, what you mean. So, iff what I'm saying is besides the point, there's not much I can say, other than what I already said.

@degski
Copy link

degski commented Jul 5, 2018

@voskrese I do use the latest Tulchan, of course.

@MVoz
Copy link
Contributor

MVoz commented Jul 5, 2018

тулчайн - toolchain - toolset

#3147

#3147 (comment)

@degski
Copy link

degski commented Jul 6, 2018

@voskrese You see, I didn't even do that [mis-interpretation] on purpose (I tried to google it). But, the answer is yes, I do use the latest tool-chain for my platform.

@MVoz
Copy link
Contributor

MVoz commented Jul 6, 2018

@degski I saw this on the log file, so I recommended to reduce it to 14.12 or even 14.10, but actually it's up to you, win-dev, fix the port and it will all be compiled as you want. all in source files

@degski
Copy link

degski commented Jul 6, 2018

@voskrese Like I said, I am on the latest stable Tulchan tool-chain, i.e. on 15.7.4. I have no problem to build tbb (non-static), other than the problem with the optimization levels (#3771) with vcpkg. Just yesterday or so I upgraded to tbb-2018-U6 (#3771 again).

@acgetchell
Copy link
Author

acgetchell commented Aug 30, 2018

After doing a git merge origin/dev/roschuma/tbb TBB installs on osx!

┌─[adam][hapkido][±][master ?:1 ✗][~/vcpkg]
└─▪ git merge origin/dev/roschuma/tbb
Updating 0c5b3ae2..844d55e4
Fast-forward
 ports/tbb/CMakeLists.txt |  18 +++++++++++++++
 ports/tbb/CONTROL        |   2 +-
 ports/tbb/portfile.cmake | 128 ++++++++++++++++++++++++++++++++++++++++++++++-------------------------------------------------------
 ports/tbb/usage          |   4 ++++
 4 files changed, 81 insertions(+), 71 deletions(-)
 create mode 100644 ports/tbb/CMakeLists.txt
 create mode 100644 ports/tbb/usage
┌─[adam][hapkido][±][master ↑1 ?:1 ✗][~/vcpkg]
└─▪ ./vcpkg install tbb
Your feedback is important to improve Vcpkg! Please take 3 minutes to complete our survey by running: vcpkg contact --survey
The following packages will be built and installed:
    tbb[core]:x64-osx
Starting package 1/1: tbb:x64-osx
Building package tbb[core]:x64-osx... 
-- Using cached /Users/adam/vcpkg/downloads/01org-tbb-2018_U5.tar.gz
-- Using source at /Users/adam/vcpkg/buildtrees/tbb/src/2018_U5-94342757ca
-- Configuring x64-osx-dbg
-- Configuring x64-osx-rel
-- Building x64-osx-dbg
-- Building x64-osx-rel
-- Performing post-build validation
-- Performing post-build validation done
Building package tbb[core]:x64-osx... done
Installing package tbb[core]:x64-osx... 
Installing package tbb[core]:x64-osx... done
Elapsed time for package tbb:x64-osx: 25.9 s

Total elapsed time: 25.9 s

The package tbb provides CMake targets:

    find_package(TBB CONFIG REQUIRED)
    target_link_libraries(main PRIVATE TBB::tbb)

However, in trying to consume it I get CMake errors:

/usr/local/bin/cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=/Users/adam/vcpkg/scripts/buildsystems/vcpkg.cmake -G "CodeBlocks - Unix Makefiles" /Users/adam/CDT-test
-- The CXX compiler identification is AppleClang 9.1.0.9020039
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found CURL: /Users/adam/vcpkg/installed/x64-osx/lib/libcurl.a (found version "7.61.0-DEV") 
-- Boost version: 1.68.0
CMake Error at /Users/adam/vcpkg/installed/x64-osx/share/tbb/TBBConfig.cmake:76 (message):
  Missed required Intel TBB component: tbb
Call Stack (most recent call first):
  /Users/adam/vcpkg/scripts/buildsystems/vcpkg.cmake:247 (_find_package)
  CMakeLists.txt:52 (find_package)


-- Configuring incomplete, errors occurred!
See also "/Users/adam/CDT-test/cmake-build-debug/CMakeFiles/CMakeOutput.log".

Here's my current CMakeLIsts.txt

And here's a gist of the CMakeOutput.log

@acgetchell
Copy link
Author

This is fixed in the vcpkg repo with:

git merge origin/dev/roschuma/tbb

Hopefully these will be merged into master soon!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants