Install vkt in Ubuntu - vtk

I would like to install Paraview in my laptop with Ubuntu 18.04.6 LTS. I'm following this post to install vkt 8.2.0 in Ubuntu 18.04 (https://discourse.vtk.org/t/installing-vtk-in-ubuntu-18-04/2147/4). When I use
sudo cmake -DCMAKE_INSTALL_PREFIX=$HOME/vtk-inst \
-DCMAKE_INSTALL_RPATH=$HOME/vtk-inst \
-DVTK_Group_Qt=ON \
-DVTK_QT_VERSION=5 \
-DVTK_Group_Imaging=ON \
-DVTK_Group_Views=ON \
-DModule_vtkRenderingFreeTypeFontConfig=ON \
-DVTK_WRAP_PYTHON=ON \
-DVTK_PYTHON_VERSION=3 \
-DPYTHON_EXECUTABLE=/usr/bin/python3 \
-DPYTHON_INCLUDE_DIR=/usr/include/python3.6 \
-DPYTHON_LIBRARY=/usr/lib/x86_64-linux-gnu/libpython3.6m.so \
-DBUILD_TESTING=OFF \
-DVTK_USE_SYSTEM_LIBRARIES=ON \
-DVTK_USE_SYSTEM_LIBPROJ4=OFF \
-DVTK_USE_SYSTEM_GL2PS=OFF \
-DVTK_USE_SYSTEM_LIBHARU=OFF \
-DVTK_USE_SYSTEM_PUGIXML=OFF \
-DCMAKE_BUILD_TYPE=Release \
..
Then I get the following error:
-- Could not use git to determine source version, using version
-- Could NOT find OpenGL (missing: OPENGL_opengl_LIBRARY OPENGL_glx_LIBRARY OpenGL)
CMake Error at CMake/vtkModule.cmake:4612 (message):
Could not find the OpenGL external dependency.
Call Stack (most recent call first):
CMake/vtkModule.cmake:5206 (vtk_module_find_package)
Utilities/OpenGL/CMakeLists.txt:58 (vtk_module_third_party_external)
-- Configuring incomplete, errors occurred!
See also "$HOME/VTK-master/build/CMakeFiles/CMakeOutput.log".
See also "$HOME/VTK-master/build/CMakeFiles/CMakeError.log".
I have tried to solve this problem using this post:
CMake could not find OpenGL in Ubuntu
but nothing happens after install "libgl1-mesa-dev" or "libegl1-mesa-dev"
Any hint of how to solve it?

Related

installing PyMuPDF in python 3.8 alpine

I am trying to install PyMuPDF in the official Python 3.8 alpine docker image. The dockerfile is like this:
FROM python:3.8-alpine
RUN apk add --update --no-cache \
gcc g++ \
libc-dev \
python3-dev \
build-base \
cairo-dev \
cairo \
cairo-tools \
jpeg-dev \
zlib-dev \
freetype-dev \
lcms2-dev \
openjpeg-dev \
tiff-dev \
tk-dev \
tcl-dev \
mupdf-dev \
musl-dev \
jbig2dec \
openjpeg-dev \
harfbuzz-dev \
vim bash
COPY requirements.txt requirements.txt
RUN pip install --no-cache-dir --upgrade pip && \
pip install --cache-dir .pip-cache -r requirements.txt && \
rm -rf .pip-cache
The version of PyMuPDF I'm trying to install is 1.20.1
Attempts to build this image is failing with this error:
#10 137.0 × Encountered error while trying to install package.
#10 137.0 ╰─> PyMuPDF
As I understand, a PyMuPDF wheel for Alpine linux is not available. That's why we have to make it from source. Scrolling up a bit in the the terminal, I see this:
#10 124.9 scripts/tesseract/endianness.h:20:2: error: #error "I don't know what architecture this is!"
#10 124.9 20 | #error "I don't know what architecture this is!"
#10 124.9 | ^~~~~
#10 124.9 make: *** [Makefile:133: build/release/source/fitz/tessocr.o] Error 1
So looks like building PyMuPDF fails because tesseract cannot recognize the endianness of this environment. How can I move past this hurdle?
If you have a working example of installing PyMuPDF in this docker image, please let me know. Thanks in advance.
Here is an example with Python 3.10 Alpine. Not 3.8 but I hope this helps.
FROM python:3.10-alpine3.16
ARG PYMUPDF_VERSION=1.20.1
RUN apk update \
&& apk add --update --no-cache \
build-base \
gcc \
jbig2dec \
jpeg-dev \
harfbuzz-dev \
libc-dev \
mupdf-dev \
musl-dev \
openjpeg-dev \
swig \
&& ln -s /usr/lib/libjbig2dec.so.0 /usr/lib/libjbig2dec.so
WORKDIR /tmp
RUN wget https://github.com/pymupdf/PyMuPDF/archive/refs/tags/${PYMUPDF_VERSION}.tar.gz \
&& tar -xzf ${PYMUPDF_VERSION}.tar.gz \
&& rm ${PYMUPDF_VERSION}.tar.gz \
&& cd PyMuPDF-${PYMUPDF_VERSION} \
&& python setup.py build && python setup.py install

ERROR: SvtAv1Enc not found using pkg-config

I am trying to compile FFmpeg with SVT-AV1 codec, following instructions from here: https://github.com/OpenVisualCloud/SVT-AV1/tree/master/ffmpeg_plugin
Everything goes well, but when I try to run
./configure --enable-libsvtav1
I am getting
ERROR: SvtAv1Enc not found using pkg-config
If you think configure made a mistake, make sure you are using the latest
version from Git. If the latest version fails, report the problem to the
ffmpeg-user#ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "ffbuild/config.log" produced by configure as this will help
solve the problem.
The content of the ffbuild/config.log: https://pastebin.com/euPriFAp
There is an exact issue on the github: https://github.com/OpenVisualCloud/SVT-AV1/issues/35, but is closed as solved.
I have tried both on my Mac and in the Docker container with Ubuntu 18.04, but getting the same result.
Could anyone please help, what am I doing wrong?
The problem was in the lack of requred libraries. Please find the complete installation instruction below.
Installing packages required for compiling:
sudo apt-get update
sudo apt-get install \
autoconf \
automake \
build-essential \
cmake \
git-core \
libass-dev \
libfreetype6-dev \
libsdl2-dev \
libtool \
libva-dev \
libvdpau-dev \
libvorbis-dev \
libxcb1-dev \
libxcb-shm0-dev \
libxcb-xfixes0-dev \
pkg-config \
texinfo \
wget \
zlib1g-dev
Installing assemblers used by some libraries:
sudo apt-get install nasm
sudo apt-get install yasm
Build and install SVT-AV1:
git clone --depth=1 https://github.com/OpenVisualCloud/SVT-AV1
cd SVT-AV1
cd Build
cmake .. -G"Unix Makefiles" -DCMAKE_BUILD_TYPE=Release
make -j $(nproc)
sudo make install
Apply SVT-AV1 plugin and enable libsvtav1 to FFmpeg:
cd ~
git clone -b release/4.2 --depth=1 https://github.com/FFmpeg/FFmpeg ffmpeg
cd ffmpeg
export LD_LIBRARY_PATH+=":/usr/local/lib"
export PKG_CONFIG_PATH+=":/usr/local/lib/pkgconfig"
git apply ../SVT-AV1/ffmpeg_plugin/0001-Add-ability-for-ffmpeg-to-run-svt-av1.patch
./configure --enable-libsvtav1
(Note: if you want other codecs to be supported please add the required flags to the ./configure command)
Build FFmpeg:
make
make install
hash -r
source ~/.profile
Now you should have ffmpeg command working and have svt-av1 in encoders list:
ffmpeg -encoders
...
V..... libsvt_av1 SVT-AV1(Scalable Video Technology for AV1) encoder (codec av1)
...
I used next docs a reference:
https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu
https://github.com/OpenVisualCloud/SVT-AV1/tree/master/ffmpeg_plugin

build vim8 and python3

environment: centos
My global python version is 2.7, but I use pyenv to create a python version 3.6.
I want to build vim8 with python3.
According the instruction on the net, I use
./configure --with-features=huge \
--enable-multibyte \
--enable-python3interp=yes \
--with-python3-config-dir=/root/.pyenv/versions/3.6.3 \
--enable-gui=gtk2 \
--enable-cscope \
--prefix=/usr/local
make && make install
Vim8 is built ok, but it without python3:
vim --version
The list shows -python and -python3.
I dont't know what's wrong.

Custom fonts in rrdgraph in a Docker container running Alpine Linux

I'm unable to use other fonts than the standard one in rrdgraph.
It may have to do with the fact, that this Alpine has no GUI (all the X-stuff), I don't know.
I found this issue https://bugs.alpinelinux.org/issues/1475 dealing with missing fonts, but installing those packages doesn't help.
This is my Dockerfile
FROM alpine:3.3
RUN apk --update add \
build-base python-dev \
ca-certificates python \
py-pip \
py-jinja2 \
py-dateutil \
py-tz \
py-requests \
py-pillow \
py-rrd && \
pip install --upgrade arrow \
websocket-client \
XlsxWriter && \
apk del build-base python-dev && \
rm -rf /var/cache/apk/* && \
echo "iot"
CMD ["/bin/sh"]
I added those font packages manually later on with a docker exec -it iot /bin/sh
I tried stuff like
# rrd_graph_fmt += ["--font", "LEGEND:8:'/home/user/data/fonts/Roboto-Regulars.ttf'"]
# rrd_graph_fmt += ["--font", "LEGEND:8:font-sony-misc"]
but it just doesn't work. I'm not even sure how to change the font globally by using environment variables. I tried (some stuff on the web with the env vars), but it didn't work.
I'd really love to use ttf fonts, but would settle with those in the packages if neccessary.
I'm using the rrdtool lib from the py-rrd package.
Does anyone have an idea on how to get this working?
RRDtool uses fontconfig to access fonts ... to see what fonts are available on your system you can use
fc-list
to configure where fontconfig should look for fonts, you may want to edit /etc/fonts/... or ~/.fonts.conf.d in your homedirectory.
To refresh the list of fonts, run
fc-cache
Note that font support is independent of X11.

Compile vim with clipboard and xterm

I want to compile the current version of vim with:
+clipboard +xterm_clipboard and ruby support
But every time I compile it the clipboard and the xterm_clipboard options aren't enabled.
Is there a lib needed or must I add any other options in the configuration step?
./configure \
--enable-rubyinterp=dynamic \
--enable-cscope \
--enable-gui=auto \
--enable-gtk2-check \
--enable-gnome-check \
--with-features=huge \
--with-x
make && sudo make install
You can see if configure manage to find a working X lib by checking the output of (or scroll through the output of configure in your terminal):
$ grep X11 src/auto/config.h
#define HAVE_X11
If configure failed then you'll see:
$ grep X11 src/auto/config.h
/* #undef HAVE_X11 */
You'll need to install the appropriate X development library like xlib and xtst for --with-x to work.
On ubuntu it should be enough to install libx11-dev and libxtst-dev.
ubuntu18.04.4
sudo apt install libx11-dev libxtst-dev libxt-dev libsm-dev libxpm-dev
./configure --enable-python3interp=dynamic --prefix=$HOME/.local --enable-rubyinterp=dynamic --enable-gtk2-check --enable-gnome-check --with-features=huge --with-x
make install
./src/vim ---version | grep clip

Resources