4.6. Building the Fortran 90 implementation of the integrators.Midpoint component.

  1. In the student-src/components/integrators/f90 directory, edit the user-defined settings in MakeIncl.user file to specify the include paths and library location of the legacy integrator library.

    file: student-src/components/integrators/f90/MakeIncl.user
    # Include path directives, including paths to Fortran modules
    INCLUDES = \
      $(CCASPEC_BABEL_F90MFLAG)$(COMPONENT_TOP_DIR)/../legacy/f90/include_w
    
    # Library paths and names
    LIBS = \
      -L$(COMPONENT_TOP_DIR)/../legacy/f90/lib \
      -lWrappedLegacyIntegrator
    

    Note that the INCLUDES variable is used by the Fortran compiler to locate compiled module information; since the flag used to specify the search path for modules is not the same in all compilers, we use the variable CCASPEC_BABEL_F90MFLAG, which was set during the configuration and installation of Babel and CCA tools. The COMPONENT_TOP_DIRvariable is set automatically when the component's Makefile is generated from the student-src/components/Makefile_template.server makefile template.

    Also note that the library specified in the definition of the LIBS variable is not the original legacy library, which contained the original definition of FunctionModule and FunctionParams_t. The only difference between the legacy library and libWrappedLegacyIntegrator.a is that the original FunctionModule has been replaced with a new definition of FunctionModule in FunctionModuleWrapper.f90 as described in Section 4.2, “The FunctionModule wrapper.”.

  2. In student-src/components/integrators/f90, run make. This will build the dynamic component libraries and generate the *.cca files needed to load these libraries and instantiate the components in the Ccaffeine framework. After a successful build, you should be able to see the libintegratorsMidpoint-f90.so and libintegratorsMidpoint-f90.so.cca files in the student-src/components/lib directory.

    [Note] Note

    In this step, the makefile automatically generated the .cca file needed by the Ccaffeine and Babel runtime systems to identify and locate babel components. This file can also be generated manually by executing the following command in the directory student-src/components/lib:

    $CCA/bin/genSCLCCA.sh cca \
       `pwd`/libintegratorsMidpoint-f90.so integrators.Midpoint \
       integratorsMidpoint dynamic private now \
       > integrators.Midpoint.cca