1
1

Add a few more fortran compile flags, and enable dynamic build for f77 library now.

This commit was SVN r22720.
Этот коммит содержится в:
Shiqing Fan 2010-02-26 07:55:32 +00:00
родитель c6448587fe
Коммит e1c009932b
3 изменённых файлов: 48 добавлений и 8 удалений

Просмотреть файл

@ -19,9 +19,11 @@ include(CMakeFortranInformation)
IF(OMPI_WANT_F77_BINDINGS AND NOT F77_SETUP_DONE)
GET_FILENAME_COMPONENT(F77 ${CMAKE_Fortran_COMPILER} NAME)
GET_FILENAME_COMPONENT(F77_NAME ${CMAKE_Fortran_COMPILER} NAME)
GET_FILENAME_COMPONENT(F77_PATH ${CMAKE_Fortran_COMPILER} PATH)
SET(F77 ${F77_NAME} CACHE INTERNAL "Name of the fortran compiler.")
# Default compiler settings.
IF(${F77} STREQUAL "ifort.exe")
#settings for Intel Fortran
@ -31,6 +33,10 @@ IF(OMPI_WANT_F77_BINDINGS AND NOT F77_SETUP_DONE)
"Fortran compiler option for setting object file name.")
SET(F77_OUTPUT_EXE "/Fe" CACHE INTERNAL
"Fortran compiler option for setting executable file name.")
SET(F77_DYNAMIC_FLAG_DEBUG "/MDd" CACHE INTERNAL
"Compile flag for using dynamically-loaded, multithread C runtime (Debug).")
SET(F77_DYNAMIC_FLAG "/MD" CACHE INTERNAL
"Compile flag for using dynamically-loaded, multithread C runtime.")
IF(CMAKE_CL_64)
SET(F77_LIB_PATH "$ENV{IFORT_COMPILER11}/lib/intel64")

Просмотреть файл

@ -53,11 +53,21 @@ ELSE(OMPI_ENABLE_MPI_PROFILING)
ENDIF(OMPI_ENABLE_MPI_PROFILING)
ADD_LIBRARY(libmpi_f77 STATIC ${OMPI_F77_FILES} ${OMPI_F77_HEADER_FILES})
SET_TARGET_PROPERTIES(libmpi_f77 PROPERTIES LINKER_LANGUAGE CXX)
ADD_LIBRARY(libmpi_f77 ${OMPI_F77_FILES} ${OMPI_F77_HEADER_FILES})
TARGET_LINK_LIBRARIES(libmpi_f77 libmpi)
IF(BUILD_SHARED_LIBS)
ADD_DEFINITIONS(-D_USRDLL -DOMPI_PROFILE_LAYER=0 -DOMPI_COMPILING_F77_WRAPPERS=1 -DOMPI_EXPORTS)
ELSE(BUILD_SHARED_LIBS)
ADD_DEFINITIONS(-D_LIB -DOMPI_PROFILE_LAYER=0 -DOMPI_COMPILING_F77_WRAPPERS=1)
ENDIF(BUILD_SHARED_LIBS)
INSTALL(TARGETS libmpi_f77
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)
IF (OMPI_DEBUG_BUILD)
INSTALL(FILES ${OpenMPI_BINARY_DIR}/Debug/libmpi_f77${CMAKE_DEBUG_POSTFIX}.pdb
DESTINATION bin)
ENDIF (OMPI_DEBUG_BUILD)

Просмотреть файл

@ -42,10 +42,10 @@ ENDMACRO()
# select debug or release libraries at configure time
IF(OMPI_DEBUG_BUILD)
SET(OMPI_WRAPPER_EXTRA_LIBS
SET(OMPI_WRAPPER_BASE_LIBS
"libmpid.lib libopen-pald.lib libopen-rted.lib advapi32.lib Ws2_32.lib shlwapi.lib")
ELSE(OMPI_DEBUG_BUILD)
SET(OMPI_WRAPPER_EXTRA_LIBS
SET(OMPI_WRAPPER_BASE_LIBS
"libmpi.lib libopen-pal.lib libopen-rte.lib advapi32.lib Ws2_32.lib shlwapi.lib")
ENDIF(OMPI_DEBUG_BUILD)
@ -60,21 +60,27 @@ ELSE(BUILD_SHARED_LIBS)
ENDIF(OMPI_DEBUG_BUILD)
ENDIF(BUILD_SHARED_LIBS)
SET(OMPI_WRAPPER_EXTRA_LIBS ${OMPI_WRAPPER_BASE_LIBS})
CONFIGURE_WRAPPER_DATA_FILE(mpicc)
UNSET(OMPI_WRAPPER_EXTRA_LIBS)
IF(OMPI_WANT_CXX_BINDINGS)
IF(BUILD_SHARED_LIBS)
SET(OMPI_WRAPPER_EXTRA_CXXFLAGS
"/TP /EHsc /D \"OMPI_IMPORTS\" /D \"OPAL_IMPORTS\" /D \"ORTE_IMPORTS\"")
ELSE(BUILD_SHARED_LIBS)
SET(OMPI_WRAPPER_EXTRA_CXXFLAGS "/TP /EHsc")
IF(OMPI_DEBUG_BUILD)
SET(OMPI_WRAPPER_EXTRA_CXXFLAGS "/TP /EHsc /MDd")
ELSE(OMPI_DEBUG_BUILD)
SET(OMPI_WRAPPER_EXTRA_CXXFLAGS "/TP /EHsc /MD")
ENDIF(OMPI_DEBUG_BUILD)
ENDIF(BUILD_SHARED_LIBS)
# select debug or release libraries at configure time
IF(OMPI_DEBUG_BUILD)
SET(OMPI_WRAPPER_CXX_LIB "libmpi_cxxd.lib")
SET(OMPI_WRAPPER_CXX_LIB "libmpi_cxxd.lib" ${OMPI_WRAPPER_BASE_LIBS})
ELSE(OMPI_DEBUG_BUILD)
SET(OMPI_WRAPPER_CXX_LIB "libmpi_cxx.lib")
SET(OMPI_WRAPPER_CXX_LIB "libmpi_cxx.lib" ${OMPI_WRAPPER_BASE_LIBS})
ENDIF(OMPI_DEBUG_BUILD)
CONFIGURE_WRAPPER_DATA_FILE(mpic++)
@ -82,7 +88,25 @@ IF(OMPI_WANT_CXX_BINDINGS)
ENDIF(OMPI_WANT_CXX_BINDINGS)
IF(OMPI_WANT_F77_BINDINGS)
IF(BUILD_SHARED_LIBS)
SET(OMPI_WRAPPER_EXTRA_FFLAGS
"/TP /EHsc /D \"OMPI_IMPORTS\" /D \"OPAL_IMPORTS\" /D \"ORTE_IMPORTS\"")
ELSE(BUILD_SHARED_LIBS)
IF(OMPI_DEBUG_BUILD)
SET(OMPI_WRAPPER_EXTRA_FFLAGS "${F77_DYNAMIC_FLAG_DEBUG}")
ELSE(OMPI_DEBUG_BUILD)
SET(OMPI_WRAPPER_EXTRA_FFLAGS "${F77_DYNAMIC_FLAG}")
ENDIF(OMPI_DEBUG_BUILD)
ENDIF(BUILD_SHARED_LIBS)
# select debug or release libraries at configure time
IF(OMPI_DEBUG_BUILD)
SET(OMPI_WRAPPER_EXTRA_LIBS "libmpi_f77d.lib" ${OMPI_WRAPPER_BASE_LIBS})
ELSE(OMPI_DEBUG_BUILD)
SET(OMPI_WRAPPER_EXTRA_LIBS "libmpi_f77.lib" ${OMPI_WRAPPER_BASE_LIBS})
ENDIF(OMPI_DEBUG_BUILD)
CONFIGURE_WRAPPER_DATA_FILE(mpif77)
UNSET(OMPI_WRAPPER_EXTRA_LIBS)
ENDIF(OMPI_WANT_F77_BINDINGS)
#IF(OMPI_WANT_F90_BINDINGS)