diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a3625ef1a..eb1448028 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -174,8 +174,10 @@ if ("${PROJECT_NAME}" STREQUAL "DAMASK_spectral") list(APPEND OBJECTFILES $) if(NOT "${CMAKE_BUILD_TYPE}" STREQUAL "SYNTAXONLY") add_executable(DAMASK_spectral "DAMASK_spectral.f90" ${OBJECTFILES}) - add_dependencies(DAMASK_spectral SPECTRAL_SOLVER) + else() + add_library(DAMASK_spectral OBJECT "DAMASK_spectral.f90") endif() + add_dependencies(DAMASK_spectral SPECTRAL_SOLVER) elseif ("${PROJECT_NAME}" STREQUAL "DAMASK_FEM") add_library(FEM_UTILITIES OBJECT "FEM_utilities.f90") add_dependencies(FEM_UTILITIES DAMASK_CPFE) diff --git a/src/DAMASK_spectral.f90 b/src/DAMASK_spectral.f90 index 6a932fd82..dfa1746b2 100755 --- a/src/DAMASK_spectral.f90 +++ b/src/DAMASK_spectral.f90 @@ -511,7 +511,6 @@ program DAMASK_spectral ',a,'//IO_intOut(stepFraction)//',a,'//IO_intOut(subStepFactor**cutBackLevel)//')') & 'Increment ',totalIncsCounter,'/',sum(loadCases%incs),& '-',stepFraction, '/', subStepFactor**cutBackLevel - endif !-------------------------------------------------------------------------------------------------- ! forward fields @@ -706,13 +705,17 @@ subroutine quit(stop_id) implicit none - #include +#include integer(pInt), intent(in) :: stop_id integer, dimension(8) :: dateAndTime ! type default integer integer(pInt) :: error = 0_pInt PetscErrorCode :: ierr = 0 logical :: ErrorInQuit + external :: & + PETScFinalize, & + MPI_finalize + call BasicPETSC_destroy() call AL_destroy() call Polarisation_destroy()