I use Atollic 8.1 which is build up upon Eclipses Neon 1a release on Windows 10.
The Clean command is by default "rm -rf" in the .cproject. When executed, the clean command removes all *.o and *.d objects im Debug/Release but not *.su files.
When comparing to newer Eclipse releases, the clean command actually is able to delete the entire Debug / Release folder (Build Outputs).
I tried to do the same by manually editing the clean command in .cproject by writing "rm -rf Debug Release", so when executed, Eclipse does something like this in the background:
"rm -rf Debug Release *.o *.d" but currently it still ignores Debug and Release.
So why are they not deleted? Then i replaced "rm -rf" with "pwd" and noticed that it is executing from inside the Debug folder.
So my .cproject executes now "rm -rf ../Debug ../Release" which is working ... kinda...
The Debug folder is completely empty, which is my goal. But:
I get the error:
C:\Program Files (x86)\Atollic\TrueSTUDIO for ARM 8.1.0\Tools\rm.exe: cannot remove directory `../Debug': Permission denied
I believe that since it executes the actual "rm -rf ../Debug" command but since it is executing from inside the Debug folder, it recreates it and issues the warning.
Is there a better way around this?
Related
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").
For a school assignment, I am trying to compile a C file using a provided Makefile in Vscode. The makefile contains the following:
CFLAGS += -std=gnu11 -g
EXES = greet
all: $(EXES)
clean:
rm -f $(EXES)
greet: greet.c
# don't treat all and clean as file targets
.PHONY: all clean
When I run make in the VScode terminal, it gives me:
bash: make: command not found
Why is this happening? The assignment says this:
The accompanying Makefile will build the program greet. Thus, you can compile the
program by running make. The make program will print out each command that it uses to
compile the program. Note that if you run make twice in a row, the second time it won’t do
anything, because it knows your source file hasn’t changed.
Run the program using the following command:
./greet
I don't know if this has anything to do with my tasks.json file in VScode?
I also ran across this VSCode extension: https://naereen.github.io/Makefiles-support-for-VSCode/
It says Vscode now has something built-in: https://github.com/microsoft/vscode/tree/master/extensions/make
I don't know how to install this.
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.
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)
i follow the following steps to install and configure clang static analyser.but still i could not run scan-build command in project directory can anyone can give correct tutorial to set path and also run scan-build command.terminal shows "scan-build command not found" the steps i followed:
Installation: Navigate to http://clang.llvm.org/StaticAnalysis.html Download the linked checker tarbell (it says tar.bz2, but it's really tar.bz2.tar). Extract that and copy that to a directory on your device. I chose ~/Developer/clang Open terminal and type sudo nano /etc/paths Enter the directory in which you keep your clang stuffs. Press 'Ctrl + X' to Exit, and press 'Y' to save.
You're now done with installation. Quit and restart terminal.
To use this, First make sure you go into Xcode and "Clean All" before you do anything. When that's all set, open terminal and navigate to the directory of the app you want to build. Enter the following command. Make sure to replace the name od the sdk with the one you currently want to build with. scan-build -k -V xcodebuild -configuration Debug -sdk iphonesimulator3.0
I've never added paths that way. But regardless you should not need to.
If you added clang to ~/Developer/clang, then just change the command you are using to run it to:
~/Developer/clang/scan-build -k -V xcodebuild -configuration Debug -sdk iphonesimulator3.0
Ran into this problem myself. It seems that scan-build is actually a perl script which changes some env variables so that clang compiler gets run before the work is passed to the real project compiler. This way clang can perform static analysis.
Try running like this:
perl <CLANG_PATH>/llvm/tools/clang/tools/scan-build/scan-build -k -o $HOME/clang-result make
Before that make sure you have the clang executable in the PATH variable:
echo $PATH
To add it:
export PATH=$PATH:<CLANG_BUILD_BIN_PATH>
eg: export PATH=$PATH:$HOME/clang/build/Release+Asserts/bin/