Ivanlh20 / multem

MULTEM is a powerful and advanced collection of C++ routines with CUDA support, designed to perform efficient and accurate multislice simulations for various TEM experiments such as HRTEM, STEM, ISTEM, ED, PED, CBED, ADF-TEM, ABF-HC, EFTEM, and EELS.
GNU General Public License v3.0
65 stars 26 forks source link

Error while compiling the il_incident_wave.cu in MULTEM v2.2.3 #42

Closed Quantumstud closed 4 years ago

Quantumstud commented 4 years ago

Hi! I am trying to compile the new MULTEM version using CUDA 10.1. I am able to compile all the source files expect the mex_incident_wave. I receive the following error. Can you anyone suggest what am I doing wrong? I tried using both GCC versions 4.9 and 7.5 I receive the same error.

mex -v -R2017b -outdir ../mex_bin -I"/usr/lib/cuda-10.0/include" -I"/home/taraprasadmishra/apps/multem/MULTEM-master/src" -L"/usr/lib/cuda-10.0/lib64" -lcudart -lcufft -lcublas -L"/usr/lib/x86_64-linux-gnu" -lfftw3f -lfftw3 -lfftw3f_threads -lfftw3_threads -L"/lib/x86_64-linux-gnu/blas" -lmwblas -L"/lib/x86_64-linux-gnu/lapack" -lmwlapack  il_incident_wave.cu 
Verbose mode is on.
... Looking for compiler 'nvcc' ...
... Looking for environment variable 'MW_NVCC_PATH' ...Yes ('/usr/lib/cuda-10.0/bin').
... Looking for file '/usr/lib/cuda-10.0/bin/nvcc' ...Yes.
... Executing command '/usr/lib/cuda-10.0/bin/nvcc --version | egrep -E 'release 10.0' > /dev/null && echo /usr/lib/cuda-10.0/bin/nvcc' ...Yes ('/usr/lib/cuda-10.0/bin/nvcc').
... Executing command '/usr/lib/cuda-10.0/bin/nvcc --version | egrep -E 'release 10.0' > /dev/null && echo /usr/lib/cuda-10.0/bin/nvcc' ...Yes ('/usr/lib/cuda-10.0/bin/nvcc').
... Executing command 'which g++' ...Yes ('/usr/bin/g++').
... Executing command 'g++ -print-file-name=libstdc++.so' ...Yes ('/usr/lib/gcc/x86_64-linux-gnu/4.9/libstdc++.so').
Found installed compiler 'nvcc'.
Options file details
-------------------------------------------------------------------
    Compiler location: /usr/lib/cuda-10.0/bin/nvcc
    Options file: /home/taraprasadmishra/apps/multem/MULTEM-master/mex_files_multem/mex_CUDA_glnxa64.xml
    CMDLINE2 : /usr/bin/g++ -pthread -Wl,--no-undefined -shared -O2 $LINKEXPORTVER /tmp/mex_11891316504599_11005/il_incident_wave.o /tmp/mex_11891316504599_11005/c_mexapi_version.o   -lcudart  -lcufft  -lcublas  -lfftw3f  -lfftw3  -lfftw3f_threads  -lfftw3_threads  -lmwblas  -lmwlapack   -L/usr/lib/cuda-10.0/lib64  -L/usr/lib/x86_64-linux-gnu  -L/lib/x86_64-linux-gnu/blas  -L/lib/x86_64-linux-gnu/lapack   -Wl,-rpath-link,/usr/local/MATLAB/R2020a/bin/glnxa64 -L"/usr/local/MATLAB/R2020a/bin/glnxa64" -lmx -lmex -lmat -lm -lstdc++ -o /home/taraprasadmishra/apps/multem/MULTEM-master/mex_files_multem/../mex_bin/il_incident_wave.mexa64
    MATLABMEX : -DMATLAB_MEX_FILE
    INCLUDE : -I"/usr/lib/cuda-10.0/include" -I"/home/taraprasadmishra/apps/multem/MULTEM-master/src"  -I"/usr/local/MATLAB/R2020a/extern/include" -I"/usr/local/MATLAB/R2020a/simulink/include"
    ARCH_FLAGS : -gencode=arch=compute_30,code=sm_30 -gencode=arch=compute_35,code=\"sm_35,compute_35\" -gencode=arch=compute_50,code=\"sm_50,compute_50\" -gencode=arch=compute_60,code=\"sm_60,compute_60\" -gencode=arch=compute_70,code=\"sm_70,compute_70\"
    NVCC_FLAGS : --std=c++11 --default-stream per-thread --expt-extended-lambda -gencode=arch=compute_30,code=sm_30 -gencode=arch=compute_35,code=\"sm_35,compute_35\" -gencode=arch=compute_50,code=\"sm_50,compute_50\" -gencode=arch=compute_60,code=\"sm_60,compute_60\" -gencode=arch=compute_70,code=\"sm_70,compute_70\"
    CXX : /usr/lib/cuda-10.0/bin/nvcc
    CXXFLAGS : --compiler-options=-fexceptions,-fPIC,-fno-omit-frame-pointer,-pthread --std=c++11 --default-stream per-thread --expt-extended-lambda -gencode=arch=compute_30,code=sm_30 -gencode=arch=compute_35,code=\"sm_35,compute_35\" -gencode=arch=compute_50,code=\"sm_50,compute_50\" -gencode=arch=compute_60,code=\"sm_60,compute_60\" -gencode=arch=compute_70,code=\"sm_70,compute_70\"
    DEFINES : -DMX_COMPAT_64  -DMATLAB_MEXCMD_RELEASE=R2017b  -DUSE_MEX_CMD   --compiler-options=-D_GNU_SOURCE,-DMATLAB_MEX_FILE
    CXXOPTIMFLAGS : -O2 -DNDEBUG
    CXXDEBUGFLAGS : -g
    LDXX : /usr/bin/g++
    LDFLAGS : -pthread -Wl,--no-undefined
    LDTYPE : -shared
    LDOPTIMFLAGS : -O2
    LDDEBUGFLAGS : -g
    LINKEXPORT : -Wl,--version-script,"/usr/local/MATLAB/R2020a/extern/lib/glnxa64/mexFunction.map"
    LINKLIBS : -lcudart  -lcufft  -lcublas  -lfftw3f  -lfftw3  -lfftw3f_threads  -lfftw3_threads  -lmwblas  -lmwlapack   -L/usr/lib/cuda-10.0/lib64  -L/usr/lib/x86_64-linux-gnu  -L/lib/x86_64-linux-gnu/blas  -L/lib/x86_64-linux-gnu/lapack   -Wl,-rpath-link,/usr/local/MATLAB/R2020a/bin/glnxa64 -L"/usr/local/MATLAB/R2020a/bin/glnxa64" -lmx -lmex -lmat -lm -lstdc++
    OBJEXT : .o
    LDEXT : .mexa64
    SETENV : CC="gcc"
                CXX="/usr/lib/cuda-10.0/bin/nvcc"
                CFLAGS="$CFLAGS -DMX_COMPAT_64  -DMATLAB_MEXCMD_RELEASE=R2017b  -DUSE_MEX_CMD   --compiler-options=-D_GNU_SOURCE,-DMATLAB_MEX_FILE"
                CXXFLAGS="--compiler-options=-fexceptions,-fPIC,-fno-omit-frame-pointer,-pthread --std=c++11 --default-stream per-thread --expt-extended-lambda -gencode=arch=compute_30,code=sm_30 -gencode=arch=compute_35,code=\"sm_35,compute_35\" -gencode=arch=compute_50,code=\"sm_50,compute_50\" -gencode=arch=compute_60,code=\"sm_60,compute_60\" -gencode=arch=compute_70,code=\"sm_70,compute_70\" -DMX_COMPAT_64  -DMATLAB_MEXCMD_RELEASE=R2017b  -DUSE_MEX_CMD   --compiler-options=-D_GNU_SOURCE,-DMATLAB_MEX_FILE"
                COPTIMFLAGS="$COPTIMFLAGS"                
                CXXOPTIMFLAGS="-O2 -DNDEBUG"
                CDEBUGFLAGS="$CDEBUGFLAGS"                
                CXXDEBUGFLAGS="-g"                
                LD="$LD"
                LDXX="/usr/bin/g++"
                LDFLAGS="-pthread -Wl,--no-undefined -shared -lcudart  -lcufft  -lcublas  -lfftw3f  -lfftw3  -lfftw3f_threads  -lfftw3_threads  -lmwblas  -lmwlapack   -L/usr/lib/cuda-10.0/lib64  -L/usr/lib/x86_64-linux-gnu  -L/lib/x86_64-linux-gnu/blas  -L/lib/x86_64-linux-gnu/lapack   -Wl,-rpath-link,/usr/local/MATLAB/R2020a/bin/glnxa64 -L"/usr/local/MATLAB/R2020a/bin/glnxa64" -lmx -lmex -lmat -lm -lstdc++ -Wl,--version-script,"/usr/local/MATLAB/R2020a/extern/lib/glnxa64/mexFunction.map""
                LDDEBUGFLAGS="-g"
    NVCC : /usr/lib/cuda-10.0/bin/nvcc
    GCC : /usr/bin/g++
    CPPLIB_DIR : /usr/lib/gcc/x86_64-linux-gnu/4.9/libstdc++.so
    MATLABROOT : /usr/local/MATLAB/R2020a
    ARCH : glnxa64
    SRC : "/home/taraprasadmishra/apps/multem/MULTEM-master/mex_files_multem/il_incident_wave.cu";"/usr/local/MATLAB/R2020a/extern/version/c_mexapi_version.c"
    OBJ : /tmp/mex_11891316504599_11005/il_incident_wave.o;/tmp/mex_11891316504599_11005/c_mexapi_version.o
    OBJS : /tmp/mex_11891316504599_11005/il_incident_wave.o /tmp/mex_11891316504599_11005/c_mexapi_version.o 
    SRCROOT : /home/taraprasadmishra/apps/multem/MULTEM-master/mex_files_multem/il_incident_wave
    DEF : /tmp/mex_11891316504599_11005/il_incident_wave.def
    EXP : "/home/taraprasadmishra/apps/multem/MULTEM-master/mex_files_multem/../mex_bin/il_incident_wave.exp"
    LIB : "/home/taraprasadmishra/apps/multem/MULTEM-master/mex_files_multem/../mex_bin/il_incident_wave.lib"
    EXE : /home/taraprasadmishra/apps/multem/MULTEM-master/mex_files_multem/../mex_bin/il_incident_wave.mexa64
    ILK : "/home/taraprasadmishra/apps/multem/MULTEM-master/mex_files_multem/../mex_bin/il_incident_wave.ilk"
    MANIFEST : "/home/taraprasadmishra/apps/multem/MULTEM-master/mex_files_multem/../mex_bin/il_incident_wave.mexa64.manifest"
    TEMPNAME : /home/taraprasadmishra/apps/multem/MULTEM-master/mex_files_multem/../mex_bin/il_incident_wave
    EXEDIR : /home/taraprasadmishra/apps/multem/MULTEM-master/mex_files_multem/../mex_bin/
    EXENAME : il_incident_wave
    OPTIM : -O2 -DNDEBUG
    LINKOPTIM : -O2
    CMDLINE1_0 : /usr/lib/cuda-10.0/bin/nvcc -c --compiler-options=-fexceptions,-fPIC,-fno-omit-frame-pointer,-pthread --std=c++11 --default-stream per-thread --expt-extended-lambda -gencode=arch=compute_30,code=sm_30 -gencode=arch=compute_35,code=\"sm_35,compute_35\" -gencode=arch=compute_50,code=\"sm_50,compute_50\" -gencode=arch=compute_60,code=\"sm_60,compute_60\" -gencode=arch=compute_70,code=\"sm_70,compute_70\" -O2 -DNDEBUG -DMX_COMPAT_64  -DMATLAB_MEXCMD_RELEASE=R2017b  -DUSE_MEX_CMD   --compiler-options=-D_GNU_SOURCE,-DMATLAB_MEX_FILE -I"/usr/lib/cuda-10.0/include" -I"/home/taraprasadmishra/apps/multem/MULTEM-master/src"  -I"/usr/local/MATLAB/R2020a/extern/include" -I"/usr/local/MATLAB/R2020a/simulink/include" "/home/taraprasadmishra/apps/multem/MULTEM-master/mex_files_multem/il_incident_wave.cu" -o /tmp/mex_11891316504599_11005/il_incident_wave.o
    CMDLINE1_1 : /usr/lib/cuda-10.0/bin/nvcc -c --compiler-options=-fexceptions,-fPIC,-fno-omit-frame-pointer,-pthread --std=c++11 --default-stream per-thread --expt-extended-lambda -gencode=arch=compute_30,code=sm_30 -gencode=arch=compute_35,code=\"sm_35,compute_35\" -gencode=arch=compute_50,code=\"sm_50,compute_50\" -gencode=arch=compute_60,code=\"sm_60,compute_60\" -gencode=arch=compute_70,code=\"sm_70,compute_70\" -O2 -DNDEBUG -DMX_COMPAT_64  -DMATLAB_MEXCMD_RELEASE=R2017b  -DUSE_MEX_CMD   --compiler-options=-D_GNU_SOURCE,-DMATLAB_MEX_FILE -I"/usr/lib/cuda-10.0/include" -I"/home/taraprasadmishra/apps/multem/MULTEM-master/src"  -I"/usr/local/MATLAB/R2020a/extern/include" -I"/usr/local/MATLAB/R2020a/simulink/include" "/usr/local/MATLAB/R2020a/extern/version/c_mexapi_version.c" -o /tmp/mex_11891316504599_11005/c_mexapi_version.o
    CMDLINE3_0 : rm -f /tmp/mex_11891316504599_11005/il_incident_wave.o
    CMDLINE3_1 : rm -f /tmp/mex_11891316504599_11005/c_mexapi_version.o
-------------------------------------------------------------------
Building with 'nvcc'.
/usr/lib/cuda-10.0/bin/nvcc -c --compiler-options=-fexceptions,-fPIC,-fno-omit-frame-pointer,-pthread --std=c++11 --default-stream per-thread --expt-extended-lambda -gencode=arch=compute_30,code=sm_30 -gencode=arch=compute_35,code=\"sm_35,compute_35\" -gencode=arch=compute_50,code=\"sm_50,compute_50\" -gencode=arch=compute_60,code=\"sm_60,compute_60\" -gencode=arch=compute_70,code=\"sm_70,compute_70\" -O2 -DNDEBUG -DMX_COMPAT_64  -DMATLAB_MEXCMD_RELEASE=R2017b  -DUSE_MEX_CMD   --compiler-options=-D_GNU_SOURCE,-DMATLAB_MEX_FILE -I"/usr/lib/cuda-10.0/include" -I"/home/taraprasadmishra/apps/multem/MULTEM-master/src"  -I"/usr/local/MATLAB/R2020a/extern/include" -I"/usr/local/MATLAB/R2020a/simulink/include" "/home/taraprasadmishra/apps/multem/MULTEM-master/mex_files_multem/il_incident_wave.cu" -o /tmp/mex_11891316504599_11005/il_incident_wave.o
Error using mex
In file included from /home/taraprasadmishra/apps/multem/MULTEM-master/src/gpu_fcns.cuh:35:0,
                 from /home/taraprasadmishra/apps/multem/MULTEM-master/src/output_multislice.hpp:33,
                 from /home/taraprasadmishra/apps/multem/MULTEM-master/mex_files_multem/il_incident_wave.cu:25:
/usr/lib/cuda-10.0/include/device_functions.h:54:2: warning: #warning "device_functions.h is an internal header file and must not
be used directly.  This file will be removed in a future CUDA release.  Please use cuda_runtime_api.h or cuda_runtime.h instead."
[-Wcpp]
 #warning "device_functions.h is an internal header file and must not be used directly.  This file will be removed in a future CUDA
 release.  Please use cuda_runtime_api.h or cuda_runtime.h instead."
  ^
/home/taraprasadmishra/apps/multem/MULTEM-master/src/types.cuh(780): warning: calling a __host__ function from a __host__
__device__ function is not allowed
/home/taraprasadmishra/apps/multem/MULTEM-master/src/types.cuh(785): warning: calling a __host__ function from a __host__
__device__ function is not allowed
/home/taraprasadmishra/apps/multem/MULTEM-master/mex_files_multem/il_incident_wave.cu(45): warning: variable "lz" was declared but
never referenced
          detected during:
            instantiation of "void read_input_multislice(const mxArray *, TInput_Multislice &, __nv_bool) [with
            TInput_Multislice=mt::Input_Multislice<float>]"
(147): here
            instantiation of "void run_incident_wave<T,dev>(mt::System_Configuration &, const mxArray *, mxArray *&) [with T=float,
            dev=mt::e_host]"
(178): here
/home/taraprasadmishra/apps/multem/MULTEM-master/src/incident_wave.cuh(95): warning: variable "f_s" was declared but never
referenced
          detected during:
            instantiation of "void mt::Incident_Wave<T, dev>::operator()(mt::Vector<mt::Incident_Wave<T, dev>::T_c, dev> &,
            mt::Incident_Wave<T, dev>::T_r, mt::Incident_Wave<T, dev>::T_r, mt::Vector<mt::Incident_Wave<T, dev>::T_r, mt::e_host>
            &, mt::Vector<mt::Incident_Wave<T, dev>::T_r, mt::e_host> &, mt::Incident_Wave<T, dev>::T_r) [with T=float,
            dev=mt::e_host]"
(122): here
            instantiation of "void mt::Incident_Wave<T, dev>::operator()(const mt::eSpace &, TOutput_multislice &) [with T=float,
            dev=mt::e_host, TOutput_multislice=mt::Output_Multislice<float>]"
/home/taraprasadmishra/apps/multem/MULTEM-master/mex_files_multem/il_incident_wave.cu(160): here
            instantiation of "void run_incident_wave<T,dev>(mt::System_Configuration &, const mxArray *, mxArray *&) [with T=float,
            dev=mt::e_host]"
/home/taraprasadmishra/apps/multem/MULTEM-master/mex_files_multem/il_incident_wave.cu(178): here
/home/taraprasadmishra/apps/multem/MULTEM-master/mex_files_multem/il_incident_wave.cu(45): warning: variable "lz" was declared but
never referenced
          detected during:
            instantiation of "void read_input_multislice(const mxArray *, TInput_Multislice &, __nv_bool) [with
            TInput_Multislice=mt::Input_Multislice<double>]"
(147): here
            instantiation of "void run_incident_wave<T,dev>(mt::System_Configuration &, const mxArray *, mxArray *&) [with
            T=double, dev=mt::e_host]"
(182): here
/home/taraprasadmishra/apps/multem/MULTEM-master/src/incident_wave.cuh(95): warning: variable "f_s" was declared but never
referenced
          detected during:
            instantiation of "void mt::Incident_Wave<T, dev>::operator()(mt::Vector<mt::Incident_Wave<T, dev>::T_c, dev> &,
            mt::Incident_Wave<T, dev>::T_r, mt::Incident_Wave<T, dev>::T_r, mt::Vector<mt::Incident_Wave<T, dev>::T_r, mt::e_host>
            &, mt::Vector<mt::Incident_Wave<T, dev>::T_r, mt::e_host> &, mt::Incident_Wave<T, dev>::T_r) [with T=double,
            dev=mt::e_host]"
(122): here
            instantiation of "void mt::Incident_Wave<T, dev>::operator()(const mt::eSpace &, TOutput_multislice &) [with T=double,
            dev=mt::e_host, TOutput_multislice=mt::Output_Multislice<double>]"
/home/taraprasadmishra/apps/multem/MULTEM-master/mex_files_multem/il_incident_wave.cu(160): here
            instantiation of "void run_incident_wave<T,dev>(mt::System_Configuration &, const mxArray *, mxArray *&) [with
            T=double, dev=mt::e_host]"
/home/taraprasadmishra/apps/multem/MULTEM-master/mex_files_multem/il_incident_wave.cu(182): here
/home/taraprasadmishra/apps/multem/MULTEM-master/src/cgpu_fcns.cuh(3135): error: no instance of overloaded function "norm" matches
the argument list
            argument types are: (const thrust::device_reference<thrust::complex<float>>)
          detected during:
            instantiation of "T mt::functor::square<T>::operator()(const U &) const [with
            T=mt::Value_type_r<mt::Vector<thrust::complex<float>, mt::e_host>>,
            U=thrust::device_reference<thrust::complex<float>>]"
/usr/lib/cuda-10.0/include/thrust/system/cuda/detail/util.h(290): here
            instantiation of "thrust::cuda_cub::transform_input_iterator_t<ValueType, InputIt, UnaryOp>::reference
            thrust::cuda_cub::transform_input_iterator_t<ValueType, InputIt,
            UnaryOp>::operator[](thrust::cuda_cub::transform_input_iterator_t<ValueType, InputIt, UnaryOp>::difference_type) const
            [with ValueType=mt::Value_type_r<mt::Vector<thrust::complex<float>, mt::e_device>>,
            InputIt=thrust::detail::normal_iterator<thrust::device_ptr<thrust::complex<float>>>,
            UnaryOp=mt::functor::square<mt::Value_type_r<mt::Vector<thrust::complex<float>, mt::e_host>>>]"
/usr/lib/cuda-10.0/include/thrust/system/cuda/detail/cub/device/dispatch/../../agent/agent_reduce.cuh(290): here
            instantiation of "void thrust::cuda_cub::cub::AgentReduce<AgentReducePolicy, InputIteratorT, OutputIteratorT, OffsetT,
            ReductionOp>::ConsumeTile<IS_FIRST_TILE,CAN_VECTORIZE>(thrust::cuda_cub::cub::AgentReduce<AgentReducePolicy,
            InputIteratorT, OutputIteratorT, OffsetT, ReductionOp>::OutputT &, OffsetT, int, thrust::cuda_cub::cub::Int2Type<0>,
            thrust::cuda_cub::cub::Int2Type<CAN_VECTORIZE>) [with AgentReducePolicy=thrust::cuda_cub::cub::AgentReducePolicy<256,
            16, 4, thrust::cuda_cub::cub::BLOCK_REDUCE_WARP_REDUCTIONS, thrust::cuda_cub::cub::LOAD_LDG>,
            InputIteratorT=thrust::cuda_cub::transform_input_iterator_t<mt::Value_type_r<mt::Vector<thrust::complex<float>,
            mt::e_device>>, thrust::detail::normal_iterator<thrust::device_ptr<thrust::complex<float>>>,
            mt::functor::square<mt::Value_type_r<mt::Vector<thrust::complex<float>, mt::e_host>>>>,
            OutputIteratorT=mt::Value_type_r<mt::Vector<thrust::complex<float>, mt::e_device>> *, OffsetT=int,
            ReductionOp=mt::functor::add<mt::Value_type_r<mt::Vector<float, mt::e_host>>>, IS_FIRST_TILE=1, CAN_VECTORIZE=0]"
/usr/lib/cuda-10.0/include/thrust/system/cuda/detail/cub/device/dispatch/../../agent/agent_reduce.cuh(322): here
            instantiation of "thrust::cuda_cub::cub::AgentReduce<AgentReducePolicy, InputIteratorT, OutputIteratorT, OffsetT,
            ReductionOp>::OutputT thrust::cuda_cub::cub::AgentReduce<AgentReducePolicy, InputIteratorT, OutputIteratorT, OffsetT,
            ReductionOp>::ConsumeRange(thrust::cuda_cub::cub::GridEvenShare<OffsetT> &,
            thrust::cuda_cub::cub::Int2Type<CAN_VECTORIZE>) [with AgentReducePolicy=thrust::cuda_cub::cub::AgentReducePolicy<256,
            16, 4, thrust::cuda_cub::cub::BLOCK_REDUCE_WARP_REDUCTIONS, thrust::cuda_cub::cub::LOAD_LDG>,
            InputIteratorT=thrust::cuda_cub::transform_input_iterator_t<mt::Value_type_r<mt::Vector<thrust::complex<float>,
            mt::e_device>>, thrust::detail::normal_iterator<thrust::device_ptr<thrust::complex<float>>>,
            mt::functor::square<mt::Value_type_r<mt::Vector<thrust::complex<float>, mt::e_host>>>>,
            OutputIteratorT=mt::Value_type_r<mt::Vector<thrust::complex<float>, mt::e_device>> *, OffsetT=int,
            ReductionOp=mt::functor::add<mt::Value_type_r<mt::Vector<float, mt::e_host>>>, CAN_VECTORIZE=0]"
/usr/lib/cuda-10.0/include/thrust/system/cuda/detail/cub/device/dispatch/../../agent/agent_reduce.cuh(360): here
            instantiation of "thrust::cuda_cub::cub::AgentReduce<AgentReducePolicy, InputIteratorT, OutputIteratorT, OffsetT,
            ReductionOp>::OutputT thrust::cuda_cub::cub::AgentReduce<AgentReducePolicy, InputIteratorT, OutputIteratorT, OffsetT,
            ReductionOp>::ConsumeRange(OffsetT, OffsetT) [with AgentReducePolicy=thrust::cuda_cub::cub::AgentReducePolicy<256, 16,
            4, thrust::cuda_cub::cub::BLOCK_REDUCE_WARP_REDUCTIONS, thrust::cuda_cub::cub::LOAD_LDG>,
            InputIteratorT=thrust::cuda_cub::transform_input_iterator_t<mt::Value_type_r<mt::Vector<thrust::complex<float>,
            mt::e_device>>, thrust::detail::normal_iterator<thrust::device_ptr<thrust::complex<float>>>,
            mt::functor::square<mt::Value_type_r<mt::Vector<thrust::complex<float>, mt::e_host>>>>,
            OutputIteratorT=mt::Value_type_r<mt::Vector<thrust::complex<float>, mt::e_device>> *, OffsetT=int,
            ReductionOp=mt::functor::add<mt::Value_type_r<mt::Vector<float, mt::e_host>>>]"
/usr/lib/cuda-10.0/include/thrust/system/cuda/detail/cub/device/dispatch/dispatch_reduce.cuh(143): here
            [ 13 instantiation contexts not shown ]
            instantiation of "mt::enable_if_device_vector<TVector, mt::Value_type_r<TVector>>
            mt::sum_square(mt::Stream<mt::e_device> &, TVector &) [with TVector=mt::Vector<thrust::complex<float>, mt::e_device>]"
/home/taraprasadmishra/apps/multem/MULTEM-master/src/gpu_fcns.cuh(1623): here
            instantiation of "mt::enable_if_device_vector<TVector_c, void> mt::probe(mt::Stream<mt::e_device> &, TGrid &,
            mt::Lens<mt::Value_type<TGrid>> &, mt::Value_type<TGrid>, mt::Value_type<TGrid>, mt::Value_type<TGrid>,
            mt::Value_type<TGrid>, TVector_c &) [with TGrid=mt::Grid_2d<float>, TVector_c=mt::Vector<thrust::complex<float>,
            mt::e_device>]"
/home/taraprasadmishra/apps/multem/MULTEM-master/src/incident_wave.cuh(84): here
            instantiation of "void mt::Incident_Wave<T, dev>::operator()(mt::Vector<mt::Incident_Wave<T, dev>::T_c, dev> &,
            mt::Incident_Wave<T, dev>::T_r, mt::Incident_Wave<T, dev>::T_r, mt::Vector<mt::Incident_Wave<T, dev>::T_r, mt::e_host>
            &, mt::Vector<mt::Incident_Wave<T, dev>::T_r, mt::e_host> &, mt::Incident_Wave<T, dev>::T_r) [with T=float,
            dev=mt::e_device]"
/home/taraprasadmishra/apps/multem/MULTEM-master/src/incident_wave.cuh(122): here
            instantiation of "void mt::Incident_Wave<T, dev>::operator()(const mt::eSpace &, TOutput_multislice &) [with T=float,
            dev=mt::e_device, TOutput_multislice=mt::Output_Multislice<float>]"
/home/taraprasadmishra/apps/multem/MULTEM-master/mex_files_multem/il_incident_wave.cu(160): here
            instantiation of "void run_incident_wave<T,dev>(mt::System_Configuration &, const mxArray *, mxArray *&) [with T=float,
            dev=mt::e_device]"
/home/taraprasadmishra/apps/multem/MULTEM-master/mex_files_multem/il_incident_wave.cu(186): here
/home/taraprasadmishra/apps/multem/MULTEM-master/src/incident_wave.cuh(95): warning: variable "f_s" was declared but never
referenced
          detected during:
            instantiation of "void mt::Incident_Wave<T, dev>::operator()(mt::Vector<mt::Incident_Wave<T, dev>::T_c, dev> &,
            mt::Incident_Wave<T, dev>::T_r, mt::Incident_Wave<T, dev>::T_r, mt::Vector<mt::Incident_Wave<T, dev>::T_r, mt::e_host>
            &, mt::Vector<mt::Incident_Wave<T, dev>::T_r, mt::e_host> &, mt::Incident_Wave<T, dev>::T_r) [with T=float,
            dev=mt::e_device]"
(122): here
            instantiation of "void mt::Incident_Wave<T, dev>::operator()(const mt::eSpace &, TOutput_multislice &) [with T=float,
            dev=mt::e_device, TOutput_multislice=mt::Output_Multislice<float>]"
/home/taraprasadmishra/apps/multem/MULTEM-master/mex_files_multem/il_incident_wave.cu(160): here
            instantiation of "void run_incident_wave<T,dev>(mt::System_Configuration &, const mxArray *, mxArray *&) [with T=float,
            dev=mt::e_device]"
/home/taraprasadmishra/apps/multem/MULTEM-master/mex_files_multem/il_incident_wave.cu(186): here
/home/taraprasadmishra/apps/multem/MULTEM-master/src/cgpu_fcns.cuh(3135): error: no instance of overloaded function "norm" matches
the argument list
            argument types are: (const thrust::device_reference<thrust::complex<double>>)
          detected during:
            instantiation of "T mt::functor::square<T>::operator()(const U &) const [with
            T=mt::Value_type_r<mt::Vector<thrust::complex<double>, mt::e_host>>,
            U=thrust::device_reference<thrust::complex<double>>]"
/usr/lib/cuda-10.0/include/thrust/system/cuda/detail/util.h(290): here
            instantiation of "thrust::cuda_cub::transform_input_iterator_t<ValueType, InputIt, UnaryOp>::reference
            thrust::cuda_cub::transform_input_iterator_t<ValueType, InputIt,
            UnaryOp>::operator[](thrust::cuda_cub::transform_input_iterator_t<ValueType, InputIt, UnaryOp>::difference_type) const
            [with ValueType=mt::Value_type_r<mt::Vector<thrust::complex<double>, mt::e_device>>,
            InputIt=thrust::detail::normal_iterator<thrust::device_ptr<thrust::complex<double>>>,
            UnaryOp=mt::functor::square<mt::Value_type_r<mt::Vector<thrust::complex<double>, mt::e_host>>>]"
/usr/lib/cuda-10.0/include/thrust/system/cuda/detail/cub/device/dispatch/../../agent/agent_reduce.cuh(290): here
            instantiation of "void thrust::cuda_cub::cub::AgentReduce<AgentReducePolicy, InputIteratorT, OutputIteratorT, OffsetT,
            ReductionOp>::ConsumeTile<IS_FIRST_TILE,CAN_VECTORIZE>(thrust::cuda_cub::cub::AgentReduce<AgentReducePolicy,
            InputIteratorT, OutputIteratorT, OffsetT, ReductionOp>::OutputT &, OffsetT, int, thrust::cuda_cub::cub::Int2Type<0>,
            thrust::cuda_cub::cub::Int2Type<CAN_VECTORIZE>) [with AgentReducePolicy=thrust::cuda_cub::cub::AgentReducePolicy<128,
            16, 4, thrust::cuda_cub::cub::BLOCK_REDUCE_WARP_REDUCTIONS, thrust::cuda_cub::cub::LOAD_LDG>,
            InputIteratorT=thrust::cuda_cub::transform_input_iterator_t<mt::Value_type_r<mt::Vector<thrust::complex<double>,
            mt::e_device>>, thrust::detail::normal_iterator<thrust::device_ptr<thrust::complex<double>>>,
            mt::functor::square<mt::Value_type_r<mt::Vector<thrust::complex<double>, mt::e_host>>>>,
            OutputIteratorT=mt::Value_type_r<mt::Vector<thrust::complex<double>, mt::e_device>> *, OffsetT=int,
            ReductionOp=mt::functor::add<mt::Value_type_r<mt::Vector<double, mt::e_host>>>, IS_FIRST_TILE=1, CAN_VECTORIZE=0]"
/usr/lib/cuda-10.0/include/thrust/system/cuda/detail/cub/device/dispatch/../../agent/agent_reduce.cuh(322): here
            instantiation of "thrust::cuda_cub::cub::AgentReduce<AgentReducePolicy, InputIteratorT, OutputIteratorT, OffsetT,
            ReductionOp>::OutputT thrust::cuda_cub::cub::AgentReduce<AgentReducePolicy, InputIteratorT, OutputIteratorT, OffsetT,
            ReductionOp>::ConsumeRange(thrust::cuda_cub::cub::GridEvenShare<OffsetT> &,
            thrust::cuda_cub::cub::Int2Type<CAN_VECTORIZE>) [with AgentReducePolicy=thrust::cuda_cub::cub::AgentReducePolicy<128,
            16, 4, thrust::cuda_cub::cub::BLOCK_REDUCE_WARP_REDUCTIONS, thrust::cuda_cub::cub::LOAD_LDG>,
            InputIteratorT=thrust::cuda_cub::transform_input_iterator_t<mt::Value_type_r<mt::Vector<thrust::complex<double>,
            mt::e_device>>, thrust::detail::normal_iterator<thrust::device_ptr<thrust::complex<double>>>,
            mt::functor::square<mt::Value_type_r<mt::Vector<thrust::complex<double>, mt::e_host>>>>,
            OutputIteratorT=mt::Value_type_r<mt::Vector<thrust::complex<double>, mt::e_device>> *, OffsetT=int,
            ReductionOp=mt::functor::add<mt::Value_type_r<mt::Vector<double, mt::e_host>>>, CAN_VECTORIZE=0]"
/usr/lib/cuda-10.0/include/thrust/system/cuda/detail/cub/device/dispatch/../../agent/agent_reduce.cuh(360): here
            instantiation of "thrust::cuda_cub::cub::AgentReduce<AgentReducePolicy, InputIteratorT, OutputIteratorT, OffsetT,
            ReductionOp>::OutputT thrust::cuda_cub::cub::AgentReduce<AgentReducePolicy, InputIteratorT, OutputIteratorT, OffsetT,
            ReductionOp>::ConsumeRange(OffsetT, OffsetT) [with AgentReducePolicy=thrust::cuda_cub::cub::AgentReducePolicy<128, 16,
            4, thrust::cuda_cub::cub::BLOCK_REDUCE_WARP_REDUCTIONS, thrust::cuda_cub::cub::LOAD_LDG>,
            InputIteratorT=thrust::cuda_cub::transform_input_iterator_t<mt::Value_type_r<mt::Vector<thrust::complex<double>,
            mt::e_device>>, thrust::detail::normal_iterator<thrust::device_ptr<thrust::complex<double>>>,
            mt::functor::square<mt::Value_type_r<mt::Vector<thrust::complex<double>, mt::e_host>>>>,
            OutputIteratorT=mt::Value_type_r<mt::Vector<thrust::complex<double>, mt::e_device>> *, OffsetT=int,
            ReductionOp=mt::functor::add<mt::Value_type_r<mt::Vector<double, mt::e_host>>>]"
/usr/lib/cuda-10.0/include/thrust/system/cuda/detail/cub/device/dispatch/dispatch_reduce.cuh(143): here
            [ 13 instantiation contexts not shown ]
            instantiation of "mt::enable_if_device_vector<TVector, mt::Value_type_r<TVector>>
            mt::sum_square(mt::Stream<mt::e_device> &, TVector &) [with TVector=mt::Vector<thrust::complex<double>, mt::e_device>]"
            /home/taraprasadmishra/apps/multem/MULTEM-master/src/gpu_fcns.cuh(1623): here
            instantiation of "mt::enable_if_device_vector<TVector_c, void> mt::probe(mt::Stream<mt::e_device> &, TGrid &,
            mt::Lens<mt::Value_type<TGrid>> &, mt::Value_type<TGrid>, mt::Value_type<TGrid>, mt::Value_type<TGrid>,
            mt::Value_type<TGrid>, TVector_c &) [with TGrid=mt::Grid_2d<double>, TVector_c=mt::Vector<thrust::complex<double>,
            mt::e_device>]"
/home/taraprasadmishra/apps/multem/MULTEM-master/src/incident_wave.cuh(84): here
            instantiation of "void mt::Incident_Wave<T, dev>::operator()(mt::Vector<mt::Incident_Wave<T, dev>::T_c, dev> &,
            mt::Incident_Wave<T, dev>::T_r, mt::Incident_Wave<T, dev>::T_r, mt::Vector<mt::Incident_Wave<T, dev>::T_r, mt::e_host>
            &, mt::Vector<mt::Incident_Wave<T, dev>::T_r, mt::e_host> &, mt::Incident_Wave<T, dev>::T_r) [with T=double,
            dev=mt::e_device]"
/home/taraprasadmishra/apps/multem/MULTEM-master/src/incident_wave.cuh(122): here
            instantiation of "void mt::Incident_Wave<T, dev>::operator()(const mt::eSpace &, TOutput_multislice &) [with T=double,
            dev=mt::e_device, TOutput_multislice=mt::Output_Multislice<double>]"
/home/taraprasadmishra/apps/multem/MULTEM-master/mex_files_multem/il_incident_wave.cu(160): here
            instantiation of "void run_incident_wave<T,dev>(mt::System_Configuration &, const mxArray *, mxArray *&) [with
            T=double, dev=mt::e_device]"
/home/taraprasadmishra/apps/multem/MULTEM-master/mex_files_multem/il_incident_wave.cu(190): here
/home/taraprasadmishra/apps/multem/MULTEM-master/src/incident_wave.cuh(95): warning: variable "f_s" was declared but never
referenced
          detected during:
            instantiation of "void mt::Incident_Wave<T, dev>::operator()(mt::Vector<mt::Incident_Wave<T, dev>::T_c, dev> &,
            mt::Incident_Wave<T, dev>::T_r, mt::Incident_Wave<T, dev>::T_r, mt::Vector<mt::Incident_Wave<T, dev>::T_r, mt::e_host>
            &, mt::Vector<mt::Incident_Wave<T, dev>::T_r, mt::e_host> &, mt::Incident_Wave<T, dev>::T_r) [with T=double,
            dev=mt::e_device]"
(122): here
            instantiation of "void mt::Incident_Wave<T, dev>::operator()(const mt::eSpace &, TOutput_multislice &) [with T=double,
            dev=mt::e_device, TOutput_multislice=mt::Output_Multislice<double>]"
/home/taraprasadmishra/apps/multem/MULTEM-master/mex_files_multem/il_incident_wave.cu(160): here
            instantiation of "void run_incident_wave<T,dev>(mt::System_Configuration &, const mxArray *, mxArray *&) [with
            T=double, dev=mt::e_device]"
/home/taraprasadmishra/apps/multem/MULTEM-master/mex_files_multem/il_incident_wave.cu(190): here
2 errors detected in the compilation of "/tmp/tmpxft_00003e8f_00000000-10_il_incident_wave.compute_70.cpp1.ii".

Error in ilm_mex (line 184)
    eval(textcommands);

Error in mex_incident_wave (line 3)
ilm_mex('release', 'il_incident_wave.cu', '../src');

Error in run (line 91)
evalin('caller', strcat(script, ';'));

Error in compile_mex_multem (line 39)
  run(['mex_files_multem/',file{1}])
chenspc commented 4 years ago

I had the same problem. The solution is to compile MULTEM with CUDA 10.0, as suggested in the README. Apparently there is a problem with thrust that it doesn't support CUDA 10.1 and above. Similar to this issue from a different software.

Quantumstud commented 4 years ago

Hi @chenspc Thank you very much. Perfect. It works completely fine with the Cuda-10.0. Many thanks again!