NOX Development
Loading...
Searching...
No Matches
NOX Developer's Guide to Prerelease Code

We define prerelease code to be code that should not be distributed, documented, or tested as part of the automatic nightly scripts.

Prerelease code will only be used if configure is executed with the NOX_BUILD_PRERELEASE=ON option. In that case,

  • all prerelease code will be compiled (-DWITH_PRERELEASE is added to CPPFLAGS),
  • doxygen will document prerelease code (WITH_PRERELEASE is added to the PREDEFINED variable in Doxyfile),
  • BUILD_PRERELEASE is true for automake/autoconf Makefile generation.

There are two steps to adding prerelease code.

  1. Add ifdef's to the source and header files.

    In other words, the code should be surrounded by a WITH_PRERELEASE ifdef as follows.

    #ifdef WITH_PRERELEASE
    // Insert All Code Here
    #endif
    

  2. Modify the CMakelists.txt file.

    For example, the following modifications were made to nox/src/Makefile.am to add NOX_Direction_QuasiNewton as prerelease code in the libnox.a library.

    # Prerelease Code
    IF (${PACKAGE_NAME}_BUILD_PRERELEASE)
    
      APPEND_SET(HEADERS
        NOX_Solver_TensorBasedTest.H
        NOX_LineSearch_Tensor.H
        NOX_Direction_Tensor.H
        NOX_Direction_QuasiNewton.H
        NOX_Direction_ModifiedNewton.H
        )
    
      APPEND_SET(SOURCES
        NOX_Solver_TensorBasedTest.C
        NOX_LineSearch_Tensor.C
        NOX_Direction_Tensor.C
        NOX_Direction_QuasiNewton.C
        NOX_Direction_ModifiedNewton.C
        )
    
    ENDIF()
    

Note
Prerelease code must still be able to compile.