cmake can not open file - makefile

When compiling a simple project with cmake I get
$ cmake CMakeLists.txt
CMake Error: cmListFileCache: error can not open file /cygdrive/d/Balladen/helloWorld/CMakeFiles/CMakeSystem.cmake
-- The C compiler identification is GNU 4.8.2
CMake Error: cmListFileCache: error can not open file /cygdrive/d/Balladen/helloWorld/CMakeFiles/CMakeCCompiler.cmake
CMake Error: Could not find cmake module file:/cygdrive/d/Balladen/helloWorld/CMakeFiles/CMakeCCompiler.cmake
-- The CXX compiler identification is GNU 4.8.2
CMake Error: cmListFileCache: error can not open file /cygdrive/d/Balladen/helloWorld/CMakeFiles/CMakeCXXCompiler.cmake
CMake Error: Could not find cmake module file:/cygdrive/d/Balladen/helloWorld/CMakeFiles/CMakeCXXCompiler.cmake
CMake Error: cmListFileCache: error can not open file /cygdrive/d/Balladen/helloWorld/CMakeFiles/CMakeSystem.cmake
CMake Error: cmListFileCache: error can not open file /cygdrive/d/Balladen/helloWorld/CMakeFiles/CMakeRCCompiler.cmake
CMake Error: Could not find cmake module file:/cygdrive/d/Balladen/helloWorld/CMakeFiles/CMakeRCCompiler.cmake
CMakeLists.txt:
cmake_minimum_required(VERSION 2.8.4)
project('helloWorld')
## Target
set(TEST_SRCS main.cpp)
add_executable(helloWorld ${TEST_SRCS})
## Link libraries
target_link_libraries(helloWorld ${CMAKE_THREAD_LIBS_INIT})
The files CMakeCCompiler and CMakeCXXCompiler do not exist, the file CMakeSystem.cmake has no access rights. Therefore they can not be read.
$ ls -la *
-rw-r--r--+ 1 WUD Domain Users 10195 Mar 26 17:59 CMakeCache.txt
----------+ 1 WUD Domain Users 426 Mar 26 17:53 CMakeLists.txt
----------+ 1 WUD Domain Users 64 Mar 26 17:58 main.cpp
----------+ 1 WUD Domain Users 5667 Mar 26 17:34 Makefile
CMakeFiles:
total 16
drwxr-xr-x+ 1 WUD Domain Users 0 Mar 26 17:59 .
d---------+ 1 WUD Domain Users 0 Mar 26 17:59 ..
-rw-r--r-- 1 WUD Domain Users 85 Mar 26 17:59 cmake.check_cache
-rw-r--r-- 1 WUD Domain Users 72 Mar 26 17:59 CMakeError.log
-rw-r--r-- 1 WUD Domain Users 803 Mar 26 17:59 CMakeOutput.log
---------- 1 WUD Domain Users 221 Mar 26 17:59 CMakeRCCompiler.cmake
---------- 1 WUD Domain Users 402 Mar 26 17:59 CMakeSystem.cmake
drwxr-xr-x+ 1 WUD Domain Users 0 Mar 26 17:59 CMakeTmp
drwxr-xr-x+ 1 WUD Domain Users 0 Mar 26 17:59 CompilerIdC
drwxr-xr-x+ 1 WUD Domain Users 0 Mar 26 17:59 CompilerIdCXX
If I copy the files from an other project and add reading rights to all files in CMakeFiles, then it works fine. I have this problem with several projects. Running it on a mounted drive DOES help (for example on a true-crypt drive).
So I guess problems with access rights.
All hints I found in the internet did not help.
I'm working with Windows 7, Cygwin 32bit, cmake version 2.8.9
Any idea?

This appears to be an issue with cmake being unable to process files with path lengths above 260 characters or more on Windows. To fix this issue you would need to reduce your path size to below 260 or set LongPathsEnabled to 1 in the file registry. See this issue for more details:
https://gitlab.kitware.com/cmake/cmake/-/issues/21875

Related

Error When Importing ROS Projects & Workspace in CLion

I wanted to give CLion a try for working with the ROS source code. I created a ROS Workspace and have the following folder structure:
joesan#joesan-InfinityBook-S-14-v5:~/Projects/Private/ros-projects$ cd catkin_ws/
drwxrwxr-x joesan joesan 4 KB Sun Aug 30 10:48:27 2020  .
drwxrwxr-x joesan joesan 4 KB Sun Aug 30 10:48:10 2020  ..
.rw-rw-r-- joesan joesan 98 B Sun Aug 30 10:48:27 2020  .catkin_workspace
drwxrwxr-x joesan joesan 4 KB Sun Aug 30 10:48:27 2020  build
drwxrwxr-x joesan joesan 4 KB Sun Aug 30 10:48:26 2020  devel
drwxrwxr-x joesan joesan 4 KB Sun Aug 30 12:13:50 2020  src
joesan#joesan-InfinityBook-S-14-v5:~/Projects/Private/ros-projects/catkin_ws$
I have sourced this location in the .bash_profile as below:
# Dynamically source all setup.bash files from multiple catkin ros workspaces
find /home/joesan/Projects/Private/ros-projects -wholename '*/devel/setup.bash' | xargs source
I then source the .bash_profile from within my .bashrc
Now, when I tried to open the project in CLion, I see the following error:
CMake Error at CMakeLists.txt:65 (message):
find_package(catkin) failed. catkin was neither found in the workspace nor
in the CMAKE_PREFIX_PATH. One reason may be that no ROS setup.sh was
sourced before.
I launch CLion via a Desktop shortcut entry that I created. How do I make CLion aware of this .bash_profile such that it can find catkin?
I managed to fix this by doing the following, but make sure that you have a Desktop entry created for Jetbrains CLion beforehand!
Open the jetbrains-clion.desktop located in the .local folder:
~/.local/share/applications/jetbrains-clion.desktop
In this desktop entry, modify the Exec= line as:
Exec=bash -i -c "/opt/softwares/clion-2020.2.1/bin/clion.sh" %f

Permission Denied error in Xcode 10 preventing Build...Command PhaseScriptExecution failed with a nonzero exit code

I'm unable to Build/Archive my project due to an error:
Permission denied
Command PhaseScriptExecution failed with a nonzero exit code
I have tried correcting keychain login as advised by other answers, but it hasn't worked. Please could someone help? Most likely a rookie mistake but means I cannot even simulate my app.
Further details on the error:
PhaseScriptExecution Copy\ Pods\ Resources
/Users/james/Library/Developer/Xcode/DerivedData/trials-fseuxkwjlleukxdxyfgdrujhdwuy/Build/Intermediates.noindex/trials.build/Debug-iphonesimulator/trials.build/Script-8DEE2FC97BFA0D6E636019C4.sh (in target: trials)
cd /Users/james/pCloud\ Drive/3.\ NeuroRecovery\ Ltd/4.\ Products/3.\ NIHR\ Trial\ NHS/v1.0\ -\ Initial\ App/1.\ App\ Delivery/3.\ Source\ Code/1.\ iOS/trials
/bin/sh -c /Users/james/Library/Developer/Xcode/DerivedData/trials-fseuxkwjlleukxdxyfgdrujhdwuy/Build/Intermediates.noindex/trials.build/Debug-iphonesimulator/trials.build/Script-8DEE2FC97BFA0D6E636019C4.sh
/Users/james/Library/Developer/Xcode/DerivedData/trials-fseuxkwjlleukxdxyfgdrujhdwuy/Build/Intermediates.noindex/trials.build/Debug-iphonesimulator/trials.build/Script-8DEE2FC97BFA0D6E636019C4.sh: line 2: /Users/james/pCloud Drive/3. NeuroRecovery Ltd/4. Products/3. NIHR Trial NHS/v1.0 - Initial App/1. App Delivery/3. Source Code/1. iOS/trials/Pods/Target Support Files/Pods-trials/Pods-trials-resources.sh: Permission denied
Command PhaseScriptExecution failed with a nonzero exit code
Edit 17th Dec:
thank you #geno-chen & #fantini I have checked & can report the following:
Did you install Cocoapods with sudo: Yes.
I checked the permissions of the files using ls -lh and had the following:
-rw-r--r-- 1 james staff 159B 25 Mar 2015 Podfile
-rw-r--r-- 1 james staff 1.2K 25 Mar 2015 Podfile.lock
drwxr-xr-x 11 james staff 352B 17 Dec 14:03 Pods
drwxr-xr-x 52 james staff 1.6K 17 Dec 14:03 trials
drwxr-xr-x# 5 james staff 160B 17 Dec 14:03 trials.xcodeproj
drwxr-xr-x# 5 james staff 160B 17 Dec 14:03 trials.xcworkspace
drwxr-xr-x 4 james staff 128B 17 Dec 14:03 trialsTests
I used chmod to modify permissions of the podfiles as below:
-rwxr-xr-x 1 james staff 159B 25 Mar 2015 Podfile
-rwxr-xr-x 1 james staff 1.2K 25 Mar 2015 Podfile.lock
drwxr-xr-x 11 james staff 352B 17 Dec 14:03 Pods
drwxr-xr-x 52 james staff 1.6K 17 Dec 14:03 trials
drwxr-xr-x# 5 james staff 160B 17 Dec 14:03 trials.xcodeproj
drwxr-xr-x# 5 james staff 160B 17 Dec 14:03 trials.xcworkspace
drwxr-xr-x 4 james staff 128B 17 Dec 14:03 trialsTests
I then Cleaned my Build Folder, restarted but still have the same error.
I fixed the permission problem by running the following command.
chmod +x "Path to .sh"
Please replace ProjectName with your project name and username with your username
chmod +x /Users/username/Documents/ProjectName/Pods/Target\ Support\ Files/Pods-ProjectName/Pods-ProjectName-frameworks.sh
You can get the path from your xcode project as explained by step 1 to 3
I've tried #Sawsan method but get no luck even the file is already executable.
Here is the step how I solve it:
1.delete Podfile.lock
2.delete Pods directory
3.delete .xcworkspace file
4.Pod install again
that's it.
give it a try!
I have to own a trial for this solution and I got a proper result.
Follow the step:
1) Open Terminal and set a project path
"pod deintegrate" command executes
2) Then after "pod install" command executes.
I solved by deleting the Pods folder that was committed to the repo.

Nativescript app will not running locally

I have a nativescript app I have inherited and am trying to get it running locally. Here is what I am seeing:
ruby-2.4.1 marklocklear:foobar_app marklocklear$ tns run ios
Skipping node_modules folder! Use the syncAllFiles option to sync files from this folder.
Searching for devices...
Executing before-liveSync hook from /Users/marklocklear/nativescript/foobar_app/hooks/before-liveSync/nativescript-angular-sync.js
Executing before-watchPatterns hook from /Users/marklocklear/nativescript/foobar_app/hooks/before-watchPatterns/nativescript-dev-typescript.js
Executing before-watch hook from /Users/marklocklear/nativescript/foobar_app/hooks/before-watch/nativescript-dev-typescript.js
Found peer TypeScript 2.9.2
15:17:35 - Starting compilation in watch mode...
15:17:40 - Found 0 errors. Watching for file changes.
At this point the command line sits there...if I open the preview or playground app I get nothing on my iPhone (which is connected to my mac) I get nothing.
If I try tns run ios --emulator this opens an emulator locally, but I don't see the app anywhere on the emulator.
I have a couple of sample apps that I am able to run locally, so I think the framework is installed correctly. Here is what the root of the app looks like:
ls -la
total 64
drwxr-xr-x 10 marklocklear staff 320 Oct 25 12:44 .
drwxr-xr-x# 7 marklocklear staff 224 Oct 26 14:44 ..
drwxr-xr-x# 31 marklocklear staff 992 Oct 25 10:09 app
drwxr-xr-x 8 marklocklear staff 256 Oct 25 12:44 hooks
drwxr-xr-x 64 marklocklear staff 2048 Oct 25 12:44 node_modules
-rw-r--r--# 1 marklocklear staff 19593 Oct 25 10:09 package-lock.json
-rw-r--r--# 1 marklocklear staff 1381 Oct 25 10:09 package.json
drwxr-xr-x# 5 marklocklear staff 160 Oct 25 10:09 platforms
-rw-r--r--# 1 marklocklear staff 271 Oct 25 10:09 references.d.ts
-rw-r--r--# 1 marklocklear staff 681 Oct 25 12:44 tsconfig.json
Any ideas on how to trouble shoot this?
Remove your platform, node_modules and build again. Try a real device too.

How to fix symbol __vdso_clock_gettime, version GLIBC_PRIVATE not defined in file libc.so.6 with link time reference [duplicate]

This question already has answers here:
Multiple glibc libraries on a single host
(11 answers)
Closed 4 years ago.
when I try to fix the problem /lib64/libc.so.6: version 'GLIBC_2.14' not found in CentOS 6 system by install latest glibc version to my home directory, I found my computer crashed.
$ conda
/public/home/liuxs/anaconda3/bin/python: relocation error: /lib64/librt.so.1: symbol __vdso_clock_gettime, version GLIBC_PRIVATE not defined in file libc.so.6 with link time reference
$ python
python: relocation error: /lib64/librt.so.1: symbol __vdso_clock_gettime, version GLIBC_PRIVATE not defined in file libc.so.6 with link time reference
I try my best to remove all the thing I have done and google to fix this, I failed. I cannot understand the problem, how it occurs and which part should I focus -- libc.so.6 or librt.so.1? Which is the key.
I have no root permission, so I cannot change the files for lib, lib64 etc.
$ ls -l $(locate librt.so.1)
lrwxrwxrwx 1 root root 13 Jul 6 2017 /lib64/librt.so.1 -> librt-2.12.so
lrwxrwxrwx 1 root root 17 Jul 6 2017 /lib64/rtkaio/librt.so.1 -> librtkaio-2.12.so
lrwxrwxrwx 1 root root 13 Aug 1 2017 /lib/i686/nosegneg/librt.so.1 -> librt-2.12.so
lrwxrwxrwx 1 root root 13 Aug 1 2017 /lib/librt.so.1 -> librt-2.12.so
lrwxrwxrwx 1 root root 17 Aug 1 2017 /lib/rtkaio/i686/nosegneg/librt.so.1 -> librtkaio-2.12.so
lrwxrwxrwx 1 root root 17 Aug 1 2017 /lib/rtkaio/librt.so.1 -> librtkaio-2.12.so
$ ls -l $(locate libc.so.6)
lrwxrwxrwx 1 root root 19 Dec 25 13:51 /lib64/libc.so.6 -> /lib64/libc-2.12.so
lrwxrwxrwx 1 root root 12 Aug 1 2017 /lib/i686/nosegneg/libc.so.6 -> libc-2.12.so
lrwxrwxrwx 1 root root 12 Aug 1 2017 /lib/libc.so.6 -> libc-2.12.so
I also have these two files in conda directory, which can not be locate
$ ls -l $(find . -name "libc.so.6")
-rwxrwxr-x 1 liuxs liuxs 3985000 Jun 21 2017 ./lib/libc.so.6
lrwxrwxr-x 1 liuxs liuxs 14 May 10 19:26 ./pkgs/gcc_impl_linux-64-7.2.0-habb00fd_3/x86_64-conda_cos6-linux-gnu/sysroot/lib/libc.so.6 -> libc-2.12.2.so
lrwxrwxr-x 1 liuxs liuxs 14 Mar 28 12:06 ./x86_64-conda_cos6-linux-gnu/sysroot/lib/libc.so.6 -> libc-2.12.2.so
[liuxs#HPC-login anaconda3]$ ls -l $(find . -name "librt.so.1")
lrwxrwxr-x 1 liuxs liuxs 15 Mar 28 11:25 ./pkgs/gcc_impl_linux-64-7.2.0-habb00fd_3/x86_64-conda_cos6-linux-gnu/sysroot/lib/librt.so.1 -> librt-2.12.2.so
lrwxrwxr-x 1 liuxs liuxs 15 Mar 28 12:06 ./x86_64-conda_cos6-linux-gnu/sysroot/lib/librt.so.1 -> librt-2.12.2.so
I think maybe it's file in anaconda3 make this error but I dont know how to locate the source of problem. And I dont know when I run conda or python, which librt.so.1 and libc.so.6 the commands use.
Hope someone can help me out of this.
I found how to fix this, the problem came from
-rwxrwxr-x 1 liuxs liuxs 3985000 Jun 21 2017 ./lib/libc.so.6
I change its name fro backup, and the system is okay now. Even though I don't very understand why it works. But the interesting thing is No matter where the file libc.so.6 is, the system will give an error. Maybe it's not a good answer, I modify its name from ./lib/libc.so.6 to ./lib/libc.so.6.bk in case I need it latter.
Thanks comment from #nos.
You are trying to run a program that is fundamentally incompatible
with the runtime of your CentOS 6 machine. You should find a pre-built
binary that is suitable for CentOS 6, or if this is an open source
project, build it yourself

Failed to archive Cocoa application with command-line tool inside Executables

I stuck with this problem in my project, so, I tried it with an empty test project. Here is what I do.
Create a new Cocoa application project in Xcode.
Add a new command-line tool target to it.
Add this target to the dependencies of the cocoa app.
In cocoa app target build phases add Copy files build phase, Destination = Executables, add executable product to the list.
Now Run cocoa application. No problem, application launched. Navigate app bundle in Finder, Show package contents, executable here in Contents/MacOS. This is what I expect to be.
The problem occurs when I archive cocoa application, it fails with the following error:
(null): error: /Users/prudnikov/Library/Developer/Xcode/DerivedData/TestAppWithExecutable-hiysgipuqcktgoayxrgjfrtcxubl/Build/Intermediates/ArchiveIntermediates/TestAppWithExecutable/BuildProductsPath/Release/TestAppExecutable: No such file or directory
Here is a screenshot
Here is content of this directory
prudnikov#Vladimirs-iMac ~ $ ls -al /Users/prudnikov/Library/Developer/Xcode/DerivedData/TestAppWithExecutable-hiysgipuqcktgoayxrgjfrtcxubl/Build/Intermediates/ArchiveIntermediates/TestAppWithExecutable/BuildProductsPath/Release/
total 8
drwxr-xr-x 5 prudnikov staff 170B Apr 26 21:59 ./
drwxr-xr-x# 3 prudnikov staff 102B Apr 26 21:59 ../
drwxr-xr-x 3 prudnikov staff 102B Apr 26 21:59 TestAppExecutable.dSYM/
lrwxr-xr-x 1 prudnikov staff 239B Apr 26 21:59 TestAppWithExecutable.app# -> /Users/prudnikov/Library/Developer/Xcode/DerivedData/TestAppWithExecutable-hiysgipuqcktgoayxrgjfrtcxubl/Build/Intermediates/ArchiveIntermediates/TestAppWithExecutable/InstallationBuildProductsLocation/Applications/TestAppWithExecutable.app
drwxr-xr-x 3 prudnikov staff 102B Apr 26 21:59 TestAppWithExecutable.app.dSYM/
Archiving executable — no problems. All build settings are defaults.
I've also tried to change build configuration from Debug to Release for Run action of Cocoa application scheme. It runs successfully in this case as well.
This is very strange for me. Please advice how to do it?
UPDATE: It seems that I have problem with OS. People tried the same example and it worked. Then I trien to create a new account on my Mac and do the same there and it worked as well. What global configuration can cause this?
I don't think this is an Answer but it's too long for a comment.
Check the parent directories
gdunham: ~/Library/Developer/Xcode/DerivedData$ ls -laeG /Users/gdunham/Library/Developer/Xcode/DerivedData | grep -e " \\.$"
drwxr-xr-x 31 gdunham staff 1054 Apr 15 14:29 /Users/gdunham/Library/Developer/Xcode/DerivedData
drwxr-xr-x 13 gdunham staff 442 May 1 19:56 /Users/gdunham/Library/Developer/Xcode
drwxr-xr-x 4 gdunham staff 136 Mar 8 2012 /Users/gdunham/Library/Developer/
drwx------# 66 gdunham staff 2244 Apr 2 22:43 /Users/gdunham/Library
0: group:everyone deny delete
drwxr-xr-x+ 62 gdunham staff 2108 Apr 30 14:33 /Users/gdunham
0: group:everyone deny delete
drwxr-xr-x 7 root admin 238 Feb 20 14:16 /Users
drwxr-xr-x 34 root wheel 1224 Apr 20 09:26 /
Also look at your group membership
gdunham: ~/Library/Developer/Xcode/DerivedData$ groups
staff com.apple.access_screensharing com.apple.access_screensharing-disabled everyone _appstore localaccounts _appserverusr admin _appserveradm _lpadmin _lpoperator _developer com.apple.sharepoint.group.1

Resources