Commit 6c1c83e5 authored by Dave Moxey's avatar Dave Moxey

Add various modifications to support Windows 7 SP1/VS2013 builds

parent c9ab456f
......@@ -9,12 +9,12 @@ IF( WIN32 AND CMAKE_CL_64 )
${CMAKE_SOURCE_DIR}/ThirdParty
${CMAKE_SOURCE_DIR}/../ThirdParty)
ELSE()
FIND_LIBRARY( WIN32_BLAS NAMES blas_win32 PATHS
FIND_LIBRARY( WIN32_BLAS NAMES blas_win32 PATHS
${WIN32_LAPACK_ADDITIONAL_DIRS}
${CMAKE_SOURCE_DIR}/ThirdParty
${CMAKE_SOURCE_DIR}/../ThirdParty)
FIND_LIBRARY( WIN32_LAPACK NAMES lapack_win32 PATHS
FIND_LIBRARY( WIN32_LAPACK NAMES lapack_win32 PATHS
${WIN32_LAPACK_ADDITIONAL_DIRS}
${CMAKE_SOURCE_DIR}/ThirdParty
${CMAKE_SOURCE_DIR}/../ThirdParty)
......
......@@ -3,38 +3,45 @@ SET(Boost_USE_MULTITHREADED ON CACHE BOOL
"Search for multithreaded boost libraries")
MARK_AS_ADVANCED(Boost_USE_MULTITHREADED)
IF (WIN32)
ADD_DEFINITIONS("-DBOOST_ALL_NO_LIB")
ENDIF()
IF (THIRDPARTY_BUILD_BOOST)
INCLUDE(ExternalProject)
# Only build the libraries we need
SET(BOOST_LIB_LIST --with-system --with-iostreams --with-filesystem
--with-program_options --with-date_time --with-thread
--with-regex)
IF (NOT WIN32)
# Only build the libraries we need
SET(BOOST_LIB_LIST --with-system --with-iostreams --with-filesystem
--with-program_options --with-date_time --with-thread
--with-regex)
# We need -fPIC for 64-bit builds
IF (NOT WIN32)
# We need -fPIC for 64-bit builds
IF( CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" )
SET(BOOST_FLAGS cxxflags=-fPIC cflags=-fPIC linkflags=-fPIC)
ENDIF ()
# Build Boost
IF (APPLE)
SET(TOOLSET darwin)
ELSE(APPLE)
SET(TOOLSET gcc)
ENDIF(APPLE)
EXTERNALPROJECT_ADD(
boost
PREFIX ${TPSRC}
URL ${TPURL}/boost_1_55_0.tar.bz2
URL_MD5 "d6eef4b4cacb2183f2bf265a5a03a354"
STAMP_DIR ${TPBUILD}/stamp
DOWNLOAD_DIR ${TPSRC}
SOURCE_DIR ${TPBUILD}/boost
BINARY_DIR ${TPBUILD}/boost
TMP_DIR ${TPBUILD}/boost-tmp
INSTALL_DIR ${TPDIST}
CONFIGURE_COMMAND CC=${CMAKE_C_COMPILER} CXX=${CMAKE_CXX_COMPILER} ./bootstrap.sh --prefix=${TPDIST}
ENDIF()
# Build Boost
IF (APPLE)
SET(TOOLSET darwin)
ELSE(APPLE)
SET(TOOLSET gcc)
ENDIF(APPLE)
IF (NOT WIN32)
EXTERNALPROJECT_ADD(
boost
PREFIX ${TPSRC}
URL ${TPURL}/boost_1_55_0.tar.bz2
URL_MD5 "d6eef4b4cacb2183f2bf265a5a03a354"
STAMP_DIR ${TPBUILD}/stamp
DOWNLOAD_DIR ${TPSRC}
SOURCE_DIR ${TPBUILD}/boost
BINARY_DIR ${TPBUILD}/boost
TMP_DIR ${TPBUILD}/boost-tmp
INSTALL_DIR ${TPDIST}
CONFIGURE_COMMAND CC=${CMAKE_C_COMPILER} CXX=${CMAKE_CXX_COMPILER} ./bootstrap.sh --prefix=${TPDIST}
BUILD_COMMAND NO_BZIP2=1 ./b2
variant=release
link=shared
......@@ -44,63 +51,99 @@ IF (THIRDPARTY_BUILD_BOOST)
--layout=system toolset=${TOOLSET} install
INSTALL_COMMAND ""
)
IF (APPLE)
EXTERNALPROJECT_ADD_STEP(boost patch-install-path
COMMAND sed -i ".bak" "s|-install_name \"|&${TPDIST}/lib/|" ${TPSRC}/boost/tools/build/v2/tools/darwin.jam
DEPENDERS build
DEPENDEES download)
ENDIF (APPLE)
# If building ThirdParty zlib, force zlib build before boost
IF (THIRDPARTY_BUILD_ZLIB)
ADD_DEPENDENCIES(boost zlib-1.2.7)
ENDIF(THIRDPARTY_BUILD_ZLIB)
# Set up CMake variables
SET(Boost_DATE_TIME_LIBRARY boost_date_time)
SET(Boost_DATE_TIME_LIBRARY_DEBUG boost_date_time)
SET(Boost_DATE_TIME_LIBRARY_RELEASE boost_date_time)
SET(Boost_FILESYSTEM_LIBRARY boost_filesystem)
SET(Boost_FILESYSTEM_LIBRARY_DEBUG boost_filesystem)
SET(Boost_FILESYSTEM_LIBRARY_RELEASE boost_filesystem)
SET(Boost_IOSTREAMS_LIBRARY boost_iostreams)
SET(Boost_IOSTREAMS_LIBRARY_DEBUG boost_iostreams)
SET(Boost_IOSTREAMS_LIBRARY_RELEASE boost_iostreams)
SET(Boost_PROGRAM_OPTIONS_LIBRARY boost_program_options)
SET(Boost_PROGRAM_OPTIONS_LIBRARY_DEBUG boost_program_options)
SET(Boost_PROGRAM_OPTIONS_LIBRARY_RELEASE boost_program_options)
SET(Boost_REGEX_LIBRARY boost_regex)
SET(Boost_REGEX_LIBRARY_DEBUG boost_regex)
SET(Boost_REGEX_LIBRARY_RELEASE boost_regex)
SET(Boost_SYSTEM_LIBRARY boost_system)
SET(Boost_SYSTEM_LIBRARY_DEBUG boost_system)
SET(Boost_SYSTEM_LIBRARY_RELEASE boost_system)
SET(Boost_THREAD_LIBRARY boost_thread)
SET(Boost_THREAD_LIBRARY_DEBUG boost_thread)
SET(Boost_THREAD_LIBRARY_RELEASE boost_thread)
SET(Boost_INCLUDE_DIRS ${TPSRC}/dist/include
${TPSRC}/dist/include/boost-1_49)
SET(Boost_LIBRARY_DIRS ${TPSRC}/dist/lib)
LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})
ELSE ()
ELSE ()
EXTERNALPROJECT_ADD(
boost
PREFIX ${TPSRC}
URL ${TPURL}/boost_1_55_0.tar.bz2
URL_MD5 "d6eef4b4cacb2183f2bf265a5a03a354"
STAMP_DIR ${TPSRC}/stamp
STAMP_DIR ${TPBUILD}/stamp
DOWNLOAD_DIR ${TPSRC}
SOURCE_DIR ${TPSRC}/boost
SOURCE_DIR ${TPBUILD}/boost
BINARY_DIR ${TPBUILD}/boost
TMP_DIR ${TPBUILD}/boost-tmp
INSTALL_DIR ${TPDIST}
CONFIGURE_COMMAND bootstrap.bat --prefix=${TPDIST}/boost
BUILD_COMMAND b2 --layout=system install
CONFIGURE_COMMAND call bootstrap.bat
BUILD_COMMAND b2 variant=release
toolset=msvc-12.0
address-model=32
-s NO_BZIP2=1
-s ZLIB_BINARY=zlib
-s ZLIB_INCLUDE=${TPDIST}/include
-s ZLIB_LIBPATH=${TPDIST}/lib
${BOOST_LIB_LIST}
--layout=system --prefix=${TPDIST} install
INSTALL_COMMAND ""
)
ENDIF ()
ELSE (THIRDPARTY_BUILD_BOOST)
ENDIF()
IF (APPLE)
EXTERNALPROJECT_ADD_STEP(boost patch-install-path
COMMAND sed -i ".bak" "s|-install_name \"|&${TPDIST}/lib/|" ${TPSRC}/boost/tools/build/v2/tools/darwin.jam
DEPENDERS build
DEPENDEES download)
ENDIF (APPLE)
# If building ThirdParty zlib, force zlib build before boost
IF (THIRDPARTY_BUILD_ZLIB)
ADD_DEPENDENCIES(boost zlib-1.2.7)
ENDIF(THIRDPARTY_BUILD_ZLIB)
# Set up CMake variables
IF (WIN32)
SET(Boost_DATE_TIME_LIBRARY libboost_date_time)
SET(Boost_DATE_TIME_LIBRARY_DEBUG libboost_date_time)
SET(Boost_DATE_TIME_LIBRARY_RELEASE libboost_date_time)
SET(Boost_FILESYSTEM_LIBRARY libboost_filesystem)
SET(Boost_FILESYSTEM_LIBRARY_DEBUG libboost_filesystem)
SET(Boost_FILESYSTEM_LIBRARY_RELEASE libboost_filesystem)
SET(Boost_IOSTREAMS_LIBRARY libboost_iostreams)
SET(Boost_IOSTREAMS_LIBRARY_DEBUG libboost_iostreams)
SET(Boost_IOSTREAMS_LIBRARY_RELEASE libboost_iostreams)
SET(Boost_PROGRAM_OPTIONS_LIBRARY libboost_program_options)
SET(Boost_PROGRAM_OPTIONS_LIBRARY_DEBUG libboost_program_options)
SET(Boost_PROGRAM_OPTIONS_LIBRARY_RELEASE libboost_program_options)
SET(Boost_REGEX_LIBRARY libboost_regex)
SET(Boost_REGEX_LIBRARY_DEBUG libboost_regex)
SET(Boost_REGEX_LIBRARY_RELEASE libboost_regex)
SET(Boost_SYSTEM_LIBRARY libboost_system)
SET(Boost_SYSTEM_LIBRARY_DEBUG libboost_system)
SET(Boost_SYSTEM_LIBRARY_RELEASE libboost_system)
SET(Boost_THREAD_LIBRARY libboost_thread)
SET(Boost_THREAD_LIBRARY_DEBUG libboost_thread)
SET(Boost_THREAD_LIBRARY_RELEASE libboost_thread)
SET(Boost_INCLUDE_DIRS ${TPDIST}/include)
SET(Boost_LIBRARY_DIRS ${TPDIST}/lib)
MESSAGE(STATUS ${Boost_DATE_TIME_LIBRARY})
LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})
ELSE()
SET(Boost_DATE_TIME_LIBRARY boost_date_time)
SET(Boost_DATE_TIME_LIBRARY_DEBUG boost_date_time)
SET(Boost_DATE_TIME_LIBRARY_RELEASE boost_date_time)
SET(Boost_FILESYSTEM_LIBRARY boost_filesystem)
SET(Boost_FILESYSTEM_LIBRARY_DEBUG boost_filesystem)
SET(Boost_FILESYSTEM_LIBRARY_RELEASE boost_filesystem)
SET(Boost_IOSTREAMS_LIBRARY boost_iostreams)
SET(Boost_IOSTREAMS_LIBRARY_DEBUG boost_iostreams)
SET(Boost_IOSTREAMS_LIBRARY_RELEASE boost_iostreams)
SET(Boost_PROGRAM_OPTIONS_LIBRARY boost_program_options)
SET(Boost_PROGRAM_OPTIONS_LIBRARY_DEBUG boost_program_options)
SET(Boost_PROGRAM_OPTIONS_LIBRARY_RELEASE boost_program_options)
SET(Boost_REGEX_LIBRARY boost_regex)
SET(Boost_REGEX_LIBRARY_DEBUG boost_regex)
SET(Boost_REGEX_LIBRARY_RELEASE boost_regex)
SET(Boost_SYSTEM_LIBRARY boost_system)
SET(Boost_SYSTEM_LIBRARY_DEBUG boost_system)
SET(Boost_SYSTEM_LIBRARY_RELEASE boost_system)
SET(Boost_THREAD_LIBRARY boost_thread)
SET(Boost_THREAD_LIBRARY_DEBUG boost_thread)
SET(Boost_THREAD_LIBRARY_RELEASE boost_thread)
SET(Boost_INCLUDE_DIRS ${TPSRC}/dist/include
${TPSRC}/dist/include/boost-1_49)
SET(Boost_LIBRARY_DIRS ${TPSRC}/dist/lib)
LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})
ENDIF()
ELSE (THIRDPARTY_BUILD_BOOST)
ADD_CUSTOM_TARGET(boost ALL)
SET(Boost_DEBUG 0)
SET(Boost_NO_BOOST_CMAKE ON)
......@@ -117,8 +160,8 @@ ELSE (THIRDPARTY_BUILD_BOOST)
FIND_PACKAGE( Boost QUIET COMPONENTS thread iostreams date_time
filesystem system program_options regex )
ELSE ()
SET(BOOST_ROOT ${TPDIST})
FIND_PACKAGE( Boost QUIET COMPONENTS thread iostreams date_time filesystem system program_options regex)
SET(BOOST_ROOT ${TPDIST})
FIND_PACKAGE( Boost QUIET COMPONENTS thread iostreams date_time filesystem system program_options regex)
ENDIF()
ELSE()
FIND_PACKAGE( Boost COMPONENTS thread iostreams zlib date_time filesystem system program_options regex)
......
......@@ -30,6 +30,7 @@ IF (THIRDPARTY_BUILD_TINYXML)
MARK_AS_ADVANCED(TINYXML_LIB)
LINK_DIRECTORIES(${TPDIST}/lib)
INCLUDE_DIRECTORIES(${TPDIST}/include)
ADD_DEFINITIONS("-DTIXML_USE_STL")
ELSE (THIRDPARTY_BUILD_TINYXML)
INCLUDE (FindTinyXml)
ENDIF (THIRDPARTY_BUILD_TINYXML)
......
......@@ -74,7 +74,7 @@ namespace Nektar
static const DataType* const_pointer(const boost::shared_ptr<DataType>& o) { return o.get(); }
static DataType& reference(const boost::shared_ptr<DataType>& o) { ASSERTL1(o, "Can't dereference null pointer."); return *o; }
static DataType* pointer(const boost::shared_ptr<DataType>& o) { return o.get(); }
static bool ReferencesObject(const boost::shared_ptr<DataType>& o) { return o; }
static bool ReferencesObject(const boost::shared_ptr<DataType>& o) { return o.get(); }
};
}
......
......@@ -52,7 +52,7 @@ namespace SolverUtils {
const std::string& name,
const std::string& value)
{
l.push_back(std::make_pair<std::string, std::string>(name, value));
l.push_back(std::make_pair(name, value));
}
/// Adds a summary item to the summary info list
......@@ -61,7 +61,7 @@ namespace SolverUtils {
const std::string& name,
const int& value)
{
l.push_back(std::make_pair<std::string, std::string>(name, boost::lexical_cast<std::string>(value)));
l.push_back(std::make_pair(name, boost::lexical_cast<std::string>(value)));
}
/// Adds a summary item to the summary info list
......@@ -70,7 +70,7 @@ namespace SolverUtils {
const std::string& name,
const NekDouble& value)
{
l.push_back(std::make_pair<std::string, std::string>(
l.push_back(std::make_pair(
name, str(boost::format("%g") % value)));
}
......
......@@ -183,11 +183,11 @@ namespace Nektar
const Array<OneD, const Array<OneD, NekDouble> > &normals,
const Array<OneD, const Array<OneD, NekDouble> > &vecLocs,
Array<OneD, Array<OneD, NekDouble> > &outarray);
bool CheckScalars (std::string name);
bool CheckVectors (std::string name);
bool CheckParams (std::string name);
bool CheckAuxScal (std::string name);
bool CheckAuxVec (std::string name);
SOLVER_UTILS_EXPORT bool CheckScalars (std::string name);
SOLVER_UTILS_EXPORT bool CheckVectors (std::string name);
SOLVER_UTILS_EXPORT bool CheckParams (std::string name);
SOLVER_UTILS_EXPORT bool CheckAuxScal (std::string name);
SOLVER_UTILS_EXPORT bool CheckAuxVec (std::string name);
};
/// A shared pointer to an EquationSystem object
......
......@@ -21,6 +21,7 @@ SET(TESTER_HEADERS
)
ADD_DEFINITIONS(-DBUILD_PATH="${CMAKE_BINARY_DIR}")
ADD_DEFINITIONS(-DDIST_PATH="${CMAKE_INSTALL_PREFIX}")
IF(CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
ADD_DEFINITIONS(-DRELWITHDEBINFO)
......
......@@ -48,7 +48,7 @@ namespace Nektar
{
// Process test file format.
#if BOOST_VERSION > 104200
m_doc = new TiXmlDocument(pFilename.c_str());
m_doc = new TiXmlDocument(pFilename.string().c_str());
#else
m_doc = new TiXmlDocument(pFilename.file_string().c_str());
#endif
......
......@@ -191,6 +191,7 @@ int main(int argc, char *argv[])
// Change working directory to the temporary directory
fs::current_path(tmpDir);
cout << "Going to directory: " << tmpDir << endl;
// Copy required files for this test from the test definition directory
// to the temporary directory.
......@@ -218,7 +219,13 @@ int main(int argc, char *argv[])
fs::path execPath = startDir / fs::path(file.GetExecutable());
if (!fs::exists(execPath))
{
execPath = fs::path(file.GetExecutable());
execPath = fs::path(std::string(DIST_PATH)+std::string("/bin/"+file.GetExecutable()));
cout << execPath.string() << " " << fs::status(execPath).type() << endl;
if (!fs::exists(execPath))
{
cout << "wat" << endl;
execPath = fs::path(file.GetExecutable());
}
}
command += PortablePath(execPath);
......
......@@ -143,7 +143,7 @@ namespace Nektar
for (cIt = m_mesh->m_composite.begin(); cIt != m_mesh->m_composite.end(); ++cIt)
{
maxId = std::max(cIt->first, maxId);
maxId = (std::max)(cIt->first, maxId);
}
++maxId;
......
......@@ -219,7 +219,7 @@ namespace Nektar
// Figure out the maximum ID so if we need to create new
// composites we can give them a unique ID.
maxId = std::max(maxId, (int)it->second->m_id) + 1;
maxId = (std::max)(maxId, (int)it->second->m_id) + 1;
}
tmp = m_mesh->m_composite;
......
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