I built an Xcode project from CMake and when I attempt to build it I get the following error.
PhaseScriptExecution CMake\ Rules /Users/LaserTech/NewBuild/Myjob2/NameCreate.build/Debug/lsjob2.build/Script-E70CB352E1334BCA9B8BE7C1.sh
cd /Users/LaserTech/NameCreate-OSG-Qt5
/bin/sh -c /Users/LaserTech/NewBuild/Myjob2/NameCreate.build/Debug/Myjob2.build/Script-E70CB352E1334BCA9B8BE7C1.sh
make: *** No rule to make target `/Users/LaserTech/NameCreate-OSG-Qt5/Myjob2/PROTOBUF_PROTOC_EXECUTABLE-NOTFOUND', needed by `/Users/LaserTech/NewBuild/Myjob2/common.pb.cc'. Stop.
Command /bin/sh failed with exit code 2
I am not sure what this means. I would appreciate it if someone could shine some light onto what I should be looking at ?
Update:
I did have thoses packages installed. I needed to simply add the path to the binaries to the environment variable. However now xcode is giving me this
echo "Running C++ protocol buffer compiler on protocol/common.proto"
Running C++ protocol buffer compiler on protocol/common.proto
/Users/..../cmake/osxbuild/Release --cpp_out /Users/..../Myjob2 -I /Users/.../Myjob2/protocol /Users/../Myjob2/protocol/common.proto
make: /Users/.../protobuf/cmake/osxbuild/Release: Permission denied
make: *** [/Users/../NewBuild/Myjob2/common.pb.cc] Error 1
Related
I'm an inexperienced programmer so bear with me if this little sense. I'm trying to run a basic "hello world" kind of program in CLion, except I'm trying to print out a value in the main.cpp file from a header and cpp file. I'm using MacOS and everything is update in terms of software. When I try to build or run the program, it gives me these errors:
====================[ Build | untitled1 | Debug ]===============================
/Applications/CLion.app/Contents/bin/cmake/mac/bin/cmake --build /Users/anshuldaga/untitled1/cmake-build-debug --target untitled1 -- -j 2
[ 33%] Building CXX object CMakeFiles/untitled1.dir/main.cpp.o
[ 66%] Building CXX object CMakeFiles/untitled1.dir/test.cpp.o
make[3]: /Library/Developer/CommandLineTools/usr/bin/c++: Permission denied
make[3]: /Library/Developer/CommandLineTools/usr/bin/c++: Permission denied
make[3]: *** [CMakeFiles/untitled1.dir/main.cpp.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: *** [CMakeFiles/untitled1.dir/test.cpp.o] Error 1
make[2]: *** [CMakeFiles/untitled1.dir/all] Error 2
make[1]: *** [CMakeFiles/untitled1.dir/rule] Error 2
make: *** [untitled1] Error 2
I've already tried running the sudo g++ main.cpp command and it gives me this error:
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Based off my research, I know that clang is the compiler for c++ and a linker error is basically when something can't find the right files or library.
I've uninstalled and reinstalled Xcode, did the
sudo xcode-select -switch /Library/Developer/CommandLineTools/
command. I'm not sure what to do at this point. Any help would be greatly appreciated, thank you!
According to this(archive.org) old post from the CLion forum, the xcode license agreement might be the issue. Try to start xcode and agree to the license, or run sudo xcodebuild -license.
I followed the installation guide and got the result as "Configuring done" in cmake GUI. I did this installation in Ubuntu18.04 local machine/laptop.
Installation guide link: https://github.com/CMU-Perceptual-Computing-Lab/openpose/blob/master/doc/installation.md#installation
when running "make -j nproc" inside the build folder, then getting below error:
make: *** No targets specified and no makefile found. Stop.
Please let me know how to solve this issue.
I've had CUDA Toolkit 9.0 correctly installed on Ubuntu 16.04 with the package manager-based method since both the two commands
cat /proc/driver/nvidia/version
nvcc -V
returne the right infomation. However, it fails to make correctly when I tried to compile the official example NVIDIA_CUDA-9.0_Samples.
io#msi:~/NVIDIA_CUDA-9.0_Samples$ make
The main output is
/usr/bin/ld: can't find -lcudart
collect2: error: ld returned 1 exit status
Makefile:334: recipe for target 'simpleMPI' failed
make[1]: *** [simpleMPI] Error 1
make[1]: Leaving directory '/home/io/NVIDIA_CUDA-9.0_Samples/0_Simple/simpleMPI'
Makefile:52: recipe for target '0_Simple/simpleMPI/Makefile.ph_build' failed
make: *** [0_Simple/simpleMPI/Makefile.ph_build] Error 2
can anyone give me a hand? Thank you.
I think I've solved this problem. As I mentioned in the question, I've had CUDA Toolkit correctly installed in my computer, but it fails when execute
io#msi:~/NVIDIA_CUDA-9.0_Samples$ make
However, the following two commands
$ ~/NVIDIA_CUDA-9.0_Samples/1_Utilities/deviceQuery/deviceQuery
$ ~/NVIDIA_CUDA-9.0_Samples/1_Utilities/bandwidthTest/bandwidthTest
gives correct response "Result = pass". It's ok to ignore the "make error" listed above- I think.
I have been trying for hours to recompile Linux kernel of https://github.com/torvalds/linux from my MacBook Pro and at the end, still stuck. Hard to find a tutorial to understand how to recompile it, headers missing, bla bla bla.
http://www.howardism.org/Technical/Linux/Rebuilding_Kernel.html
https://medium.com/#ssreehari/implementing-a-system-call-in-linux-kernel-4-7-1-6f98250a8c38
https://tssurya.wordpress.com/2014/08/19/adding-a-hello-world-system-call-to-linux-kernel-3-16-0/ (but useless since I have the v4.17)
PS: I tried first adding a syscall website because that's what I'm trying to do at first.
At the begining, I got a .config not found.
*** Configuration file ".config" not found!
***
*** Please run some configurator (e.g. "make oldconfig" or
*** "make menuconfig" or "make xconfig").
***
make[3]: *** [silentoldconfig] Error 1
make[2]: *** [silentoldconfig] Error 2
make[1]: *** No rule to make target `include/config/auto.conf', needed by`include/config/kernel.release'. Stop.
Unlike in some web-links, the conf used doesn't exist or something else is wrong, so I'm creating a new .config from "make menuconfig" (as some answers on the web).
Then, I try to compile again. There is some command I tried:
- make
emixam23#Maximes-MBP:~/Workspace/linux-kernel$ make
getconf: no such configuration parameter `LFS_CFLAGS'
getconf: no such configuration parameter `LFS_LDFLAGS'
getconf: no such configuration parameter `LFS_LIBS'
/bin/sh: scripts/basic/modules.order: Permission denied
make[1]: *** [scripts/basic/modules.order] Error 1
make: *** [scripts_basic] Error 2
- sudo make
emixam23#Maximes-MBP:~/Workspace/linux-kernel$ sudo make
Password:
getconf: no such configuration parameter `LFS_CFLAGS'
getconf: no such configuration parameter `LFS_LDFLAGS'
getconf: no such configuration parameter `LFS_LIBS'
HOSTCC arch/x86/tools/relocs_32.o
In file included from arch/x86/tools/relocs_32.c:2:
arch/x86/tools/relocs.h:13:10: fatal error: 'elf.h' file not found
#include <elf.h>
^~~~~~~
1 error generated.
make[1]: *** [arch/x86/tools/relocs_32.o] Error 1
make: *** [archscripts] Error 2
After that, I begin to search if the mistake was coming from my make command and I found this:
- sudo make -j 4 && sudo make modules_install -j 4 && sudo make install -j 4
emixam23#Maximes-MBP:~/Workspace/linux-kernel$ sudo make -j 4 && sudo make modules_install -j 4 && sudo make install -j 4
getconf: no such configuration parameter `LFS_CFLAGS'
getconf: no such configuration parameter `LFS_LDFLAGS'
getconf: no such configuration parameter `LFS_LIBS'
CHK include/config/kernel.release
CHK include/generated/uapi/linux/version.h
CHK include/generated/utsrelease.h
HOSTCC arch/x86/tools/relocs_32.o
HOSTCC arch/x86/tools/relocs_64.o
HOSTCC arch/x86/tools/relocs_common.o
In file included from arch/x86/tools/relocs_common.c:2:
arch/x86/tools/relocs.h:13:10: fatal error: 'elf.h' file not found
#include <elf.h>
^~~~~~~
In file included from arch/x86/tools/relocs_32.c:2:
arch/x86/tools/relocs.h:13:10: fatal error: 'elf.h' file not found
#include <elf.h>
^~~~~~~
In file included from arch/x86/tools/relocs_64.c:2:
arch/x86/tools/relocs.h:13:10: fatal error: 'elf.h' file not found
#include <elf.h>
^~~~~~~
1 error generated.
make[1]: *** [arch/x86/tools/relocs_common.o] Error 1
make[1]: *** Waiting for unfinished jobs....
1 error generated.
1 error generated.
make[1]: *** [arch/x86/tools/relocs_32.o] Error 1
make[1]: *** [arch/x86/tools/relocs_64.o] Error 1
make: *** [archscripts] Error 2
make: INTERNAL: Exiting with 5 jobserver tokens available; should be 4!
So, based on the errors I got, I searched about <elf.h> and it seems to be something about Android. To me, it doesn't have any links, I mean, I feel like this.
The thing is, I just downloaded a Linux kernel (Torvalds), I added my syscall, now I'm trying to recompile it and use it with vagrant. That's it. Why does it seem so complicated? I will be honest, I feel completely lost... Do you have any idea if I'm right but I just missunderstood something, or I'm totally out of the good way?
I am working from a MacBook Pro:
MacBook Pro (Retina, 15-inch, Mid 2015)
macOS High Sierra
Version 10.13.1
Thanks for any hints/help
Max
PS: Edit 1: Add of my edits: https://github.com/Emixam23/linux-kernel/commit/d7d7b66cc6513e7b69fd2122b880c259628c438a
Vagrant
I found a workaround which is vagrant :) With vragrant you can recompile the kernel from a Mac OS. You just have to vagrant init then you connect yourself to the vagrant VM vagrant ssh. Once your inside the vagrant VM, run cd / and you will arrive to the root of your machin, which is also where you created the VM, so you can do whatever you want from Mac OS and compile from the terminal make -j 4 :)
Check your tool-chain. It is not just android thing. https://linux.die.net/man/5/elf.
Please go ahead if you like being challenged. cause this will not be straight forward.
If your task is just compiling code use virtual machine / other linux machine it will be quicker.
But if you are curious to check how things work and getting them work on mac for future compilations without vm. then continue.try adding those header files. in /usr/include as per this
I am new to compiling.
I am trying to compile iperf3 for Windows 10 because there is no official Windows distribution of iperf3 and for the learning experience. I am trying to do so on the new Windows Subsystem for Linux feature via Bash on Ubuntu on Windows, also for the learning experience.
I installed mingw-w64, which should give me the proper compiler and environment necessary for cross-compiling:
sudo apt-get install mingw-w64
This put two directories into my /usr directory:
i686-w64-mingw32
x86_64-w64-mingw32
It also put a bunch of things that look like compilers into /usr/bin.
I unzipped the .tar.gz file from iperf3 and navigated into it. Then, I run ./configure --host=i686-w64-mingw32.static and it completes without errors.
I note that the output of the command has a worrisome line: checking for i686-w64-mingw32.static-gcc... no
I note that the Makefile's CC variable is set to gcc, which doesn't sound like the proper compiler.
Then, I run make. It fails with errors:
collect2: error: ld returned 1 exit status
make[2]: *** [iperf3] Error 1
make[2]: Leaving directory `/home/snip/iperf3/iperf-3.1.4/src'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/snip/iperf3/iperf-3.1.4/src'
make: *** [all-recursive] Error 1
I also see the line: libtool: warning: undefined symbols not allowed in i686-w64-mingw32.static shared libraries; building static only
I think that the ./configure is not working correctly since it appears to have not found the right compiler for my --host argument and put it in the Makefile.
What am I doing wrong?
EDIT:
I changed the command to ./configure --host=i686-w64-mingw32 per comments and it completes without error. But no makefile is created so make yields make: *** No targets specified and no makefile found. Stop.
What am I doing wrong, now?
EDIT 2:
Looks like the ./configure actually is failing. Last line of its output is nanosleep() required for timing operations., which seems to mean that its missing a library for nanosleep.
How do I get nanosleep?
mingw doesn't support nanosleep. So programs using it cannot be compiled using mingw-w64.