Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Users can use different types of libraries using gcc supplied by HYPERSIM.
  • Note that {HYPERSIM_DIR} is the HYPERSIM installation directory. By default, it should resemble: C:\OPAL-RT\HYPERSIM\hypersim_R6.0.XX.oYYY
  • Note that {TOOLS_MINGW} is the HYPERSIM tools installation directory. By default, it should be something like C:\OPAL-RT\HYPERSIM\tools\MinGW\X.X.X
  • Library paths are absolute. Each time the library file is changed in the directory (it is moved or the simulation is used on another computer), the paths in .def file must be updated.

...

  • Open a command line window and go to the directory where your C code is.
  • Generate the .o file by replacing the bold part with your filenamefilename with the correct one.

    {HYPERSIMTOOLS_DIRMINGW}\Windows\MinGW\bin\ gcc -c test.c -o test.o
  • Generate the dll file using the following command. By convention, the DLL file should be lib{name of your lib}.dll. In this case library name is test. The .lib file name is arbitrary.

    {HYPERSIMTOOLS_DIRMINGW}\Windows\MinGW\bin\gcc -shared -o libtest.dll test.o -Wl,--out-implib, libtest_dll.lib
  • Add the path of library to the UCM. Open the def file and fill in the following line:

    UCM_SIMULATION_LIBRARIES_WINDOWS = -L{Path to your lib} –l{name of your lib} *without extension* the path is entered using / instead of \.
  • Example where {Path to your lib} = C:/Users/joffreynadeau/test_code/ and {name of your lib} =libtest.dll:


    UCM_SIMULATION_LIBRARIES_WINDOWS =-LC:/Users/joffreynadeau/test_code/  -ltest

...

  • Open a command line window and go to the directory where your C code is.
  • Generate the .o file by replacing the bold part with your filenamefilename with the correct one:
{HYPERSIMTOOLS_DIRMINGW}\Windows\MinGW\bin\ gcc -c test.c -o test.o
  • Generate the lib file using the following command.
{HYPERSIMTOOLS_DIRMINGW}\Windows\MinGW\bin\ar -rcs libtest.lib test.o

...