Skip to content
New issue

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

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

Already on GitHub? # to your account

OSX ltbb library not found #58

Closed
louisdeb opened this issue Oct 18, 2017 · 4 comments
Closed

OSX ltbb library not found #58

louisdeb opened this issue Oct 18, 2017 · 4 comments

Comments

@louisdeb
Copy link

(I have read #13, #19 and #32 and have still not resolved my issue)

I am trying to compile my implementation of julia_frame_parallel_inner.cpp

When running make bin/julia after implementing the first tbb::parallel_for, I get the following:

ld: library not found for -ltbb

I previously received

src/julia_frame_parallel_inner.cpp:3:10: fatal error: 'tbb/parallel_for.h' file not found
#include "tbb/parallel_for.h"

but resolved this by adding CPPFLAGS += -I /usr/local/Cellar/tbb/2018_U1/include to the makefile.

tbb is installed via brew.

Could someone explain how I can, I suppose, link tbb? Or suggest what might be going wrong.

@m8pple
Copy link
Contributor

m8pple commented Oct 18, 2017

(Somebody with more brew knowledge may be able to help here, as I only have brief experience
with ports, and have never used brew).

In the same way that there is a search path for headers, there is also a search path
for libraries. In the makefile, you would add this to LDFLAGS, in the same way
you add preprocessors paths to to CPPFLAGS.

So if you can find where the tbb library is, you can point towards it
using the -L flag. From memory, on OSX the library is going to be called something
like tbb.a (for a static library), or tbb.dylib (for a dynamic library).

Let's assume you find a tbb library at:

/usr/local/Cellar/tbb/2018_U1/lib/tbb.a

then you would add this to your makefile:

LDFLAGS += -L /usr/local/Cellar/tbb/2018_U1/lib

Adding non-existent locations to the search path is not a problem, so don't worry
about these existing on other computers.

That said, I'm a little surprised that such an approach is needed, as I would assume that
brew would put the headers and library on the search path.

Is your version of g++ installed by brew, or is it the system default?

@louisdeb
Copy link
Author

I've tried this and still haven't succeeded.

Linking straight to the libtbb.dylib resulted in make requesting a directory. Giving the directory of the library resulted in an x86 architecture issue (same issue as if you hadn't uncommented the original LDFLAGS assignment).

I've seen my friends OSX work perfectly. He brew installed tbb and uncommented the LDFLAGS bit. He doesn't have g++ installed via brew. I also don't have g++ installed via brew. Maybe I'll try that.

@louisdeb
Copy link
Author

He is on High Sierra and I am on Sierra. His g++ version is more up to date than mine. Will update my system and try again.

@louisdeb
Copy link
Author

Fixed. Outdated XCode..

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

No branches or pull requests

2 participants