I'm trying to compile caffe using cmake on a Linux machine. I get this complaint when running cmake:
Could NOT find PythonLibs (missing: PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS) (Required is at least version "2.7")
I later get this error
CMake Error at CMakeLists.txt:85 (add_dependencies):
The dependency target "pycaffe" of target "pytest" does not exist.
What am I doing wrong? I tried setting an environment variable for PYTHON_LIBRARIES but that didn't help. I'm using my locally installed version of python (2.7.13), so I think that might be causing the problem, but I don't know how to get past this.
I was able to "fix it" by editing the file build/CMakeCache.txt and manually setting these
PYTHON_INCLUDE_DIR
PYTHON_LIBRARY
I don't know if that's the correct way to resolve this. If not, what is the right way to resolve this?
I had the same error while installing caffe on Ubuntu 14.04; I solved this by installing boost-python:
sudo apt-get install libboost-python-dev
Check carefully through the installation instructions. There's a variety of dependencies to install (python-devel, glog-devel, ...) and some environment variables to set. Using a local Python installation isn't a problem, as long as you have that properly in your paths. Remember to check your PATH and LD_LIBRARY_PATH variables as well.
You might check with
env | egrep -i "py"
to see what variables do have Python references. If you suspect a version problem with an executable, use
ldd <executable>
To see what objects and versions get loaded. Among other things, it's vaguely possible that something got compiled against an older Python in the system directories.
You need to install numpy
Try pip install numpy
Related
I have some software from a collaborator. When performing >cmake .. I receive the error message "Could NOT find LibXml2 (missing: LIBXML2_INCLUDE_DIR)" (see screenshot)
I have found the libxml2.so.2.9.12 file on my machine and have added its directory to my PATH (/home/silicon/anaconda3/pkgs/libxml2-2.9.12-h03d6c58_0/lib) as well as several others that seem related, including one that just had a link to the file in it.
I saw a similar question in here (although on a Windows machine), here: cmake cannot find LibXml2
and I have tried several versions of this, but still the same error. I typed in the path the way it would look on a Linux machine (parenthesis in previous paragraph). I tried several versions. Always the same error.
I looked in the CMakeLists.txt file to see if there was something that looked like I could adjust it for my system, but I don't know anything about that type of file and I just left it the way it was.
Thank you for the help.
Quick solution from the asker's comment: sudo apt-get install libxml2-dev
I'm trying to run a piece of software I built in MSYS2 MINGW32 shell. The software is 32bits (don't have time to port it to 64bits) and there is one statically linked executable. Here is how I setup the build environment:
Installed a fresh copy of MSYS2;
$ pacman -Syu
Installed the following packages: git mingw-w64-i686-gcc mingw-w64-i686-cmake mingw-w64-i686-SDL mingw-w64-i686-SDL_mixer mingw-w64-i686-zlib mingw-w64-i686-libpng mingw-w64-i686-make
Git checkout the repo
Run the build in CMake
Build runs fine and the exe is generated.
Now the problem starts: the executable can't run and displays an error message about missing DLLs. I copied the missing DLLs to the same folder of the executable, and them another error message pops up complaining about error 0xC000007B, which I tracked down to be missing dependencies. After a while I figured out that the problem was that some of the DLLs is missing a dependency itself. Copied this last dependency to the folder.
Now, the big question: I can run the exe perfectly fine in the MINGW32 shell but I can't run it neither in cmd.exe nor by double-clicking in Windows Explorer and this is a problem (I can't ship a software this way). Is there any way to produce a binary that is able to run from explorer and from cmd.exe? What is the cause of this problem? Can it be mitigated?
I solved my problem!
After a lot of research, I realized that nothing was wrong with my MSYS2 build/setup/dependencies. The real problem was that CMake hide one parameter for the linker: -mwindows. Actually, the CMake find_package routine from one of the libraries I'm using (SDL) added this parameter to the linker command line parameters.
Adding a -mconsole to the linker parameters (using add_link_options("-mconsole")) solved the problem. The CLI now works as expected.
Thank you all for your help.
When I run command conda, I receive this error:
Conda is not recognized as an internal or external command operable program or batch file In almost every case, the solution are the environmental variables (I have already added it to C:\Users\*me*\Anaconda3\Scripts), but the situation here is different:
I have installed Anaconda recently, mainly because of Spyder. It has been going well for a while, but when I installed AstroQuery, the debugger gave me the error: __ init __ is not a method of NumPy (I can't remember accurately). I tried to solve this problem with some googling. I found that I need to remove NumPy and SetupTools with force flag (-f), and then install them again. So I removed these libraries, but I received Conda output that new NumPy cannot be combined with other libraries (Conda made a list of nearly 100 packages which cannot be combined with NumPy). At that point, I thought to myself that I really screwed up. I deleted Anaconda and installed it again, but when I opened Conda, I got the error The specified path cannot be found.
And there we are. I tried also with conda command, but no success.
Question in nutshell: I removed NumPy and setuptools from Conda, but then I couldn't install them again because of incompatibility. So I removed Anaconda and installed it again. I get error The specified path cannot be found.
Thank you!
I managed to solve the problem: I just had to activate the base environment.
This question shows us that sometimes we have an answer right in front of our nose, but we don't see it because we often complicate things too much.
Thanks to #FlyingTeller for support in comments.
I'm trying to build cpp-netlib 0.12.0 stable in Ubuntu 18.04, but when I get to running
$ make -j4
I get a lot of errors, such as:
error: ‘SSL_R_SHORT_READ’ was not declared in this scope
ERR_PACK(ERR_LIB_SSL, 0, SSL_R_SHORT_READ)
Google told me this was because the make variables -DOPENSSL_INCLUDE_DIR and -DOPENSSL_SSL_LIBRARY need to be defined. However, I can't find the directories/libraries I need to set them to. Examples give /usr/lib/openssl-1.0 and /usr/include/openssl-1.0, but I can't find anything like those, even though I have the latest version of openssl installed through apt-get.
My /usr/include directory contains the folder 'openssl', but usr/lib doesn't have even that, only 'openssh', which doesn't appear to contain anything relevant.
How can I fix this?
Fixed by cloning latest version from git repository and building from that.
Well I've recently come out of the dark ages and upgraded my GCC from 3.4.4 to 4.5.0 with Cygwin (I use Netbeans 6.8 on Windows for future reference). I tried testing the new compiler by attempting to run a simple program through it. The run failed however, citing that NetBeans "cannot find -lstdc++".
Interesting.
I look in ...
C:\cygwin\lib\gcc\i686-pc-cygwin\4.5.0
...where libstdc++.a, libstdc++.dll.a, libstdc++.la, libsupc++.a, and libsupc++.la are supposed to be (they're in that spot in the 3.4.4 folder), and they're not there. I also notice something else: there's a 4.3.4 folder in...
C:\cygwin\lib\gcc\i686-pc-cygwin
which contains these exact files! Good. So I copy them in to the 4.5.0 folder and try to run the program again. This time i'm getting two other errors:
build/Debug/Cygwin-Windows/extract_fail_operations.o:/usr/lib/gcc/i686-pc-cygwin/4.5.0/include/c++/bits/stl_list.h:1435: undefined reference to `std::_List_node_base::_M_hook(std::_List_node_base*)'
and:
build/Debug/Cygwin-Windows/extract_fail_operations.o:/usr/lib/gcc/i686-pc-cygwin/4.5.0/include/c++/bits/stl_list.h:1451: undefined reference to `std::_List_node_base::_M_unhook()'
At this point I figured that I was way over my head and decided to come for help before copying and pasting any more files. If anyone could tell me how to get this working, i'd be really appreciative.
(If any solutions involve the command line, please be warned that i'm not well versed in it... you may have to provide extra details that you wouldn't need to to other SO users!)
EDIT: The PATH variables are as follows:
C:\Program Files\SSH Communications Security\SSH Secure Shell;C:\Program Files\CVSNT\;C:\cygwin\bin
And yes, the Cygwin installed is the latest from the site.
You need to install version 4.5.0 of libstdc++6-devel.