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

Build wangle encountered error: error: use of undeclared identifier 'malloc_usable_size' #65

Closed
ustczxf opened this issue Sep 17, 2016 · 9 comments

Comments

@ustczxf
Copy link

ustczxf commented Sep 17, 2016

When I tried to build wangle, it reported:
In file included from /project/opensource/source/wangle/wangle/../wangle/concurrent/ThreadPoolExecutor.h:19:
In file included from /project/opensource/source/wangle/wangle/../wangle/deprecated/rx/Observable.h:20:
/usr/local/include/folly/small_vector.h:619:14: error: use of undeclared identifier 'malloc_usable_size'
return malloc_usable_size(u.pdata_.heap_) / sizeof(value_type);

I've built "folly" successfully, did anyone encounter the same issue?
Thanks!

@mohnishkodnani
Copy link

mohnishkodnani commented Sep 17, 2016

Yes I am getting the same issue.
I was also able to compile folly without any issues.
I am using MAC OS X 10.11.6 and gcc 6.
This is happening after pulling the latest master branch after about few months on both folly and wangle.

/git/wangle/wangle/concurrent/ThreadPoolExecutor.cpp:68:58: required from here
/usr/local/include/folly/small_vector.h:619:32: error: 'malloc_usable_size' was not declared in this scope
return malloc_usable_size(u.pdata_.heap_) / sizeof(value_type);
~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
make[2]: *** [CMakeFiles/wangle.dir/concurrent/ThreadPoolExecutor.cpp.o] Error 1
make[1]: *** [CMakeFiles/wangle.dir/all] Error 2
make: *** [all] Error 2

@mohnishkodnani
Copy link

It turns out it has something to do with jemalloc.
when I checked the configure output of compiling folly it had checked and said malloc_usable_size yes but for malloc.h check it had said false.
Then when I uninstalled jemalloc from my system , recompiled folly, it said malloc_usable_size as false and after this I could build wangle fine.

@ustczxf
Copy link
Author

ustczxf commented Sep 18, 2016

Thanks @mohnishkodnani , after I removed jemalloc, it works now.

@Allen5
Copy link

Allen5 commented Oct 27, 2016

It still not work after i removed jemalloc from my system(OSX 10.12).

@YiqiuLiu
Copy link

I am having problem with this too. Installed folly with homebrew, got back luck with small_vector.h.

@anyflow
Copy link

anyflow commented Nov 21, 2016

I got the same problem. No difference with removing jemalloc, installing folly by homebrew / compiling source in macOS 10.12.1.

@howardzhang
Copy link

I am getting the same issue.
My machine is OS X 10.12.
Any update?

@anirudhvr
Copy link
Contributor

folly/portability/Malloc.cpp provides a defintion for malloc_usable_size for apple platforms. Can you check why that code is not being executed on your platform (e.g., put a #error "check") inside the APPLE guard.

@howardzhang
Copy link

@anirudhvr I was able to resolve this issue using @mohnishkodnani method.

  • Compile and install folly from source(mater branch) without jemalloc. (Note: Never use brew to install folly)
  • If you encounter any openssl issue, try apply patch fix bootstrap on osx folly#513
  • Then you may be able to compile wangle successfully.

@djwatson djwatson closed this as completed Jan 6, 2017
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

8 participants