Error when building Kogito native images with Persistence profile enabled (quarkus-infinispan-client extension) witn ubi8 images - infinispan

While trying to build a simple Kogito application with the Persistence profile enabled the build failed complaining that the lib stdc++ was not found:
/usr/bin/ld: cannot find -lstdc++
The builder image is based on the ubi8-minimal and to build it the s2i tool was used with the following command was used:
s2i build https://github.com/kiegroup/kogito-examples --context-dir jbpm-quarkus-example quay.io/kiegroup/kogito-quarkus-ubi8-s2i:0.8.0-rc1 kogitotest:10.0 --runtime-image quay.io/kiegroup/kogito-quarkus-ubi8:0.8.0-rc1 --loglevel 5 --env MAVEN_MIRROR_URL=http://nexus.apps.spolti.cloud/nexus/content/groups/public/ --env NATIVE=true --env MAVEN_ARGS_APPEND="-Ppersistence"
As first hint I think it could be something related with the libstdc++-static because when running the same build on my local machine it works and the only difference I found around this the stdc++ lib was that my machine have the llibstdc++-devel and static packages while the image only have the libstdc++, tried the to install the devel one, but no luck thus I thought it could be something related with the static one.
The fix:
To solve this I had to symlink /usr/lib64/libstdc++.so.6.0.25 to /usr/lib64/libstdc++.so
but not sure why on my machine it works without the symlink and have piratically the same libs available, eg libstdc++.so.6.0.27 with a symlink to libstdc++.so.6

Proper fix:
Just install gcc-c++ package.

Related

Environment variables (zsh terminal) installed through npm on MacOS 12.4 Monterey - SOLVED

Background:
Dear Stackoverflow community. I recently switched from Windows to MacOS and am at a loss how to configure environment variables. Many of the previous questions asked here are about bash instead of zsh.
Goal:
I am trying to install an npm package globally. For instance:
npm install -g vercel
or any other package, and use it in my Visual Studio Code terminal (also zsh). If I want to deploy code I have to use 'npx vercel deploy' every time. I want to be able to use "vercel deploy" but instead I get:
zsh: command not found: vercel
What I tried so far:
Installing the package in zsh and visual studio code terminals (didn't work)
Setting the path equal on both VS and terminal: export PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
I learned that you need to add environment variabels to a .zshrc file. I don't seem to have a zshrc file. When I do:
sudo ~/.zshrc
Password: XXXXXX
sudo: /Users/vincent/.zshrc: command not found
I am getting another error.
I read in the zsh man file that you should use $HOME/.zshrc instead. Again I am getting the same errors:
vincent#Vincents-MacBook-Air-2 ~ % $HOME/.zshrc
zsh: permission denied: /Users/vincent/.zshrc
vincent#Vincents-MacBook-Air-2 ~ % sudo $HOME/.zshrc
sudo: /Users/vincent/.zshrc: command not found
Update 1:
#slebetman Thank you for your explanation. When I open the terminal I go to home via "cd $HOME" which puts me in in the home directory. However there is no way for me to create a .zshrc file in that directory. Neither via touch or vs code. I am getting the following error: "Unable to write file '/home/.zshrc' (Unknown (FileSystemError): Error: ENOTSUP: operation not supported on socket, open '/home/.zshrc')"
Update 2:
I did manage to find the .zshrc file in visual studio code under /etc. I hope this will work. I was able to overwrite the file with Sudo and add environment variables to it.
Add this to the file .zshrc file under /etc and force overwrite it:
export vercel=/Users/vincent/.npm-global/bin/vercel
Screenshots below for those who will try in the future:
Image with .zshrc file layout
Final remarks:
I don't understand how it is so difficult to add environment variables on Mac while everything else is so easy.
I have read many different questions on stackoverflow, and I can't seem to solve it. Also since I am a newbie I am not allowed to comment on there so I post here in the hope that anyone can help me :)
Best,
Vincent
Note that when you do:
npx vercel deploy
Npm will execute vercel for you without installing it. It does that by temporarily downloading vercel. If you want to run vercel directly without using npx then simply don't use npx. Install it instead:
npm install -g vercel
The -g flag installs the module globally and if the module has a CLI it will be available globally as well (note that depending on your setup you may need admin/sudo privileges to use the -g flag). Now you can run vercel by simply typing:
vercel deploy
This works in all operating systems supported by node.js and npm. That means you can even do this in Windows. In fact I use npm to distribute my tools in a simple cross-platform way so I don't have to support multiple package managers like chocolatey (Windows), homebrew (Mac OS), deb (Debian based distros), rpm (Redhat based distros) etc. (npm does not require your software to be written in node.js - I have published packages on npm written in tcl and bash).

Override Platform for Yarn 2 install

I have a number of docker containers which have a volume shared with my local filesystem. I am trying to install the package esbuild, which has different versions for linux and darwin OS's. When I run yarn install locally, it installs the wrong package version, and ignores the correct version, no matter how I declare it, as it detects my darwin platform and assumes I don't need the linux version:
esbuild-linux-64#npm:0.14.14 The linux-x64 architecture is incompatible with this module, link skipped.
I can connect to the container and run the install from there, and it installs the correct esbuild-linux-64 version in that case, but the install/build runs prohibitively slower because the container is much smaller than my machine.
I have looked through most of the Yarn documentation, and it seems they got rid of a couple of methods in Yarn Classic which allowed you to override the platform, or at least ignore incompatible package detection.
In Yarn v2, there is a new config setting, supportedArchitectures:, set in the .yarnrc.yml file, but it seems the yarn link step still ignores any incompatible packages which were included in supportedArchitectures.
Thanks for any help!

Serverless framework running Java code hangs

I'm running Serverless 2.15.0 with Node 14.15.0. I've tried installing both with npm i -g and by using the curl script in the tutorial. I have Maven 3.6.3 installed
When I try to run a simple Java "hello world" function locally, I get this message:
Serverless: Building Java bridge, first invocation might take a bit longer.
Then Serverless just hangs. No error message, nothing. When I try to run with SLS_DEBUG=*, there are no messages after that point.
The only thing I've been able to Google is this, but there isn't any resolution to the problem. The other thing I've found is this but there seems to be no java directory where Serverless is installed, so I can't manually compile the pom file.
Anyone know how to fix this problem?
The problem is that they moved the path of the java runtime wrapper. Base paths differ regarding install location.
NVM (global installation)
cd ~/.nvm/versions/node/v16.13.1/lib/node_modules/serverless/lib/plugins/aws/invoke-local/runtime-wrappers/java
mvn package
NPM (global installation)
cd ~/.npm-global/lib/node_modules/serverless/lib/plugins/aws/invokeLocal/runtimeWrappers/java
mvn package
Homebrew
cd /usr/local/Cellar/serverless/2.29.0/libexec/lib/node_modules/serverless/lib/plugins/aws/invokeLocal/runtimeWrappers/java
mvn package
Replace 2.29.0 with installed serverless version.

Mojave + Xcode 10 build fails on glog config.h, gflags/gflags.h

I'm testing React Native 0.56.0-rc.2 on Mac OS Mojave and Xcode 10.
Running:
react-native init TestProject --version="0.56.0-rc.2"
cd TestProject
npm run start
react-native run-ios
Which generated some long errors.
Entering Xcode gave me a failure on missing config.h for glog, which I found could be built manually:
cd ./node_modules/react-native/third-party/glog-0.3.4
./configure && make && make install
Which passed that stage, but got me on yet another issue
(...)/node_modules/react-native/third-party/glog-0.3.4/src/glog/logging.h:85:10:
'gflags/gflags.h' file not found
I can't find anything related to RN and this on Google or Stack Overflow, only references to other packages and instructions to install those on a Debian-based system.
Is this a known issue?
Running this from the project directory fixed it for me:
cd ./node_modules/react-native/third-party/glog-0.3.4 && ../../scripts/ios-configure-glog.sh
This manually triggers the config script
A simple and quick resolution.
In Xcode, go to File->Project/Workspace settings.
Change the build system to Legacy Build system.
This is the resolution from Wesley's link. Saw something the other day about posting the direct answer and trying to avoid linking because links / websites can change. I was going to leave this as a comment, but don't have enough rep.
Update
It is a known issue, tracked here:
https://github.com/facebook/react-native/issues/19774
I resolved it by running following steps
In the root of the project, run npm install or yarn - install packages
cd node_modules/react-native - go to node modules directory
scripts/ios-install-third-party.sh - install # node_modules/react-native/third-party
cd third-party - go to newly created third party directory
cd glog-0.3.x - ls -la to find your directory version number or just use tab to auto-complete)
./configure - run setup
cd ../../../../ - change back to your project directory
react-native run-ios or react-native run-android - deploy
If any of these solution does not work, please check your project path. Project path and/or directory names should not contain any
space in its name or you can create project on Desktop or in Documents
directory.
Because of invalid name in project path, React Native project unable to link / add glob header files inside project / workspace.

CMake error not providing FindGnuradio.cmake

Getting the following error when running cmake and am unsure how to fix it. It seems like it's telling me exactly what to do, but not very familiar with Linux.
CMake Error at CMakeLists.txt:153 (find_package):
By not providing "FindGnuradio.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "Gnuradio",
but CMake did not find one.
Could not find a package configuration file provided by "Gnuradio"
(requested version 3.7.3) with any of the following names:
GnuradioConfig.cmake
gnuradio-config.cmake
Add the installation prefix of "Gnuradio" to CMAKE_PREFIX_PATH or set
"Gnuradio_DIR" to a directory contaning one of the above files. If
"Gnuradio" provides a separate development package or SDK, be sure it has
been installed.
EDIT: So I've located something called FindGnuradioRuntime.cmake but am still unsure what to do with it. The error message makes me think it was looking for something named "FindGnuradio.cmake" when it was actually called "FindGnuradioRuntime.cmake"
Commands that were run on a fresh Ubuntu install:
git clone git://git.osmocom.org/rtl-sdr.git
cd rtl-sdr/
mkdir build
cd build
cmake ../
make
sudo make install
sudo ldconfig
git clone git://git.osmocom.org/gr-osmosdr
cd gr-osmosdr/
mkdir build
cd build/
cmake ../ (here is where I ran into a the problem above)
Install / build GNU Radio.
Remove the CMakeCache.txt
When you call cmake .. you can pass arguments. Add the path to the parent directory of GnuradioConfig.cmake or FindGnuRadio.cmake as in
cmake -DCMAKE_PREFIX_PATH=/gnu/radio/path ..
Making my somewhat hidden response an actual answer:
Just found out that the install script provided on GNURadio's website not only installs GNURadio, but also the RTL SDR requirements as well, so I wiped my VM and started over and was successful. It takes a few hours, but it is complete and automated so definitely the best way to install GNURadio. Script is here http://www.sbrac.org/files/build-gnuradio
As previous answers noted you didn't describe where you ran into this problem. I'm going to assume it happened when creating an Out Of Tree (OOT) module.
On the OOT Module Page, see the "Notes" Section. They note that you need to install gr-dev. That package will install GnuradioConfig.cmake. You can find it in the standard yum repos, and install it with sudo yum install gnuradio-devel.