Can not find <torch/extension.h> - c++

I create a pytorch extention, followed by this link
but it throws out the error that
fatal error: torch/extension.h: No such file or directory.
ubuntu 18.04
code::blocks 17.04
gcc 7.4.0
#include <torch/extension.h>
I expect the code to run.
Is there any document to fix this problem?

is the canonical header file that create Python bindings for C++/Cuda extensions.
So Try upgrading the version of Pytorch if it's not in newest version.

Related

Compile faster_rcnn_cplusplus and caffe example with correct protobuf

I Installed protobuffer 3.3.0 form a source code instead of version 2.6.1 used "make" to make caffe, tested it, and tried to compile faster_rcnn_cplusplus
Unfortunately it gives ma an error:
/home/adzhus/Workspace/Faster-RCNN-CPP-1/faster_rcnn_cplusplus/py-faster-rcnn/caffe-fast-rcnn/include/caffe/proto/caffe.pb.h:17:2: error: #error This file was generated by an older version of protoc which is...
Path is seems to be correct.
I also checked protoc --version which gives me libprotoc 3.3.0, but for some reason apt-get upgrade libprotobuf-dev gives me ibprotobuf-dev is already the newest version (2.6.1-1.3).
Could someone,please, advice how to fix the compilation error ?
Problem is solved for me.
I just copied caffe.pb.h from ...caffe-fast-rcnn/build/src/caffe/proto to ...caffe-fast-rcnn/include/caffe/proto

omp.h can't be found when compile C++ with MinGW on windows

I am writing C++ code and compile using g++, MinGM, on windows, but error shows that:
error: omp.h: No such file or directory
#include
^
compilation terminated.
This is the installation list when i installed MinGW:
omp.h file cannot be found in installation file of MinGW:
Basically, the public sources recommend installing TDM-GCC, because it has default OpenMP installation choice:
http://tdm-gcc.tdragon.net/download
Also, with standard MinGW, try from your MinGW console:
mingw-get install mingw32-pthreads-w32
mingw-get install mingw32-pthreads-w32-dev

Matlab R2016a Mex file error

I have gcc version 5.3.1 on fedora 23 and I want to run some mex files. Whe I compile the file I get the following warning:
Warning: You are using gcc version '5.3.1-6)'. The version of gcc is not supported. The version currently supported with MEX is '4.7.x'. For a list of currently supported compilers
see: http://www.mathworks.com/support/compilers/current_release.
and when I try to run it I get the following error :
Invalid MEX-file '/home/x/Downloads/MatlabEXR/MatlabEXR/exrread.mexa64': /usr/local/MATLAB/R2016a/bin/glnxa64/../../sys/os/glnxa64/libstdc++.so.6: version `CXXABI_1.3.8' not
found (required by /home/x/Downloads/MatlabEXR/MatlabEXR/exrread.mexa64)
I tried this : How to tell mex to link with the libstdc++.so.6 in /usr/lib instead of the one in the MATLAB directory?
but still I get the same error. Anything in mind what can be the problem?
I had a similar problem regarding libstdc++(I couldn't plot anything). This is the link to my question. matlab on linux can't plot anything(can't load libstdc++.so.6: version `CXXABI_1.3.8' not found)
How I solved the issue is also stated there.
Hope that helps
You error is originated from the fact that your libstdc++ uses a new ABI by default (https://gcc.gnu.org/gcc-5/changes.html). You can't link your MEX files using gcc 5.xx version.

error: #error user defined BOOST_POSIX_API or BOOST_WINDOWS_API not supported

I am trying to compile a program and getting the error in the title. The compilation requires boost. The boost 1.55 is installed and I don't think there is problem with the boost. I don't have any idea why I am getting this error.
My machine is running Ubuntu 14.04 LTS and gcc version is 4.8.4.

g++: error: libgomp.spec: No such file or directory

I use g++ (GCC) 4.7.2. on Windows 7, 64-bit version.
downloaded from http://nuwen.net/mingw.html
I tried to use the "-fopenmp" flag and got the error:
g++: error: libgomp.spec: No such file or directory
I can't find the file anywhere on my system. Do I need to re-install something? Can I just throw a file somewhere?
You could try installing TDM-GCC, which looks as though it includes OpenMP.
There's also Sezero's personal build.
I had a similar problem. I got it working installing one of the version at the following discussion.
Which version of MinGW should I use
I don't have access to my windows machine now so I don't know which version I used but I can check on Monday if you don't have it working by then.
It might have been this one.
http://sourceforge.net/projects/mingwbuilds/files/host-windows/releases/