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

CMAKE failed because it is missing: TCMALLOC_LIBRARY TCMALLOC_INCLUDE_DIR #2524

Closed
Rabab53 opened this issue Feb 27, 2017 · 14 comments
Closed

Comments

@Rabab53
Copy link

Rabab53 commented Feb 27, 2017

I am trying to build hpx with the following command it cause an error as follow:
cmake .. -DBOOST_ROOT=/usr/lib/x86_64-linux-gnu/ -DHWLOC_ROOT=/home/runtime_systems/hwloc-1.10.1/install/lib -DCMAKE_INSTALL_PREFIX=/home/runtime_systems/hpx/install

build failed as follow:
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.26")
-- Could NOT find TCMalloc (missing: TCMALLOC_LIBRARY TCMALLOC_INCLUDE_DIR)
CMake Error at cmake/HPX_Message.cmake:43 (message):
ERROR: HPX_WITH_MALLOC was set to tcmalloc, but tcmalloc could not be
found. Valid options for HPX_WITH_MALLOC are: system, tcmalloc, jemalloc,
tbbmalloc, and custom
Call Stack (most recent call first):
cmake/HPX_SetupAllocator.cmake:29 (hpx_error)
CMakeLists.txt:1308 (include)

-- Configuring incomplete, errors occurred!
See also "/home/runtime_systems/hpx/my_hpx_build/CMakeFiles/CMakeOutput.log".
See also "/home/runtime_systems/hpx/my_hpx_build/CMakeFiles/CMakeError.log"

Any advice on how to solve it?

Thanks,
Rabab

@sithhell
Copy link
Member

sithhell commented Feb 27, 2017 via email

@hkaiser
Copy link
Member

hkaiser commented Feb 27, 2017

@Rabab53 to clarify: try using cmake -DHPX_WITH_MALLOC=system ...

@hkaiser
Copy link
Member

hkaiser commented Feb 27, 2017

@sithhell we should probably change our build system to fall back to system if tcmalloc is not available.

@sithhell
Copy link
Member

sithhell commented Feb 27, 2017 via email

@hkaiser
Copy link
Member

hkaiser commented Feb 27, 2017

Ok, fair enough.

@biddisco
Copy link
Contributor

Since it is very easy to install jemalloc, and it gives as good, or better performance as tcmalloc, we could simply extend the error message to output the following

You have requested a non system malloc, but it was not found, you may install jemalloc as follows

JEMALLOC_VER=4.4.0
wget https://github.com/jemalloc/jemalloc/releases/download/$JEMALLOC_VER/jemalloc-$JEMALLOC_VER.tar.bz2
tar -xjf jemalloc-$JEMALLOC_VER.tar.bz2
cd jemalloc-$JEMALLOC_VER
./autogen.sh --prefix=$HOME/local/jemalloc/$JEMALLOC_VER
make -j -k install

and invoke cmake with the extra options

cmake -DHPX_WITH_MALLOC=JEMALLOC -DJEMALLOC_ROOT=$HOME/local/jemalloc/$JEMALLOC_VER

and update the error message from time to time when a newer jemalloc is available

@hkaiser
Copy link
Member

hkaiser commented Feb 28, 2017

I'd rather put a (stable) link to our documentation into the error message where this is described in detail.

@Rabab53
Copy link
Author

Rabab53 commented Feb 28, 2017

Thanks all

@hkaiser
Copy link
Member

hkaiser commented Feb 28, 2017

@Rabab53 Can we close this issue now? Has it been resolved for you?

@Rabab53 Rabab53 closed this as completed Mar 1, 2017
@ZiCog
Copy link

ZiCog commented Jan 19, 2019

Please God somebody tell me how to build HPX with tcmalloc on Debian stretch?

I start with:

$ sudo apt-get install libtcmalloc-minimal4

Then try to build HPX:

$ cd build
$ cmake HPX_WITH_MALLOC=tcmalloc ..

Result:

-- Could NOT find TCMalloc (missing: TCMALLOC_LIBRARY TCMALLOC_INCLUDE_DIR)
CMake Error at cmake/HPX_Message.cmake:43 (message):
ERROR: HPX_WITH_MALLOC was set to tcmalloc, but tcmalloc could not be
found. Valid options for HPX_WITH_MALLOC are: system, tcmalloc, jemalloc,
tbbmalloc, and custom

Two hours of scanning the documentation and googling later I'm no closer to resolving this problem.

Any help greatly appreciated.

@hkaiser
Copy link
Member

hkaiser commented Jan 19, 2019

@ZiCog as @sithhell said above, you might have to install the -dev packages, depending on your distro.

@prlw1
Copy link

prlw1 commented Feb 28, 2019

I see where @ZiCog is coming from... on Ubuntu 18.04.2:

$ sudo apt search tcmalloc 
Sorting... Done
Full Text Search... Done
libtcmalloc-minimal4/bionic,now 2.5-2.2ubuntu3 amd64 [installed]
  efficient thread-caching malloc
$

(and cmake fails to find TCMalloc)

There are no -dev packages.

$ sudo apt search jemalloc 
Sorting... Done
Full Text Search... Done
libjemalloc-dev/bionic 3.6.0-11 amd64
  development files and documentation for jemalloc

libjemalloc1/bionic 3.6.0-11 amd64
  general-purpose scalable concurrent malloc(3) implementation

and

$ sudo apt install libjemalloc-dev
...
$ cmake -DHPX_WITH_MALLOC=jemalloc ...

does the trick.

@hkaiser
Copy link
Member

hkaiser commented Feb 28, 2019

A simple google search would have revealed that the corresponding -dev package on Ubuntu is named libgoogle-perftools-dev.

@rakeshsagalagatte
Copy link

@ZiCog I'm using Arch destro [manjaro]. Here I installed gperftools package to satisfies the tcmalloc dependencies.
sudo pacman -S gperftools .

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

No branches or pull requests

7 participants