Commit 57d04ca7 authored by Dave Moxey's avatar Dave Moxey

Remove dependency on boost date_time

parent 953a9ecb
......@@ -9,8 +9,7 @@
#If the user has not set BOOST_ROOT, look in a couple common places first.
MESSAGE(STATUS "Searching for Boost:")
SET(MIN_VER "1.56.0")
SET(NEEDED_BOOST_LIBS thread iostreams date_time filesystem system
program_options regex)
SET(NEEDED_BOOST_LIBS thread iostreams filesystem system program_options regex)
SET(Boost_DEBUG 0)
SET(Boost_NO_BOOST_CMAKE ON)
IF( BOOST_ROOT )
......
......@@ -34,14 +34,15 @@
////////////////////////////////////////////////////////////////////////////////
#include <boost/asio/ip/host_name.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/date_time/posix_time/posix_time_io.hpp>
#include <boost/format.hpp>
#include <LibUtilities/BasicConst/GitRevision.h>
#include <LibUtilities/BasicUtils/FieldIO.h>
#include <LibUtilities/BasicUtils/FileSystem.h>
#include <chrono>
#include <ctime>
#include <iomanip>
#include <fstream>
#include <set>
......@@ -54,7 +55,6 @@
#endif
namespace berrc = boost::system::errc;
namespace ptime = boost::posix_time;
namespace ip = boost::asio::ip;
namespace Nektar
......@@ -335,11 +335,12 @@ void FieldIO::AddInfoTag(TagWriterSharedPtr root,
ProvenanceMap["NektarVersion"] = string(NEKTAR_VERSION);
// Date/time stamp
ptime::time_facet *facet = new ptime::time_facet("%d-%b-%Y %H:%M:%S");
std::stringstream wss;
wss.imbue(locale(wss.getloc(), facet));
wss << ptime::second_clock::local_time();
ProvenanceMap["Timestamp"] = wss.str();
auto now = std::chrono::system_clock::now();
auto now_t = std::chrono::system_clock::to_time_t(now);
auto now_tm = *std::localtime(&now_t);
char buffer[128];
strftime(buffer, sizeof(buffer), "%d-%b-%Y %H:%M:%S", &now_tm);
ProvenanceMap["Timestamp"] = buffer;
// Hostname
boost::system::error_code ec;
......
......@@ -381,12 +381,9 @@ ENDIF( NEKTAR_USE_ARPACK )
TARGET_LINK_LIBRARIES(LibUtilities LINK_PUBLIC
${Boost_THREAD_LIBRARY}
${Boost_IOSTREAMS_LIBRARY}
${Boost_DATE_TIME_LIBRARY}
${Boost_PROGRAM_OPTIONS_LIBRARY}
${Boost_FILESYSTEM_LIBRARY}
${Boost_SYSTEM_LIBRARY}
${Boost_TIMER_LIBRARY}
${Boost_CHRONO_LIBRARY}
debug ${ZLIB_LIBRARY_DEBUG} optimized ${ZLIB_LIBRARY_RELEASE}
)
......
......@@ -218,7 +218,7 @@ int main(int argc, char *argv[])
command += "@MPIEXEC@ @MPIEXEC_NUMPROC_FLAG@ "
+ boost::lexical_cast<string>(file.GetNProcesses())
+ " ";
if ("@NEKTAR_TEST_USE_HOSTFILE@" == "ON")
if (std::string("@NEKTAR_TEST_USE_HOSTFILE@") == "ON")
{
command += " -hostfile hostfile ";
system("echo 'localhost slots=12' > hostfile");
......
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