Perfect Asistant: Build Linux failed due to module cache path on linux vs macOS - perfect

I tried to follow along the Perfect screencast from RayWenderlich on a Mac. On Perfect Asistant (2nd screencast), he showed using Perfect Assistant, we could just click on the Build Linux and it will build on Linux given we have installed the Docker.
In my case it started to compile then it failed with error that current module cache path and the module cache path the PCH was compiled was not the same. I don't know how to update the module cache path just for Linux.
Here are the console output:
Starting Linux build of /Users/hange/Developer/RayWenderlich/Practices/ServerSide_Perfect/hello-perfect-assistant
Using image perfectassistant/helloperfectassistant
Using image perfectassistant/helloperfectassistant
Compile COpenSSL openssl.c
Compile LinuxBridge LinuxBridge.c
error: PCH was compiled with module cache path '/perfectbuild/.build_lin/debug/ModuleCache/5QE1M5WG4ATI', but the path is currently '/perfectbuild/.build/debug/ModuleCache/5QE1M5WG4ATI'
1 error generated.
Failed: systemError(1, ":0: error: build had 1 command failures\nswift-build: error: exit(1): /swift-3.1.1-RELEASE-ubuntu16.04/usr/bin/swift-build-tool -f /perfectbuild/.build/debug.yaml\n")

In Perfect Assistant project editor window, press and hold button "Build" and choose "Clean Project", then try building it once more.
Alternatively, press and hold button "Open" then choose "Open Terminal", and run commands below:
$ rm -rf .build*
$ rm -rf *.pins
$ rm -rf *.resolved
Then try building.
If you still couldn't understand what was going on, try opening a terminal window and run scripts below:
$ cd "/Users/hange/Developer/RayWenderlich/Practices/ServerSide_Perfect/hello-perfect-assistant"
$ rm -rf .build*
$ rm -rf *.pins
$ rm -rf *.resolved
Which should perform the same task as the second solution.

Related

How do I fix DWM "make clean install" command error?

I was setting up DWM window manager on debian, but when conpiling it, it came up with an error.
I installed it, then tried to run it with make clean install, but it did not have the make command. I installed it with sudo apt-get install -y make. I tried to run make clean install, but it came up with the error:
make: cc: No such file or directory
make: *** [Makefile:18: drw.o] Error 127
Help?
Doing just make install (sudo if required) the first time should fix the error.
As to why it happens — you probably have a custom Makefile or your rm binary does not understand the -f flag. The upstream Makefile has the following under the clean target:
clean:
rm -f dwm ${OBJ} dwm-${VERSION}.tar.gz
Ensure that your Makefile also passes the -f flag to rm (which means "ignore nonexistent files").

Command line tools not accessible from Eclipse on OSX

I am using Eclipse on a macOS machine. CMake is present on my machine at /usr/local/bin/cmake and has been installed using Homebrew. Eclipse is at the latest version (2018-09).
I have the following target in a Makefile, which has been set up and is visible from Eclipse:
all:
./configure
Rscript -e "Rcpp::compileAttributes()"
R CMD INSTALL --no-multiarch --with-keep.source .
Inside the configure file, there is this code:
cd src/build;cmake ..
However, when I double click the all target in Eclipse, I get the following message:
make all
./configure
./configure: line 1: cmake: command not found
make: *** [all] Error 127
I remember that some time ago this target worked out of the box on macOS. I can also launch CMake from a terminal without any trouble.
echo $PATH shows different behaviour:
If called from a standard macOS terminal, it yields /usr/local/sbin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/opt/X11/bin
If called from a TM Terminal inside Eclipse, it yields /usr/bin:/bin:/usr/sbin:/sbin
What is the most canonical way to have Eclipse detect my CMake installation ?
For macOS High Sierra 10.13.6, the solution provided here works. This must be performed to see the changes immediately.

CMake install directory permission

I have built a project using cmake (LLVM project) and tried to install it by issuing the following command:
$ cmake3 --build . --target install
If I run it using root then there is no problem and the files will be installed under the directory /usr/local/.
My problem is when I want to install the project using normal user.
I get the following error:
CMake Error at cmake_install.cmake:36 (file):
file INSTALL cannot set permissions on "/usr/local/include/llvm"
I have changed the permission of directory /usr/local/ to 777 recursively, and their ownership to root:wheel and I added my normal user to group wheel. But I still cannot install the files into the /usr/local/ directory.
The main issue is about building project in Eclipse which fails at "Build Install" command.
chmod 777 -R / is a very scary command. I've destroyed a system once by doing that.
The philosophy I use for this is:
If I need to deploy something through my IDE to debug or test before packaging, I deploy it locally within my home directory.
I only install stuff to my system (outside of home) if it has been packaged first (*.deb, *.rpm, *.tar.gz) so that I can remove it without problems.
For me, I do this with:
cmake $src
cmake --build . --target install -- DESTDIR=stage
This will configure my project, make it, then install it locally in a folder called ./stage which resides in my build directory. I can then run my executable from ./stage/usr/bin. Note that this only works if make is your generator.
Once I've tested it and I'm happy, I package it and deploy to my system or upload to a repository:
cpack
sudo dpkg -i <package>.deb
We should use USE_SOURCE_PERMISSIONS in our install function.
Example:
install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Release/" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}" USE_SOURCE_PERMISSIONS)

Why there is no mkdir in MSYS?

Hello I've installed MinGW with Msys and there is no mkdir in bin folder of Msys.
Why?
How can I use Netbeans to compile C++ code?
I get such error
mkdir -p build/Debug/MinGW-Windows
make.exe[2]: mkdir: Command not found
when trying to compile in Netbeans 8.1
Several commands are missing when installing MinGW and Msys.
E.g. when running the "/postinstall/pi.sh" as recommended in the "Getting started" guide, the following commands were missing:
- mkdir
- cp
- rm
I fixed it by downloading:
https://sourceforge.net/projects/unxutils/?source=typ_redirect
and then copying the missing commands to C:\MinGW\msys\1.0\bin
Of course I did a search initially to see if the commands should hide anywhere else in the MinGW/Msys filetrees, and they didn't.
I also copied useful commands like:
- ls
- rmdir

How to uninstall opencv in Ubuntu?

I have the following system:
Linux 64 bit LTS 12.04
I have multiple installations of opencv library on the system.
I want to know the procedure to remove all opencv libraries from the system.
I am having trouble while executing my program through Eclipse IDE.
Though I can build the project when I try to execute it, it gives the following error:
OpenCV Error: Assertion failed (k == STD_VECTOR_MAT) in release, file /build/buildd /opencv-2.3.1/modules/core/src/matrix.cpp, line 1364
terminate called after throwing an instance of 'cv::Exception'
what(): /build/buildd/opencv-2.3.1/modules/core/src/matrix.cpp:1364: error: (-215) k == STD_VECTOR_MAT in function release
Confusing thing is I am not able to find the path specified in the error i.e.
/build/buildd/opencv-2.3.1/modules/core/src/matrix.cpp
I am able to compile the same source code using command line tool gcc and using pkg-config.
However I am unable to do the same through eclipse IDE.
You can also uninstall by going to the "build" folder directory of opencv from terminal, and execute the following
make uninstall
cd ..
sudo rm -r build
sudo rm -r /usr/local/include/opencv2 /usr/local/include/opencv /usr/include/opencv /usr/include/opencv2 /usr/local/share/opencv /usr/local/share/OpenCV /usr/share/opencv /usr/share/OpenCV /usr/local/bin/opencv* /usr/local/lib/libopencv*
I remember I used this command a while ago to remove all opencv related things. It is interactive which promote you to remove the file. choose y or n depending.Take your time and be-careful
$> sudo find / -name "*opencv*" -exec rm -i {} \;
The correct way is cd /path/to/cv/build then sudo make uninstall. Of course you will have to have the source code with you
I tried the exec rm thing but nothing changed. Also FYI, sudo apt-get remove libopencv-* did not remove openCV for me