Code::Blocks 10.05 and Environmentmental Variables - environment-variables

I'm probably missing something really obvious, but I don't have the Environmental Variables dialog shown in Configuring environmental variables. I've been through Settings -> Environment... (and other submenus from Settings) and its just missing.
OpenSSL FIPS Capable is particular about having CC and FIPSLD_CC set to embed the module's fingerprint. I even tried running the following as a prebuild step with no joy (the echo's are empty):
Running project pre-build steps
export CC=`find /usr/local/ssl -name fipsld`
export FIPSLD_CC=`find /usr/bin -name g++`
echo $CC
echo $FIPSLD_CC
I'm working on Debian 7.3 (x64) fully patched, if it matters. Code::Blocks was installed from Debian's repos. OpenSSL was custom built and installed in /usr/local/ssl.
Where does one set environmental variables in Code::Blocks 10.05?

The Environment Variables Editor is an optional plugin. Debian packages can be found at Package: codeblocks-contrib (10.05-2.1).
To install it you need to install package codeblocks-contrib as well as codeblocks:
sudo apt-get install codeblocks codeblocks-contrib
Close and restart Code::Blocks, if it is running. The dialog you looking for will then appear in Settings -> Environment

Related

Jenkins does not work properly on Mac M1 agent

We want to use a Mac Mini with the M1 processor as an agent in our CI pipeline to make sure that developers with new Macs can compile the project. We duplicated the setup that we have for x86, but cmake cannot find libraries such as boost:
CMake Error at /opt/homebrew/Cellar/cmake/3.19.7/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:218 (message):
Could NOT find Boost (missing: Boost_INCLUDE_DIR container system
date_time)
Weirdly, this is not an issue when connecting to the machine directly via ssh. Even manually setting the environment variables does not change anything.
The Jenkins agent uses Java. If you install Java via brew (e.g., adoptopenjdk8), you might get an x64 version (as of March 2021) that is run using the Rosetta translation layer. You can verify this by executing sysctl sysctl.proc_translated. In the "normal" SSH connection, this should return 0, when executed as sh "sysctl sysctl.proc_translated" in Jenkins, you will see a 1.
Preferred Option (install native JDK)
Instead of using, e.g., adoptopenjdk8, you can install the zulu JDK, which is available natively, via
brew install --cask zulu
After this, you should be able to verify that proc_translated is 0 within Jenkins. You can verify that a native binary is built as described below.
Hotfix (without changing the JDK)
The following is a hotfix if you cannot install a native JDK.
We were able to force cmake to run natively (and thus to find the native libraries) by modifying our Jenkinsfile as follows:
old:
sh "cmake .."
sh "make hyriseTest"
new:
sh "PATH=/opt/homebrew/bin:$PATH arch -arm64 cmake .."
sh "arch -arm64 make hyriseTest"
Having to repeat the arch command over and over is not really pretty. Maybe someone has a better solution.
Verification of the result
We can verify that our generated binary is a native ARM binary:
sh "file hyriseTest"
Result:
+ file ./hyriseTest
./hyriseTest: Mach-O 64-bit executable arm64
Compiler warnings
Note: We are still seeing linker warnings about "ltmp3" and "ltmp4". I have not found any information about that online and it does not seem to affect the correctness of the result. Example:
ld: warning: direct access in function 'ltmp4' from file 'CMakeFiles/hyriseMvccDeletePlugin.dir/Unity/unity_0_cxx.cxx.o' to global weak symbol

install MongoDB C++ Driver problem in ubuntu 16.04

I want to install MongoDB C++ Driver, so first is mongocxx
I follow this installation:
http://mongocxx.org/mongocxx-v3/installation/
but I can not pass step 4
when I run this in mongo-cxx-driver/build
sudo cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local ..
it shows
-- Auto-configuring bsoncxx to use MNMLSTC for polyfills since C++17 is inactive
CMake Error at src/mongocxx/CMakeLists.txt:37 (find_package):
By not providing "Findlibmongoc-1.0.cmake" in CMAKE_MODULE_PATH this
project has asked CMake to find a package configuration file provided by
"libmongoc-1.0", but CMake did not find one.
Could not find a package configuration file provided by "libmongoc-1.0"
(requested version 1.13.0) with any of the following names:
[![enter image description here][1]][1]
libmongoc-1.0Config.cmake
libmongoc-1.0-config.cmake
Add the installation prefix of "libmongoc-1.0" to CMAKE_PREFIX_PATH or set
"libmongoc-1.0_DIR" to a directory containing one of the above files. If
"libmongoc-1.0" provides a separate development package or SDK, be sure it
has been installed.
second question,
Step 2: Choose a C++17 polyfill how can I set MNMLSTC/core?
does anyone can help me,I already trap here for a long time ?
my env:
mongo-c-driver 1.15.1
libmongoc-1.0
mongocxx-3.4.x
Cmake is complaining about not finding a package configuration file (xxx.cmake), probably because you didn't build libmongoc/libbson.
I've tried to reproduce your issue and hit the same problem when I only installed them (apt-get install), so my suggestion is that you get the sources and build them as described at: http://mongoc.org/libmongoc/current/installing.html
Here's the list of commands (with the latest version of mongo-c-driver=1.15.1) which I just tried and worked fine:
wget https://github.com/mongodb/mongo-c-driver/releases/download/1.15.1/mongo-c-driver-1.15.1.tar.gz
tar xzf mongo-c-driver-1.15.1.tar.gz
cd mongo-c-driver-1.15.1
mkdir cmake-build
cd cmake-build
cmake -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF ..
make
sudo make install
At this point you can go back into mongocxx/build and run again the command you were stuck at:
cd ../../mongo-cxx-driver/build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local ..

CMake can't find python3

In my CMake I have:
find_package(PythonInterp 3.6 REQUIRED)
This works fine when I execute cmake ., because I have python3.6 in /opt/local/bin. However, when CLion executes the same cmake, it is unable to find it. How can I make it aware?
I tried adding /opt/local/bin to PATH and adding a python interpreter setting, but nether worked for that.
I solved this issue by adding an extra parameter to cmake which is: Python3_EXECUTABLE
cmake -DPython3_EXECUTABLE=/path/to/bin/python3 ..
One thing to try is temporarily set CMAKE_PREFIX_PATH with /usr/local where python is installed in some platforms (happens in macOS).
+ set(CMAKE_PREFIX_PATH_bak ${CMAKE_PREFIX_PATH})
+ set(CMAKE_PREFIX_PATH "/usr/local")
find_package(PythonInterp)
+ set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH_bak})
I was able to figure it out. It is possible to add env variables to cmake execution: look for env in here https://cmake.org/cmake/help/latest/manual/cmake.1.html
Knowing this it was easy to add it in clion: Settings/Preferences -> Build, Execution, Deployment -> CMake -> CMake Options
and add into that field env PATH=${PATH}:/opt/local/bin.

package opencv was not found in the pkg-config search path for centos

When I go with this command:
pkg-config --cflags opencv
I get the following message:
Package opencv was not found in the pkg-config search path.
Perhaps you should add the directory containing `opencv.pc'
to the PKG_CONFIG_PATH environment variable
No package 'opencv' found
I'm on Cent OS 6, have found the solution for Linux Ubuntu over the internet and here on stack but not for Cent OS
I tried under OpenCV specifications with
PKG_CONFIG_PATH=/usr/share/opencv/lib/pkgconfig:${PKG_CONFIG_PATH}
export PKG_CONFIG_PATH
Still it doesn't work. How can I be sure OpenCV is also installed in that directory, I used whereis opencv and it triggered me /usr/share/
I know it is really late to answer to a question 4 years later but I will leave it here in hope that it will help someone.
I came also across a similar error after installing OpenCV 3.3.0 on Fedora 26. First, make sure you have the right path to your opencv.pc file. Mine is in this directory '/usr/local/lib/pkgconfig/'.
Run this command in your terminal. It will modify your .bashrc:
echo "#ADD OpenCV in PKG_CONFIG" >> ~/.bashrc
echo "PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:${PKG_CONFIG_PATH}" >> ~/.bashrc
echo "export PKG_CONFIG_PATH" >> ~/.bashrc
Then execute:
source ~/.bashrc
Hi first of all i would like you to use 'Synaptic Package Manager'. You just need to goto the ubuntu software center and search for synaptic package manager.. The beauty of this is that all the packages you need are easily available here. Second it will automatically configures all your paths. Now install this then search for opencv packages over there if you found the package with the green box then its installed but else the package is not in the right place so you need to reinstall it but from package manager this time. If installed then you can do this only, you just need to fill the OpenCV_DIR variable with the path of opencv (containing the OpenCVConfig.cmake file)
export OpenCV_DIR=<path_of_opencv>

ERROR: cannot start RubyMine. No JDK found. JDK Version? + desktop link

ERROR: cannot start RubyMine.
No JDK found. Please validate either RUBYMINE_JDK, JDK_HOME or JAVA_HOME environment variable points to valid JDK installation.
I'm not sure what JDK version number to use to download it?
Also how to create a desktop link in 11.10?
I think using apt-get is easier, see for example this article:
sudo apt-get install openjdk-7-jdk
Turned out that in the end I had to do several things to get java running and thus resolve the issue:
Get Java
Download oracle7 jdk at:
http://www.oracle.com/technetwork/java/javase/downloads/java-se-jdk-7-download-432154.html
e.g. http://download.oracle.com/otn-pub/java/jdk/7/jdk-7-linux-x64.tar.gz
Follow instructions at:
http://www.webupd8.org/2011/09/how-to-install-oracle-java-7-jdk-in.html
e.g.
After downloading java (above):
Extract the downloaded Oracle Java JDK archive into your home folder and rename the newly created folder to "java-7-oracle".
sudo mv its_name java-7-oracle
Install Java
cd
sudo mkdir -p /usr/lib/jvm/ #just in case
sudo mv java-7-oracle/ /usr/lib/jvm/
sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt-get update
sudo apt-get install update-java
sudo update-java # choose version 1.7 if necessary.
Check the Java install
java -version
javac -version
I was then able to start up rubyMine successfully.
Create rubyMine shortcut
To create the desktop launcher in Ubuntu 11.10:
Once you've installed rubymine and you have the executable somewhere:
If it's called mine, then create a desktop launcher that runs it
http://www.ubuntugeek.com/how-to-create-desktop-launchers-in-ubuntu-11-10oneiric.html
You'll run (in a terminal window):
gnome-desktop-item-edit ~/Desktop/ --create-new
Indicate where the rubyMine executable is, e.g. use /usr/local/bin/mine as the command to run.
You can then also drag that to the left side toolbar icons area for a icon quick-launcher there.
Note:
If following these instructions and making a quick-launch icon at the end - make sure NOT to delete the desktop icon you created earlier when cleaning up your desktop as this will also remove that quick-launch item (it's a link to it).

Resources