Example Plugin Not Loading

Hi,
Our team is trying to run the minimal CommandPlugin in the SDK and it seems like Cubit is failing to successfully load it as it does not appear in the plugins section in the Cubit GUI. We are using 2022.04 installation.

Here are the steps we took:

  1. Copy “\examples\CommandPlugin” to a separate local drive
  2. Run CMake with Cubit_DIR as the cubit installation bin folder.
  3. Generate the project with VS2019 and compile it
  4. Copy the DLL to the plugins folder in bin.
  5. Also tried changing the .dll to .ccg and copying to the bin folder and still no luck.

The plugin was not found at all. It is not listed in the plugin list, and adding extra plugin load directory also does not work.

The strange thing is that after building the Component example and copying the .ccl file into the bin folder, cubit successfully registers this component and it shows in the Plugins menu in Cubit. However, we need the command plugin example to work, since that’s a much more simple example and a better template for what we want to achieve.

Can you please helping us with running this CommandPlugin example?

Sincerely,
Ali.

The CommandPlugin should produce a library file with a .ccm extension. The .ccg extension is for a graphical plugin. Have you tried renaming the .dll to .ccm? Also, are you able to use the latest release of Coreform Cubit? There’s been some fixes to plugin loading in the latest.

Thanks for the quick reply Scot,

  1. I tried changing .dll to .ccm and still it is not showing up in the Plugins window inside Cubit.

  2. I also tried with the latest version, and this time a .ccm file is produced instead of a .dll, but after copying that to the bin folder, it is still not showing up in the Plugins window inside Cubit, leading me to believe that the library is not actually loaded.

Anything else that comes to mind?

When you run Cubit, are you using the argument -commandplugindir to pass in the folder that contains your plugin?

I just tried running via cmd with the following command:

coreform_cubit.exe -commandplugindir "C:/Program Files/Coreform Cubit 2023.8/bin/plugins"

and still no luck.

I also added the paths here (which should do the same thing I believe):
image

And still, as you can see from the screenshot, the CommandPlugin doesn’t show up.

When building with CMake, are you building in Debug or Release? On Windows specifically, Cubit will only load plugins built in Release or RelWithDebInfo.

I am building in Release mode in Visual Studio, but still it does not load the plugin.

How are you testing if the plugin is loaded or not? I built the plugin on Windows in Release and ran Cubit with the -commandplugindir pointing to the “Release” directory, then ran the new version command. Like this:

C:\Users\wilco\Documents\Cubit_SDK\examples\CommandPlugin\build\Release>dir
 Volume in drive C is OS
 Volume Serial Number is 568C-6B97

 Directory of C:\Users\wilco\Documents\Cubit_SDK\examples\CommandPlugin\build\Release

11/02/2023  01:56 PM    <DIR>          .
11/02/2023  01:56 PM    <DIR>          ..
11/02/2023  01:56 PM            43,520 my_plugin.ccm
11/02/2023  01:56 PM               993 my_plugin.exp
11/02/2023  01:56 PM             2,002 my_plugin.lib
               3 File(s)         46,515 bytes
               2 Dir(s)  103,607,177,216 bytes free

C:\Users\wilco\Documents\Cubit_SDK\examples\CommandPlugin\build\Release>"C:\Program Files\Coreform Cubit 2023.8\bin\coreform_cubit.com" -nog -prompt Cubit -commandplugindir .
Python version 0 selected
Supervisor::Impl::load_plugins: Loaded component: cubitcomp.ccl from directory: C:/Program Files/Coreform Cubit 2023.8/bin
Loading command plugins from .


                   CCCCC    UU   UU   BBBBBB    IIII   TTTTTT
                  CC   CC   UU   UU   BB   BB    II      TT
                  CC        UU   UU   BB   BB    II      TT
                  CC        UU   UU   BBBBBB     II      TT
                  CC        UU   UU   BB   BB    II      TT
                  CC   CC   UU   UU   BB   BB    II      TT
                   CCCCC     UUUUU    BBBBBB    IIII     TT  tm

                            MESH GENERATION TOOLKIT
                                      FOR
                   PRE-PROCESSING OF FINITE ELEMENT ANALYSES

                User community forum: https://forum.coreform.com


                         Cubit Version 2023.8 64-Bit Build ac3a4765
                               VTK Version 9.2.2
                              ACIS Version 33.0.0.0
                            Exodus API Version 8.03
                            MeshGems Version 2.14-1
                     Copyright 2001-2019 Sandia Corporation
              Revised Mon Aug 28 12:52:29 2023 +0000
                        Running 11/03/2023 06:30:02 AM

                 CUBIT includes MeshGems by Spatial Inc.
                  CUBIT includes ACIS software by Spatial Inc.
                  CUBIT includes LP Solve by Michel Berkelaar.
                       CUBIT includes VTK by Kitware Inc.
           CUBIT includes Exodus II, based on netCDF by UCAR/Unidata.
            CUBIT includes VERDICT, by Sandia National Laboratories.
          CUBIT includes MESQUITE, by Argonne National Laboratory and
                         Sandia National Laboratories.

Machine type is Microsoft Windows 10.0 (Build 22621)
Machine name is DESKTOP-OP29DVU
Working Directory: C:\Users\wilco\Documents\Cubit_SDK\examples\CommandPlugin\build\Release\

(Non-Commercial License) CUBIT> version
        MyPlugin Version 0.1
        Cubit Version 2023.8 Build ac3a4765
        VTK Version 9.2.2
        ACIS Version 33.0.0.0
        Exodus Version 8.03
        Revised Mon Aug 28 12:52:29 2023 +0000

Finished Command: version

(Non-Commercial License) CUBIT>

I was checking the to see if the name shows up in the Plugins window on the sub-window on the right, is it not supposed to show up there?

image

But it seems like this is not the right way of doing it.
After doing the version command in the latest Cubit version, it does indeed show MyPlugin version which should indicate that the plugin is loaded.

But it still does not work in the 2022.04 version.

After building against the 2022.4 version and launching it like this:
C:\Program Files\Coreform Cubit 2022.4\bin>coreform_cubit.exe -commandplugindir C:\Users\wilco\Documents\Cubit_SDK\examples\CommandPlugin\build\Release

I’m able to run the version command in the GUI Cubit prompt.

The coreform_cubit.com terminal output doesn’t seem to be working correctly in 2022.4 on Windows. This is fixed in later versions.

Isn’t the version command supposed to work without even any plugins? I thought the correct behavior is to see MyPlugin Version 0.1 which is what I see when I use the latest version :

As my understanding, if this doesn’t show up it means the plugin was not loaded correctly which is the case in your screenshot.

Oh you’re right, sorry I missed that. Is there a reason why you need specifically Cubit version 2022.4?

No, I think we will be migrating to the latest version to get around the bug.

Thanks again for all your help and quick responses Scot.

Much appreciated.