Commit 5b480e39 authored by bonnell's avatar bonnell
Browse files

Support for static builds, esp. with libSim

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@23526 18c085ea-50e0-402c-830e-de6fd14e8384
parent bd7b439f
#*****************************************************************************
#
# Copyright (c) 2000 - 2013, Lawrence Livermore National Security, LLC
# Produced at the Lawrence Livermore National Laboratory
# LLNL-CODE-442911
# All rights reserved.
#
# This file is part of VisIt. For details, see https://visit.llnl.gov/. The
# full copyright notice is contained in the file COPYRIGHT located at the root
# of the VisIt distribution or at http://www.llnl.gov/visit/copyright.html.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# - Redistributions of source code must retain the above copyright notice,
# this list of conditions and the disclaimer below.
# - Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the disclaimer (as noted below) in the
# documentation and/or other materials provided with the distribution.
# - Neither the name of the LLNS/LLNL nor the names of its contributors may
# be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL LAWRENCE LIVERMORE NATIONAL SECURITY,
# LLC, THE U.S. DEPARTMENT OF ENERGY OR CONTRIBUTORS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
# DAMAGE.
#
#*****************************************************************************
#******************************************************************************
# Purpose: To create a static simV2 archive containing all relevant visit
# libs (creates libsimV2_static_ser.a, libsimV2_static_par.a)
#
#******************************************************************************
set(VISIT_PARALLEL @VISIT_PARALLEL@)
set(VISIT_BINARY_DIR @VISIT_BINARY_DIR@)
set(VISIT_FORTRAN @VISIT_FORTRAN@)
set(CMAKE_CURRENT_BINARY_DIR "@CMAKE_CURRENT_BINARY_DIR@")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "@CMAKE_ARCHIVE_OUTPUT_DIRECTORY@")
set(CMAKE_AR "@CMAKE_AR@")
set(CMAKE_RANLIB "@CMAKE_RANLIB@")
set(TMPDIR ${CMAKE_CURRENT_BINARY_DIR}/CreateStaticSimV2)
unset(visit_libs_ser)
unset(visit_libs_par)
# want to build up a list of library files to merge into one simV2_static_ser
# For this to work with cmake, need to list the cmake targets needed.
set(SLIVR_LIBS air alan biff bow dye ell gage hest moss nrrd slivrG slivrV
unrrdu)
set(VISIT_LIBS enginerpc lightweight_visit_vtk mdserverproxy mdserverrpc
visit_verdict visit_vtk visitcommon simV2)
set(AVT_LIBS avtdbatts avtmath avtqtviswindow avtshapelets avtview)
set(AVT_SER_LIBS avtdatabase_ser avtdbin_ser avtexpressions_ser avtfilters_ser
avtivp_ser avtmir_ser avtpipeline_ser avtplotter_ser
avtquery_ser avtviswindow_ser avtwriter_ser)
set(ENGINE_SER_LIBS simV2runtime_ser engine_ser)
set(AVT_PAR_LIBS cognomen avtdatabase_par avtdbin_par avtexpressions_par
avtfilters_par avtivp_par avtmir_par avtpipeline_par
avtplotter_par avtquery_par avtviswindow_par avtwriter_par)
set(TP_LIBS visitGLEW tess2 nek5000_interp)
set(ENGINE_PAR_LIBS simV2runtime_par engine_par)
set(DDTSIM_LIBS ddtsim_static)
list(APPEND visit_libs_ser ${ENGINE_SER_LIBS} ${AVT_LIBS} ${AVT_SER_LIBS}
${VISIT_LIBS} ${TP_LIBS} ${SLIVR_LIBS})
if(VISIT_PARALLEL)
list(APPEND visit_libs_par ${ENGINE_PAR_LIBS} ${AVT_LIBS} ${AVT_PAR_LIBS}
${VISIT_LIBS} ${TP_LIBS} ${DDTSIM_LIBS}
${VISIT_SLIVR})
endif()
macro(get_enabled_plugins fname type suffix plist)
unset(lines)
file(READ "${fname}" lines)
string(REGEX REPLACE "\n" ";" lines "${lines}")
foreach(plugin ${lines})
string(REPLACE "PLUGIN_VERB\(" "" pname "${plugin}")
string(REPLACE "\)" "" pname "${pname}")
list(APPEND ${plist} "I${pname}${type}" "E${pname}${type}${suffix}")
endforeach()
endmacro()
get_enabled_plugins("${VISIT_BINARY_DIR}/include/enabled_plots.h"
"Plot" "_ser" visit_libs_ser)
get_enabled_plugins("${VISIT_BINARY_DIR}/include/enabled_operators.h"
"Operator" "_ser" visit_libs_ser)
list(APPEND visit_libs_ser "ISimV2Database" "ESimV2Database_ser")
if(VISIT_PARALLEL)
get_enabled_plugins("${VISIT_BINARY_DIR}/include/enabled_plots.h"
"Plot" "_par" visit_libs_par)
get_enabled_plugins("${VISIT_BINARY_DIR}/include/enabled_operators.h"
"Operator" "_par" visit_libs_par)
list(APPEND visit_libs_par "ISimV2Database" "ESimV2Database_ser")
endif()
function(create_archive libname liblist)
unset(ALL_OBJS)
make_directory(${TMPDIR})
# Extract every library in the list into a series of object files
foreach(LIB ${${liblist}})
if(EXISTS ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/lib${LIB}.a)
file(MAKE_DIRECTORY ${TMPDIR}/${LIB})
execute_process(
COMMAND ${CMAKE_AR} x ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/lib${LIB}.a
WORKING_DIRECTORY ${TMPDIR}/${LIB}
)
file(GLOB_RECURSE OBJS "${TMPDIR}/${LIB}/*")
set(ALL_OBJS ${ALL_OBJS} ${OBJS})
endif()
endforeach(LIB)
# Merge all extracted object files into the existing target archive
execute_process(
COMMAND ${CMAKE_AR} cr ${libname} ${ALL_OBJS}
WORKING_DIRECTORY ${TMPDIR}
)
# Ranlib the new archive library
execute_process(
COMMAND ${CMAKE_RANLIB} ${libname}
WORKING_DIRECTORY ${TMPDIR}
)
# Delete all leftover object files
file(REMOVE_RECURSE ${TMPDIR})
endfunction()
create_archive("${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/libsimV2_static_ser.a"
visit_libs_ser)
if(VISIT_PARALLEL)
create_archive("${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/libsimV2_static_par.a"
visit_libs_par)
endif()
#/home/biagas2/visit/thirdparty/static/2.8.0/cmake/2.8.12.2/linux-x86_64_gcc-4.4/bin/cmake
##
## bv280b generated host.cmake
## created: Tue May 13 14:46:54 PDT 2014
## system: Linux beetlehunter 2.6.32-358.6.1.el6.x86_64 #1 SMP Fri Mar 29 16:51:51 EDT 2013 x86_64 x86_64 x86_64 GNU/Linux
## by: biagas2
##
## Setup VISITHOME & VISITARCH variables.
##
SET(VISITHOME /home/biagas2/visit/thirdparty/static/2.8.0)
SET(VISITARCH linux-x86_64_gcc-4.4)
## Compiler flags.
##
VISIT_OPTION_DEFAULT(VISIT_C_COMPILER gcc TYPE FILEPATH)
VISIT_OPTION_DEFAULT(VISIT_CXX_COMPILER g++ TYPE FILEPATH)
VISIT_OPTION_DEFAULT(VISIT_C_FLAGS " -m64 -fPIC -fvisibility=hidden" TYPE STRING)
VISIT_OPTION_DEFAULT(VISIT_CXX_FLAGS " -m64 -fPIC -fvisibility=hidden" TYPE STRING)
##
## Static build
##
VISIT_OPTION_DEFAULT(VISIT_STATIC ON TYPE BOOL)
##
## VisIt Thread Option
##
VISIT_OPTION_DEFAULT(VISIT_THREAD OFF TYPE BOOL)
##############################################################
##
## Database reader plugin support libraries
##
## The HDF4, HDF5 and NetCDF libraries must be first so that
## their libdeps are defined for any plugins that need them.
##
## For libraries with LIBDEP settings, order matters.
## Libraries with LIBDEP settings that depend on other
## Library's LIBDEP settings must come after them.
##############################################################
##
##
## Python
##
VISIT_OPTION_DEFAULT(VISIT_PYTHON_DIR ${VISITHOME}/python/2.7.5/${VISITARCH})
##
## Qt
##
VISIT_OPTION_DEFAULT(VISIT_QT_BIN ${VISITHOME}/qt/4.8.3/${VISITARCH}/bin)
##
## VTK
##
SETUP_VTK_VERSION(6.1.0)
VISIT_OPTION_DEFAULT(VISIT_VTK_DIR ${VISITHOME}/vtk/${VTK_VERSION}/${VISITARCH})
##
##
## AdvIO
##
VISIT_OPTION_DEFAULT(VISIT_ADVIO_DIR ${VISITHOME}/AdvIO/1.2/${VISITARCH})
##
## Boxlib
##
VISIT_OPTION_DEFAULT(VISIT_BOXLIB_DIR ${VISITHOME}/boxlib/1.0.7/${VISITARCH})
##
## CCMIO
##
VISIT_OPTION_DEFAULT(VISIT_CCMIO_DIR ${VISITHOME}/ccmio/2.6.1/${VISITARCH})
##
## CFITSIO
##
VISIT_OPTION_DEFAULT(VISIT_CFITSIO_DIR ${VISITHOME}/cfitsio/3006/${VISITARCH})
##
## SZIP
##
VISIT_OPTION_DEFAULT(VISIT_SZIP_DIR ${VISITHOME}/szip/2.1/${VISITARCH})
##
## HDF5
##
VISIT_OPTION_DEFAULT(VISIT_HDF5_DIR ${VISITHOME}/hdf5/1.8.7/${VISITARCH})
VISIT_OPTION_DEFAULT(VISIT_HDF5_LIBDEP ${VISITHOME}/szip/2.1/${VISITARCH}/lib sz /usr/lib z TYPE STRING)
##
## CGNS
##
VISIT_OPTION_DEFAULT(VISIT_CGNS_DIR ${VISITHOME}/cgns/3.0.8/${VISITARCH})
VISIT_OPTION_DEFAULT(VISIT_CGNS_LIBDEP HDF5_LIBRARY_DIR hdf5 ${VISIT_HDF5_LIBDEP} TYPE STRING)
##
## FastBit
##
VISIT_OPTION_DEFAULT(VISIT_FASTBIT_DIR ${VISITHOME}/fastbit/1.2.0/${VISITARCH})
##
## GDAL
##
VISIT_OPTION_DEFAULT(VISIT_GDAL_DIR ${VISITHOME}/gdal/1.10.0/${VISITARCH})
##
## H5Part
##
VISIT_OPTION_DEFAULT(VISIT_H5PART_DIR ${VISITHOME}/h5part/1.6.6/${VISITARCH})
VISIT_OPTION_DEFAULT(VISIT_H5PART_LIBDEP HDF5_LIBRARY_DIR hdf5 ${VISIT_HDF5_LIBDEP} TYPE STRING)
##
## HDF4
##
VISIT_OPTION_DEFAULT(VISIT_HDF4_DIR ${VISITHOME}/hdf4/4.2.5/${VISITARCH})
VISIT_OPTION_DEFAULT(VISIT_HDF4_LIBDEP ${VISITHOME}/szip/2.1/${VISITARCH}/lib sz ${VISITHOME}/vtk/${VTK_VERSION}/${VISITARCH}/lib vtkjpeg-${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION} TYPE STRING)
##
## NetCDF
##
VISIT_OPTION_DEFAULT(VISIT_NETCDF_DIR ${VISITHOME}/netcdf/4.1.1/${VISITARCH})
VISIT_OPTION_DEFAULT(VISIT_NETCDF_LIBDEP HDF5_LIBRARY_DIR hdf5_hl HDF5_LIBRARY_DIR hdf5 ${VISIT_HDF5_LIBDEP} TYPE STRING)
##
## ITAPS
##
## MOAB implementation
ITAPS_INCLUDE_DIRECTORIES(MOAB ${VISITHOME}/itaps/1.4/MOAB/4.6.0/${VISITARCH}/include)
ITAPS_FILE_PATTERNS(MOAB *.cub)
ITAPS_LINK_LIBRARIES(MOAB iMesh MOAB hdf5_hl hdf5 sz z netcdf_c++ netcdf )
ITAPS_LINK_DIRECTORIES(MOAB ${VISITHOME}/itaps/1.4/MOAB/4.6.0/${VISITARCH}/lib ${VISITHOME}/hdf5/1.8.7/${VISITARCH}/lib ${VISITHOME}/szip/2.1/${VISITARCH}/lib ${VISITHOME}/netcdf/4.1.1/${VISITARCH}/lib )
## FMDB implementation
ITAPS_INCLUDE_DIRECTORIES(FMDB ${VISITHOME}/itaps/1.4/FMDB/1.4.0/${VISITARCH}/include)
ITAPS_FILE_PATTERNS(FMDB *.sms)
ITAPS_LINK_LIBRARIES(FMDB FMDB SCORECModel SCORECUtil )
ITAPS_LINK_DIRECTORIES(FMDB ${VISITHOME}/itaps/1.4/FMDB/1.4.0/${VISITARCH}/lib)
## GRUMMP implementation
ITAPS_INCLUDE_DIRECTORIES(GRUMMP ${VISITHOME}/itaps/1.4/GRUMMP/0.6.5/${VISITARCH}/include)
ITAPS_FILE_PATTERNS(GRUMMP *.bdry *.smesh *.vmesh)
ITAPS_LINK_LIBRARIES(GRUMMP iMesh_GRUMMP GR_3D GR_surf GR_2D GR_geom GR_base SUMAAlog_lite OptMS cgm dl)
ITAPS_LINK_DIRECTORIES(GRUMMP ${VISITHOME}/itaps/1.4/GRUMMP/0.6.5/${VISITARCH}/lib)
##
## Mili
##
VISIT_OPTION_DEFAULT(VISIT_MILI_DIR ${VISITHOME}/mili/13.1.1-patch/${VISITARCH})
##
## Silo
##
VISIT_OPTION_DEFAULT(VISIT_SILO_DIR ${VISITHOME}/silo/4.9.1/${VISITARCH})
VISIT_OPTION_DEFAULT(VISIT_SILO_LIBDEP HDF5_LIBRARY_DIR hdf5 ${VISIT_HDF5_LIBDEP} TYPE STRING)
##
## Xdmf
##
VISIT_OPTION_DEFAULT(VISIT_XDMF_DIR ${VISITHOME}/Xdmf/2.1.1/${VISITARCH})
VISIT_OPTION_DEFAULT(VISIT_XDMF_LIBDEP HDF5_LIBRARY_DIR hdf5 VTK_LIBRARY_DIRS vtklibxml2-${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION} TYPE STRING)
......@@ -87,19 +87,19 @@ SET(INSTALLTARGETS IH5PartDatabase)
IF(NOT VISIT_ENGINE_ONLY AND NOT VISIT_DBIO_ONLY)
ADD_LIBRARY(MH5PartDatabase ${LIBM_SOURCES} )
TARGET_LINK_LIBRARIES(MH5PartDatabase visitcommon avtdbatts avtdatabase_ser ${FASTBIT_LIB} ${H5PART_LIB} ${HDF5_LIB} ${ZLIB_LIB} )
TARGET_LINK_LIBRARIES(MH5PartDatabase visitcommon avtdbatts avtdatabase_ser ${FASTBIT_LIB} ${H5PART_LIB} ${HDF5_LIB} ${ZLIB_LIB} rt)
ADD_TARGET_DEFINITIONS(MH5PartDatabase MDSERVER)
SET(INSTALLTARGETS ${INSTALLTARGETS} MH5PartDatabase)
ENDIF(NOT VISIT_ENGINE_ONLY AND NOT VISIT_DBIO_ONLY)
ADD_LIBRARY(EH5PartDatabase_ser ${LIBE_SOURCES})
TARGET_LINK_LIBRARIES(EH5PartDatabase_ser visitcommon avtdatabase_ser avtpipeline_ser ${FASTBIT_LIB} ${H5PART_LIB} ${HDF5_LIB} ${ZLIB_LIB} )
TARGET_LINK_LIBRARIES(EH5PartDatabase_ser visitcommon avtdatabase_ser avtpipeline_ser ${FASTBIT_LIB} ${H5PART_LIB} ${HDF5_LIB} ${ZLIB_LIB} rt)
ADD_TARGET_DEFINITIONS(EH5PartDatabase_ser ENGINE)
SET(INSTALLTARGETS ${INSTALLTARGETS} EH5PartDatabase_ser)
IF(VISIT_PARALLEL)
ADD_PARALLEL_LIBRARY(EH5PartDatabase_par ${LIBE_SOURCES})
TARGET_LINK_LIBRARIES(EH5PartDatabase_par visitcommon avtdatabase_par avtpipeline_par ${FASTBIT_LIB} ${H5PART_LIB} ${HDF5_LIB} ${ZLIB_LIB} )
TARGET_LINK_LIBRARIES(EH5PartDatabase_par visitcommon avtdatabase_par avtpipeline_par ${FASTBIT_LIB} ${H5PART_LIB} ${HDF5_LIB} ${ZLIB_LIB} rt)
ADD_TARGET_DEFINITIONS(EH5PartDatabase_par ENGINE)
SET(INSTALLTARGETS ${INSTALLTARGETS} EH5PartDatabase_par)
ENDIF(VISIT_PARALLEL)
......
......@@ -124,9 +124,8 @@ ${ICET_LIBRARY_DIR}
)
ADD_LIBRARY(simV2runtime_ser ${LIBSIM_RUNTIME_SOURCES} ${LIBSIM_STATIC_SOURCES})
TARGET_LINK_LIBRARIES(simV2runtime_ser
engine_ser
)
TARGET_LINK_LIBRARIES(simV2runtime_ser engine_ser)
IF(NOT APPLE)
SET_TARGET_PROPERTIES(simV2runtime_ser PROPERTIES INSTALL_RPATH "$ORIGIN")
ENDIF(NOT APPLE)
......@@ -135,9 +134,7 @@ VISIT_INSTALL_TARGETS(simV2runtime_ser)
IF(VISIT_PARALLEL)
ADD_PARALLEL_LIBRARY(simV2runtime_par ${LIBSIM_RUNTIME_SOURCES} ${LIBSIM_STATIC_SOURCES})
TARGET_LINK_LIBRARIES(simV2runtime_par
engine_par
)
TARGET_LINK_LIBRARIES(simV2runtime_par engine_par)
IF(NOT APPLE)
SET_TARGET_PROPERTIES(simV2runtime_par PROPERTIES INSTALL_RPATH "$ORIGIN")
ENDIF(NOT APPLE)
......
function bv_pyside_initialize
{
export DO_PYSIDE="yes"
export ON_PYSIDE="on"
export USE_SYSTEM_PYSIDE="no"
add_extra_commandline_args "pyside" "alt-pyside-dir" 1 "Use alternative directory for pyside"
if [[ "$DO_STATIC_BUILD" == "no" ]]; then
export DO_PYSIDE="yes"
export ON_PYSIDE="on"
export USE_SYSTEM_PYSIDE="no"
add_extra_commandline_args "pyside" "alt-pyside-dir" 1 "Use alternative directory for pyside"
else
export DO_PYSIDE="no"
export ON_PYSIDE="off"
export USE_SYSTEM_PYSIDE="no"
fi
}
function bv_pyside_enable
......
......@@ -133,6 +133,9 @@ function bv_silo_dry_run
# Brad Whitlock, Tue Apr 9 12:20:22 PDT 2013
# Add support for custom zlib.
#
# Kathleen Biagas, Tue Jun 10 08:21:33 MST 2014
# Disable silex for static builds.
#
# *************************************************************************** #
function build_silo
......@@ -170,7 +173,7 @@ function build_silo
else
WITHSZIPARG="--without-szlib"
fi
if [[ "$DO_QT" != "yes" || "$OPSYS" == "Darwin" ]] ; then
if [[ "$DO_QT" != "yes" || "$OPSYS" == "Darwin" || "$DO_STATIC_BUILD" == "yes" ]] ; then
WITHSILOQTARG="--disable-silex"
else
export SILOQTDIR="$QT_INSTALL_DIR" #"${VISITDIR}/qt/${QT_VERSION}/${VISITARCH}"
......
......@@ -10,6 +10,10 @@
# Jonathan Byrd (Allinea Software) Sun Dec 18, 2011
# Added static libddtsim to parallel archive
#
# Kathleen Biagas, Thu Jun 12 10:19:07 PDT 2014
# Moved GLEW to visit_deps as visitGLEW, add libtess2 to visit_deps.
# Split avtivp into ser and par versions.
#
################################################################################
import os, sys
......@@ -37,11 +41,13 @@ visit_deps = (
"libvisit_verdict.a",
"libvisit_vtk.a",
"libvisitcommon.a",
"libsimV2.a")
"libsimV2.a",
"libvisitGLEW.a",
"libtess2.a",
"libnek5000_interp.a")
avt = (
"libavtdbatts.a",
"libavtivp.a",
"libavtmath.a",
"libavtqtviswindow.a",
"libavtshapelets.a",
......@@ -52,6 +58,7 @@ avt_ser = (
"libavtdbin_ser.a",
"libavtexpressions_ser.a",
"libavtfilters_ser.a",
"libavtivp_ser.a",
"libavtmir_ser.a",
"libavtpipeline_ser.a",
"libavtplotter_ser.a",
......@@ -69,6 +76,7 @@ avt_par = (
"libavtdbin_par.a",
"libavtexpressions_par.a",
"libavtfilters_par.a",
"libavtivp_par.a",
"libavtmir_par.a",
"libavtpipeline_par.a",
"libavtplotter_par.a",
......@@ -181,10 +189,10 @@ frameworks = "-lGL "
if sys.platform == "darwin":
frameworks = "-framework OpenGL -framework AGL -framework SystemConfiguration -framework IOKit -framework Cocoa "
ser_link_line = get_linkline(ser_libs) + "-lGLEW -lz " + vtk_libs + frameworks
ser_link_line = get_linkline(ser_libs) + "-lz " + vtk_libs + frameworks
print "Serial link line if you link each library: "
print ser_link_line
par_link_line = get_linkline(par_libs) + "-lGLEW -lz " + vtk_libs + frameworks
par_link_line = get_linkline(par_libs) + "-lz " + vtk_libs + frameworks
print "Parallel link line if you link each library: "
print par_link_line
......@@ -65,6 +65,10 @@
# Remove no-longer use SIMV1 functions. Copy python examples when
# doing out-of-source builds.
#
# Kathleen Biagas, Thu Jun 12 13:24:08 PDT 2014
# Added mechanism for creating a simV2_static archive containing all
# visit symbols necessary for compiling these examples statically.
#
#****************************************************************************/
INCLUDE_DIRECTORIES(
......@@ -77,6 +81,36 @@ IF(NOT VISIT_DATA_MANUAL_EXAMPLES)
ADD_CUSTOM_TARGET(all_simulations)
ENDIF(NOT VISIT_DATA_MANUAL_EXAMPLES)
IF(VISIT_STATIC)
# Create a single static simV2 archive containing all relevant visit libraries
# create a library that depends on a dummy source file
set(SIMV2_STATIC_SRC ${CMAKE_CURRENT_BINARY_DIR}/simv2_static_dummy.c)
set(SIMV2_STATIC_SER ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libsimV2_static_ser.a)
set(SIMV2_STATIC_PAR ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libsimV2_static_par.a)
add_library(simV2_static_ser STATIC ${SIMV2_STATIC_SRC})
# create the dummy source file
add_custom_command(OUTPUT ${SIMV2_STATIC_SRC}
COMMAND ${CMAKE_COMMAND} -E touch ${SIMV2_STATIC_SRC}
)
configure_file(${VISIT_SOURCE_DIR}/CMake/CreateStaticSimV2.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/CreateStaticSimV2.cmake
@ONLY
)
add_custom_command(TARGET simV2_static_ser POST_BUILD
COMMAND ${CMAKE_COMMAND} -P
${CMAKE_CURRENT_BINARY_DIR}/CreateStaticSimV2.cmake
COMMENT "CREATING SIMV2 STATIC ARCHIVE"
)
if (VISIT_PARALLEL)
add_library(simV2_static_par STATIC ${SIMV2_STATIC_SRC})
endif()
ENDIF()
# The simulation will be built here but not added to the "all" target. This means
# it won't be built unless we explicitly build it or make the "all_simulations"
# target.
......@@ -94,14 +128,6 @@ FUNCTION(SET_SIMULATION_PROPERTIES target)
ENDIF(NOT VISIT_DATA_MANUAL_EXAMPLES)
ENDFUNCTION(SET_SIMULATION_PROPERTIES)
# Add the --export-dynamic flag for Linux gcc so SimV1 simulations will expose
# their callback functions.
FUNCTION(ADD_EXPORT_DYNAMIC_LINK_FLAGS target)
SET_TARGET_PROPERTIES(sim_${target} PROPERTIES
ENABLE_EXPORTS ON
)
ENDFUNCTION(ADD_EXPORT_DYNAMIC_LINK_FLAGS)
# We need more libraries on Linux and Windows
IF(WIN32)
SET(EXTRA_SIM_LIBS ws2_32)
......@@ -120,7 +146,15 @@ FUNCTION(ADD_SIMV2_SIMULATION target)
ADD_EXECUTABLE(sim_${target} ${ARGN})
SET_SIMULATION_PROPERTIES(${target})
SET_TARGET_PROPERTIES(sim_${target} PROPERTIES HAS_CXX ON)
TARGET_LINK_LIBRARIES(sim_${target} simV2 ${EXTRA_SIM_LIBS})
IF(NOT VISIT_STATIC)
TARGET_LINK_LIBRARIES(sim_${target} simV2 ${EXTRA_SIM_LIBS})
ELSE()
SET(VTK_LIBS vtkCommonCore vtkImagingCore vtkRenderingCore vtkIOLegacy vtkIOPLY
vtkInteractionStyle vtkRenderingOpenGL vtkRenderingFreeTypeOpenGL
vtkFiltersHybrid vtkFiltersModeling vtkGeovisCore)
TARGET_LINK_LIBRARIES(sim_${target} simV2_static_ser ${VTK_LIBS} ${ZLIB_LIB}
${EXTRA_SIM_LIBS})
ENDIF()
ADD_TARGET_INCLUDE(sim_${target} ${VISIT_SOURCE_DIR}/sim/V2/lib)
ENDFUNCTION(ADD_SIMV2_SIMULATION)
......@@ -138,7 +172,11 @@ FUNCTION(ADD_PARALLEL_SIMV2_SIMULATION target)
ADD_PARALLEL_EXECUTABLE(sim_${target} ${ARGN})
SET_SIMULATION_PROPERTIES(${target})
SET_TARGET_PROPERTIES(sim_${target} PROPERTIES HAS_CXX ON)
TARGET_LINK_LIBRARIES(sim_${target} simV2 ${EXTRA_SIM_LIBS})
IF(NOT VISIT_STATIC)
TARGET_LINK_LIBRARIES(sim_${target} simV2 ${EXTRA_SIM_LIBS})
ELSE()
TARGET_LINK_LIBRARIES(sim_${target} simV2_static_par ${EXTRA_SIM_LIBS})
ENDIF()
ADD_TARGET_INCLUDE(sim_${target} ${VISIT_SOURCE_DIR}/sim/V2/lib)
ENDIF(VISIT_PARALLEL)
ENDFUNCTION(ADD_PARALLEL_SIMV2_SIMULATION)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment