czimaginginstitute / AreTomo3

Live processing and real time reconstruction of cryo
BSD 3-Clause "New" or "Revised" License
16 stars 1 forks source link

cufft.h not found during compilation #2

Closed McHaillet closed 5 months ago

McHaillet commented 5 months ago

hi @szhengczii!

I am extremely excited for this version! This will make processing so much easier :)

I am trying to install it but immediately get this error:

------------------------------------------------
In file included from MaUtil/CParseArgs.cpp:1:
MaUtil/CMaUtilInc.h:2:10: fatal error: cufft.h: No such file or directory
    2 | #include <cufft.h>
      |          ^~~~~~~~~
compilation terminated.
make: *** [makefile11:289: MaUtil/CParseArgs.o] Error 1

It seems to be one of the first things that is being compiled: ./MaUtil/CParseArgs.cpp is first in the list and includes MaUtil/CMaUtilInc.h and that tries to include cufft.h first. So I guess my cuda libraries are not correctly included or something. I did set the correct cuda path in the makefile11, i.e. CUDAHOME = /usr/local/cuda-12.5. I also checked my /usr/local/cuda-12.5/include and there is a file cufft.h there.

I downloaded cuda samples to test my cuda-toolkit installation (https://github.com/NVIDIA/cuda-samples) and those seem to compile fine.

Any ideas of what is going wrong?

Best wishes, Marten

McHaillet commented 5 months ago

Apparently I messed up some things. I am not too familiar with makefiles, took this command too literally and added in the square brackets:

make exe -f makefile11 [CUDAHOME=path/cuda-xx.x]

, thus the path was not passed correctly. Therefore I directly set the path in the makefile11 but added a space behind the variable (?) which caused /include to result in a variable /usr/local/cuda-12.5 /include which messed things up.

Perhaps you could make the install instructions clearer for make noobies like me :stuck_out_tongue:

szhengczii commented 5 months ago

Try running which nvcc. This is what I got: /hpc/apps/x86_64/cuda/12.0.0_525.60.13/bin/nvcc. /hpc/apps/x86_64/cuda/12.0.0_525.60.13 is the path that should be used for CUDAHOME in the makefile and makefile11.

McHaillet commented 5 months ago

Indeed the cuda libraries were not passed correctly. The problem was I didnt remove the brackets. I did:

make exe -f makefile11 [CUDAHOME=/usr/local/cuda-12.5]

but should have typed:

make exe -f makefile11 CUDAHOME=/usr/local/cuda-12.5

After that I had to recompile libutil.a and libmrcfile.a to get it running, but the manual was clear on that.

It is running for me know! And the results look great!