I have an issue about cmake version - cmake

I want to update my Cmake to version 3.18.4 but my 'which cmake' is fixed to "/tools/Xilinx/Vitis/2020.1/tps/lnx64/cmake-3.3.2/bin/cmake" because I am currently using VIVADO and maybe it was fixed when i have installed it first..
I already installed my cmake-3.18.4 in /usr/local/ , also I can not remove cmake-3.3.2 because I am using vivado actively.. What can I do in this situation?

You can give /usr/local/bin priority by add /usr/local/bin to your path after /tools/Xilinx/Vitis/2020.1/tps/lnx64/cmake-3.3.2/bin:
$ export PATH=/usr/local/bin:$PATH
$ which cmake
/usr/local/bin/cmake
To make this permanent, add to the end (or right after sourcing Vivado scripts) of ~/.profile (or ~/.bashrc).
PATH=/usr/local/bin:$PATH

Related

Can I use cmake that bundled in CLion in my terminal?

So I have CLion IDE and I wonder if I can use Cmake that my CLion use straightly from terminal. Because the system tells me that cmake isn't installed so there is no cmake in /usr/bin.
Sure, all you need to do is find the absolute path to the CMake binary bundled with your CLion installation.
# This can help you find the binary if you don't know where it is
# Substitute <dir> for where you want to search on the system
$ find <dir> -executable -type f -name cmake
# It will give you can output like this
/usr/foobar/baz/clion/cmake/3.24.0/bin/cmake
Then you'll just need to add CMake to your path.
Here is some bash code that does that:
PATH="/usr/foobar/baz/clion/cmake/3.24.0/bin:$PATH"
export PATH
Place the above code in your .bash_aliases or your .bashrc whichever approach you prefer. So that the PATH is persistently modified in your terminal sessions.
Then reload .bashrc
$> source .bashrc
Then you'll know you succeeded when you get a result like this:
$ cmake --version
cmake version 3.24.0
CMake suite maintained and supported by Kitware (kitware.com/cmake).

How to add and remove some flag to cmake in commandline?

In the command line ubuntu, I want to directly delete a series of flags contained in the source code of the HHVM when using cmake for install HHVM, if available, and add another set of flags to it.
What should I do about this?
please guide me.
for use linker -Wl,--emit-relocs should don't use -E , -s and -c.
example :
$ cmake + (-O3 -fno-reorder-blocks-and-partition -Wl,--emit-relocs)
and
$ cmake - (-E ,-s,-c)

How do I remove CLion-2016.2.3 completely from Ubuntu 16.04 LTS?

I had installed CLion(2016.2.3) IDE from CLion-2016.2.3.tar.gz file. I accidentally deleted the CLion-2016.2.3.tar.gz file and CLion-2016.2.3 folder(which I got after extracting CLion-2016.2.3.tar.gz). Now CLion isn't working. When I ran dpkg --list from terminal, CLion wasn't present in the output. I want to remove CLion completely(all its files, folders, dependencies, etc.(even the configuration files)). How do I remove it completely?
Run the following command in terminal to find all the directories and files containing clion in their name :-
$ sudo find . -iname "*clion*"
Then delete the directories and files you have found.
To delete directories/files, go to the location of that directory/file in terminal using cd and run the following command :-
$ sudo rm -rf DIRECTORY_NAME/FILE_NAME
Simple Steps are :
Delete the clion folder you have downloaded and extracted.
Remove cache in ~/. using the command : sudo rm -r ~/.Clion.
Also need remove settings: /home/user/.config/JetBrains
You need also to remove settings that are stored in ~/. directory. That's it for Unix/Linux.
All Clion's binaries are store inside the folder you deleted.
But Clion sets up preferences at first launch, and you may have a menu icon which is pointing nowhere.
I suggest you run something like find ~ -iname "*clion*" and investigate what is found. If you are using Gnome2 or MATE desktop you will certainly find .desktop files which are the icons you are looking for.
If you used snap to install you can uninstall using
sudo snap remove --purge clion

CMake error while running tar

I am trying to copy a directory using a CMake script.
execute_process(COMMAND ${CMAKE_COMMAND} -E tar czf "${name}.orig.tar.gz" "${folder}"
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/Debian)
but it is throwing an error.
CMake Error: archive_write_header: Can't translate pathname 'files/osgModels/textures/índice.jpeg' to UTF-8
Now I end up with an archive which doesn't contain all the files.
However I can successfully create the archive when running tar independently, i.e. not using CMake.
I think you're seeing this CMake bug which was resolved after version 2.8.12.2. I'm not sure whether the fix made it into 3.0.0 or if it was 3.0.1, but either way, if you update CMake to the current version, you should see the problem disappear.
(I expect the í character of índice is the problem here)

How to set the CMAKE_PREFIX_PATH?

I have a problem with the global environmental variable CMAKE_PREFIX_PATH. I already set this and I can see it is set when I type env, but when I run cmake . to build HipHop, it tells me that the variable isn't set.
Is there a way I can hard-code this into the makefiles?
Try to run cmake -DCMAKE_PREFIX_PATH=/your/path .
CMAKE_PREFIX_PATH works as a build directive, rather than as an environment variable. Moreover, you may perform the build into a dedicated temporary directory (it's cleaner, because when done, you can remove that temporary directory and you get back a clean pristine source tree).
$ mkdir -p tmpbuild && cd tmpbuild
$ cmake -DCMAKE_PREFIX_PATH=~/deliveries/hiphop ..
$ make install
$ cd ..
On MacOS it's different. I had to use:
make -i CMAKE_PREFIX_PATH="/the/path"
This was while installing VMQT, and this error was shown:
CMake Error at CMakeLists.txt:87 (find_package): By not providing
"FindOpenCV.cmake" in CMAKE_MODULE_PATH this project has asked CMake
to find a package configuration file provided by "OpenCV", but CMake
did not find one.
Could not find a package configuration file provided by "OpenCV"
with any of the following names:
OpenCVConfig.cmake
opencv-config.cmake
Add the installation prefix of "OpenCV" to CMAKE_PREFIX_PATH or set
"OpenCV_DIR" to a directory containing one of the above files. If
"OpenCV" provides a separate development package or SDK, be sure it
has been installed.
Used this to solve it: make -i CMAKE_PREFIX_PATH="/opt/homebrew/Cellar/opencv/4.6.0_1/lib/cmake/opencv4/"