Committing progress, almost works.

This commit is contained in:
Alex Lin 2019-11-06 08:05:31 -06:00
parent 6205864d92
commit 2d055ff2e9
15 changed files with 1400 additions and 9573 deletions

1167
CMakeLists.txt Normal file

File diff suppressed because it is too large Load Diff

130
CMakeModules/FindLLVM.cmake Normal file
View File

@ -0,0 +1,130 @@
# Find the native LLVM includes and library
#
# LLVM_INCLUDE_DIR - where to find llvm include files
# LLVM_LIBRARY_DIR - where to find llvm libs
# LLVM_CFLAGS - llvm compiler flags
# LLVM_LDFLAGS - llvm linker flags
# LLVM_MODULE_LIBS - list of llvm libs for working with modules.
# LLVM_FOUND - True if llvm found.
if (LLVM_INSTALL_DIR)
find_program(LLVM_CONFIG_EXECUTABLE
NAMES llvm-config-37 llvm-config-3.7 llvm-config-36 llvm-config-3.6 llvm-config-38 llvm-config-3.8 llvm-config-39 llvm-config-3.9 llvm-config llvm-config-35 llvm-config-3.5 llvm-config-34 llvm-config-3.4
DOC "llvm-config executable"
PATHS ${LLVM_INSTALL_DIR} NO_DEFAULT_PATH)
else (LLVM_INSTALL_DIR)
find_program(LLVM_CONFIG_EXECUTABLE
NAMES llvm-config-37 llvm-config-3.7 llvm-config-36 llvm-config-3.6 llvm-config-38 llvm-config-3.8 llvm-config-39 llvm-config-3.9 llvm-config llvm-config-35 llvm-config-3.5 llvm-config-34 llvm-config-3.4
DOC "llvm-config executable")
endif (LLVM_INSTALL_DIR)
if (LLVM_CONFIG_EXECUTABLE)
message(STATUS "LLVM llvm-config found at: ${LLVM_CONFIG_EXECUTABLE}")
else (LLVM_CONFIG_EXECUTABLE)
message(FATAL_ERROR "Could NOT find LLVM executable, please add -DLLVM_INSTALL_DIR=/path/to/llvm-config/ in cmake command")
endif (LLVM_CONFIG_EXECUTABLE)
execute_process(
COMMAND ${LLVM_CONFIG_EXECUTABLE} --version
OUTPUT_VARIABLE LLVM_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE
)
string(REGEX REPLACE "([0-9])\\.([0-9]*).*" "\\1\\2" LLVM_VERSION_NODOT ${LLVM_VERSION})
string(REGEX REPLACE "([0-9])\\.([0-9]*).*" "\\1.\\2" LLVM_VERSION_NOPATCH ${LLVM_VERSION})
if (LLVM_FIND_VERSION_MAJOR AND LLVM_FIND_VERSION_MINOR)
SET(LLVM_FIND_VERSION_NODOT "${LLVM_FIND_VERSION_MAJOR}${LLVM_FIND_VERSION_MINOR}")
if (LLVM_VERSION_NODOT VERSION_LESS LLVM_FIND_VERSION_NODOT)
message(FATAL_ERROR "imcompatible LLVM version ${LLVM_VERSION} required ${LLVM_FIND_VERSION}")
else (LLVM_VERSION_NODOT VERSION_LESS LLVM_FIND_VERSION_NODOT)
if (LLVM_VERSION_NODOT VERSION_EQUAL LLVM_FIND_VERSION_NODOT)
message(STATUS "find stable LLVM version ${LLVM_VERSION}")
else (LLVM_VERSION_NODOT VERSION_EQUAL LLVM_FIND_VERSION_NODOT)
message(STATUS "find unstable LLVM version ${LLVM_VERSION}")
endif (LLVM_VERSION_NODOT VERSION_EQUAL LLVM_FIND_VERSION_NODOT)
add_definitions("-DLLVM_${LLVM_VERSION_NODOT}")
endif (LLVM_VERSION_NODOT VERSION_LESS LLVM_FIND_VERSION_NODOT)
endif (LLVM_FIND_VERSION_MAJOR AND LLVM_FIND_VERSION_MINOR)
if (LLVM_INSTALL_DIR)
find_program(CLANG_EXECUTABLE
NAMES clang-${LLVM_VERSION_NODOT} clang-${LLVM_VERSION_NOPATCH} clang
PATHS ${LLVM_INSTALL_DIR} NO_DEFAULT_PATH)
find_program(LLVM_AS_EXECUTABLE
NAMES llvm-as-${LLVM_VERSION_NODOT} llvm-as-${LLVM_VERSION_NOPATCH} llvm-as
PATHS ${LLVM_INSTALL_DIR} NO_DEFAULT_PATH)
find_program(LLVM_LINK_EXECUTABLE
NAMES llvm-link-${LLVM_VERSION_NODOT} llvm-link-${LLVM_VERSION_NOPATCH} llvm-link
PATHS ${LLVM_INSTALL_DIR} NO_DEFAULT_PATH)
else (LLVM_INSTALL_DIR)
find_program(CLANG_EXECUTABLE
NAMES clang-${LLVM_VERSION_NODOT} clang-${LLVM_VERSION_NOPATCH} clang)
find_program(LLVM_AS_EXECUTABLE
NAMES llvm-as-${LLVM_VERSION_NODOT} llvm-as-${LLVM_VERSION_NOPATCH} llvm-as)
find_program(LLVM_LINK_EXECUTABLE
NAMES llvm-link-${LLVM_VERSION_NODOT} llvm-link-${LLVM_VERSION_NOPATCH} llvm-link)
endif (LLVM_INSTALL_DIR)
execute_process(
COMMAND ${LLVM_CONFIG_EXECUTABLE} --includedir
OUTPUT_VARIABLE LLVM_INCLUDE_DIR
OUTPUT_STRIP_TRAILING_WHITESPACE
)
execute_process(
COMMAND ${LLVM_CONFIG_EXECUTABLE} --libdir
OUTPUT_VARIABLE LLVM_LIBRARY_DIR
OUTPUT_STRIP_TRAILING_WHITESPACE
)
execute_process(
COMMAND ${LLVM_CONFIG_EXECUTABLE} --cppflags
OUTPUT_VARIABLE LLVM_CFLAGS
OUTPUT_STRIP_TRAILING_WHITESPACE
)
execute_process(
COMMAND ${LLVM_CONFIG_EXECUTABLE} --ldflags
OUTPUT_VARIABLE LLVM_LDFLAGS
OUTPUT_STRIP_TRAILING_WHITESPACE
)
execute_process(
COMMAND ${LLVM_CONFIG_EXECUTABLE} --libs
OUTPUT_VARIABLE LLVM_MODULE_LIBS
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if (LLVM_VERSION_NODOT VERSION_GREATER 34)
execute_process(
COMMAND ${LLVM_CONFIG_EXECUTABLE} --system-libs
OUTPUT_VARIABLE LLVM_SYSTEM_LIBS_ORIG
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if (LLVM_SYSTEM_LIBS_ORIG)
string(REGEX REPLACE " *\n" "" LLVM_SYSTEM_LIBS ${LLVM_SYSTEM_LIBS_ORIG})
endif (LLVM_SYSTEM_LIBS_ORIG)
endif (LLVM_VERSION_NODOT VERSION_GREATER 34)
macro(add_one_lib name)
FIND_LIBRARY(CLANG_LIB
NAMES ${name}
PATHS ${LLVM_LIBRARY_DIR} NO_DEFAULT_PATH)
set(CLANG_LIBRARIES ${CLANG_LIBRARIES} ${CLANG_LIB})
unset(CLANG_LIB CACHE)
endmacro()
#Assume clang lib path same as llvm lib path
add_one_lib("clangCodeGen")
add_one_lib("clangFrontend")
add_one_lib("clangSerialization")
add_one_lib("clangDriver")
add_one_lib("clangSema")
add_one_lib("clangStaticAnalyzerFrontend")
add_one_lib("clangStaticAnalyzerCheckers")
add_one_lib("clangStaticAnalyzerCore")
add_one_lib("clangAnalysis")
add_one_lib("clangEdit")
add_one_lib("clangAST")
add_one_lib("clangParse")
add_one_lib("clangSema")
add_one_lib("clangLex")
add_one_lib("clangBasic")

View File

@ -0,0 +1,91 @@
# - Find UDUNITS2
# Find the native UDUNITS2 includes and library
#
# UDUNITS2_INCLUDES - where to find udunits2.h
# UDUNITS2_LIBRARIES - libraries to link with
# UDUNITS2_FOUND - True if UDUNITS2 was found.
if (UDUNITS2_INCLUDES)
# Already in cache, be silent
set (UDUNITS2_FIND_QUIETLY TRUE)
endif (UDUNITS2_INCLUDES)
find_path (UDUNITS2_INCLUDES udunits2.h
HINTS "${UDUNITS2_ROOT}/include" "$ENV{UDUNITS2_ROOT}/include"
PATH_SUFFIXES "udunits2"
DOC "Path to udunits2.h")
# UDUNITS2 headers might be in .../include or .../include/udunits2.
# We try both.
if (${UDUNITS2_INCLUDES} MATCHES "udunits2/?$")
string(REGEX REPLACE "/include/udunits2/?$" "/lib"
UDUNITS2_LIB_HINT ${UDUNITS2_INCLUDES})
else()
string(REGEX REPLACE "/include/?$" "/lib"
UDUNITS2_LIB_HINT ${UDUNITS2_INCLUDES})
endif()
find_library (UDUNITS2_LIBRARIES
NAMES udunits2
HINTS ${UDUNITS2_LIB_HINT})
set(UDUNITS2_TEST_SRC "
#include <udunits2.h>
int main(int argc, char **argv) {
ut_system *s = ut_read_xml(NULL);
ut_free_system(s);
return 0;
}
")
if ((NOT UDUNITS2_LIBRARIES) OR (NOT UDUNITS2_INCLUDES))
message(STATUS "Trying to find UDUNITS-2 using LD_LIBRARY_PATH (we're desperate)...")
file(TO_CMAKE_PATH "$ENV{LD_LIBRARY_PATH}" LD_LIBRARY_PATH)
find_library(UDUNITS2_LIBRARIES
NAMES udunits2
HINTS ${LD_LIBRARY_PATH})
if (UDUNITS2_LIBRARIES)
get_filename_component(UDUNITS2_LIB_DIR ${UDUNITS2_LIBRARIES} PATH)
string(REGEX REPLACE "/lib/?$" "/include"
UDUNITS2_H_HINT ${UDUNITS2_LIB_DIR})
find_path (UDUNITS2_INCLUDES udunits2.h
HINTS ${UDUNITS2_H_HINT}
PATH_SUFFIXES "udunits2"
DOC "Path to udunits2.h")
endif()
endif()
include (CheckCSourceRuns)
set(CMAKE_REQUIRED_INCLUDES ${UDUNITS2_INCLUDES})
set(CMAKE_REQUIRED_LIBRARIES ${UDUNITS2_LIBRARIES})
check_c_source_runs("${UDUNITS2_TEST_SRC}" UDUNITS2_WORKS_WITHOUT_EXPAT)
if(${UDUNITS2_WORKS_WITHOUT_EXPAT})
message(STATUS "UDUNITS-2 does not require expat")
else()
find_package(EXPAT REQUIRED)
set(CMAKE_REQUIRED_INCLUDES ${UDUNITS2_INCLUDES} ${EXPAT_INCLUDE_DIRS})
set(CMAKE_REQUIRED_LIBRARIES ${UDUNITS2_LIBRARIES} ${EXPAT_LIBRARIES})
check_c_source_runs("${UDUNITS2_TEST_SRC}" UDUNITS2_WORKS_WITH_EXPAT)
if(NOT ${UDUNITS2_WORKS_WITH_EXPAT})
message(FATAL_ERROR "UDUNITS-2 does not seem to work with or without expat")
endif()
message(STATUS "UDUNITS-2 requires EXPAT")
set (UDUNITS2_LIBRARIES "${UDUNITS2_LIBRARIES};${EXPAT_LIBRARIES}" CACHE STRING "" FORCE)
endif()
# handle the QUIETLY and REQUIRED arguments and set UDUNITS2_FOUND to TRUE if
# all listed variables are TRUE
include (FindPackageHandleStandardArgs)
find_package_handle_standard_args (UDUNITS2 DEFAULT_MSG UDUNITS2_LIBRARIES UDUNITS2_INCLUDES)
mark_as_advanced (UDUNITS2_LIBRARIES UDUNITS2_INCLUDES)

428
Makefile
View File

@ -1,428 +0,0 @@
# Makefile to build Trick
# Make Targets
#-------------------------------------------------------------------------------
# default - Compile Trick-core and Trick Data-products Libraries and Applications.
# 'no_dp' - Compile Trick-core only.
# 'dp' - Compile Data-products only.
# 'java' - Compile Java GUI Applications
# 'javadoc' - Generate Java Documentation.
# 'doxygen' - Generate HTML User's Guide.
# 'test' - Run Unit-tests and Simulation Tests.
export TRICK_HOME = $(CURDIR)
# Include the build configuration information.
include $(TRICK_HOME)/share/trick/makefiles/Makefile.common
#-------------------------------------------------------------------------------
# Specify the contents of: libtrick.a
#-------------------------------------------------------------------------------
TRICK_LIB = $(TRICK_LIB_DIR)/libtrick.a
SIM_SERV_DIRS = \
${TRICK_HOME}/trick_source/sim_services/ExternalApplications \
${TRICK_HOME}/trick_source/sim_services/Clock \
${TRICK_HOME}/trick_source/sim_services/CheckPointAgent \
${TRICK_HOME}/trick_source/sim_services/CheckPointRestart \
${TRICK_HOME}/trick_source/sim_services/Collect \
${TRICK_HOME}/trick_source/sim_services/CommandLineArguments \
${TRICK_HOME}/trick_source/sim_services/DataRecord \
${TRICK_HOME}/trick_source/sim_services/DebugPause \
${TRICK_HOME}/trick_source/sim_services/DMTCP \
${TRICK_HOME}/trick_source/sim_services/EchoJobs \
${TRICK_HOME}/trick_source/sim_services/Environment \
${TRICK_HOME}/trick_source/sim_services/EventManager \
${TRICK_HOME}/trick_source/sim_services/Executive \
${TRICK_HOME}/trick_source/sim_services/FrameLog \
${TRICK_HOME}/trick_source/sim_services/JITInputFile \
${TRICK_HOME}/trick_source/sim_services/JSONVariableServer \
${TRICK_HOME}/trick_source/sim_services/Integrator \
${TRICK_HOME}/trick_source/sim_services/UnitTest \
${TRICK_HOME}/trick_source/sim_services/MasterSlave \
${TRICK_HOME}/trick_source/sim_services/MemoryManager \
${TRICK_HOME}/trick_source/sim_services/Message \
${TRICK_HOME}/trick_source/sim_services/MonteCarlo \
${TRICK_HOME}/trick_source/sim_services/RealtimeInjector \
${TRICK_HOME}/trick_source/sim_services/RealtimeSync \
${TRICK_HOME}/trick_source/sim_services/ScheduledJobQueue \
${TRICK_HOME}/trick_source/sim_services/Scheduler \
${TRICK_HOME}/trick_source/sim_services/Sie \
${TRICK_HOME}/trick_source/sim_services/SimObject \
${TRICK_HOME}/trick_source/sim_services/SimTime \
${TRICK_HOME}/trick_source/sim_services/ThreadBase \
${TRICK_HOME}/trick_source/sim_services/Timer \
${TRICK_HOME}/trick_source/sim_services/UdUnits \
${TRICK_HOME}/trick_source/sim_services/UnitsMap \
${TRICK_HOME}/trick_source/sim_services/VariableServer \
${TRICK_HOME}/trick_source/sim_services/Zeroconf \
${TRICK_HOME}/trick_source/sim_services/include \
${TRICK_HOME}/trick_source/sim_services/mains
ifeq ($(USE_ER7_UTILS), 0)
SIM_SERV_DIRS += ${TRICK_HOME}/trick_source/sim_services/Integrator/trick_algorithms
endif
SIM_SERV_OBJS = $(addsuffix /object_$(TRICK_HOST_CPU)/*.o ,$(SIM_SERV_DIRS))
SIM_SERV_OBJS := $(filter-out ${TRICK_HOME}/trick_source/sim_services/MemoryManager/%, $(SIM_SERV_OBJS))
ER7_UTILS_DIRS = \
${ER7_UTILS_HOME}/integration/abm4 \
${ER7_UTILS_HOME}/integration/beeman \
${ER7_UTILS_HOME}/integration/core \
${ER7_UTILS_HOME}/integration/euler \
${ER7_UTILS_HOME}/integration/mm4 \
${ER7_UTILS_HOME}/integration/nl2 \
${ER7_UTILS_HOME}/integration/position_verlet \
${ER7_UTILS_HOME}/integration/rk2_heun \
${ER7_UTILS_HOME}/integration/rk2_midpoint \
${ER7_UTILS_HOME}/integration/rk4 \
${ER7_UTILS_HOME}/integration/rkf45 \
${ER7_UTILS_HOME}/integration/rkf78 \
${ER7_UTILS_HOME}/integration/rkg4 \
${ER7_UTILS_HOME}/integration/rkn4 \
${ER7_UTILS_HOME}/integration/symplectic_euler \
${ER7_UTILS_HOME}/integration/velocity_verlet \
${ER7_UTILS_HOME}/interface \
${ER7_UTILS_HOME}/math \
${ER7_UTILS_HOME}/trick/integration
ifeq ($(USE_ER7_UTILS_CHECKPOINTHELPER), 1)
ER7_UTILS_DIRS += ${ER7_UTILS_HOME}/CheckpointHelper
endif
ER7_UTILS_OBJS = $(addsuffix /object_$(TRICK_HOST_CPU)/*.o ,$(ER7_UTILS_DIRS))
UTILS_DIRS := \
${TRICK_HOME}/trick_source/trick_utils/interpolator \
${TRICK_HOME}/trick_source/trick_utils/trick_adt \
${TRICK_HOME}/trick_source/trick_utils/comm \
${TRICK_HOME}/trick_source/trick_utils/shm \
${TRICK_HOME}/trick_source/trick_utils/math \
${TRICK_HOME}/trick_source/trick_utils/units \
${TRICK_HOME}/trick_source/trick_utils/unicode
UTILS_OBJS := $(addsuffix /object_$(TRICK_HOST_CPU)/*.o ,$(UTILS_DIRS))
# filter out the directories that make their own libraries
UTILS_OBJS := $(filter-out ${TRICK_HOME}/trick_source/trick_utils/comm/%, $(UTILS_OBJS))
UTILS_OBJS := $(filter-out ${TRICK_HOME}/trick_source/trick_utils/math/%, $(UTILS_OBJS))
UTILS_OBJS := $(filter-out ${TRICK_HOME}/trick_source/trick_utils/units/%, $(UTILS_OBJS))
#-------------------------------------------------------------------------------
# Specify the contents of: libtrick_pyip.a
# This library contains the SWIG generated interface-code between Trick and Python.
#-------------------------------------------------------------------------------
TRICK_SWIG_LIB = $(TRICK_LIB_DIR)/libtrick_pyip.a
SWIG_DIRS = \
${TRICK_HOME}/trick_source/sim_services/InputProcessor \
${TRICK_HOME}/trick_source/trick_swig
SWIG_OBJS = $(addsuffix /object_$(TRICK_HOST_CPU)/*.o ,$(SWIG_DIRS))
#-------------------------------------------------------------------------------
# Specify where to find units tests.
#-------------------------------------------------------------------------------
UNIT_TEST_DIRS := \
$(wildcard ${TRICK_HOME}/trick_source/sim_services/*/test) \
$(wildcard ${TRICK_HOME}/trick_source/trick_utils/*/test) \
${TRICK_HOME}/trick_source/data_products/DPX/test/unit_test
ifeq ($(USE_ER7_UTILS), 0)
UNIT_TEST_DIRS := $(filter-out %Integrator/test,$(UNIT_TEST_DIRS))
endif
# The name of the ICG executable indicates the operating system, and the machine
# hardware on which it is built. This allows pre-build ICG binaries to be
# distributed in the installation package. The reason for distributing pre-built
# ICG binaries is because the user's machine may not have the requisite clang
# libraries.
ICG_EXE := ${TRICK_HOME}/bin/trick-ICG
################################################################################
# RULES
################################################################################
# DEFAULT TARGET
# 1 Build Trick-core and Trick Data-products.
all: no_dp webserver dp
@ echo ; echo "Trick compilation complete:" ; date
ifeq ($(USE_JAVA), 1)
all: java
endif
#-------------------------------------------------------------------------------
# 1.1 Build Trick-core
no_dp: $(TRICK_LIB) $(TRICK_SWIG_LIB)
@ echo ; echo "Trick libs compiled:" ; date
# 1.1.1 Build libTrick.a
$(TRICK_LIB): $(SIM_SERV_DIRS) $(UTILS_DIRS) | $(TRICK_LIB_DIR)
ar crs $@ $(SIM_SERV_OBJS) $(UTILS_OBJS)
ifeq ($(USE_ER7_UTILS), 1)
ER7_UTILS_LIB = $(TRICK_LIB_DIR)/liber7_utils.a
no_dp: $(ER7_UTILS_LIB)
$(ER7_UTILS_LIB): $(ER7_UTILS_DIRS) | $(TRICK_LIB_DIR)
ar crs $@ $(ER7_UTILS_OBJS)
endif
# 1.1.1.1 Compile the objects in the specified sim_services directories.
.PHONY: $(SIM_SERV_DIRS)
$(SIM_SERV_DIRS): icg_sim_serv $(TRICK_LIB_DIR)
@ $(MAKE) -C $@ trick
# 1.1.1.2 Compile the objects in the specified utils directories.
.PHONY: $(UTILS_DIRS)
$(UTILS_DIRS): icg_sim_serv
@ $(MAKE) -C $@ trick
# 1.1.1.3 Compile the objects in the specified er7_utils directories.
.PHONY: $(ER7_UTILS_DIRS)
$(ER7_UTILS_DIRS): TRICK_CXXFLAGS += -Wno-unused-parameter
$(ER7_UTILS_DIRS): icg_sim_serv
@ $(MAKE) -C $@ trick
# 1.1.1.4 Generate interface code (using ICG) for the specified sim_services
# header files.
.PHONY: icg_sim_serv
icg_sim_serv: $(ICG_EXE) ${TRICK_HOME}/include/mongoose/mongoose.h
${ICG_EXE} -sim_services -m ${TRICK_CXXFLAGS} ${TRICK_SYSTEM_CXXFLAGS} ${TRICK_HOME}/include/trick/files_to_ICG.hh
# 1.1.1.4.1 Build the Interface Code Generator (ICG) executable.
$(ICG_EXE) :
$(MAKE) -C trick_source/codegen/Interface_Code_Gen
# 1.1.1.5 Create Trick Library directory.
$(TRICK_LIB_DIR):
@ mkdir $@
# 1.1.2 Build libTrick_pyip.a (Swig Lib)
$(TRICK_SWIG_LIB): $(SWIG_DIRS) | $(TRICK_LIB_DIR)
ar crs $@ $(SWIG_OBJS)
.PHONY: $(SWIG_DIRS)
$(SWIG_DIRS): icg_sim_serv $(TRICK_LIB_DIR)
@ $(MAKE) -C $@ trick
#-------------------------------------------------------------------------------
# 1.2 Build Trick's Data-products Applications.
.PHONY: dp
dp: ${TRICK_HOME}/trick_source/trick_utils/units
@ $(MAKE) -C ${TRICK_HOME}/trick_source/data_products
#-------------------------------------------------------------------------------
#
.PHONY: webserver
webserver: ${TRICK_LIB_DIR}/libmongoose.a ${TRICK_HOME}/include/mongoose/mongoose.h
@ $(MAKE) -C ${TRICK_HOME}/trick_source/web/HttpServer
#-------------------------------------------------------------------------------
TRICK_ICG_EXCLUDE += ${TRICK_HOME}/include/mongoose
mongoose.h:
curl --retry 4 -O https://raw.githubusercontent.com/cesanta/mongoose/6.16/mongoose.h
mongoose.c:
curl --retry 4 -O https://raw.githubusercontent.com/cesanta/mongoose/6.16/mongoose.c
mongoose.o: mongoose.h mongoose.c
$(CC) $(TRICK_CFLAGS) -c -o mongoose.o mongoose.c
rm mongoose.c
${TRICK_LIB_DIR}/libmongoose.a: mongoose.o ${TRICK_HOME}/include/mongoose/mongoose.h | $(TRICK_LIB_DIR)
ar crs $@ mongoose.o
rm mongoose.o
rm mongoose.h
@ echo ; echo "Mongoose library compiled:" ; date
${TRICK_HOME}/include/mongoose/mongoose.h: mongoose.h | ${TRICK_HOME}/include/mongoose
@ cp mongoose.h $@
${TRICK_HOME}/include/mongoose:
@ mkdir $@
#-------------------------------------------------------------------------------
# 1.3 Build Trick's Java Tools
java:
@ $(MAKE) -C ${TRICK_HOME}/trick_source/java
.PHONY: javadoc
javadoc:
@ $(MAKE) -C ${TRICK_HOME}/trick_source/java $@
#-------------------------------------------------------------------------------
# 1.4 This target builds the Trick Documentation.
.PHONY: doxygen
doxygen:
@ $(MAKE) -C $@
#-------------------------------------------------------------------------------
# 1.5 Some Trick source is auto-generated as part of the Trick's build process. When
# Trick is distributed to the user community, we can't be certain that everyone's
# machine will have the approriate versions of the code generations tool. So rather
# than just hope, we go ahead and pre-generate the necessary source files, and
# include those in the distribution package.
# This target pre-generates these source files, that are necessary for creating
# a distribution package.
premade:
@ $(MAKE) -C ${TRICK_HOME}/trick_source/sim_services/MemoryManager premade
@ $(MAKE) -C ${TRICK_HOME}/trick_source/sim_services/CheckPointAgent premade
@ $(MAKE) -C ${TRICK_HOME}/trick_source/java
################################################################################
# TESTING
################################################################################
# This target runs Trick's Unit-tests and simulation-tests.
test: unit_test sim_test
@ echo "All tests completed sucessfully"
.PHONY: $(UNIT_TEST_DIRS)
$(UNIT_TEST_DIRS):
@ $(MAKE) -C $@ test
unit_test: $(UNIT_TEST_DIRS)
sim_test:
@ $(MAKE) -C test
@ $(MAKE) -C trick_sims test
#requirements:
# @ $(MAKE) -C trick_test/requirements_docs install
################################################################################
# CLEAN Targets
################################################################################
clean: clean_sim_serv clean_utils clean_swig clean_dp clean_ICG clean_java
@/bin/rm -rf $(TRICK_BIN_DIR)
@/bin/rm -rf $(TRICK_LIB_DIR)
ifeq ($(USE_ER7_UTILS), 1)
clean: clean_er7_utils
endif
clean_sim_serv:
@for i in $(SIM_SERV_DIRS) ; do \
$(MAKE) -C $$i real_clean ; \
done
@ $(MAKE) -C ${TRICK_HOME}/trick_source/sim_services/mains real_clean
clean_er7_utils:
@for i in $(ER7_UTILS_DIRS) ; do \
$(MAKE) -C $$i real_clean ; \
done
clean_utils:
@for i in $(UTILS_DIRS) ; do \
$(MAKE) -C $$i real_clean ; \
done
clean_swig:
@for i in $(SWIG_DIRS) ; do \
$(MAKE) -C $$i real_clean ; \
done
clean_ICG :
$(MAKE) -C ${TRICK_HOME}/trick_source/codegen/Interface_Code_Gen clean
clean_unit_test:
@/bin/rm -rf ${TRICK_HOME}/trick_test/*.xml
@ for i in $(UNIT_TEST_DIRS) ; do \
$(MAKE) -C $$i clean ; \
done
clean_doxygen:
@ $(MAKE) -C ${TRICK_HOME}/doxygen clean
clean_dp:
@ $(MAKE) clean -C ${TRICK_HOME}/trick_source/data_products
clean_java:
@ $(MAKE) -C ${TRICK_HOME}/trick_source/java clean
# FIXME: Seems to me that the for loop below should be removed and that the
# 'clean' target in trick_sims/makefile should be doing this. --Penn
clean_test: clean_unit_test
-@ $(MAKE) -C trick_sims clean
-@ $(MAKE) -C test clean
clean_gui: clean_java
################################################################################
# INSTALL Targets
################################################################################
ER7_HEADERS := $(addprefix $(PREFIX)/include/, $(filter er7_utils/%, $(shell cd trick_source && find er7_utils -name \*.hh)))
${ER7_HEADERS} : ${PREFIX}/include/% : trick_source/%
@ mkdir -p ${@D}
install -m 0644 $? $@
install: ${ER7_HEADERS}
@if [ ! -d ${TRICK_LIB_DIR} ]; then \
make; \
fi
@if [ ${PREFIX} = "/usr/local" ]; then \
if [[ $EUID -ne 0 ]]; then \
echo -e "\n\e[31mInstalling Trick to /usr/local, the default installation location, requires super user privileges."; \
echo -e "Please log in as a super user to continue.\e[0m\n"; \
exit 1; \
fi; \
fi
cp -r bin include $(notdir ${TRICK_LIB_DIR}) libexec share ${PREFIX}
@echo -e "\n\e[32mTrick has been installed successfully to ${PREFIX}.\e[0m\n"
uninstall:
rm -f ${PREFIX}/bin/trick-CP
rm -f ${PREFIX}/bin/trick-ICG
rm -f ${PREFIX}/bin/trick-config
rm -f ${PREFIX}/bin/trick-dp
rm -f ${PREFIX}/bin/trick-dre
rm -f ${PREFIX}/bin/trick-gte
rm -f ${PREFIX}/bin/trick-gxplot
rm -f ${PREFIX}/bin/trick-jxplot
rm -f ${PREFIX}/bin/trick-killsim
rm -f ${PREFIX}/bin/trick-mm
rm -f ${PREFIX}/bin/trick-mtv
rm -f ${PREFIX}/bin/trick-qp
rm -f ${PREFIX}/bin/trick-sie
rm -f ${PREFIX}/bin/trick-simcontrol
rm -f ${PREFIX}/bin/trick-sniffer
rm -f ${PREFIX}/bin/trick-stripchart
rm -f ${PREFIX}/bin/trick-trk2ascii
rm -f ${PREFIX}/bin/trick-trk2csv
rm -f ${PREFIX}/bin/trick-tv
rm -f ${PREFIX}/bin/trick-version
rm -rf ${PREFIX}/include/trick
rm -rf ${PREFIX}/include/er7_utils
rm -f ${PREFIX}/$(notdir ${TRICK_LIB_DIR})/liber7_utils.a
rm -f ${PREFIX}/$(notdir ${TRICK_LIB_DIR})/libtrick.a
rm -f ${PREFIX}/$(notdir ${TRICK_LIB_DIR})/libtrick_comm.a
rm -f ${PREFIX}/$(notdir ${TRICK_LIB_DIR})/libtrick_math.a
rm -f ${PREFIX}/$(notdir ${TRICK_LIB_DIR})/libtrick_mm.a
rm -f ${PREFIX}/$(notdir ${TRICK_LIB_DIR})/libtrick_pyip.a
rm -f ${PREFIX}/$(notdir ${TRICK_LIB_DIR})/libtrick_units.a
rm -rf ${PREFIX}/libexec/trick
rm -rf ${PREFIX}/share/doc/trick
rm -f ${PREFIX}/share/man/man1/trick-CP.1
rm -f ${PREFIX}/share/man/man1/trick-ICG.1
rm -f ${PREFIX}/share/man/man1/trick-killsim.1
rm -rf ${PREFIX}/share/trick
################################################################################
# MISCELLANEOUS DEVELOPER UTILITY TARGETS #
################################################################################
# ICG all sim_services files (for testing and debugging ICG).
# The -f flag forces io_src files to be regenerated whether or not they need to be.
ICG: $(ICG_EXE) ${TRICK_HOME}/include/mongoose/mongoose.h
$(ICG_EXE) -f -s -m -n ${TRICK_CXXFLAGS} ${TRICK_SYSTEM_CXXFLAGS} ${TRICK_HOME}/include/trick/files_to_ICG.hh
# This builds a tricklib share library.
trick_lib: $(SIM_SERV_DIRS) $(UTILS_DIRS) | $(TRICK_LIB_DIR)
${TRICK_CXX} $(SHARED_LIB_OPT) -o ${TRICK_LIB_DIR}/libtrick.so $(SIM_SERV_OBJS) $(UTILS_OBJS)
# For NASA/JSC developers include optional rules
-include Makefile_jsc_dirs

9136
configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -65,7 +65,8 @@ export TRICK_PYTHON_PATH := $(TRICK_PYTHON_PATH)
export TRICK_GTE_EXT := $(TRICK_GTE_EXT)
export TRICK_HOST_CPU := $(shell TRICK_FORCE_32BIT=$(TRICK_FORCE_32BIT) $(TRICK_HOME)/bin/trick-gte TRICK_HOST_CPU)
export TRICK_EXEC_LINK_LIBS := ${PTHREAD_LIBS} $(PYTHON_LIB) $(UDUNITS_LDFLAGS) $(PLATFORM_LIBS) -lm -ldl
export TRICK_LIBS := ${RPATH} -L${TRICK_LIB_DIR} -ltrick -ltrick_pyip -ltrick_comm -ltrick_math -ltrick_units -ltrick_mm -ltrickHTTP -lmongoose
#export TRICK_LIBS := ${RPATH} -L${TRICK_LIB_DIR} -ltrick -ltrick_pyip -ltrick_comm -ltrick_math -ltrick_units -ltrick_mm -ltrickHTTP -lmongoose
export TRICK_LIBS := ${RPATH} -L${TRICK_LIB_DIR} -ltrick -lmongoose
export TRICK_SYSTEM_LDFLAGS := $(TRICK_SYSTEM_LDFLAGS)
export TRICK_SWIG_FLAGS := $(TRICK_SWIG_FLAGS)
export TRICK_SWIG_CFLAGS := $(TRICK_SWIG_CFLAGS)
@ -104,7 +105,7 @@ endif
ifeq ($(USE_ER7_UTILS), 1)
ER7_UTILS_HOME := $(TRICK_HOME)/trick_source/er7_utils
TRICK_SYSTEM_CXXFLAGS += -DUSE_ER7_UTILS_INTEGRATORS
TRICK_LIBS += -ler7_utils
#TRICK_LIBS += -ler7_utils
ifneq ($(wildcard ${ER7_UTILS_HOME}/CheckpointHelper),)
USE_ER7_UTILS_CHECKPOINTHELPER = 1
TRICK_SYSTEM_CXXFLAGS += -DUSE_ER7_UTILS_CHECKPOINTHELPER

View File

@ -36,12 +36,14 @@ void HeaderSearchDirs::AddCompilerBuiltInSearchDirs () {
// Add clang specific include directory first. Only required on linux systems. :(
// This is so that ICG will find clang friendly headers first. gcc headers cause
// all kinds of problems. On macs all headers are clang friendly.
#if 0
#if __linux
std::stringstream icg_dir ;
icg_dir << LLVM_HOME << "/lib/clang/" ;
icg_dir << LIBCLANG_MAJOR << "." << LIBCLANG_MINOR ;
#ifdef LIBCLANG_PATCHLEVEL
icg_dir << "." << LIBCLANG_PATCHLEVEL ;
#endif
#endif
icg_dir << "/include" ;
char * resolved_path = realpath(icg_dir.str().c_str(), NULL ) ;

View File

@ -274,7 +274,7 @@ void PrintAttributes::createMapFiles() {
std::string enum_map_function_name ;
if ( sim_services_flag ) {
map_dir = "trick_source/sim_services/include/io_src" ;
map_dir = output_dir ;
class_map_function_name = "populate_sim_services_class_map" ;
enum_map_function_name = "populate_sim_services_enum_map" ;
} else {

View File

@ -25,7 +25,7 @@
#include <ctype.h>
#include "trick/mm_error.h"
#include "trick/ChkPtParseContext.hh"
#include "input_parser.tab.h"
#include "input_parser.tab.hpp"
#include "trick/TrickConstant.hh"
#define YY_EXTRA_TYPE ChkPtParseContext*

View File

@ -22,7 +22,7 @@
#include "trick/var.h"
#include "trick/message_proto.h"
#include "trick/message_type.h"
#include "input_parser.tab.h"
#include "input_parser.tab.hpp"
using namespace std;

View File

@ -16,7 +16,7 @@
#include <ctype.h>
#include "trick/mm_error.h"
#include "trick/ADefParseContext.hh"
#include "adef_parser.tab.h"
#include "adef_parser.tab.hpp"
#pragma GCC diagnostic ignored "-Wunused-parameter"
#pragma GCC diagnostic ignored "-Wsign-compare"

View File

@ -19,7 +19,7 @@
#include "trick/value.h"
#include "trick/var.h"
#include "trick/ADefParseContext.hh"
#include "adef_parser.tab.h"
#include "adef_parser.tab.hpp"
#pragma GCC diagnostic ignored "-Wunused-parameter"

View File

@ -17,7 +17,7 @@
#include <ctype.h>
#include "trick/mm_error.h"
#include "trick/RefParseContext.hh"
#include "ref_parser.tab.h"
#include "ref_parser.tab.hpp"
#pragma GCC diagnostic ignored "-Wunused-parameter"
#pragma GCC diagnostic ignored "-Wsign-compare"

View File

@ -19,7 +19,7 @@
#include "trick/vval.h"
#include "trick/value.h"
#include "trick/var.h"
#include "ref_parser.tab.h"
#include "ref_parser.tab.hpp"
#pragma GCC diagnostic ignored "-Wunused-parameter"