10
$\begingroup$

Is there a robust way to ensure that a package is always loaded on startup, even in parallel kernels?

Parallel kernels do not read Kernel/init.m.

$\endgroup$
2
  • $\begingroup$ Don't know if they answer your question, but have you seen this and this? $\endgroup$
    – Jason B.
    May 12, 2016 at 12:30
  • $\begingroup$ @JasonB I'm on the way to the solution with Autoload, but I haven't figured out all the details yet. $\endgroup$
    – Szabolcs
    May 12, 2016 at 12:32

1 Answer 1

8
$\begingroup$

The Autoload mechanism can be used for this. Place the package in $UserBaseDirectory/Autoload or $BaseDirectory/Autoload.

However, the package must follow the standard structure, and must have a Kernel/init.m file, otherwise it won't get loaded.

Also keep in mind that auto-loading of packages happens only after $UserBaseDirectory/Kernel/init.m was loaded (on the main kernel; subkernels don't load the standard kernel init.m because they are launched with -noinit).

$\endgroup$
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.