fastLLaMa: Getting Error with make command

make[2]: *** No rule to make target `../fastLLaMa/libllama.a', needed by `fastLlama.so'.  Stop.
make[1]: *** [CMakeFiles/fastLlama.dir/all] Error 2
make: *** [all] Error 2

Edit:

Getting Error with make command from build.sh file:

cc  -I.              -O3 -DNDEBUG -std=c11   -fPIC -pthread -mavx -mavx2 -mfma -mf16c -msse3   -c ggml.c -o ggml.o
ggml.c: In function 'ggml_time_ms':
ggml.c:308:21: error: storage size of 'ts' isn't known
  308 |     struct timespec ts;
      |                     ^~
ggml.c:309:5: warning: implicit declaration of function 'clock_gettime' [-Wimplicit-function-declaration]
  309 |     clock_gettime(CLOCK_MONOTONIC, &ts);
      |     ^~~~~~~~~~~~~
ggml.c:309:19: error: 'CLOCK_MONOTONIC' undeclared (first use in this function)
  309 |     clock_gettime(CLOCK_MONOTONIC, &ts);
      |                   ^~~~~~~~~~~~~~~
ggml.c:309:19: note: each undeclared identifier is reported only once for each function it appears in
ggml.c: In function 'ggml_time_us':
ggml.c:314:21: error: storage size of 'ts' isn't known
  314 |     struct timespec ts;
      |                     ^~
ggml.c:315:19: error: 'CLOCK_MONOTONIC' undeclared (first use in this function)
  315 |     clock_gettime(CLOCK_MONOTONIC, &ts);
      |                   ^~~~~~~~~~~~~~~
make: *** [ggml.o] Error 1
Unable to build static library 'libllama'

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 22 (8 by maintainers)

Most upvoted comments

Fair enough. If anyone wants to add support to CentOS in the makefile. They can raise a PR. Or if I get time, I will replicate it with docker and add it.

For now I will close this Issue. Please feel free to reopen.

FROM centos:7

# Install development tools
RUN yum groupinstall -y "Development Tools"

# Build CMake 3
RUN yum install -y epel-release wget
RUN wget https://cmake.org/files/v3.26/cmake-3.26.0.tar.gz && tar zxvf cmake-3.* \
    && cd cmake-3.* && ./bootstrap --prefix=/usr/local \
    && make -j$(nproc) && make install && cmake --version

# Install GCC and G++
RUN yum install -y centos-release-scl && yum install -y devtoolset-10-gcc* devtoolset-10-binutils

# Configure
RUN alternatives --install /usr/bin/gcc gcc /opt/rh/devtoolset-10/root/usr/bin/gcc 30 && \
    alternatives --install /usr/bin/g++ g++ /opt/rh/devtoolset-10/root/usr/bin/g++ 30 && \
    alternatives --install /usr/bin/cc cc /opt/rh/devtoolset-10/root/usr/bin/gcc 30 && \
    alternatives --install /usr/bin/c++ c++ /opt/rh/devtoolset-10/root/usr/bin/g++ 30 && \
    alternatives --set cc /opt/rh/devtoolset-10/root/usr/bin/gcc && \
    alternatives --set c++ /opt/rh/devtoolset-10/root/usr/bin/g++

# Install Python 3.8
RUN yum install -y centos-release-scl-rh && \
    yum install -y rh-python38 && \
    ln -s /opt/rh/rh-python38/root/usr/bin/python3.8 /usr/bin/python3

WORKDIR /app
RUN yum install -y git && git clone https://github.com/PotatoSpudowski/fastLLaMa.git /app

COPY now/CMakeLists.txt /app/CMakeLists.txt
COPY now/Makefile /app/

ENV CC=/opt/rh/devtoolset-10/root/usr/bin/gcc
ENV CXX=/opt/rh/devtoolset-10/root/usr/bin/g++
RUN chmod +x build.sh && bash ./build.sh

RUN yum install -qy python3-pip
RUN python3.8 -m pip install --upgrade pip && python3.8 -m pip install setuptools-rust
RUN python3.8 -m pip install -r requirements.txt

CMD ["python3.8", "example.py"]

You can start with this as my machine is slow to build so I’m unsure at which stage it will not work. Possibly have to swap dev toolset from 10 to 11.

While I appreciate the enthusiasm, the fix I provided will work for his scenario based on his environment (I replicated it with Docker). So adding that line for everyone will produce issues that will not work, unless ofcourse it’s added in a define in the Makefile which unfortunately don’t know how to do. If anyone’s willing to do that he must handle the Makefile correctly. 🙏🏻

try to export CC and CXX with latest gcc toolchain.

export CC=/usr/local/bin/gcc
export CXX=/usr/local/bin/g++
cmake ..
make

@imranraad07 add CFLAGS += -D_POSIX_C_SOURCE=199309L to line 160 in Makefile. @PotatoSpudowski you need to add support in the Makefile for CentOS if you like.

Added CentOS (RHEL) support in #11

Thanks @amitsingh19975! It worked.