microsoft / mimalloc

mimalloc is a compact general purpose allocator with excellent performance.
MIT License
9.74k stars 791 forks source link

Can't compile v2.1.6 tag on Ubuntu 22.04.LTS #899

Closed Zabrane closed 1 month ago

Zabrane commented 1 month ago

Hi guys

I don't know why even when switching to v2.1.6, cmake is keeps telling me that it will build mimalloc v1.8.0:

> git clone https://github.com/microsoft/mimalloc.git
> mimalloc
> git checkout -b v2.1.6
Switched to a new branch 'v2.1.6'
> mkdir -p out/release
> cd out/release
> cmake ../..
-- The C compiler identification is GNU 11.4.0
-- The CXX compiler identification is GNU 11.4.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
--
-- No build type selected, default to: Release
-- Override standard malloc (MI_OVERRIDE=ON)
--
-- Library base name: mimalloc
-- Version          : 1.8       <<<======================
-- Build type       : release
-- C Compiler       : /usr/bin/cc
-- Compiler flags   : -Wall;-Wextra;-Wno-unknown-pragmas;-fvisibility=hidden;-Wstrict-prototypes;-ftls-model=initial-exec;-fno-builtin-malloc
-- Compiler defines :
-- Link libraries   : /usr/lib/x86_64-linux-gnu/libpthread.a;/usr/lib/x86_64-linux-gnu/librt.a
-- Build targets    : shared;static;object;tests
--
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/mimalloc/out/release

Am i missing something? Many thanks.

res2k commented 1 month ago

From https://git-scm.com/docs/git-checkout: "Specifying -b causes a new branch to be created as if git-branch[1] were called and then checked out." So what you're doing is not checking out a specific tag, you're creating a new branch off main, named "v2.1.6".

Zabrane commented 1 month ago

From https://git-scm.com/docs/git-checkout: "Specifying -b causes a new branch to be created as if git-branch[1] were called and then checked out." So what you're doing is not checking out a specific tag, you're creating a new branch off main, named "v2.1.6".

My bad. Thanks @res2k

> git clone https://github.com/microsoft/mimalloc.git
> mimalloc
> git checkout -b v2.1.6
Switched to a new branch 'v2.1.6'
> mkdir -p out/release
> cd out/release
> cmake ../..
[...]
-- Library base name: mimalloc
-- Version          : 2.1
-- Build type       : release
-- C Compiler       : /usr/bin/cc
-- Compiler flags   : -Wall;-Wextra;-Wno-unknown-pragmas;-fvisibility=hidden;-Wstrict-prototypes;-ftls-model=initial-exec;-fno-builtin-malloc
-- Compiler defines :
-- Link libraries   : /usr/lib/x86_64-linux-gnu/libpthread.a;/usr/lib/x86_64-linux-gnu/librt.a
-- Build targets    : shared;static;object;tests
--
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/mimalloc/out/release

All good.

res2k commented 1 month ago

All good.

Just be aware that you're still not using the right command; you're not checking out a specific tag, you're creating a new branch. (Which is also what the output tells you.)