Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile error: "no suitable user-defined conversion from "cufftComplex" to "Scalar2" exists" #3

Closed
rbnvrw opened this issue Apr 24, 2019 · 4 comments

Comments

@rbnvrw
Copy link

rbnvrw commented Apr 24, 2019

Thank you for making the source code to this plugin available!
I'm trying to compile the plugin. I've compiled hoomd using the following command:

cmake ../ -DCMAKE_CXX_FLAGS=-march=native -DCMAKE_C_FLAGS=-march=native -DENABLE_CUDA=ON -DENABLE_MPI=ON -DCMAKE_INSTALL_PREFIX=`~/anaconda3/envs/defpy/bin/python3 -c "import site; print(site.getsitepackages()[0])"` -DPYTHON_EXECUTABLE='~/anaconda3/envs/defpy/bin/python3' -DBUILD_MD=ON -DBUILD_HPMC=ON -DCOPY_HEADERS=ON

Followed by a make -j4. Then, I try to compile the PSE plugin with the following:

cmake ../ -DHOOMD_ROOT=~/repositories/hoomd-blue/build/hoomd

This works as expected. However, when I try to run make -j4, I get the following output:

[  6%] Building NVCC (Device) object PSEv1/CMakeFiles/cuda_compile_1.dir/cuda_compile_1_generated_Mobility.cu.o
[ 13%] Building NVCC (Device) object PSEv1/CMakeFiles/cuda_compile_1.dir/cuda_compile_1_generated_Stokes.cu.o
[ 20%] Building NVCC (Device) object PSEv1/CMakeFiles/cuda_compile_1.dir/cuda_compile_1_generated_Brownian.cu.o
[ 26%] Copy hoomd/PSEv1/__init__.py
[ 33%] Copy hoomd/PSEv1/integrate.py
[ 40%] Copy hoomd/PSEv1/shear_function.py
[ 46%] Copy hoomd/PSEv1/variant.py
[ 46%] Built target copy_PSEv1
[ 53%] Building NVCC (Device) object PSEv1/CMakeFiles/cuda_compile_1.dir/cuda_compile_1_generated_Helper.cu.o
~/repositories/PSE/PSEv1/Helper.cu(94): error: no operator "=" matches these operands
            operand types are: cufftComplex = Scalar2

~/repositories/PSE/PSEv1/Mobility.cu(277): error: no suitable user-defined conversion from "cufftComplex" to "Scalar2" exists

~/repositories/PSE/PSEv1/Mobility.cu(278): error: no suitable user-defined conversion from "cufftComplex" to "Scalar2" exists

~/repositories/PSE/PSEv1/Mobility.cu(279): error: no suitable user-defined conversion from "cufftComplex" to "Scalar2" exists

~/repositories/PSE/PSEv1/Mobility.cu(293): error: no operator "=" matches these operands
            operand types are: cufftComplex = Scalar2

~/repositories/PSE/PSEv1/Mobility.cu(294): error: no operator "=" matches these operands
            operand types are: cufftComplex = Scalar2

~/repositories/PSE/PSEv1/Mobility.cu(295): error: no operator "=" matches these operands
            operand types are: cufftComplex = Scalar2

1 error detected in the compilation of "/tmp/tmpxft_000047f8_00000000-10_Helper.compute_70.cpp1.ii".
6 errors detected in the compilation of "/tmp/tmpxft_000047ea_00000000-10_Mobility.compute_70.cpp1.ii".
CMake Error at cuda_compile_1_generated_Helper.cu.o.Release.cmake:279 (message):
  Error generating file
  ~/repositories/PSE/plugin_build/PSEv1/CMakeFiles/cuda_compile_1.dir//./cuda_compile_1_generated_Helper.cu.o


make[2]: *** [PSEv1/CMakeFiles/_PSEv1.dir/build.make:1011: PSEv1/CMakeFiles/cuda_compile_1.dir/cuda_compile_1_generated_Helper.cu.o] Error 1
make[2]: *** Waiting for unfinished jobs....
CMake Error at cuda_compile_1_generated_Mobility.cu.o.Release.cmake:279 (message):
  Error generating file
  ~/repositories/PSE/plugin_build/PSEv1/CMakeFiles/cuda_compile_1.dir//./cuda_compile_1_generated_Mobility.cu.o


make[2]: *** [PSEv1/CMakeFiles/_PSEv1.dir/build.make:1327: PSEv1/CMakeFiles/cuda_compile_1.dir/cuda_compile_1_generated_Mobility.cu.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:147: PSEv1/CMakeFiles/_PSEv1.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

Do you have any idea what I'm doing wrong?

@andrew-fiore
Copy link
Contributor

Based on the error log, it seems like the plugin installation is unable to access the cufft header file, where the variable type cufftComplex is define. What commands did you use to compile HOOMD? Specifically, did you specify for CUDA to be enabled and for headers to be copied?

If you could share the commands you used for the HOOMD installation that would be helpful. Also, which HOOMD and CUDA versions are you using?

@sottcap
Copy link

sottcap commented Jun 15, 2019

I came across the same issue and figured it out. That's because cufftComplex type was switched from

typedef cufftReal[2] cufftComplex;

to

typedef struct {
  cufftReal x,
  cufftReal y
} cufftComplex;

So, go to the lines with errors and change anything like

cufftComplex a;
Scalar2 b;
...
b = a

to

cufftComplex a;
Scalar2 b;
...
b[0] = a.x;
b[1] = a.y;

Then, it will work. FYI, I used CUDA 9.1 for my compilation.

@rbnvrw
Copy link
Author

rbnvrw commented Jun 15, 2019

Thank you for the information @sottcap
Did you make those changes to the code also? Maybe you could turn it into a PR for this repository so that it'll be fixed?

I don't have time at the moment, but if you don't have it I'll look into it later.

@rbnvrw
Copy link
Author

rbnvrw commented Jun 15, 2019

Based on the error log, it seems like the plugin installation is unable to access the cufft header file, where the variable type cufftComplex is define. What commands did you use to compile HOOMD? Specifically, did you specify for CUDA to be enabled and for headers to be copied?

If you could share the commands you used for the HOOMD installation that would be helpful. Also, which HOOMD and CUDA versions are you using?

The commands I used to compile HOOMD are in the original report. As you can see there, CUDA was enabled.

I don't remember the exact versions but I used the latest github version of HOOMD.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants