@@ -230,8 +230,8 @@ static int CeedCompileCore_Cuda(Ceed ceed, const char *source, const bool throw_
230230 if (dir) {
231231 closedir (dir);
232232 } else {
233- mkdir ( " temp" , 0777 );
234- chmod ( " temp" , 0777 );
233+ CeedCallSystem (ceed, " mkdir -m 777 temp" , " create JiT folder " );
234+ CeedCallSystem (ceed, " chmod 0777 temp" , " update JiT folder permissions " );
235235 }
236236 }
237237 // Write code to temp file
@@ -284,6 +284,7 @@ static int CeedCompileCore_Cuda(Ceed ceed, const char *source, const bool throw_
284284 std::to_string (build_id) + " _1_wrapped.ll " ;
285285 command += opts[4 ];
286286 CeedCallSystem (ceed, command.c_str (), " JiT kernel source" );
287+ CeedCallSystem (ceed, (" chmod 0777 temp/kernel_" + std::to_string (build_id) + " _1_wrapped.ll" ).c_str (), " update JiT file permissions" );
287288
288289 // the find command finds the rust-installed llvm-link tool and runs it
289290 command = " $(find $(rustup run " + std::string (rust_toolchain) + " rustc --print sysroot) -name llvm-link) temp/kernel_" +
@@ -322,12 +323,14 @@ static int CeedCompileCore_Cuda(Ceed ceed, const char *source, const bool throw_
322323 std::to_string (build_id) + " _2_linked.ll -o temp/kernel_" + std::to_string (build_id) + " _3_opt.bc" )
323324 .c_str (),
324325 " optimize linked C and Rust source" );
326+ CeedCallSystem (ceed, (" chmod 0777 temp/kernel_" + std::to_string (build_id) + " _2_linked.ll" ).c_str (), " update JiT file permissions" );
325327 CeedCallSystem (ceed,
326328 (" $(find $(rustup run " + std::string (rust_toolchain) + " rustc --print sysroot) -name llc) -O3 -mcpu=sm_" +
327329 std::to_string (prop.major ) + std::to_string (prop.minor ) + " temp/kernel_" + std::to_string (build_id) +
328330 " _3_opt.bc -o temp/kernel_" + std::to_string (build_id) + " _4_final.ptx" )
329331 .c_str (),
330332 " compile final CUDA kernel" );
333+ CeedCallSystem (ceed, (" chmod 0777 temp/kernel_" + std::to_string (build_id) + " _4_final.ptx" ).c_str (), " update JiT file permissions" );
331334
332335 ifstream ptxfile (" temp/kernel_" + std::to_string (build_id) + " _4_final.ptx" );
333336 ostringstream sstr;
0 commit comments