...
 
Commits (723)
*.patch whitespace=-blank-at-eol,-space-before-tab -text
*.patch whitespace=-blank-at-eol,-space-before-tab,-blank-at-eof -text -crlf
cmake_minimum_required(VERSION 2.8.11)
if (POLICY CMP0025)
# Clang and AppleClang are now unique compiler ids
cmake_policy(SET CMP0025 NEW)
endif ()
cmake_minimum_required(VERSION 3.11.2)
project(cmb-superbuild)
list(INSERT CMAKE_MODULE_PATH 0
"${CMAKE_CURRENT_LIST_DIR}/cmake")
macro (superbuild_setup_variables)
include(SuperbuildVersionMacros)
superbuild_set_version_variables(cmb "4.0.0" "cmb-version.cmake")
if (cmb_SOURCE_SELECTION STREQUAL "git")
# Assuming master; just use the latest version, but let the user set their
# own version in case it is actually a branch from some other version.
set(CMB_VERSION_DEFAULT "<FETCH_FROM_GIT>"
CACHE STRING "The default version of CMB to use if it cannot be detected")
if (CMB_VERSION_DEFAULT STREQUAL "<FETCH_FROM_GIT>")
include(cmbVersion)
set(CMB_VERSION_DEFAULT "${cmb_version_major}.${cmb_version_minor}.${cmb_version_patch}")
endif ()
mark_as_advanced(CMB_VERSION_DEFAULT)
set(cmb_default_version "${CMB_VERSION_DEFAULT}")
elseif (cmb_SOURCE_SELECTION STREQUAL "source")
# If it is a git repo, we'll get it that way. Otherwise, we will look at the
# `version.txt` in the checkout.
set(cmb_default_version "")
else ()
# The selection is the version number; use it.
set(cmb_default_version "${cmb_SOURCE_SELECTION}")
endif()
superbuild_set_version_variables(cmb "${cmb_default_version}" "cmb-version.cmake" "version.txt")
set(cmb_version "${cmb_version_major}.${cmb_version_minor}")
superbuild_set_version_variables(paraview "5.1.2" "paraview-version.cmake")
if (smtk_SOURCE_SELECTION STREQUAL "git")
# Assuming master; just use the latest version, but let the user set their
# own version in case it is actually a branch from some other version.
set(SMTK_VERSION_DEFAULT "<FETCH_FROM_GIT>"
CACHE STRING "The default version of SMTK to use if it cannot be detected")
if (SMTK_VERSION_DEFAULT STREQUAL "<FETCH_FROM_GIT>")
include(smtkVersion)
set(SMTK_VERSION_DEFAULT "${smtk_version_major}.${smtk_version_minor}.${smtk_version_patch}")
endif ()
mark_as_advanced(SMTK_VERSION_DEFAULT)
set(smtk_default_version "${SMTK_VERSION_DEFAULT}")
elseif (smtk_SOURCE_SELECTION STREQUAL "source")
# If it is a git repo, we'll get it that way. Otherwise, we will look at the
# `version.txt` in the checkout.
set(smtk_default_version "")
else ()
# The selection is the version number; use it.
set(smtk_default_version "${smtk_SOURCE_SELECTION}")
endif()
superbuild_set_version_variables(smtk "${smtk_default_version}" "smtk-version.cmake" "version.txt")
set(smtk_version "${smtk_version_major}.${smtk_version_minor}")
superbuild_set_version_variables(paraview "5.6.0" "paraview-version.cmake" "version.txt")
set(paraview_version "${paraview_version_major}.${paraview_version_minor}")
superbuild_set_version_variables(vtk "8.1.0" "vtk-version.cmake")
set(vtk_version "${vtk_version_major}.${vtk_version_minor}")
endmacro ()
function (superbuild_find_projects var)
include(CMBSuperbuildMacros)
set(projects
boost
bzip2
cgm
cmb
cmbusersguide
cmbworkflows
cumulus
cxx11
eigen
fortran
freetype
ftgl
gdal
hdf5
kml
lapack
matplotlib
moab
netcdf
nlohmannjson
numpy
oce
opencv
opencvcontrib
paraview
paraviewweb
paraviewwebvisualizer
paraviewweblightviz
pegtl
png
protobuf
pyarc
pybind11
python
pythondiskcache
pythongirderclient
pythonrequests
pythonrequeststoolbelt
pythonsetuptools
pythonsix
qt
qt4
qt5
remus
shiboken
rggsession
smtk
smtkusersguide
szip
vtk
vtkonly
vxl
zeromq
zlib)
......@@ -53,28 +114,55 @@ function (superbuild_find_projects var)
if (NOT WIN32)
list(APPEND projects
fontconfig
libxml2)
gperf
libxml2
meshkit)
endif ()
if (WIN32)
list(APPEND projects
ftjam
pythonsetuptools)
pythonsetuptools
pywin32)
endif ()
if (NOT DEVELOPER_MODE_smtk)
list(APPEND projects
smtkprojectmanager
smtkresourcemanagerstate)
endif ()
# For now it's a convenient option to control smtk documentation
option(ENABLE_DOCUMENTATION "Enable smtk documentation" ON)
option(USE_NONFREE_COMPONENTS "Enable the non-free parts of the superbuild" OFF)
mark_as_advanced(USE_NONFREE_COMPONENTS)
if (USE_NONFREE_COMPONENTS)
list(APPEND projects
capstone
cubit
triangle)
endif ()
# Capstone and Cubit are closed-source programs to which Kitware developers
# have access. We provide logic for situating these programs into our
# superbuild for development purposes only. These packages are not bundled or
# distributed.
set(KW_SHARE "" CACHE PATH "Location of Kitware-internal share directory.")
if (NOT (capstone_enabled OR cubit_enabled))
mark_as_advanced(KW_SHARE)
endif ()
set("${var}"
${projects}
PARENT_SCOPE)
endfunction ()
function (superbuild_sanity_check)
if (vtkonly_enabled AND paraview_enabled)
message(FATAL_ERROR
"Only one of the following projects should be enabled: vtkonly, paraview.")
endif ()
if (NOT smtk_enabled AND NOT cmb_enabled)
message(FATAL_ERROR
"At least one of the following projects must be enabled: cmb, smtk.")
......@@ -97,18 +185,38 @@ function (superbuild_add_packaging)
TGZ)
endif ()
if (USE_SYSTEM_qt4)
if (qt5_built_by_superbuild)
set(Qt5_DIR "${superbuild_install_location}/lib/cmake/Qt5")
endif ()
if (USE_SYSTEM_qt5)
list(APPEND superbuild_export_variables
QT_LIBRARY_DIR)
Qt5_DIR)
find_package(Qt5 QUIET REQUIRED COMPONENTS Core)
set(qt5_version "${Qt5Core_VERSION_MAJOR}.${Qt5Core_VERSION_MINOR}")
else ()
set(qt5_version "${qt5_SOURCE_SELECTION}")
endif ()
list(APPEND superbuild_export_variables
qt5_version)
list(APPEND superbuild_export_variables
BOOST_ADDITIONAL_LIBRARIES)
include(cmb.suffix)
list(APPEND superbuild_export_variables
CMB_PACKAGE_SUFFIX)
if (cmb_enabled)
set(CMB_PACKAGE_FILE_NAME ""
CACHE STRING "If set, overrides the generated filename for the package")
list(APPEND superbuild_export_variables
CMB_PACKAGE_FILE_NAME)
endif ()
foreach (generator IN LISTS generators)
superbuild_add_extra_package_test(modelbuilder "${generator}"
LABELS "CMB"
TIMEOUT 1200)
superbuild_add_extra_package_test(hydrology "${generator}"
LABELS "CMB"
TIMEOUT 1200)
TIMEOUT 6400)
endforeach ()
endfunction ()
......@@ -126,13 +234,39 @@ function (superbuild_add_tests)
superbuild_test_projects cmb smtk)
endfunction ()
set(CMB_TEST_DATA_ROOT "" CACHE PATH "Location of CMB's testing data")
# Default Qt5 to ON.
set(_superbuild_default_qt5 ON)
set(qt5_skip_modules
qtconnectivity
qtgamepad
qtlocation
qtmultimedia
qtsensors
qtserialport
qtwayland
qtwebchannel
qtwebengine
qtwebsockets)
set(BOOST_ADDITIONAL_LIBRARIES "" CACHE STRING "Additional boost libraries to build and package")
mark_as_advanced(BOOST_ADDITIONAL_LIBRARIES)
set(boost_minimum_version 1.64.0)
set(boost_libraries
atomic
chrono
date_time
filesystem
log
regex
serialization
system
thread)
thread
timer
${BOOST_ADDITIONAL_LIBRARIES})
configure_file(
"${CMAKE_CURRENT_LIST_DIR}/cmake/CTestCustom.cmake.in"
......@@ -143,9 +277,27 @@ if (__BUILDBOT_INSTALL_LOCATION)
set(superbuild_install_location "${__BUILDBOT_INSTALL_LOCATION}")
endif ()
set(suppress_projects
boost
freetype
ftgl
gdal
hdf5
netcdf
numpy
png
pybind11
szip
vxl
zeromq
zlib)
foreach (suppress_project IN LISTS suppress_projects)
set("_superbuild_suppress_${suppress_project}_output" ON)
endforeach ()
list(APPEND superbuild_version_files
"${CMAKE_CURRENT_LIST_DIR}/versions.cmake")
list(APPEND extra_ctest_custom_files
list(APPEND superbuild_ctest_custom_files
"${CMAKE_CURRENT_BINARY_DIR}/CTestCustom-cmb.cmake")
list(APPEND superbuild_project_roots
"${CMAKE_CURRENT_LIST_DIR}/projects")
......
......@@ -2,54 +2,86 @@
# CMB SuperBuild
Though CMB is relatively simple to build itself, it does depend on a several libraries including Qt, ParaView/VTK, MOAB, etc.. To help make the process of building CMB and the libraries it depends on easier we have create a SuperBuild CMake Project.
# What You Need To Start
Though CMB is relatively simple to build itself, it does depend on a several
libraries including Qt, ParaView/VTK, Boost, MOAB, etc.. To help make the process of
building CMB and the libraries it depends on easier we have created a
SuperBuild CMake Project.
* CMake version 3.5 or greater
* ninja or make - note that for Windows build you will need to have ninja installed
# Requirements
* CMake version 3.9 or greater with SSL support (Binaries from `cmake.org`
have this already; custom built CMake binaries need to use
`CMAKE_USE_SYSTEM_CURL=ON`).
* ninja or make - (the Windows build requires ninja)
* Checkout of the [CMB SuperBuild Git Repo](https://gitlab.kitware.com/cmb/cmb-superbuild)
* Qt Related Info
* Have Qt 5.10 or greater installed on the system and make sure you set `USE_SYSTEM_qt5` on
* In CMake: `QT5_DIR` needs to be set to [Qt installation dir for your compiler]/lib/cmake/Qt5
* C++ Compiler
* XCode 7.1 or greater
* GCC 4.8
* Visual Studio 2013 64 bit
* XCode 9.x or greater
* GCC 4.9 or greater
* Clang 3.4 or greater
* Microsoft Visual C++ 2015 / Build Tools 14.0.25123.0 (and possibly later)
* Ubuntu 16.04 specific
* sudo apt-get install m4
* sudo apt-get install build-essential
* turn on `USE_SYSTEM_qt5` in CMake(Recommend)
* sudo apt-get install qt5-qmake libqt5-dev qt5-dev-tools (if using system qt)
* sudo apt-get install libxt-dev
Note that the build process will also download additional tar balls and checkout additional git repos so you will also need an internet connection.
Note that the build process will also download additional tarballs and
checkout additional git repos so you will also need an internet connection.
# Building CMB using the SuperBuild Process
## Prepping the Git Repo
1. Clone the CMB SuperBuild Repo using git clone https://gitlab.kitware.com/cmb/cmb-superbuild.git
2. cd into the git repo and do the following commands:
* git submodule init
* git submodule update
1. Clone the CMB SuperBuild Repo using `git clone https://gitlab.kitware.com/cmb/cmb-superbuild.git`
2. Using a shell in the cloned repository check out the latest stable release `git checkout release`
3. Using a shell in the cloned repository, run `git submodule update --init`
## Configuring the Build Using CMake
There are two possible methods you can use: CMake GUI or the ccmake command line tool
### Using the CMake GUI
![](images/CmakeScreenShot.png)
1. Select the Source directory that contains the CMake SuperBuild Git Repo
2. Select the build directory to be used to hold the build. Note that due to a bug in git this should not be under and git repository including the Source Directory.
2. Select the build directory to be used to hold the build. Note that due to
a bug in git this should not be under and git repository including the
Source Directory.
### Using ccmake commandline tool
1. Make the directory you want to build in
1. Make the directory you want to build in
2. cd into that directory
3. If you are building with ninja (as oppose to make) run ccmake -G Ninja PathToYourSuperBuildRepo, else omit the -G Ninja
3. If you are building with ninja (as oppose to make) run
`ccmake -G Ninja PathToYourSuperBuildRepo`, else omit the `-G Ninja`
### Configuring the CMB SuperBuild
* By default the build will be in Release Mode (not Debug) - this can be changed using an advance option
* The process will also build Qt 4.8.6 by default. If you already have a Qt installed (4.8.*) then you can do the following:
* Turn USE\_SYSTEM\_qt4 on
* By default the build will be in Release Mode (not Debug) - this can be
changed using the `CMAKE_BUILD_TYPE_cmb` variable. Similar variables exist
for other projects depending on the setup including `paraview` and `smtk`.
* The process will also build Qt 5.9.1 by default. If you already have a Qt
installed (5.9 or newer) then you can do the following:
* Turn `USE_SYSTEM_qt5` on
* Tell CMake to configure
* Check to see if the QT\_QMAKE\_EXECUTABLE variable is set to the appropriate qmake - if is not then set it correctly
* NOTE! Qt built on Mac OSX 10.9 and greater needs several patches to work properly. These patches are automatically applied when Qt is built using the superbuild and it is the recommended way to build Qt. You will also need to make sure you have a 10.9 SDK on your OSX platform
* tell CMake to configure
* tell CMake to generate
* Check to see if the `Qt5_DIR` variable is set to the appropriate location -
if is not then set it correctly
* On Windows, the directory to the Qt5 libraries must be in the `PATH`
environment variable in order to build.
* Tell CMake to configure
* Tell CMake to generate
## Building the CMB SuperBuild
* cd into the build directory
* run make or ninja - depending on which build system you previously selected.
## Building a CMB Installable Package
* cd into the build directory
* run ctest -R cpack
\ No newline at end of file
* run ctest -R cpack
macro (cmb_superbuild_add_pdf name outname)
superbuild_add_project("${name}"
DOWNLOAD_NO_EXTRACT 1
DEFAULT_ON
CONFIGURE_COMMAND
""
BUILD_COMMAND
""
INSTALL_COMMAND
"${CMAKE_COMMAND}" -E copy_if_different
<DOWNLOADED_FILE>
"<INSTALL_DIR>/doc/${outname}")
if (${name}_enabled)
set("${name}_pdf" "${superbuild_install_location}/doc/${outname}")
endif ()
endmacro ()
set_property(GLOBAL
PROPERTY
cmb_superbuild_lfs_steps
lfs-init
lfs-download
lfs-checkout)
macro (cmb_superbuild_add_lfs_steps _name)
superbuild_project_add_step(lfs-init
COMMAND "${GIT_EXECUTABLE}"
lfs
install
--local
DEPENDEES download
DEPENDERS configure
DEPENDS ${ARGN}
COMMENT "Enabling LFS for ${_name}"
WORKING_DIRECTORY <SOURCE_DIR>)
superbuild_project_add_step(lfs-download
COMMAND "${GIT_EXECUTABLE}"
lfs
fetch
DEPENDEES lfs-init
DEPENDERS configure
COMMENT "Downloading LFS data for ${_name}"
WORKING_DIRECTORY <SOURCE_DIR>)
superbuild_project_add_step(lfs-checkout
COMMAND "${GIT_EXECUTABLE}"
lfs
checkout
DEPENDEES lfs-download
DEPENDERS configure
COMMENT "Checking out LFS data for ${_name}"
WORKING_DIRECTORY <SOURCE_DIR>)
endmacro ()
......@@ -10,6 +10,12 @@ set(CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS 1000)
##------------------------------------------------------------------------------
## Regular expression for warning exception during build process
list(APPEND CTEST_CUSTOM_WARNING_EXCEPTION
# Ignore all warnings.
".*"
"[w|W]arning"
"WARNING"
"CMake Warning"
"-jN forced in submake: disabling jobserver mode"
"thirdparty/qt5json"
"/usr/bin/libtool"
......@@ -29,10 +35,6 @@ list(APPEND CTEST_CUSTOM_WARNING_EXCEPTION
"build/.*/doc"
#Shiboken
"CMakeFiles/shiboken.dir"
"libapiextractor.a"
# Boost
"clang: warning: optimization flag '-finline-functions' is not supported"
"clang: warning: argument unused during compilation: '-finline-functions'"
......@@ -77,7 +79,6 @@ list(APPEND CTEST_CUSTOM_WARNING_EXCEPTION
"qmutex.h.* : warning C4512:"
"vil3d_dicom.obj : warning LNK4221:"
"install\\\\include"
"shiboken\\\\build"
"smtk\\\\src\\\\smtk\\\\ThirdParty"
"warning C4996: 'strcpy'"
"warning C4996: 'scanf'"
......@@ -117,17 +118,15 @@ ignore_project_warnings(boost)
ignore_project_warnings(gdal)
ignore_project_warnings(hdf5)
ignore_project_errors(hdf5)
ignore_project_warnings(kml)
ignore_project_warnings(python)
ignore_project_warnings(qt4)
ignore_project_warnings(shiboken)
ignore_project_warnings(qt5)
ignore_project_warnings(szip)
ignore_project_warnings(vxl)
ignore_project_warnings(zeromq)
if (WIN32)
set(ENV{PATH}
"$ENV{PATH};${CMAKE_CURRENT_LIST_DIR}/install/bin;${CMAKE_CURRENT_LIST_DIR}/install/lib")
"$ENV{PATH};${CMAKE_CURRENT_LIST_DIR}/install/bin;${CMAKE_CURRENT_LIST_DIR}/install/lib;${CMAKE_CURRENT_LIST_DIR}/install/x64/vc14/bin")
endif ()
# Regular expression for error exceptions during build process
......
# Download SMTK's master branch version.txt
file(DOWNLOAD https://gitlab.kitware.com/cmb/cmb/raw/master/version.txt
${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/cmbVersion.txt STATUS status)
list(GET status 0 error_code)
if (error_code)
message(FATAL_ERROR "Could not access the version file for CMB")
endif ()
file(STRINGS ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/cmbVersion.txt version_string )
string(REGEX MATCH "([0-9]+)\\.([0-9]+)\\.([0-9]+)[-]*(.*)"
version_matches "${version_string}")
set(cmb_version_major ${CMAKE_MATCH_1})
set(cmb_version_minor ${CMAKE_MATCH_2})
set(cmb_version_patch "${CMAKE_MATCH_3}")
# Do we just have a patch version or are there extra stuff?
if (CMAKE_MATCH_4)
set(cmb_version_patch "${CMAKE_MATCH_3}-${CMAKE_MATCH_4}")
endif()
set(cmb_version "${cmb_version_major}.${cmb_version_minor}")
# Download SMTK's master branch version.txt
file(DOWNLOAD https://gitlab.kitware.com/cmb/smtk/raw/master/version.txt
${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/smtkVersion.txt STATUS status)
list(GET status 0 error_code)
if (error_code)
message(FATAL_ERROR "Could not access the version file for SMTK")
endif ()
file(STRINGS ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/smtkVersion.txt version_string )
string(REGEX MATCH "([0-9]+)\\.([0-9]+)\\.([0-9]+)[-]*(.*)"
version_matches "${version_string}")
set(smtk_version_major ${CMAKE_MATCH_1})
set(smtk_version_minor ${CMAKE_MATCH_2})
set(smtk_version "${smtk_version_major}.${smtk_version_minor}")
if (CMAKE_MATCH_3)
set(smtk_version_patch ${CMAKE_MATCH_3})
set(smtk_version "${smtk_version}.${smtk_version_patch}")
else()
set(smtk_version_patch 0)
endif()
# To be thorough, we should split the label into "-prerelease+metadata"
# and, if prerelease is specified, use it in determining precedence
# according to semantic versioning rules at http://semver.org/ .
# For now, just make the information available as a label:
if (CMAKE_MATCH_4)
set(smtk_version_label "${CMAKE_MATCH_4}")
endif()
cmake_minimum_required(VERSION 3.6.1)
project(meshkit-superbuild)
function (superbuild_find_projects var)
set(projects
cgm
cxx11
eigen
hdf5
meshkit
moab
netcdf
szip
zlib)
set("${var}"
${projects}
PARENT_SCOPE)
endfunction ()
function (superbuild_sanity_check)
if (NOT meshkit_enabled)
message(FATAL_ERROR "Meshkit is disabled...")
endif ()
endfunction ()
list(APPEND superbuild_version_files
"${CMAKE_CURRENT_LIST_DIR}/versions.cmake"
"${CMAKE_CURRENT_LIST_DIR}/../versions.cmake")
list(APPEND superbuild_project_roots
"${CMAKE_CURRENT_LIST_DIR}/projects"
"${CMAKE_CURRENT_LIST_DIR}/../projects")
# set the default arguments used for "git clone"
set(_git_clone_arguments_default --progress)
# set the default for meshkit to be enabled for this project
set(_superbuild_default_meshkit ON)
if (NOT EXISTS "${CMAKE_CURRENT_LIST_DIR}/../superbuild/CMakeLists.txt")
message(FATAL_ERROR "It appears as though the superbuild infrastructure "
"is missing; did you forget to do `git submodule init` "
"and `git submodule update`?")
endif ()
add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/../superbuild" "${CMAKE_CURRENT_BINARY_DIR}/superbuild")
superbuild_add_project(cgm
DEPENDS oce
DEPENDS_OPTIONAL cxx11
CMAKE_ARGS
-DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS}
# Set link path on linux
-DCMAKE_INSTALL_RPATH:PATH=$ORIGIN/../lib
# Set link path on OSX
-DCMAKE_INSTALL_NAME_DIR:PATH=<INSTALL_DIR>/lib
-DCGM_USE_CUBIT:BOOL=OFF
-DCGM_OCC:BOOL=ON
-DCGM_OCC:BOOL=OFF
-DUSE_MPI:BOOL=OFF)
superbuild_add_extra_cmake_args(
"-DCGM_DIR=<INSTALL_DIR>/lib/cmake/CGM")
-DCGM_DIR:PATH=<INSTALL_DIR>/lib/cmake/CGM)
superbuild_add_project(meshkit
DEPENDS moab cgm
CMAKE_ARGS
# Set link path on linux
-DCMAKE_INSTALL_RPATH:PATH=$ORIGIN/../lib
-DCGM_DIR:PATH=<INSTALL_DIR>/lib/cmake/CGM
-DBUILD_ALGS:BOOL=ON
-DBUILD_SRC:BOOL=ON
-DBUILD_UTILS:BOOL=ON
-DBUILD_RGG:BOOL=ON
-DWITH_MPI:BOOL=OFF
-DENABLE_TESTING:BOOL=OFF)
# MOAB has public headers which include Eigen, but it doesn't add the include
# flags properly.
superbuild_append_flags(cxx_flags "-I<INSTALL_DIR>/include/eigen3" PROJECT_ONLY)
superbuild_add_project(moab
DEPENDS cgm eigen netcdf zlib
CMAKE_ARGS
# Set link path on OSX
-DCMAKE_INSTALL_NAME_DIR:PATH=<INSTALL_DIR>/lib
-DCMAKE_INSTALL_LIBDIR:STRING=lib
-DENABLE_IMESH:BOOL=ON
-DENABLE_CGM:BOOL=ON
-DENABLE_NETCDF:BOOL=ON
-DENABLE_IREL:BOOL=ON
-DENABLE_HDF5:BOOL=OFF
-DENABLE_PNETCDF:BOOL=OFF
-DENABLE_MPI:BOOL=OFF
-DENABLE_TESTING:BOOL=OFF
-DNETCDF_ROOT:PATH=<INSTALL_DIR>)
superbuild_apply_patch(moab disable-fortran
"Disable use of fortran")
# By default, linux and os x cmake looks in <INSTALL_DIR>/lib/cmake for
# things. On windows, it does not. So, we set MOAB_DIR to point to the
# location of MOABConfig.cmake for everyone.
superbuild_add_extra_cmake_args(
-DMOAB_DIR:PATH=<INSTALL_DIR>/lib/cmake/MOAB)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index bc5b0cef..a5b75198 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,24 +2,24 @@ cmake_minimum_required( VERSION 3.0 )
SET(PACKAGE_NAME "MOAB")
SET(PACKAGE_VERSION "5.1.1")
-if (NOT WIN32)
- #This all breaks on windows.
- SET(CMAKE_Fortran_COMPILER_INIT ${CMAKE_GENERATOR_FC})
- SET(CMAKE_CXX_FLAGS_INIT "-fPIC -DPIC")
- SET(CMAKE_CXX_FLAGS_DEBUG_INIT "-O0 -g")
- SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-O2 -g")
- SET(CMAKE_CXX_FLAGS_RELEASE_INIT "-O2 -DNDEBUG")
- SET(CMAKE_C_FLAGS_INIT "-fPIC -DPIC")
- SET(CMAKE_C_FLAGS_DEBUG_INIT "-O0 -g")
- SET(CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-O2 -g")
- SET(CMAKE_C_FLAGS_RELEASE_INIT "-O2 -DNDEBUG")
- SET(CMAKE_Fortran_FLAGS_INIT "-fPIC")
- SET(CMAKE_Fortran_FLAGS_DEBUG_INIT "-O0 -g")
- SET(CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT "-O2 -g")
- SET(CMAKE_Fortran_FLAGS_RELEASE_INIT "-O2")
- SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS_INIT "")
- SET(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS_INIT "")
-endif()
+#if (NOT WIN32)
+# #This all breaks on windows.
+# SET(CMAKE_Fortran_COMPILER_INIT ${CMAKE_GENERATOR_FC})
+# SET(CMAKE_CXX_FLAGS_INIT "-fPIC -DPIC")
+# SET(CMAKE_CXX_FLAGS_DEBUG_INIT "-O0 -g")
+# SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-O2 -g")
+# SET(CMAKE_CXX_FLAGS_RELEASE_INIT "-O2 -DNDEBUG")
+# SET(CMAKE_C_FLAGS_INIT "-fPIC -DPIC")
+# SET(CMAKE_C_FLAGS_DEBUG_INIT "-O0 -g")
+# SET(CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-O2 -g")
+# SET(CMAKE_C_FLAGS_RELEASE_INIT "-O2 -DNDEBUG")
+# SET(CMAKE_Fortran_FLAGS_INIT "-fPIC")
+# SET(CMAKE_Fortran_FLAGS_DEBUG_INIT "-O0 -g")
+# SET(CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT "-O2 -g")
+# SET(CMAKE_Fortran_FLAGS_RELEASE_INIT "-O2")
+# SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS_INIT "")
+# SET(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS_INIT "")
+#endif()
project( MOAB )
@@ -395,29 +395,29 @@ CONFIGURE_FILE(
IMMEDIATE @ONLY
)
-if (ENABLE_FORTRAN)
- enable_language(Fortran)
-
- # Include CMake's Fortran mangling evaluation macros
- include(FortranCInterface)
-
- if ("${FortranCInterface_GLOBAL_CASE}" MATCHES "UPPER")
- set(FC_CASE "NAME")
- else ("${FortranCInterface_GLOBAL_CASE}" MATCHES "UPPER")
- set(FC_CASE "name")
- endif ("${FortranCInterface_GLOBAL_CASE}" MATCHES "UPPER")
- if (NOT "${FortranCInterface_GLOBAL_SUFFIX}" STREQUAL "")
- set(FortranCInterface_GLOBAL_SUFFIX "## ${FortranCInterface_GLOBAL_SUFFIX}")
- endif (NOT "${FortranCInterface_GLOBAL_SUFFIX}" STREQUAL "")
- if (NOT "${FortranCInterface_GLOBAL__SUFFIX}" STREQUAL "")
- set(FortranCInterface_GLOBAL__SUFFIX "## ${FortranCInterface_GLOBAL__SUFFIX}")
- endif (NOT "${FortranCInterface_GLOBAL__SUFFIX}" STREQUAL "")
-
- set(MOAB_F77_FUNC "${FortranCInterface_GLOBAL_PREFIX} ${FC_CASE} ${FortranCInterface_GLOBAL_SUFFIX}")
- set(MOAB_F77_FUNC_ "${FortranCInterface_GLOBAL__PREFIX} ${FC_CASE} ${FortranCInterface_GLOBAL__SUFFIX}")
- set(MOAB_FC_FUNC "${FortranCInterface_GLOBAL_PREFIX} ${FC_CASE} ${FortranCInterface_GLOBAL_SUFFIX}")
- set(MOAB_FC_FUNC_ "${FortranCInterface_GLOBAL__PREFIX} ${FC_CASE} ${FortranCInterface_GLOBAL__SUFFIX}")
-endif (ENABLE_FORTRAN)
+ #if (ENABLE_FORTRAN)
+ # enable_language(Fortran)
+ #
+ # # Include CMake's Fortran mangling evaluation macros
+ # include(FortranCInterface)
+ #
+ # if ("${FortranCInterface_GLOBAL_CASE}" MATCHES "UPPER")
+ # set(FC_CASE "NAME")
+ # else ("${FortranCInterface_GLOBAL_CASE}" MATCHES "UPPER")
+ # set(FC_CASE "name")
+ # endif ("${FortranCInterface_GLOBAL_CASE}" MATCHES "UPPER")
+ # if (NOT "${FortranCInterface_GLOBAL_SUFFIX}" STREQUAL "")
+ # set(FortranCInterface_GLOBAL_SUFFIX "## ${FortranCInterface_GLOBAL_SUFFIX}")
+ # endif (NOT "${FortranCInterface_GLOBAL_SUFFIX}" STREQUAL "")
+ # if (NOT "${FortranCInterface_GLOBAL__SUFFIX}" STREQUAL "")
+ # set(FortranCInterface_GLOBAL__SUFFIX "## ${FortranCInterface_GLOBAL__SUFFIX}")
+ # endif (NOT "${FortranCInterface_GLOBAL__SUFFIX}" STREQUAL "")
+ #
+ # set(MOAB_F77_FUNC "${FortranCInterface_GLOBAL_PREFIX} ${FC_CASE} ${FortranCInterface_GLOBAL_SUFFIX}")
+ # set(MOAB_F77_FUNC_ "${FortranCInterface_GLOBAL__PREFIX} ${FC_CASE} ${FortranCInterface_GLOBAL__SUFFIX}")
+ # set(MOAB_FC_FUNC "${FortranCInterface_GLOBAL_PREFIX} ${FC_CASE} ${FortranCInterface_GLOBAL_SUFFIX}")
+ # set(MOAB_FC_FUNC_ "${FortranCInterface_GLOBAL__PREFIX} ${FC_CASE} ${FortranCInterface_GLOBAL__SUFFIX}")
+ #endif (ENABLE_FORTRAN)
# Generate the CMake input header file and then pass it through configuration
## execute_process( COMMAND cat MOABConfig.h.in COMMAND sed -e "s/#undef /#cmakedefine MOAB_/g"
superbuild_add_project(moab
DEPENDS cgm eigen netcdf zlib
CMAKE_ARGS
# Set link path properly on linux
-DCMAKE_INSTALL_RPATH:PATH=$ORIGIN/../lib
-DCMAKE_INSTALL_LIBDIR:STRING=lib
-DENABLE_BLASLAPACK:BOOL=OFF
-DENABLE_IMESH:BOOL=ON
-DENABLE_CGM:BOOL=ON
-DENABLE_NETCDF:BOOL=ON
-DENABLE_IREL:BOOL=ON
-DENABLE_HDF5:BOOL=OFF
-DENABLE_PNETCDF:BOOL=OFF
-DENABLE_MPI:BOOL=OFF
-DENABLE_TESTING:BOOL=OFF
-DNETCDF_ROOT:PATH=<INSTALL_DIR>)
superbuild_apply_patch(moab disable-fortran
"Disable use of fortran")
# By default, linux and os x cmake looks in <INSTALL_DIR>/lib/cmake for
# things. On windows, it does not. So, we set MOAB_DIR to point to the
# location of MOABConfig.cmake for everyone.
superbuild_add_extra_cmake_args(
-DMOAB_DIR:PATH=<INSTALL_DIR>/lib/cmake/MOAB)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index bc5b0cef..a5b75198 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,24 +2,24 @@ cmake_minimum_required( VERSION 3.0 )
SET(PACKAGE_NAME "MOAB")
SET(PACKAGE_VERSION "5.1.1")
-if (NOT WIN32)
- #This all breaks on windows.
- SET(CMAKE_Fortran_COMPILER_INIT ${CMAKE_GENERATOR_FC})
- SET(CMAKE_CXX_FLAGS_INIT "-fPIC -DPIC")
- SET(CMAKE_CXX_FLAGS_DEBUG_INIT "-O0 -g")
- SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-O2 -g")
- SET(CMAKE_CXX_FLAGS_RELEASE_INIT "-O2 -DNDEBUG")
- SET(CMAKE_C_FLAGS_INIT "-fPIC -DPIC")
- SET(CMAKE_C_FLAGS_DEBUG_INIT "-O0 -g")
- SET(CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-O2 -g")
- SET(CMAKE_C_FLAGS_RELEASE_INIT "-O2 -DNDEBUG")
- SET(CMAKE_Fortran_FLAGS_INIT "-fPIC")
- SET(CMAKE_Fortran_FLAGS_DEBUG_INIT "-O0 -g")
- SET(CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT "-O2 -g")
- SET(CMAKE_Fortran_FLAGS_RELEASE_INIT "-O2")
- SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS_INIT "")
- SET(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS_INIT "")
-endif()
+#if (NOT WIN32)
+# #This all breaks on windows.
+# SET(CMAKE_Fortran_COMPILER_INIT ${CMAKE_GENERATOR_FC})
+# SET(CMAKE_CXX_FLAGS_INIT "-fPIC -DPIC")
+# SET(CMAKE_CXX_FLAGS_DEBUG_INIT "-O0 -g")
+# SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-O2 -g")
+# SET(CMAKE_CXX_FLAGS_RELEASE_INIT "-O2 -DNDEBUG")
+# SET(CMAKE_C_FLAGS_INIT "-fPIC -DPIC")
+# SET(CMAKE_C_FLAGS_DEBUG_INIT "-O0 -g")
+# SET(CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-O2 -g")
+# SET(CMAKE_C_FLAGS_RELEASE_INIT "-O2 -DNDEBUG")
+# SET(CMAKE_Fortran_FLAGS_INIT "-fPIC")
+# SET(CMAKE_Fortran_FLAGS_DEBUG_INIT "-O0 -g")
+# SET(CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT "-O2 -g")
+# SET(CMAKE_Fortran_FLAGS_RELEASE_INIT "-O2")
+# SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS_INIT "")
+# SET(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS_INIT "")
+#endif()
project( MOAB )
@@ -395,29 +395,29 @@ CONFIGURE_FILE(
IMMEDIATE @ONLY
)
-if (ENABLE_FORTRAN)
- enable_language(Fortran)
-
- # Include CMake's Fortran mangling evaluation macros
- include(FortranCInterface)
-
- if ("${FortranCInterface_GLOBAL_CASE}" MATCHES "UPPER")
- set(FC_CASE "NAME")
- else ("${FortranCInterface_GLOBAL_CASE}" MATCHES "UPPER")
- set(FC_CASE "name")
- endif ("${FortranCInterface_GLOBAL_CASE}" MATCHES "UPPER")
- if (NOT "${FortranCInterface_GLOBAL_SUFFIX}" STREQUAL "")
- set(FortranCInterface_GLOBAL_SUFFIX "## ${FortranCInterface_GLOBAL_SUFFIX}")
- endif (NOT "${FortranCInterface_GLOBAL_SUFFIX}" STREQUAL "")
- if (NOT "${FortranCInterface_GLOBAL__SUFFIX}" STREQUAL "")
- set(FortranCInterface_GLOBAL__SUFFIX "## ${FortranCInterface_GLOBAL__SUFFIX}")
- endif (NOT "${FortranCInterface_GLOBAL__SUFFIX}" STREQUAL "")
-
- set(MOAB_F77_FUNC "${FortranCInterface_GLOBAL_PREFIX} ${FC_CASE} ${FortranCInterface_GLOBAL_SUFFIX}")
- set(MOAB_F77_FUNC_ "${FortranCInterface_GLOBAL__PREFIX} ${FC_CASE} ${FortranCInterface_GLOBAL__SUFFIX}")
- set(MOAB_FC_FUNC "${FortranCInterface_GLOBAL_PREFIX} ${FC_CASE} ${FortranCInterface_GLOBAL_SUFFIX}")
- set(MOAB_FC_FUNC_ "${FortranCInterface_GLOBAL__PREFIX} ${FC_CASE} ${FortranCInterface_GLOBAL__SUFFIX}")
-endif (ENABLE_FORTRAN)
+ #if (ENABLE_FORTRAN)
+ # enable_language(Fortran)
+ #
+ # # Include CMake's Fortran mangling evaluation macros
+ # include(FortranCInterface)
+ #
+ # if ("${FortranCInterface_GLOBAL_CASE}" MATCHES "UPPER")
+ # set(FC_CASE "NAME")
+ # else ("${FortranCInterface_GLOBAL_CASE}" MATCHES "UPPER")
+ # set(FC_CASE "name")
+ # endif ("${FortranCInterface_GLOBAL_CASE}" MATCHES "UPPER")
+ # if (NOT "${FortranCInterface_GLOBAL_SUFFIX}" STREQUAL "")
+ # set(FortranCInterface_GLOBAL_SUFFIX "## ${FortranCInterface_GLOBAL_SUFFIX}")
+ # endif (NOT "${FortranCInterface_GLOBAL_SUFFIX}" STREQUAL "")
+ # if (NOT "${FortranCInterface_GLOBAL__SUFFIX}" STREQUAL "")
+ # set(FortranCInterface_GLOBAL__SUFFIX "## ${FortranCInterface_GLOBAL__SUFFIX}")
+ # endif (NOT "${FortranCInterface_GLOBAL__SUFFIX}" STREQUAL "")
+ #
+ # set(MOAB_F77_FUNC "${FortranCInterface_GLOBAL_PREFIX} ${FC_CASE} ${FortranCInterface_GLOBAL_SUFFIX}")
+ # set(MOAB_F77_FUNC_ "${FortranCInterface_GLOBAL__PREFIX} ${FC_CASE} ${FortranCInterface_GLOBAL__SUFFIX}")
+ # set(MOAB_FC_FUNC "${FortranCInterface_GLOBAL_PREFIX} ${FC_CASE} ${FortranCInterface_GLOBAL_SUFFIX}")
+ # set(MOAB_FC_FUNC_ "${FortranCInterface_GLOBAL__PREFIX} ${FC_CASE} ${FortranCInterface_GLOBAL__SUFFIX}")
+ #endif (ENABLE_FORTRAN)
# Generate the CMake input header file and then pass it through configuration
## execute_process( COMMAND cat MOABConfig.h.in COMMAND sed -e "s/#undef /#cmakedefine MOAB_/g"
include("${CMAKE_CURRENT_LIST_DIR}/../moab.cmake")
superbuild_apply_patch(moab quote-compiler-path
"Add quotations around compiler path to avoid whitespace warnings.")
superbuild_apply_patch(moab remove-flags-from-link-list
"Remove CMake error where linker flags are a part of the link library list")
superbuild_apply_patch(moab msvc-fixes
"Many windows-specific fixes for moab (not developed on windows).")
diff -Nr -U5 moab/src/GeomQueryTool.cpp moab_patched/src/GeomQueryTool.cpp
--- moab/src/GeomQueryTool.cpp Fri Jan 19 16:55:39 2018
+++ moab_patched/src/GeomQueryTool.cpp Fri Jan 19 16:53:37 2018
@@ -7,10 +7,12 @@
#include <limits>
#include <algorithm>
#include <set>
#include <ctype.h>
+#define _USE_MATH_DEFINES
+#include <math.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include "moab/OrientedBoxTreeTool.hpp"
diff -Nr -U5 moab/src/IntxMesh/Intx2MeshOnSphere.cpp moab_patched/src/IntxMesh/Intx2MeshOnSphere.cpp
--- moab/src/IntxMesh/Intx2MeshOnSphere.cpp Fri Jan 19 16:55:39 2018
+++ moab_patched/src/IntxMesh/Intx2MeshOnSphere.cpp Fri Jan 19 16:53:37 2018
@@ -2,10 +2,13 @@
* Intx2MeshOnSphere.cpp
*
* Created on: Oct 3, 2012
*/
+#define _USE_MATH_DEFINES
+#include <cmath>
+
#include "moab/IntxMesh/Intx2MeshOnSphere.hpp"
#include "moab/IntxMesh/IntxUtils.hpp"
#include "moab/GeomUtil.hpp"
#ifdef MOAB_HAVE_MPI
#include "moab/ParallelComm.hpp"
diff -Nr -U5 moab/src/IntxMesh/IntxUtils.cpp moab_patched/src/IntxMesh/IntxUtils.cpp
--- moab/src/IntxMesh/IntxUtils.cpp Fri Jan 19 16:55:39 2018
+++ moab_patched/src/IntxMesh/IntxUtils.cpp Fri Jan 19 16:53:37 2018
@@ -2,10 +2,11 @@
* IntxUtils.cpp
*
* Created on: Oct 3, 2012
*/
+#define _USE_MATH_DEFINES
#include <math.h>
#include "moab/IntxMesh/IntxUtils.hpp"
// this is from mbcoupler; maybe it should be moved somewhere in moab src
// right now, add a dependency to mbcoupler
// #include "ElemUtil.hpp"
diff -Nr -U5 moab/src/MeshGeneration.cpp moab_patched/src/MeshGeneration.cpp
--- moab/src/MeshGeneration.cpp Fri Jan 19 16:55:39 2018
+++ moab_patched/src/MeshGeneration.cpp Fri Jan 19 16:53:37 2018
@@ -6,10 +6,12 @@
#include "moab/MeshGeneration.hpp"
#include "moab/MergeMesh.hpp"
#include <iostream>
#include <vector>
+#include <time.h>
+
#ifdef MOAB_HAVE_MPI
#include "moab_mpi.h"
#include "moab/ParallelComm.hpp"
#include "MBParallelConventions.h"
#include "moab/ParallelMergeMesh.hpp"
diff -Nr -U5 moab/src/moab/Util.hpp moab_patched/src/moab/Util.hpp
--- moab/src/moab/Util.hpp Fri Jan 19 16:55:40 2018
+++ moab_patched/src/moab/Util.hpp Fri Jan 19 16:53:38 2018
@@ -18,20 +18,23 @@
#include "moab/MOABConfig.h"
#include "moab/Forward.hpp"
#include "moab/CartVect.hpp"
-#include <math.h>
-#if defined MOAB_HAVE_ISFINITE
-#define moab_isfinite(f) isfinite(f)
-#elif defined MOAB_HAVE_STDISFINITE
#include <cmath>
-#define moab_isfinite(f) std::isfinite(f)
+#if defined MOAB_HAVE_ISFINITE
+# define moab_isfinite(f) isfinite(f)
+//If we have c++11 support, we will have std::isfinite
+#elif (defined(__cplusplus) && __cplusplus >= 201103L)
+# define moab_isfinite(f) std::isfinite(f)
+#elif (defined(_WIN32) && defined(_MSC_VER)) || defined(__MINGW32__)
+# include <float.h>
+# define moab_isfinite(A) _finite(A)
#elif defined MOAB_HAVE_FINITE
-#define moab_isfinite(f) finite(f)
+# define moab_isfinite(f) finite(f)
#else
-#define moab_isfinite(f) (!isinf(f) && !isnan(f))
+# define moab_isfinite(f) (!isinf(f) && !isnan(f))
#endif
namespace moab {
/** \class Util
diff -Nr -U5 moab/src/ProgOptions.cpp moab_patched/src/ProgOptions.cpp
--- moab/src/ProgOptions.cpp Fri Jan 19 16:55:40 2018
+++ moab_patched/src/ProgOptions.cpp Fri Jan 19 16:53:38 2018
@@ -1,5 +1,7 @@
+#define NOMINMAX
+#include <algorithm>
#include <iostream>
#include <sstream>
#include <iomanip>
#include <cstdlib>
#include <list>
diff -Nr -U5 moab/test/perf/CMakeLists.txt moab_patched/test/perf/CMakeLists.txt
--- moab/test/perf/CMakeLists.txt Fri Jan 19 16:55:40 2018
+++ moab_patched/test/perf/CMakeLists.txt Fri Jan 19 16:53:38 2018
@@ -11,12 +11,12 @@
perf.cpp
perftool.cpp
umr_perf.cpp )
if ( MOAB_HAVE_IMESH )
- set(TESTS ${TESTS} tstt_perf_binding.cpp)
- set(tstt_perf_binding_CMDARGS 4;B)
+# set(TESTS ${TESTS} tstt_perf_binding.cpp)
+# set(tstt_perf_binding_CMDARGS 4;B)
set(LIBS ${LIBS} iMesh )
endif()
if ( MOAB_HAVE_CGM )
set(LIBS ${LIBS} ${CGM_LIBRARIES})
endif()
diff -Nr -U5 moab/test/spherical_area_test.cpp moab_patched/test/spherical_area_test.cpp
--- moab/test/spherical_area_test.cpp Fri Jan 19 16:55:40 2018
+++ moab_patched/test/spherical_area_test.cpp Fri Jan 19 16:53:38 2018
@@ -1,10 +1,13 @@
/*
* spherical_area_test.cpp
*
* Created on: Feb 1, 2013
*/
+#define _USE_MATH_DEFINES
+#include <math.h>
+
#include <iostream>
#include "moab/Core.hpp"
#include "moab/Interface.hpp"
#include "moab/IntxMesh/IntxUtils.hpp"
#include "TestUtil.hpp"
diff -Nr -U5 moab/test/urefine_mesh_test.cpp moab_patched/test/urefine_mesh_test.cpp
--- moab/test/urefine_mesh_test.cpp Fri Jan 19 16:55:40 2018
+++ moab_patched/test/urefine_mesh_test.cpp Fri Jan 19 16:53:38 2018
@@ -1,10 +1,9 @@
/*This unit test is for the uniform refinement capability based on AHF datastructures*/
#include <iostream>
#include <string>
#include <sstream>
-#include <sys/time.h>
#include <vector>
#include <algorithm>
#include "moab/Core.hpp"
#include "moab/Range.hpp"
#include "moab/MeshTopoUtil.hpp"
diff -Nr -U5 moab/tools/umr.cpp moab_patched/tools/umr.cpp
--- moab/tools/umr.cpp Fri Jan 19 16:55:41 2018
+++ moab_patched/tools/umr.cpp Fri Jan 19 16:53:39 2018
@@ -3,11 +3,10 @@
#include <vector>
#include <string>
#include <stdio.h>
#include <iomanip>
#include <fstream>
-#include <sys/time.h>
#include <time.h>
#include <math.h>
#include <assert.h>
#include <float.h>
diff -Nr -U5 src/config/MOABConfig.cmake.in src.new/config/MOABConfig.cmake.in
--- src/config/MOABConfig.cmake.in 2017-11-29 11:03:38.000000000 -0500
+++ src.new/config/MOABConfig.cmake.in 2018-01-24 10:26:22.000000000 -0500
@@ -8,14 +8,14 @@
# MOAB_CXX, MOAB_CC, MOAB_F77, MOAB_FC - compilers used to compile MOAB
# MOAB_CXXFLAGS, MOAB_CCFLAGS, MOAB_FFLAGS, MOAB_FCFLAGS - compiler flags used to compile MOAB; possibly need to use these in add_definitions or CMAKE_<LANG>_FLAGS_<MODE>
set(MOAB_FOUND 1)
-set(MOAB_CC @CC@)
-set(MOAB_CXX @CXX@)
-set(MOAB_FC @FC@)
-set(MOAB_F77 @F77@)
+set(MOAB_CC "@CC@")
+set(MOAB_CXX "@CXX@")
+set(MOAB_FC "@FC@")
+set(MOAB_F77 "@F77@")
# Compiler flags used by MOAB
set(MOAB_CFLAGS "@CFLAGS@")
set(MOAB_CXXFLAGS "@CXXFLAGS@")
set(MOAB_FCFLAGS "@FCFLAGS@")
set(MOAB_FFLAGS "@FFLAGS@")
diff -Nr -U5 src/config/MOABConfig.cmake.cmake src_patched/config/MOABConfig.cmake.cmake
--- src/config/MOABConfig.cmake.cmake 2017-11-29 11:03:38.000000000 -0500
+++ src_patched/config/MOABConfig.cmake.cmake 2018-02-14 16:08:31.000000000 -0500
@@ -8,14 +8,14 @@
# MOAB_CXX, MOAB_CC, MOAB_F77, MOAB_FC - compilers used to compile MOAB
# MOAB_CXXFLAGS, MOAB_CCFLAGS, MOAB_FFLAGS, MOAB_FCFLAGS - compiler flags used to compile MOAB; possibly need to use these in add_definitions or CMAKE_<LANG>_FLAGS_<MODE>
set(MOAB_FOUND 1)
-set(MOAB_CC @CMAKE_C_COMPILER@)
-set(MOAB_CXX @CMAKE_CXX_COMPILER@)
-set(MOAB_FC @CMAKE_Fortran_COMPILER@)
-set(MOAB_F77 @CMAKE_Fortran_COMPILER@)
+set(MOAB_CC "@CMAKE_C_COMPILER@")
+set(MOAB_CXX "@CMAKE_CXX_COMPILER@")
+set(MOAB_FC "@CMAKE_Fortran_COMPILER@")
+set(MOAB_F77 "@CMAKE_Fortran_COMPILER@")
# Compiler flags used by MOAB
set(MOAB_CFLAGS "@CFLAGS@")
set(MOAB_CXXFLAGS "@CXXFLAGS@")
set(MOAB_FCFLAGS "@FFLAGS@")
set(MOAB_FFLAGS "@FFLAGS@")
diff -Nr -U5 src/src/CMakeLists.txt src.new/src/CMakeLists.txt
--- src/src/CMakeLists.txt 2017-11-29 11:03:38.000000000 -0500
+++ src.new/src/CMakeLists.txt 2018-01-19 15:58:49.000000000 -0500
@@ -279,11 +279,11 @@
SOVERSION ${MOAB_VERSION_MAJOR}
)
target_link_libraries(
MOAB
- ${CMAKE_EXE_LINKER_FLAGS} ${MOAB_DEP_LIBRARIES} ${MOAB_LIBS} ${MOAB_CGM_LIBS} ${MPI_LIBRARIES} ${LAPACK_LIBRARIES} ${BLAS_LIBRARIES}
+ ${MOAB_DEP_LIBRARIES} ${MOAB_LIBS} ${MOAB_CGM_LIBS} ${MPI_LIBRARIES} ${LAPACK_LIBRARIES} ${BLAS_LIBRARIES}
)
install(
TARGETS MOAB
EXPORT MOABTargets
superbuild_set_revision(cgm
GIT_REPOSITORY "https://bitbucket.org/fathomteam/cgm.git"
GIT_TAG 18403e5b100fe8d49a8ac0d6a2e849a0bbeae3bd)
superbuild_set_revision(meshkit
GIT_REPOSITORY "https://haocheng_liu@bitbucket.org/haocheng_liu/meshkit.git"
GIT_TAG osx-10-dot-13-patch)
superbuild_set_revision(moab
GIT_REPOSITORY "https://bitbucket.org/fathomteam/moab.git"
GIT_TAG 78d0b938fcf80fcdfb34fa39583fbce544b56953)
include("${CMAKE_CURRENT_LIST_DIR}/../kml.cmake")
superbuild_apply_patch(kml add-missing-unistd.h
"file_posix.cc misses including unistd.h")
diff -Nru5 src/src/kml/base/file_posix.cc src.add-missing-unistd.h/src/kml/base/file_posix.cc
--- src/src/kml/base/file_posix.cc 2012-04-06 08:25:40.000000000 -0400
+++ src.add-missing-unistd.h/src/kml/base/file_posix.cc 2016-02-23 17:04:57.943711396 -0500
@@ -30,10 +30,13 @@
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
+// posix compile fix:
+#include <unistd.h>
+
namespace kmlbase {
// Internal to the POSIX File class.
static bool StatFile(const char* path, struct stat* stat_data) {
struct stat tmp;
# Capstone is a private program to which Kitware developers have access. We
# provide logic for situating these programs into our superbuild for development
# purposes only. Nothing is bundled or distributed.
superbuild_add_project(capstone
CAN_USE_SYSTEM
DOWNLOAD_NO_EXTRACT 1
CONFIGURE_COMMAND
/bin/sh -c "yes | hdiutil attach -mountpoint '<SOURCE_DIR>' '<DOWNLOADED_FILE>'"
BUILD_COMMAND
${CMAKE_COMMAND} -E copy_directory "<SOURCE_DIR>/Capstone-9.1.2" "<BINARY_DIR>"
INSTALL_COMMAND
hdiutil detach <SOURCE_DIR>
)
set(capstone_pythonpath ${CMAKE_CURRENT_BINARY_DIR}/capstone/build/Capstone.app/Contents/MacOS)
set(CreateMG_DIR ${CMAKE_CURRENT_BINARY_DIR}/capstone/build/lib)
set(cmb_plugins)
foreach (cmb_plugin IN LISTS cmb_plugins_all)
if (EXISTS "${superbuild_install_location}/Applications/ModelBuilder.app/Contents/Libraries/lib${cmb_plugin}.dylib")
list(APPEND cmb_plugins
${cmb_plugin})
set("cmb_plugin_path_${cmb_plugin}"
"${superbuild_install_location}/Applications/ModelBuilder.app/Contents/Libraries/lib${cmb_plugin}.dylib")
continue ()
endif ()
foreach(program IN LISTS cmb_programs_to_install)
set(additional_libraries)
set(plugins)
set(plugin_paths)
foreach (path IN ITEMS "" "cmb-${cmb_version}" "paraview-${paraview_version}")
if (EXISTS "${superbuild_install_location}/lib/${path}/lib${cmb_plugin}.dylib")
list(APPEND cmb_plugins
${cmb_plugin})
set("cmb_plugin_path_${cmb_plugin}"
"${superbuild_install_location}/lib/${path}/lib${cmb_plugin}.dylib")
break ()
endif ()
endforeach ()
endforeach ()
if (program STREQUAL "modelbuilder")
# Install additional libraries in modelbuilder app
foreach(library IN LISTS cmb_additional_libraries)
list(APPEND additional_libraries "${superbuild_install_location}/lib/lib${library}.dylib")
endforeach()
set(python_modules)
if (pythongirderclient_enabled)
list(APPEND python_modules
requests
girder_client)
endif ()
# Install CMB plugins in modelbuilder app
foreach(plugin IN LISTS cmb_plugins_cmb)
list(APPEND plugin_paths "${superbuild_install_location}/Applications/modelbuilder.app/Contents/Plugins/lib${plugin}.dylib")
endforeach()
list(APPEND plugins ${cmb_plugins_cmb})
foreach(program IN LISTS cmb_programs_to_install)
set(plugins "${cmb_plugins_${program}}")
# Install CMB plugins in modelbuilder app
foreach(plugin IN LISTS cmb_plugins_standalone)
list(APPEND plugin_paths "${superbuild_install_location}/lib/lib${plugin}.dylib")
endforeach()
list(APPEND plugins ${cmb_plugins_standalone})
set(plugin_paths)
foreach (plugin IN LISTS plugins)
if (NOT DEFINED "cmb_plugin_path_${plugin}")
message(FATAL_ERROR "The application ${program} needs the ${plugin} plugin, but it was not found.")
endif ()
list(APPEND plugin_paths
"${cmb_plugin_path_${plugin}}")
endforeach ()
# Install paraview plugins in modelbuilder app
foreach (plugin IN LISTS cmb_plugins_paraview)
list(APPEND plugin_paths "${superbuild_install_location}/Applications/paraview.app/Contents/Plugins/lib${plugin}.dylib")
endforeach()
list(APPEND plugins ${cmb_plugins_paraview})
endif()
superbuild_apple_create_app(
"\${CMAKE_INSTALL_PREFIX}/${cmb_package}"
"${program}.app"
"${superbuild_install_location}/Applications/${program}.app/Contents/MacOS/${program}"
CLEAN
FAKE_PLUGIN_PATHS
PLUGINS ${plugin_paths}
ADDITIONAL_LIBRARIES ${additional_libraries}
SEARCH_DIRECTORIES
"${superbuild_install_location}/lib")
foreach (icon_filename MacIcon.icns pvIcon.icns)
foreach (icon_filename MacIcon.icns pvIcon.icns modelbuilder.icns)
set(icon_path "${superbuild_install_location}/Applications/${program}.app/Contents/Resources/${icon_filename}")
if (EXISTS "${icon_path}")
install(
......@@ -95,12 +85,12 @@ foreach(program IN LISTS cmb_programs_to_install)
"${superbuild_install_location}/lib"
"${superbuild_install_location}/Applications/paraview.app/Contents/Libraries")
# Install the paraview.vtk module.
install(CODE
"file(INSTALL
FILES \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${cmb_package}/${program}.app/Contents/Python/vtk/\"
DESTINATION \"\${CMAKE_INSTALL_PREFIX}/${cmb_package}/${program}.app/Contents/Python/paraview/vtk\")"
COMPONENT superbuild)
if (matplotlib_enabled)
install(
DIRECTORY "${superbuild_install_location}/lib/python2.7/site-packages/matplotlib/mpl-data/"
DESTINATION "${cmb_package}/${program}.app/Contents/Python/matplotlib/mpl-data"
COMPONENT superbuild)
endif ()
if (pythonrequests_enabled)
install(
......@@ -108,6 +98,36 @@ foreach(program IN LISTS cmb_programs_to_install)
DESTINATION "${cmb_package}/${program}.app/Contents/Python/requests"
COMPONENT superbuild)
endif ()
if (paraviewweb_enabled)
install(
FILES "${superbuild_install_location}/Applications/paraview.app/Contents/Python/paraview/web/defaultProxies.json"
DESTINATION "${cmb_package}/${program}.app/Contents/Python/paraview/web"
COMPONENT "superbuild")
install(
DIRECTORY "${superbuild_install_location}/share/paraview/web"
DESTINATION "${cmb_package}/${program}.app/Contents/Resources"
COMPONENT "superbuild")
endif ()
foreach (qt5_plugin_path IN LISTS qt5_plugin_paths)
get_filename_component(qt5_plugin_group "${qt5_plugin_path}" DIRECTORY)
get_filename_component(qt5_plugin_group "${qt5_plugin_group}" NAME)
superbuild_apple_install_module(
"\${CMAKE_INSTALL_PREFIX}/${cmb_package}"
"${program}.app"
"${qt5_plugin_path}"
"Contents/Plugins/${qt5_plugin_group}"
SEARCH_DIRECTORIES "${library_paths}")
endforeach ()
if (cmb_doc_base_dir)
set(cmb_doc_dir "${cmb_package}/${program}.app/${cmb_doc_base_dir}")
endif ()
# Install PDF guides.
cmb_install_extra_data()
endforeach ()
# FIXME: Install inside of each application?
......@@ -115,3 +135,15 @@ install(
DIRECTORY "${superbuild_install_location}/share/cmb/workflows/"
DESTINATION "Workflows"
COMPONENT superbuild)
if (meshkit_enabled)
foreach (meshkit_exe IN ITEMS coregen assygen)
superbuild_apple_install_utility(
"\${CMAKE_INSTALL_PREFIX}/${cmb_package}"
"modelbuilder.app"
"${superbuild_install_location}/bin/${meshkit_exe}"
SEARCH_DIRECTORIES "${library_paths}"
FRAMEWORK_DEST "Frameworks/meshkit"
LIBRARY_DEST "Libraries/meshkit")
endforeach ()
endif ()
# Cubit is a private program to which Kitware developers have access. We provide
# logic for situating these programs into our superbuild for development
# purposes only. Nothing is bundled or distributed.
superbuild_add_project(cubit
CAN_USE_SYSTEM
DOWNLOAD_NO_EXTRACT 1
CONFIGURE_COMMAND
/bin/sh -c "yes | hdiutil attach -mountpoint '<SOURCE_DIR>' '<DOWNLOADED_FILE>'"
BUILD_COMMAND
${CMAKE_COMMAND} -E copy_directory "<SOURCE_DIR>/Cubit-15.2" "<BINARY_DIR>"
INSTALL_COMMAND
hdiutil detach <SOURCE_DIR>
)
set(CUBIT_EXE ${CMAKE_CURRENT_BINARY_DIR}/cubit/build/Cubit.app/Contents/MacOS/Cubit)
include(hydrology.bundle.common)
set(cmb_package "CMB-Hydro ${cmb_version_major}.${cmb_version_minor}.${cmb_version_patch}")
include(cmb.bundle.apple)
include(modelbuilder.bundle.common)
set(cmb_package "ModelBuilder ${cmb_version_major}.${cmb_version_minor}.${cmb_version_patch}")
set(cmb_package "modelbuilder ${cmb_version_major}.${cmb_version_minor}.${cmb_version_patch}")
set(cmb_doc_base_dir "Contents/doc")
include(cmb.bundle.apple)
include("${CMAKE_CURRENT_LIST_DIR}/../opencv.cmake")
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "8.0.0")
superbuild_apply_patch(opencv coreimage-videoio-link
"Remove CoreImage from videoio's linkline")
endif ()
diff --git a/modules/videoio/CMakeLists.txt b/modules/videoio/CMakeLists.txt
index 413b3cd..3b4150b 100644
--- a/modules/videoio/CMakeLists.txt
+++ b/modules/videoio/CMakeLists.txt
@@ -173,7 +173,7 @@ if(HAVE_AVFOUNDATION)
list(APPEND VIDEOIO_LIBRARIES "-framework AVFoundation" "-framework QuartzCore")
else()
list(APPEND videoio_srcs ${CMAKE_CURRENT_LIST_DIR}/src/cap_avfoundation_mac.mm)
- list(APPEND VIDEOIO_LIBRARIES "-framework Cocoa" "-framework Accelerate" "-framework AVFoundation" "-framework CoreGraphics" "-framework CoreImage" "-framework CoreMedia" "-framework CoreVideo" "-framework QuartzCore")
+ list(APPEND VIDEOIO_LIBRARIES "-framework Cocoa" "-framework Accelerate" "-framework AVFoundation" "-framework CoreGraphics" "-framework CoreMedia" "-framework CoreVideo" "-framework QuartzCore")
endif()
endif()
superbuild_add_project(shiboken
DEPENDS qt4 python
CMAKE_ARGS
-DDISABLE_DOCSTRINGS:BOOL=ON)
# Capstone is a private program to which Kitware developers have access. We
# provide logic for situating these programs into our superbuild for development
# purposes only. Nothing is bundled or distributed.
find_package(CreateMG REQUIRED)
set(capstone_pythonpath ${CreateMG_DIR}/bin)
if (APPLE)
set(capstone_pythonpath ${CreateMG_DIR}/../Capstone.app/Contents/MacOS)
endif ()
</
......@@ -4,35 +4,27 @@ include(cmb-version)
include(paraview-version)
set(CPACK_PACKAGE_VENDOR "Kitware, Inc.")
set(CPACK_RESOURCE_FILE_LICENSE
"${superbuild_source_directory}/License.txt")
set(CPACK_PACKAGE_VERSION_MAJOR ${cmb_version_major})
set(CPACK_PACKAGE_VERSION_MINOR ${cmb_version_minor})
if (cmb_version_suffix)
set(CPACK_PACKAGE_VERSION_PATCH ${cmb_version_patch}-${cmb_version_suffix})
else()
set(CPACK_PACKAGE_VERSION_PATCH ${cmb_version_patch})
endif()
set(CPACK_PACKAGE_VERSION_PATCH ${cmb_version_patch}${cmb_version_suffix})
if (CMB_PACKAGE_SUFFIX)
set(CPACK_PACKAGE_VERSION_PATCH ${CPACK_PACKAGE_VERSION_PATCH}-${CMB_PACKAGE_SUFFIX})
endif ()
SET(CPACK_PACKAGE_INSTALL_DIRECTORY
"${cmb_package_name} ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
set(CPACK_SOURCE_PACKAGE_FILE_NAME
"${cmb_package_name}-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
if (NOT DEFINED package_filename)
set(package_filename "${CMB_PACKAGE_FILE_NAME}")
endif ()
if(NOT DEFINED CPACK_SYSTEM_NAME)
set(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR})
endif()
if(${CPACK_SYSTEM_NAME} MATCHES Windows)
if(CMAKE_CL_64)
set(CPACK_SYSTEM_NAME win64)
else(CMAKE_CL_64)
set(CPACK_SYSTEM_NAME win32)
endif()
endif()
if(NOT DEFINED CPACK_PACKAGE_FILE_NAME)
if (package_filename)
set(CPACK_PACKAGE_FILE_NAME "${package_filename}")
else ()
set(CPACK_PACKAGE_FILE_NAME
"${CPACK_SOURCE_PACKAGE_FILE_NAME}-${CPACK_SYSTEM_NAME}")
endif()
"${cmb_package_name}-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
endif ()
# Set the license file.
set(CPACK_RESOURCE_FILE_LICENSE
"${superbuild_source_directory}/License.txt")
list(SORT cmb_programs_to_install)
list(REMOVE_DUPLICATES cmb_programs_to_install)
......@@ -40,7 +32,7 @@ list(REMOVE_DUPLICATES cmb_programs_to_install)
function (cmb_add_plugin output)
set(contents "<?xml version=\"1.0\"?>\n<Plugins>\n</Plugins>\n")
foreach (name IN LISTS ARGN)
set(plugin_directive " <Plugin name=\"${name}\" auto_load=\"1\" />\n")
set(plugin_directive " <Plugin name=\"${name}\" auto_load=\"0\" />\n")
string(REPLACE "</Plugins>" "${plugin_directive}</Plugins>" contents "${contents}")
endforeach ()
file(WRITE "${output}" "${contents}")
......@@ -59,52 +51,177 @@ if (cmb_install_paraview_python)
pvpython)