emeryberger / Hoard

The Hoard Memory Allocator: A Fast, Scalable, and Memory-efficient Malloc for Linux, Windows, and Mac.
http://www.hoard.org
Apache License 2.0
1.1k stars 128 forks source link

Building from source fails on Pop!_OS #74

Closed jwoertink closed 1 year ago

jwoertink commented 1 year ago

Following the directions on the README

I got this error:

Hoard/src on  master 
❯ make
git clone https://github.com/emeryberger/Heap-Layers
Cloning into 'Heap-Layers'...
remote: Enumerating objects: 2587, done.
remote: Counting objects: 100% (734/734), done.
remote: Compressing objects: 100% (293/293), done.
remote: Total 2587 (delta 446), reused 719 (delta 438), pack-reused 1853
Receiving objects: 100% (2587/2587), 945.24 KiB | 5.40 MiB/s, done.
Resolving deltas: 100% (1664/1664), done.
clang++ -std=c++14 -flto -O3 -DNDEBUG -ffast-math -fno-builtin-malloc -Wall -Wextra -Wshadow -Wconversion -Wuninitialized  -g -W -Wconversion -Wall -I/usr/include/nptl -fno-builtin-malloc -pipe -fPIC -DNDEBUG  -I. -Iinclude -Iinclude/util -Iinclude/hoard -Iinclude/superblocks -IHeap-Layers -D_REENTRANT=1 -shared   source/libhoard.cpp source/unixtls.cpp -Bsymbolic -o libhoard.so -ldl -lpthread
source/libhoard.cpp:22:10: fatal error: 'cstddef' file not found
#include <cstddef>
         ^~~~~~~~~
1 error generated.
source/unixtls.cpp:55:10: fatal error: 'new' file not found
#include <new>
         ^~~~~
1 error generated.
make: *** [GNUmakefile:215: Linux-gcc-x86_64] Error 1
❯ uname -a
Linux pop-os 6.0.12-76060006-generic #202212290932~1671652965~22.04~452ea9d SMP PREEMPT_DYNAMIC Wed D x86_64 x86_64 x86_64 GNU/Linux
emeryberger commented 1 year ago

What version of clang is this?

jwoertink commented 1 year ago
❯ clang --version
Ubuntu clang version 14.0.0-1ubuntu1
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
emeryberger commented 1 year ago

Try this?

apt-get install build-essential

(I can't install Pop!_OS since the ISO is Intel only.)

jwoertink commented 1 year ago

Looks like I'm up-to-date on that.

0 upgraded, 0 newly installed, 0 to remove and 14 not upgraded.

Also, I'm not running on Intel. I'm not sure about the ISO, but Pop itself seems to run fine.

❯ neofetch
             /////////////                jeremy@pop-os 
         /////////////////////            ------------- 
      ///////*767////////////////         OS: Pop!_OS 22.04 LTS x86_64 
    //////7676767676*//////////////       Host: Thelio Mira thelio-mira-r1 
   /////76767//7676767//////////////      Kernel: 6.2.6-76060206-generic 
  /////767676///*76767///////////////     Uptime: 3 days, 17 hours, 28 mins 
 ///////767676///76767.///7676*///////    Packages: 2776 (dpkg), 55 (flatpak), 20 (snap) 
/////////767676//76767///767676////////   Shell: bash 5.1.16 
//////////76767676767////76767/////////   Resolution: 1920x1080, 3840x2160 
///////////76767676//////7676//////////   DE: GNOME 42.5 
////////////,7676,///////767///////////   WM: Mutter 
/////////////*7676///////76////////////   WM Theme: Pop 
///////////////7676////////////////////   Theme: Pop [GTK2/3] 
 ///////////////7676///767////////////    Icons: pop-os-branding [GTK2/3] 
  //////////////////////'////////////     Terminal: gnome-terminal 
   //////.7676767676767676767,//////      CPU: AMD Ryzen 5 5600X (12) @ 3.700GHz 
    /////767676767676767676767/////       GPU: NVIDIA GeForce RTX 3070 Ti 
      ///////////////////////////         Memory: 15097MiB / 64208MiB 
         /////////////////////
             /////////////                                        
emeryberger commented 1 year ago

For all intents and purposes, AMD and Intel are the same (same instruction set: "x86-64"). AFAICT there is not a distro of Pop for the Mac M1 that I can run in a VM, so I can't easily debug this.

How about trying this: sudo apt install libstdc++-dev.

jwoertink commented 1 year ago

there is not a distro of Pop for the Mac M1 that I can run in a VM

Ah! Ok. That makes sense then.

Alright, so trying that, and I got this error:

Package libstdc++-dev is a virtual package provided by:
  libstdc++-9-dev 9.5.0-1ubuntu1~22.04
  libstdc++-12-dev 12.1.0-2ubuntu1~22.04
  libstdc++-10-dev 10.4.0-4ubuntu1~22.04
  libstdc++-11-dev 11.3.0-1ubuntu1~22.04.1
You should explicitly select one to install.

E: Package 'libstdc++-dev' has no installation candidate

So I installed libstdc++-12-dev and that looks like it fixed it! Or, at least I was able to run make now :joy: I actually abandoned my original use for Hoard, but I'm sure it probably works now. I guess this could just be added to the README as some docs. Thanks for looking in to this!