staghado / vit.cpp

Inference Vision Transformer (ViT) in plain C/C++ with ggml
MIT License
225 stars 18 forks source link

README is misleading, need ninja, not make #13

Closed tornikeo closed 6 months ago

tornikeo commented 6 months ago

I have little experience with c++ projects, tried to follow the README, failed, and found that you need ninja instead of make in build dir. This PR will save other newbies some time.

staghado commented 6 months ago

Hello,

what was the issue, error you got with make? You could install make on ubuntu for example using :

sudo apt update 
sudo apt install make

make is the most used build system while ninja is really niche.

tornikeo commented 6 months ago

In build, cmake .. doesn't generate makefile, at all. I still don't know why. Following the readme, I got to this point:

vit.cpp/build$ cmake .. && make -j4
-- CMAKE_SYSTEM_PROCESSOR: x86_64
GNU ld (GNU Binutils for Ubuntu) 2.39
-- x86 detected
-- Linux detected
-- Configuring done
-- Generating done
-- Build files have been written to: /home/tornikeo/Documents/personal/ml/ggml/vit.cpp/build
make: *** No targets specified and no makefile found.  Stop.

Then, I noticed that there's build.ninja file right there, and no Makefile, so tried out ninja build, and it just works.

staghado commented 6 months ago

I think it’s because you don’t have cmake and make installed.

tornikeo commented 6 months ago

Unlikely, I mean, build is empty when I run cmake ... CMake does create a build.ninja file, it just somehow doesn't create Makefile.

I've just tried the out to cmake .. in the ggml/examples/sam/build, here, it does create a Makefile.

staghado commented 6 months ago

u need to be in 'build' when u run cmake .. was that the case?

Also what is your platform? print the output of these commands :

which make
which cmake 
tornikeo commented 6 months ago

AHA. Issue was not cloning recursively initially.

asciicast

When I cloned it first, I noticed ggml was missing, so I did the submodule update... I guess that broke it somehow?