Frequently Asked Questions

Can the tool build a shared library when both Fortran and C/C++ source code is specified?

Yes, the tool can handle mixed source code as well as object files.

What platform does the tool build my library for?

The supported platforms are 64-bit Windows and 64-bit Linux.

Is my shared library a debug or release version?

The shared library created is a release version library.

Where can I get sample templates for the syntax of the C/C++/Fortran code?

Sample user subroutine code is provided in the installation in the following locations:
For C/C++ source code:
<install>\Altair\<version>\hwsolvers\motionsolve\usersub\c_src
For Fortran source code:
<install>\Altair\<version>\hwsolvers\motionsolve\usersub\f_src
Note: For MotionSolve to use the functions defined in the source code, these functions must be exported on the Windows platform (on Linux, all functions are automatically exported). The syntax to do this for C/C++ and Fortran is described below.
C/C++:
Include the header file msolvsub_c_include.h (located in <install>\Altair\<version>\hwsolvers\motionsolve\usersub\c_src\include) in your code. To export a function, use the keywords CLINKAGE, DLLFUNC and STDCALL.
#include " msolvsub_c_include.h"
#include "stdlib.h"
CLINKAGE 
DLLFUNC
void
STDCALL
ARYSUB (int *id, double *time, double *par, 
                     int *npar, int *dflag, int *iflag, int *nvalue, double *value)
{
}
Fortran
In Fortran syntax, the same function above can be exported as below.
SUBROUTINE
ARYSUB (ID, TIME, PAR, NPAR, DFLAG,
     &  IFLAG, NVALUE, VALUE)
!DEC$ ATTRIBUTES DLLEXPORT ::
ARYSUB

The code above exports the function ARYSUB using C/C++ and Fortran syntax.

Does the order in which I choose the source files matter?

Yes, this can matter in certain cases. For example, when building Fortran source code and defining MODULES, you may want to include the source file that contains the definition of any defined modules before the source files that refer to these modules.

I am not able to compile Fortran files even though I have a supported Intel Fortran compiler installed. What's wrong?

The build tool relies on an environment variable to detect the version of the Intel Fortran compiler and its location on your machine. Make sure you have the environment variable IFORT_COMPILERxx (where xx is the version of the compiler - 10, 11 or 12) defined correctly on your system and pointing to the installed version.