Linux compilation

135 views
Skip to first unread message

Mateusz Zelent

unread,
Jun 30, 2020, 3:26:47 PM6/30/20
to Boris Computational Spintronics
Hi Serban,

thank you for linux version!

I cannot compile boris from source. I have a problem with :


compilation terminated.
make: *** [Boris/HeatCUDA.o] Error 1
make: *** [Boris/BorisConsole.o] Error 1
make: *** [Boris/DiffEqDMCUDA.o] Error 1
make: *** [Boris/Atom_DMExchangeCUDA.o] Error 1
make: *** [Boris/BorisInteractiveObjects_Ctrl.o] Error 1
make: *** [Boris/Atom_DiffEqCubic_Evals_RKF.o] Error 1
make: *** [Boris/DemagTFunc_Irregular.o] Error 1
make: *** [Boris/Atom_Mesh_Cubic_GetData.o] Error 1
In file included from Boris/stdafx.h:11:0,
                 from Boris/Atom_DipoleDipoleCUDA.cpp:1:
Boris/targetver.h:8:10: fatal error: SDKDDKVer.h: No such file or directory
 #include <SDKDDKVer.h>
          ^~~~~~~~~~~~~
compilation terminated.
make: *** [Boris/Atom_DipoleDipoleCUDA.o] Error 1

SDKDDKVer.h seems to be unavailable on linux?

Mateusz Zelent

unread,
Jun 30, 2020, 3:28:25 PM6/30/20
to Boris Computational Spintronics
Sorry, i missed the points in instruction about the flags ;)

Serban Lepadatu

unread,
Jul 1, 2020, 1:51:31 AM7/1/20
to Boris Computational Spintronics
Good, yes it's because of the OS_LIN flag (that file is used for Windows compilation). Hopefully it worked now.
This version also has the things we talked about some time ago (user-supplied text equation to give applied fields, material parameters and other settings space and temporal dependencies, setting spatial dependencies from files programatically etc. - I need to update the manual as there's quite a lot to explain).

Cheers,
Serban

Enrique Cobas

unread,
Jul 13, 2020, 12:25:23 AM7/13/20
to Boris Computational Spintronics
Hi Serban, thanks for the Linux version and detailed instructions. 
I believe I installed all the prerequisites and set all the compiler flags but my compilation is failing to find cufft.h
Have I done something wrong? 
Thanks

Serban Lepadatu

unread,
Jul 13, 2020, 1:12:38 AM7/13/20
to Boris Computational Spintronics
Hi Enrique,

cufft.h is part of the CUDA toolkit. Did you install it? On Ubuntu it's: $ sudo apt install nvidia-cuda-toolkit

Regards,
Serban

Enrique Cobas

unread,
Jul 13, 2020, 2:18:24 PM7/13/20
to Boris Computational Spintronics
Yes I have nvidia-cuda-toolkit installed and working but I think manually instead of from a repo. (version 9.1.85-3ubuntu1) 
I found /usr/local/cuda-10.0/targets/x86_64-linux/include/cufft.h but during Boris compilation it's not found. Is a path wrong somewhere in my install?

Serban Lepadatu

unread,
Jul 14, 2020, 1:26:55 AM7/14/20
to Boris Computational Spintronics
OK, that must be the problem. I think when installed from a repo all the cuda include files required for compiling (cufft.h, cuda_runtime.h) appear in a standard directory and they're probably specified in an environment variable so g++ and nvcc know where they are; same for the cuda libraries required for linking. See https://docs.nvidia.com/cuda/cufft/index.html section 2.1.

The easiest way is to reinstall cuda from repo.

Another way (probably better) is to edit the makefile, but could take some digging to get right.

See the makefile, last two clauses: these are for g++ and nvcc compilation respectively. You need to specify for both the include path (similar to how BorisLib and BorisCUDALib are included there), e.g. as:

-I/usr/local/cuda-10.0/targets/x86_64-linux/include

Now you also need to edit the line for the install clause in the makefile where the linking is done. Before the -lcudart and -lcufft flags you need to tell it where to find these libraries, e.g. as (I assume this is where the library directory would be, but you'll need to check):

-L/usr/local/cuda-10.0/targets/x86_64-linux/lib

Regards,
Serban

Enrique Cobas

unread,
Jul 16, 2020, 5:23:02 PM7/16/20
to Boris Computational Spintronics
Thanks again Serban. I've made the changes to the makefile and now get a different error:

BorisLib/Funcs_Files_Linux.h:9:10: fatal error: filesystem: No such file or directory
 #include <filesystem>
          ^~~~~~~~~~~~
compilation terminated. 

I would reinstall CUDA from repo but... there was some reason I didn't do that, and I'm using it. ;) Anyway I'm not sure this new error is related. 

Serban Lepadatu

unread,
Jul 17, 2020, 1:07:41 AM7/17/20
to Boris Computational Spintronics
What g++ version do you have? I have a feeling you have an older version that doesn't support this feature as <filesystem> is included with C++17.

This include is not really needed and you can just comment it out. If you do, then scroll down a bit in that file (Funcs_Files_Linux.h) and find the function inline bool MakeDirectory(std::string directory); you need to also comment out the first line in that function, but leaving the return true; in place.
All this does is make the Boris_Data directory if it's not in Documents, but it's made by the makefile now anyway - use the latest stable release download BorisLin.zip from the website.
Reply all
Reply to author
Forward
0 new messages