pcl_gpu_utils /EHsc ?

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

pcl_gpu_utils /EHsc ?

marco
Hi-
I've just ran into a compile issue with pcl_gpu_utils

I don't know if this is related to using the new Cuda 5... but anyway here is the way I fixed it just in case..


1>C:/Program Files (x86)/boost/include\boost/exception/detail/exception_ptr.hpp(17): fatal error C1189: #error :  This header requires exception handling to be enabled.
========== Build: 0 succeeded, 1 failed, 1 up-to-date, 0 skipped ==========


medecine: solved if compiled with /EHsc flag


1>MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: __thiscall type_info::type_info(class type_info const &)" (??0type_info@@AAE@ABV0@@Z) already defined in LIBCMT.lib(typinfo.obj)
1>MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: class type_info & __thiscall type_info::operator=(class type_info const &)" (??4type_info@@AAEAAV0@ABV0@@Z) already defined in LIBCMT.lib(typinfo.obj)
1>     Creating library c:/PCL/lib/pcl_gpu_utils_release.lib and object c:/PCL/lib/pcl_gpu_utils_release.exp
1>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>C:\PCL\bin\pcl_gpu_utils_release.dll : fatal error LNK1169: one or more multiply defined symbols found
========== Build: 0 succeeded, 1 failed, 1 up-to-date, 0 skipped ==========


medecine: solved if ask linker to ignore specific library LIBCMT.lib
Reply | Threaded
Open this post in threaded view
|

Re: pcl_gpu_utils /EHsc ?

Sergey
Administrator
Hi,

Perhaps it has something to do with Windows, because I use CUDA 5 on Ubuntu, and it compiles just fine.

Regards,
Sergey
Reply | Threaded
Open this post in threaded view
|

Re: pcl_gpu_utils /EHsc ?

marco
This post was updated on .
In reply to this post by marco
Hi -
I think this may be related (on windows) to the compile flag /EHsc not being passed to Cuda compiler in some cases... (CUDA_PROPAGATE_HOST_FLAGS??) and maybe to a deprecated /GX?
Reply | Threaded
Open this post in threaded view
|

Re: pcl_gpu_utils /EHsc ?

Sergey
Administrator
Marco,

I'm not really familiar with CUDA, but this is how NVCC is invoked to compile gpu_utils on my machine:

/usr/local/cuda/bin/nvcc -M -D__CUDACC__ /home/sergey/Workspace/Libraries/pcl/gpu/utils/src/repacks.cu -o /home/sergey/Workspace/Libraries/pcl/build/gpu/utils/CMakeFiles/pcl_gpu_utils_generated_repacks.cu.o.NVCC-depend -m64 -DEIGEN_USE_NEW_STDVECTOR -DEIGEN_YES_I_KNOW_SPARSE_MODULE_IS_NOT_STABLE_YET -Dqh_QHpointer -DQT_GUI_LIB -DQT_CORE_LIB -Dpcl_gpu_utils_EXPORTS -Xcompiler ,\"-Wall\",\"-Wextra\",\"-Wno-unknown-pragmas\",\"-Wconversion\",\"-fno-strict-aliasing\",\"-Wno-format-extra-args\",\"-Wno-sign-compare\",\"-Wabi\",\"-pthread\",\"-fopenmp\",\"-Wno-conversion\",\"-Wno-unused-but-set-variable\",\"-Wno-unused-parameter\",\"-Wno-unused-variable\",\"-Wno-unused-function\",\"-fPIC\",\"-O2\",\"-g\",\"-march=native\" -gencode arch=compute_20,code=sm_20 -gencode arch=compute_20,code=sm_21 -gencode arch=compute_30,code=sm_30 -DPCLAPI_EXPORTS -DNVCC -I/usr/local/cuda/include -I/usr/include -I/usr/include/eigen3 -I/opt/ros/fuerte/include -I/usr/include/openni -I/usr/include/qt4 -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtCore -I/home/sergey/Workspace/Libraries/pcl/build/include -I/home/sergey/Workspace/Libraries/pcl/common/include -I/home/sergey/Workspace/Libraries/pcl/gpu/containers/include -I/home/sergey/Workspace/Libraries/pcl/gpu/utils/include -I/usr/local/cuda/include

I do not see anything similar to /EHsc flag here.

Regards,
Sergey
Reply | Threaded
Open this post in threaded view
|

Re: pcl_gpu_utils /EHsc ?

marco
This post was updated on .
Hi again -

This appears at link time, not at compile. Ok, so here is some fact at link time (I think this is related to C++ exception handling requested by Boost...) :

(1) without /EHsc
-----------------

2>------ Build started: Project: pcl_gpu_utils, Configuration: Debug Win32 ------
2>  Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.40219.01 for 80x86
2>  Copyright (C) Microsoft Corporation.  All rights reserved.
2>  
2>  cl /c /I"C:/Program Files (x86)/boost/include" /I"C:/Users/jc/Desktop/LIB_BUILDER/VS2010/eigen-3.1" /I"C:/Program Files (x86)/flann/include" /I"C:/Program Files (x86)/OpenNI/Include" /IC:/Qt/4.8.0/include /IC:/Qt/4.8.0/include/QtGui /IC:/Qt/4.8.0/include/QtCore /Ic:/PCL/include /IC:/PCL/TRUNK/common/include /IC:/PCL/TRUNK/gpu/containers/include /IC:/PCL/TRUNK/gpu/utils/include /I"C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v5.0/include" /Zi /W3 /WX- /MP3 /Od /Ob0 /Oy- /D WIN32 /D _WINDOWS /D _DEBUG /D BOOST_DISABLE_ASSERTS /D EIGEN_NO_DEBUG /D BOOST_ALL_NO_LIB /D _SCL_SECURE_NO_WARNINGS /D _CRT_SECURE_NO_WARNINGS /D NOMINMAX /D BOOST_LIB_DIAGNOSTIC /D EIGEN_USE_NEW_STDVECTOR /D EIGEN_YES_I_KNOW_SPARSE_MODULE_IS_NOT_STABLE_YET /D FLANN_STATIC /D QT_DLL /D QT_GUI_LIB /D QT_CORE_LIB /D QT_DEBUG /D "CMAKE_INTDIR=\"Debug\"" /D PCLAPI_EXPORTS /D _WINDLL /D _MBCS /Gm- /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /openmp /Fo"pcl_gpu_utils.dir\Debug\\" /Fd"C:/PCL/bin/pcl_gpu_utils_debug.pdb" /Gd /TP /analyze- /errorReport:prompt C:\PCL\TRUNK\gpu\utils\src\repacks.cpp  /Zm1000
2>  
2>  repacks.cpp
2>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xlocale(323): warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
2>  You are using an Intel supplied intrinsic header file with a third-party compiler.
2>C:\Program Files (x86)\boost\include\boost/exception/detail/exception_ptr.hpp(17): fatal error C1189: #error :  This header requires exception handling to be enabled.
========== Build: 1 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


(2) with /EHsc
---------------

1>------ Build started: Project: pcl_gpu_utils, Configuration: Debug Win32 ------
1>  Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.40219.01 for 80x86
1>  Copyright (C) Microsoft Corporation.  All rights reserved.
1>  
1>  cl /c /I"C:/Program Files (x86)/boost/include" /I"C:/Users/jc/Desktop/LIB_BUILDER/VS2010/eigen-3.1" /I"C:/Program Files (x86)/flann/include" /I"C:/Program Files (x86)/OpenNI/Include" /IC:/Qt/4.8.0/include /IC:/Qt/4.8.0/include/QtGui /IC:/Qt/4.8.0/include/QtCore /Ic:/PCL/include /IC:/PCL/TRUNK/common/include /IC:/PCL/TRUNK/gpu/containers/include /IC:/PCL/TRUNK/gpu/utils/include /I"C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v5.0/include" /Zi /W3 /WX- /MP3 /Od /Ob0 /Oy- /D WIN32 /D _WINDOWS /D _DEBUG /D BOOST_DISABLE_ASSERTS /D EIGEN_NO_DEBUG /D BOOST_ALL_NO_LIB /D _SCL_SECURE_NO_WARNINGS /D _CRT_SECURE_NO_WARNINGS /D NOMINMAX /D BOOST_LIB_DIAGNOSTIC /D EIGEN_USE_NEW_STDVECTOR /D EIGEN_YES_I_KNOW_SPARSE_MODULE_IS_NOT_STABLE_YET /D FLANN_STATIC /D QT_DLL /D QT_GUI_LIB /D QT_CORE_LIB /D QT_DEBUG /D "CMAKE_INTDIR=\"Debug\"" /D PCLAPI_EXPORTS /D _WINDLL /D _MBCS /Gm- /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /openmp /Fo"pcl_gpu_utils.dir\Debug\\" /Fd"C:/PCL/bin/pcl_gpu_utils_debug.pdb" /Gd /TP /analyze- /errorReport:prompt C:\PCL\TRUNK\gpu\utils\src\repacks.cpp  /Zm1000 /EHsc

1>  LINK : C:\PCL\bin\pcl_gpu_utils_debug.dll not found or not built by the last incremental link; performing full link
1>     Creating library c:/PCL/lib/pcl_gpu_utils_debug.lib and object c:/PCL/lib/pcl_gpu_utils_debug.exp
1>LINK : warning LNK4199: /DELAYLOAD:VCOMP100D.dll ignored; no imports found from VCOMP100D.dll
1>  pcl_gpu_utils.vcxproj -> C:\PCL\bin\pcl_gpu_utils_debug.dll
========== Build: 1 succeeded, 0 failed, 1 up-to-date, 0 skipped ==========
Reply | Threaded
Open this post in threaded view
|

Re: pcl_gpu_utils /EHsc ?

marco
As per the Cuda compile, you're right. I don't see /EHsc...

1>  "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v5.0/bin/nvcc.exe" -M -D__CUDACC__ C:/PCL/TRUNK/gpu/utils/src/repacks.cu -o c:/PCL/gpu/utils/CMakeFiles/pcl_gpu_utils.dir/src/pcl_gpu_utils_generated_repacks.cu.obj.NVCC-depend -m32 -DBOOST_LIB_DIAGNOSTIC -DEIGEN_USE_NEW_STDVECTOR -DEIGEN_YES_I_KNOW_SPARSE_MODULE_IS_NOT_STABLE_YET -DFLANN_STATIC -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -Dpcl_gpu_utils_EXPORTS -Xcompiler ,\"/DWIN32\",\"/D_WINDOWS\",\"/W3\",\"/Zm1000\",\"/openmp\",\"/D_DEBUG\",\"/MDd\",\"/Zi\",\"/Ob0\",\"/Od\",\"/RTC1\",\"/MP3\" -v -gencode arch=compute_20,code=sm_21 -DPCLAPI_EXPORTS -DNVCC "-IC:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v5.0/include" "-IC:/Program Files (x86)/boost/include" -IC:/Users/jc/Desktop/LIB_BUILDER/VS2010/eigen-3.1 "-IC:/Program Files (x86)/flann/include" "-IC:/Program Files (x86)/OpenNI/Include" -IC:/Qt/4.8.0/include -IC:/Qt/4.8.0/include/QtGui -IC:/Qt/4.8.0/include/QtCore -Ic:/PCL/include -IC:/PCL/TRUNK/common/include -IC:/PCL/TRUNK/gpu/containers/include -IC:/PCL/TRUNK/gpu/utils/include "-IC:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v5.0/include"
Reply | Threaded
Open this post in threaded view
|

Re: pcl_gpu_utils /EHsc ?

marco
By the way, I'm just curious: what are your settings in cmake for CUDA?

CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE V
CUDA_BUILD_CUBIN                V
CUDA_HOST_COMPILATION_CPP        0
CUDA_PROPAGATE_HOST_FLAGS        V
Reply | Threaded
Open this post in threaded view
|

Re: pcl_gpu_utils /EHsc ?

Sergey
Administrator
Marco,

I use the default settings, which in my case are:

CUDA_ATTACH_VS_BUILD_RULE_TO_C   ON
CUDA_BUILD_CUBIN                            OFF
CUDA_HOST_COMPILATION_CPP            ON
CUDA_PROPAGATE_HOST_FLAGS           ON

Strangely, the name of my first option is slightly different from yours, but this is the closest one I have.

Regards,
Sergey
Reply | Threaded
Open this post in threaded view
|

Re: pcl_gpu_utils /EHsc ?

Sergey
Administrator
Well, obviously it is simply truncated to fit the screen.
Reply | Threaded
Open this post in threaded view
|

Re: pcl_gpu_utils /EHsc ?

marco
Thanks Sergey

Interesting, this may give a hint...

Actually these CUDA options are somewhat criptic
see: http://svn.mi.fu-berlin.de/seqan/trunk/seqan/util/cmake/cuda/FindCUDA.cmake

Cheers
Marco