4

I was trying to install mesos latest version(1.9.0) on the ubuntu 20.04 using Dockefile.

FROM ubuntu:20.04

ENV MESOS_VERSION 1.9.0
ENV MESOS_ARTIFACT_FILENAME mesos-${MESOS_VERSION}.tar.gz

# Install Mesos dependencies
# Compile and install Mesos (compilation phase uses 6 threads for speed up this process)
# Uninstall Mesos build dependencies
RUN apt-get update && apt-get install -y \
    openjdk-8-jdk \
    python-dev \
    libcurl4-nss-dev \
    libsasl2-dev \
    libsasl2-modules \
    maven \
    libapr1-dev \
    libsvn-dev \
    zlib1g-dev 
RUN wget http://archive.apache.org/dist/mesos/${MESOS_VERSION}/${MESOS_ARTIFACT_FILENAME} \
  && tar -xf ${MESOS_ARTIFACT_FILENAME} 
RUN cd mesos-${MESOS_VERSION} \
  && mkdir build \
  && cd build \
  && ../configure \ 
  && make -j 6 \
  && cp src/.libs/libmesos-${MESOS_VERSION}.so /usr/local/lib/libmesos-${MESOS_VERSION}.so \
  && cd ../.. \
  && rm -rf mesos-${MESOS_VERSION} ${MESOS_ARTIFACT_FILENAME} \
  && apt-get purge -y \
   openjdk-8-jdk \
    python-dev \
    libsasl2-dev \
    libsasl2-modules \
    maven \
   zlib1g-dev \
  && apt-get clean \
  && apt-get autoremove -y \
  && rm -rf /var/lib/apt/lists/*

RUN ln -s /usr/local/lib/libmesos-${MESOS_VERSION}.so /usr/lib/libmesos.so

It is working till configure command

../configure \ 
      && make -j 6 \

After configuring, the make commad is throwing out different errors. One of them is:

ar: 'u' modifier ignored since 'D' is the default (see 'U')

rc/core/lib/gpr/log_linux.cc:42:13: error: ambiguating new declaration of 'long int gettid()'
   42 | static long gettid(void) { return syscall(__NR_gettid); }
      |             ^~~~~~
In file included from /usr/include/unistd.h:1170,
                 from src/core/lib/gpr/log_linux.cc:40:
/usr/include/x86_64-linux-gnu/bits/unistd_ext.h:34:16: note: old declaration '__pid_t gettid()'
   34 | extern _pid_t gettid (void) _THROW;
      |                ^~~~~~
src/core/lib/gpr/log_linux.cc:42:13: warning: 'long int gettid()' defined but not used [-Wunused-function]
   42 | static long gettid(void) { return syscall(__NR_gettid); }
      |             ^~~~~~
make[4]: *** [Makefile:2650: /mesos-1.9.0/build/3rdparty/grpc-1.10.0/objs/opt/src/core/lib/gpr/log_linux.o] Error 1

What I am doing wrong here in building mesos-spark-docker image for seahorse?? Please help me.

  • The message you put here is not an error. It's just an informational message. How can we help you if you don't tell use what the problem is? Does the build fail? If so what error messages do you see? Or did the build succeed but just print some info messages like this that you don't understand? – MadScientist Mar 04 '21 at 14:32
  • i added the error i am getting. Please help now in understanding what i am missing – Bruce wayne - The Geek Killer Mar 05 '21 at 07:37
  • It looks like the code you are trying to compile is redefining functions from the standard C runtime, and using different types so the compiler is complaining. This is a problem in the code you're trying to compile, so there's little we can do to help. The configure script for this code should be detecting that the system already has the `gettid()` function available and disabling the internal version. Either it doesn't have that check, or it does but it's not working correctly. You'll have to discuss with the libmesos maintainers. Maybe file an issue with them. – MadScientist Mar 05 '21 at 14:31

4 Answers4

2

You are masking the real problems from make by running the make -j 6. This will cause the make to run in 6 threads and all of them will output at the same time. Move to -j 1 to be able to troubleshoot.

To troubleshoot this type of problems, you need to stop the build before the stage it's failing. If you are using buildx, check this SO post how to create stages and intermediate images. Once you have the intermediate stage you will create container and to the manual steps and resolve problem-by-problem.

To check your issue, I build the image until the ./configure and create container to troubleshoot further. What I saw is that there are prerequisites that are missing such as build-essential, autogen, autoconf. I even needed the default-jdk, but this can be path issue since I see that you are installing openjdk-8-jdk. There are still issues with missing libraries, so you will need to continue from this point.

jordanvrtanoski
  • 5,104
  • 1
  • 20
  • 29
  • Most recently, i tried with make -j 2, that is running with two threads. I will make it one as you suggested. I already built an intermediate container till the 2nd RUN command where i download the Mesos tar file. Now, i am going inside this container and doing the rest of the steps from 3rd RUN command. But how can i identify what all libraries are missing. – Bruce wayne - The Geek Killer Mar 04 '21 at 16:25
  • 1
    There are two ways to find missing libraries: 1) Follow the installation instructions for all of the dependancies you are installing, or 2) Old-good-trial-and-error method. I usually mix both, whenever the dependancies are properly documented #1 helps, and if not, I apply #2. Most of the times you can recognize which library is missing by the error you get from the build tool. – jordanvrtanoski Mar 05 '21 at 04:41
  • 1
    i updated current error i got in the question. I couldn't understand what library am missing here. – Bruce wayne - The Geek Killer Mar 05 '21 at 07:40
  • You are failing to compile `grpc-1.10.0` [library](https://github.com/grpc/grpc.git) due to error in the code. I don't know why 1.10 would be required, since it's quite old version, and I assume the problem is that you are using newer compiler. Try installing the ubuntu 20.04 grpc release from `libgrpc-dev` and `libgrpc++-dev` packages before calling `configure`. If this doesn't work you will need to use older version of the compiler – jordanvrtanoski Mar 05 '21 at 07:53
  • how can i install ubuntu 20.04 grpc release?? – Bruce wayne - The Geek Killer Mar 05 '21 at 08:01
  • 1
    `apt install libgrpc-dev libgrpc++-dev` – jordanvrtanoski Mar 05 '21 at 08:10
  • do i need to downgrade the ubuntu version to 18.04, do that helps me?? – Bruce wayne - The Geek Killer Mar 05 '21 at 08:36
  • downgrading to 18.04 will help you to avoid some of the errors that new compilers will throw. If you are not limited to 20.04, I suggest to try lowering to 18.04 – jordanvrtanoski Mar 05 '21 at 09:07
1

This is a problem related to the declaration of the function in the source code maybe it is not compatible with newer version of compilers.We can edit the log_linux.cc file(if you cannot find the file use command locate "log_linux.cc" this will list out the file path copy that and use any text editor to edit it.in the file replace long gettid(void) with sys_gettid().and this should solve your problem.It solved mine.Cheers.

0

gcc version 10+ will give you this error, you can install gcc-9 g++-9 and change your current gcc and g++ to 9

sudo apt install gcc-9 g++-9

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 90 --slave /usr/bin/g++ g++ /usr/bin/g++-9 --slave /usr/bin/gcov gcov /usr/bin/gcov-9 
Arun VC
  • 115
  • 3
0

i find the method maybe Deprecated,replace with sys_gettid() in log_linux.cc.

  • 1
    Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jan 06 '22 at 10:21