Include <sstream> not found compile error in Xcode 7.3 - xcode7

enter image description hereI have to use in my project, but when I try to include to my cpp file. The complier show error "'sstream' file not found"
#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>
#include <sstream>

Related

Dynamic Parallelism on GTX 980 ti: Unknown Error

I am attempting dynamic parallelism on a GTX 980 ti card.
All attempts at running code return "unknown error".
Simple code is shown below with compilation options.
I can execute kernels at depth=0 with no issues.
The first time a child is called, the error is given.
The cudaDeviceSynchronize() were included after looking at other questions here, but didn't solve problem.
Any ideas? Could this be a drivers issue?
Edit 1:
OS: Linux-x86_64
Nvidia driver version: 384.59
nvcc version 7.5.17
There are two 980 ti's connected with PCIe x16 Gen3. The system also has windows installed on another RAID configured SSD.
#include <cuda.h>
#include <fstream>
#include <stdio.h>
#include <stdlib.h>
__global__ void ker_two(){
int two=0;
two++;
}
__global__ void ker_one(){
int one=0;
one++;
ker_two<<<1,1>>>();
cudaDeviceSynchronize();
};
int main( ){
ker_one<<<1,1>>>();
cudaDeviceSynchronize();
cudaError_t err = cudaGetLastError();
if (err != cudaSuccess)
printf("Cuda Error: %s\n", cudaGetErrorString(err));//*/
return 0;
}
compiled with
nvcc -arch=compute_52 -rdc=true -lcudadevrt test.cu
I am able (?) to reproduce the error on a machine with a Maxwell Titan card. It's a Fedora 24 distribution with CUDA 8.0.61 installed manually. Driver version is 375.51.
However - it seems the problem only occurs on my system when I call the cudaDeviceSynchronize() within the ker_one(), regardless of whether I call the second kernel or not. So maybe that's the problem you're seeing rather than dynamic parallelism per se.
Considering #talonmies' comment, this might even be just a driver issue.

Cross-compiling Open NI for Linux MIPS Platform

I am trying to cross-compile Open NI in a MIPS based platform. But I see that all the header files check for platform and reject MIPS as unsupported platform.
Snippet:
#elif defined(ANDROID) && defined(__arm__)
#include "Android-Arm/XnPlatformAndroid-Arm.h"
#elif (linux && (i386 || __x86_64__))
#include "Linux-x86/XnPlatformLinux-x86.h"
#elif (linux && __arm__)
#include "Linux-Arm/XnPlatformLinux-Arm.h"
#elif _ARC
#include "ARC/XnPlatformARC.h"
#elif (__APPLE__)
#include "MacOSX/XnPlatformMacOSX.h"
#else
#error OpenNI Platform Abstraction Layer - Unsupported Platform!
#endif
As far as I have checked the code does not have any assembly code that might be processor-specific.
Is it safe to ignore the compiler error and proceed (by commenting out the #error statements) with the cross-compilation or is there a good reason why MIPS is not supported by Open NI?

separate compilaton in CUDA

System specs: laptop with nvidia optimus support (geforce 740m, supports compute capability 2.0), ubuntu 13.10, cuda 5.0, optirun (Bumblebee) 3.2.1.
Im' trying to compile and run simpler version of example described here:
main.cu
#include "defines.h"
#include <cuda.h>
int main ()
{
hello<<<1, 1>>>();
cudaDeviceSynchronize();
}
defines.h
#include <cuda.h>
extern __global__ void hello(void);
defines.cu
#include <cstdio>
#include <cuda.h>
__global__ void hello()
{
printf("Hello!\n");
}
using:
nvcc –arch=sm_20 –dc main.cu defines.cu
nvcc –arch=sm_20 main.o defines.o
When I try to run output a.out file using:
optirun ./a.out
I get no "Hello!" in console. What can be the problem?
This is not right:
nvcc –arch=sm_20 –dc main.cu defines.cu
nvcc –arch=sm_20 main.cu defines.cu
The first command performs compilation (but no linking) in separate compilation mode.
The second command performs compilation and linking in one step, but without using separate compilation mode.
Try just this:
nvcc -arch=sm_20 -rdc=true main.cu defines.cu
The relevant nvcc documentation is here
Alternatively, and following the example you linked, you could also do this:
nvcc –arch=sm_20 –dc main.cu defines.cu
nvcc –arch=sm_20 main.o defines.o
As #JackOLantern points out, you may wish to replace sm_20 in the above commands with sm_30 to match your device, but that is not the reason for the failure you are observing. Code compiled for -arch=sm_20 will run on a cc 3.0 device.

Cuda function pointer consistency [duplicate]

System specs: laptop with nvidia optimus support (geforce 740m, supports compute capability 2.0), ubuntu 13.10, cuda 5.0, optirun (Bumblebee) 3.2.1.
Im' trying to compile and run simpler version of example described here:
main.cu
#include "defines.h"
#include <cuda.h>
int main ()
{
hello<<<1, 1>>>();
cudaDeviceSynchronize();
}
defines.h
#include <cuda.h>
extern __global__ void hello(void);
defines.cu
#include <cstdio>
#include <cuda.h>
__global__ void hello()
{
printf("Hello!\n");
}
using:
nvcc –arch=sm_20 –dc main.cu defines.cu
nvcc –arch=sm_20 main.o defines.o
When I try to run output a.out file using:
optirun ./a.out
I get no "Hello!" in console. What can be the problem?
This is not right:
nvcc –arch=sm_20 –dc main.cu defines.cu
nvcc –arch=sm_20 main.cu defines.cu
The first command performs compilation (but no linking) in separate compilation mode.
The second command performs compilation and linking in one step, but without using separate compilation mode.
Try just this:
nvcc -arch=sm_20 -rdc=true main.cu defines.cu
The relevant nvcc documentation is here
Alternatively, and following the example you linked, you could also do this:
nvcc –arch=sm_20 –dc main.cu defines.cu
nvcc –arch=sm_20 main.o defines.o
As #JackOLantern points out, you may wish to replace sm_20 in the above commands with sm_30 to match your device, but that is not the reason for the failure you are observing. Code compiled for -arch=sm_20 will run on a cc 3.0 device.

openNI interferes with cvCreateCameraCapture()

I am using opencv 2.3 on ubuntu 11.04. while compiling, for completeness, I'd set WITH_OPENNI=ON. (regret it now, because I dont plan to use a kinect soon, and openni is giving me headaches with normal opencv programs)
anyway, to test the opencv installation i compiled following code that shows me video from my laptop webcam:
#include <stdio.h>
#include <string.h>
#include "highgui.h"
#include "cv.h"
int main()
{
cvNamedWindow("Webcam",CV_WINDOW_AUTOSIZE);
CvCapture* capture=cvCaptureFromCAM(0);
IplImage* frame;
while(1)
{
frame=cvQueryFrame(capture);
if(!frame) break;
cvShowImage("Webcam",frame);
char c=cvWaitKey(33);
if(c==27) break;
}
cvReleaseCapture(&capture);
cvDestroyWindow("Webcam");
}
the code complies correctly but gives the following error on execution:
OpenCV Error: Unspecified error (Failed to enumerate production trees: Can't create any node of the requested type!) in CvCapture_OpenNI, file /home/samarth/OpenCV-2.3.0/modules/highgui/src/cap_openni.cpp, line 188
terminate called after throwing an instance of 'cv::Exception'
what(): /home/samarth/OpenCV-2.3.0/modules/highgui/src/cap_openni.cpp:188: error: (-2) Failed to enumerate production trees: Can't create any node of the requested type! in function CvCapture_OpenNI
Aborted
has anybody faced the same problem? any idea to cure this would be highly appreciated.
This problem was fixed in OpenCV 2.3.1 release.
See following link for the details:
https://code.ros.org/trac/opencv/ticket/1237