[CP2K-user] [CP2K:20028] Re: CP2K-2024-1 compialtion with libtorch

Guilherme da Silva gcarneiroq at gmail.com
Thu Mar 14 12:48:46 UTC 2024


Some updates I got with the issue.

I tried to ask toolchain to compile the gcc-compiler and this seems to have 
solved the problem:

./install_cp2k_toolchain.sh --with-gcc=install --with-spglib=no 
--with-cosma=no --with-libxsmm=no --with-libvori=no --with-libxc=no 
--with-plumed=no --with-sirius=no --with-libint=no --with-fftw=no 
--with-libvdwxc=no --with-gsl=no --with-elpa=no --with-libtorch 
--with-intel=no --with-intelmpi=no

It was an ubuntu 22.04 and the care that I really needed to take was to be 
sure inteloneapi suite was not loaded. From here I will try to compile with 
more features to see if everything works.

Em quinta-feira, 22 de fevereiro de 2024 às 21:13:50 UTC-3, Guilherme da 
Silva escreveu:

> Hi folks,
>
> Hope everything is fine at your site.
>
> I am trying to perform the compilation on an ubuntu 22.04.
>
> I compiled the code many times, there is only one library i didnt manage 
> to make it work and it was libtorch.
>
> I tried a few different way:
>
> 1. following the instructions using the static download - here we have a 
> problem. the static download doesnt have the cuda.h headers since it is 
> prebuilt for cpu-only use. Because of that compilation fails in:
>
> /src/torch_c_api.cpp:10:10: fatal error: 
> 'torch/csrc/api/include/torch/cuda.h' file not found
>
> 2. Then i tried to modified the version of the prebuilt with one 
> gpu-compatible. It also fails with the same error.
>
> Thus, i was thinking there might me some linking problems or headers 
> addresses.
>
> So i tried 3. compile libtorch from scratch. Although i managed to do the 
> compilation, i couldnt find a way to correct point for all the headers.
>
> The only way i manage to advance in the compilation was to manually edit 
> each header it complains about not finding another header. Well... given 
> the amount of header i need to edit i gave up?
>
> Since i have no experience with libtorch whatsoever, i am probably doing 
> something wrong.
>
> Could someone please give me some directions on how to compile cp2k-2024-1 
> with libtorch?
>
> Thank you in advance!
>
>
>

-- 
You received this message because you are subscribed to the Google Groups "cp2k" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cp2k+unsubscribe at googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cp2k/fa5e6203-dab3-43ff-ab40-c268d1c4cce0n%40googlegroups.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cp2k.org/archives/cp2k-user/attachments/20240314/27170ff3/attachment.htm>


More information about the CP2K-user mailing list