From 60d472ac562210d4bc1436578f5d76389da87962 Mon Sep 17 00:00:00 2001 From: Dennis Luxen Date: Tue, 20 Jul 2010 13:33:06 +0000 Subject: [PATCH] changing build management to scons --- Makefile | 7 ------ README.TXT | 14 ++++++----- Sconstruct | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 78 insertions(+), 13 deletions(-) delete mode 100644 Makefile create mode 100644 Sconstruct diff --git a/Makefile b/Makefile deleted file mode 100644 index 062c4add8..000000000 --- a/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -all: - g++ -O3 -Wall -Wno-deprecated -fopenmp -march=native -lboost_regex-mt -lboost_iostreams-mt -lboost_thread-mt -lboost_system-mt -o routed routed.cpp -DNDEBUG - g++ createHierarchy.cpp -fopenmp -Wno-deprecated -o createHierarchy -O3 -march=native -DNDEBUG - g++ extractNetwork.cpp -fopenmp -Wno-deprecated -o extractNetwork -O3 -march=native -I/usr/include/libxml2/ -lxml2 -DNDEBUG - g++ extractLargeNetwork.cpp -fopenmp -Wno-deprecated -o extractLargeNetwork -O3 -march=native -I/usr/include/libxml2/ -lxml2 -DNDEBUG -I/usr/include/include -lstxxl -clean: - rm -rf createHierarchy routed extractNetwork *.o *.gch diff --git a/README.TXT b/README.TXT index f518525bd..64ac713a8 100644 --- a/README.TXT +++ b/README.TXT @@ -10,13 +10,15 @@ dependencies are installed: - sparsehash 1.4+ - g++ 4.4+ - libxml2 - - make + - scons 1.20 + - stxxl 1.2.1+ -Once the dependencies are properly installed running 'make' should build the -binaries. The Makefile has been built for Ubuntu 10.04, but it should work -under any recent Linux. It is possible to build and run the binaries under -OS X, but for the time being manual compilation is required. Nevertheless, -the code should compile under any recent flavor of UNIX. +Building the binaries is done by using scons. It should check for required +libraries and header files and report missing ones. + +Once the dependencies are properly installed running 'scons' should build the +binaries. The Sconstruct has been built for Ubuntu 10.04, but it should work +under any recent Linux. Running the Server --- diff --git a/Sconstruct b/Sconstruct new file mode 100644 index 000000000..7cddf2dbf --- /dev/null +++ b/Sconstruct @@ -0,0 +1,70 @@ +#Sconstruct + +import os +import sys + +env = Environment() + +if sys.platform == 'win32': + #SCons really wants to use Microsoft compiler :D + print "Compiling has not been done on Windows" + Exit(-1) +else: #Mac OS X + if sys.platform == 'darwin': + print "Compiling has not been done on Mac" + else: + env.Append(CPPPATH = ['/usr/include', '/usr/include/include', '/usr/include/libxml2/']) + +env.Append(CCFLAGS = ' -O3') +print "Compiling with: ", env['CC'] +conf = Configure(env) +if not conf.CheckCC(): + print "No suitable C++ Compiler installed" + Exit(-1) +if not conf.CheckHeader('omp.h'): + print "Compiler does not support OpenMP. Exiting" + Exit(-1) +if not conf.CheckLib('stxxl'): + print "stxxl library not found. Exiting" + Exit(-1) +if not conf.CheckLibWithHeader('xml2', 'libxml/xmlreader.h', 'CXX'): + print "libxml2 library or header not found. Exiting" + Exit(-1) +if not conf.CheckCXXHeader('stxxl.h'): + print "Could not locate stxxl header. Exiting" + Exit(-1) +if not conf.CheckCXXHeader('google/sparse_hash_map'): + print "Could not find Google Sparsehash library. Exiting" + Exit(-1) +if not conf.CheckCXXHeader('boost/asio.hpp'): + print "boost/asio.hpp not found. Exiting" + Exit(-1) +if not conf.CheckLibWithHeader('boost_thread', 'boost/thread.hpp', 'CXX'): + print "boost/thread.hpp not found. Exiting" + Exit(-1) +if not conf.CheckCXXHeader('boost/bind.hpp'): + print "boost/bind.hpp not found. Exiting" + Exit(-1) +if not conf.CheckCXXHeader('boost/thread.hpp'): + print "boost/thread.hpp not found. Exiting" + Exit(-1) +if not conf.CheckCXXHeader('boost/noncopyable.hpp'): + print "boost/noncopyable.hpp not found. Exiting" + Exit(-1) +if not conf.CheckCXXHeader('boost/shared_ptr.hpp'): + print "boost/shared_ptr.hpp not found. Exiting" + Exit(-1) +if not conf.CheckCXXHeader('kdtree++/kdtree.hpp'): + print "kdtree++/kdtree.hpp not found. Exiting" + Exit(-1) + +env.Append(CCFLAGS = ' -fopenmp') +env.Append(LINKFLAGS = ' -fopenmp') +env.Program("extractNetwork.cpp") +env.Program("extractLargeNetwork.cpp") +env.Program("createHierarchy.cpp") +env.Append(CCFLAGS = ' -lboost_regex -lboost_iostreams -lboost_thread -lboost_system') +env.Append(LINKFLAGS = ' -lboost_regex -lboost_iostreams -lboost_thread -lboost_system') +env.Program("routed.cpp") +env = conf.Finish() +