From 9ae55243e25560338095c5e87e191f22019625de Mon Sep 17 00:00:00 2001 From: Hieu Hoang Date: Thu, 4 Oct 2012 15:08:22 +0100 Subject: remove dependency on boost filesystem object --- .../moses-cmd.xcodeproj/project.pbxproj | 3 --- .../other-builds/moses.xcodeproj/project.pbxproj | 8 ------- jam-files/sanity.jam | 1 - moses/src/Jamfile | 2 +- moses/src/StaticData.cpp | 27 +++++++++++++--------- regression-testing/tests | 2 +- 6 files changed, 18 insertions(+), 25 deletions(-) diff --git a/contrib/other-builds/moses-cmd.xcodeproj/project.pbxproj b/contrib/other-builds/moses-cmd.xcodeproj/project.pbxproj index aac225ced..5bf91e2b8 100644 --- a/contrib/other-builds/moses-cmd.xcodeproj/project.pbxproj +++ b/contrib/other-builds/moses-cmd.xcodeproj/project.pbxproj @@ -337,7 +337,6 @@ "-lflm", "-llattice", "-lboost_thread-mt", - "-lboost_filesystem-mt", "-lboost_system-mt", "-lcmph", ); @@ -385,7 +384,6 @@ "-lflm", "-llattice", "-lboost_thread-mt", - "-lboost_filesystem-mt", "-lboost_system-mt", "-lcmph", ); @@ -430,7 +428,6 @@ "-lflm", "-llattice", "-lboost_thread-mt", - "-lboost_filesystem-mt", "-lboost_system-mt", "-lcmph", ); diff --git a/contrib/other-builds/moses.xcodeproj/project.pbxproj b/contrib/other-builds/moses.xcodeproj/project.pbxproj index 2864615c6..91d3ee250 100644 --- a/contrib/other-builds/moses.xcodeproj/project.pbxproj +++ b/contrib/other-builds/moses.xcodeproj/project.pbxproj @@ -135,8 +135,6 @@ 1EC737A814B977AB00238410 /* GlobalLexicalModel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1EC7363F14B977AA00238410 /* GlobalLexicalModel.cpp */; }; 1EC737A914B977AB00238410 /* GlobalLexicalModel.h in Headers */ = {isa = PBXBuildFile; fileRef = 1EC7364014B977AA00238410 /* GlobalLexicalModel.h */; }; 1EC737AA14B977AB00238410 /* gzfilebuf.h in Headers */ = {isa = PBXBuildFile; fileRef = 1EC7364114B977AA00238410 /* gzfilebuf.h */; }; - 1EC737AB14B977AB00238410 /* hash.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1EC7364214B977AA00238410 /* hash.cpp */; }; - 1EC737AC14B977AB00238410 /* hash.h in Headers */ = {isa = PBXBuildFile; fileRef = 1EC7364314B977AA00238410 /* hash.h */; }; 1EC737AD14B977AB00238410 /* Hypothesis.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1EC7364514B977AA00238410 /* Hypothesis.cpp */; }; 1EC737AE14B977AB00238410 /* Hypothesis.h in Headers */ = {isa = PBXBuildFile; fileRef = 1EC7364614B977AA00238410 /* Hypothesis.h */; }; 1EC737AF14B977AB00238410 /* HypothesisStack.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1EC7364714B977AA00238410 /* HypothesisStack.cpp */; }; @@ -465,8 +463,6 @@ 1EC7363F14B977AA00238410 /* GlobalLexicalModel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = GlobalLexicalModel.cpp; path = ../../moses/src/GlobalLexicalModel.cpp; sourceTree = ""; }; 1EC7364014B977AA00238410 /* GlobalLexicalModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GlobalLexicalModel.h; path = ../../moses/src/GlobalLexicalModel.h; sourceTree = ""; }; 1EC7364114B977AA00238410 /* gzfilebuf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = gzfilebuf.h; path = ../../moses/src/gzfilebuf.h; sourceTree = ""; }; - 1EC7364214B977AA00238410 /* hash.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = hash.cpp; path = ../../moses/src/hash.cpp; sourceTree = ""; }; - 1EC7364314B977AA00238410 /* hash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = hash.h; path = ../../moses/src/hash.h; sourceTree = ""; }; 1EC7364414B977AA00238410 /* hypergraph.proto */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = hypergraph.proto; path = ../../moses/src/hypergraph.proto; sourceTree = ""; }; 1EC7364514B977AA00238410 /* Hypothesis.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Hypothesis.cpp; path = ../../moses/src/Hypothesis.cpp; sourceTree = ""; }; 1EC7364614B977AA00238410 /* Hypothesis.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Hypothesis.h; path = ../../moses/src/Hypothesis.h; sourceTree = ""; }; @@ -772,8 +768,6 @@ 1EC7363F14B977AA00238410 /* GlobalLexicalModel.cpp */, 1EC7364014B977AA00238410 /* GlobalLexicalModel.h */, 1EC7364114B977AA00238410 /* gzfilebuf.h */, - 1EC7364214B977AA00238410 /* hash.cpp */, - 1EC7364314B977AA00238410 /* hash.h */, 1EC7364414B977AA00238410 /* hypergraph.proto */, 1EF8F2C3159A61970047B613 /* HypoList.h */, 1EC7364514B977AA00238410 /* Hypothesis.cpp */, @@ -1155,7 +1149,6 @@ 1EC737A714B977AB00238410 /* GenerationDictionary.h in Headers */, 1EC737A914B977AB00238410 /* GlobalLexicalModel.h in Headers */, 1EC737AA14B977AB00238410 /* gzfilebuf.h in Headers */, - 1EC737AC14B977AB00238410 /* hash.h in Headers */, 1EC737AE14B977AB00238410 /* Hypothesis.h in Headers */, 1EC737B014B977AB00238410 /* HypothesisStack.h in Headers */, 1EC737B214B977AB00238410 /* HypothesisStackCubePruning.h in Headers */, @@ -1378,7 +1371,6 @@ 1EC737A414B977AB00238410 /* FloydWarshall.cpp in Sources */, 1EC737A614B977AB00238410 /* GenerationDictionary.cpp in Sources */, 1EC737A814B977AB00238410 /* GlobalLexicalModel.cpp in Sources */, - 1EC737AB14B977AB00238410 /* hash.cpp in Sources */, 1EC737AD14B977AB00238410 /* Hypothesis.cpp in Sources */, 1EC737AF14B977AB00238410 /* HypothesisStack.cpp in Sources */, 1EC737B114B977AB00238410 /* HypothesisStackCubePruning.cpp in Sources */, diff --git a/jam-files/sanity.jam b/jam-files/sanity.jam index 6beec3f94..2aca84e4d 100644 --- a/jam-files/sanity.jam +++ b/jam-files/sanity.jam @@ -152,7 +152,6 @@ rule boost ( min-version ) { boost-lib program_options PROGRAM_OPTIONS_DYN_LINK ; boost-lib unit_test_framework TEST_DYN_LINK ; boost-lib iostreams IOSTREAMS_DYN_LINK ; - boost-lib filesystem FILE_SYSTEM_DYN_LINK : boost_system ; } #Link normally to a library, but sometimes static isn't installed so fall back to dynamic. diff --git a/moses/src/Jamfile b/moses/src/Jamfile index 7589e5098..1ea22eb81 100644 --- a/moses/src/Jamfile +++ b/moses/src/Jamfile @@ -24,6 +24,6 @@ lib moses_internal : [ glob *.cpp DynSAInclude/*.cpp : PhraseDictionary.cpp ThreadPool.cpp SyntacticLanguageModel.cpp ] synlm ThreadPool headers rt ; -lib moses : PhraseDictionary.cpp moses_internal CYKPlusParser//CYKPlusParser CompactPT//CompactPT LM//LM RuleTable//RuleTable Scope3Parser//Scope3Parser fuzzy-match//fuzzy-match headers ../..//z ../../OnDiskPt//OnDiskPt ../..//boost_filesystem ; +lib moses : PhraseDictionary.cpp moses_internal CYKPlusParser//CYKPlusParser CompactPT//CompactPT LM//LM RuleTable//RuleTable Scope3Parser//Scope3Parser fuzzy-match//fuzzy-match headers ../..//z ../../OnDiskPt//OnDiskPt ; alias headers-to-install : [ glob-tree *.h ] ; diff --git a/moses/src/StaticData.cpp b/moses/src/StaticData.cpp index 07a8005f7..48eef17b4 100644 --- a/moses/src/StaticData.cpp +++ b/moses/src/StaticData.cpp @@ -20,9 +20,6 @@ License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ***********************************************************************/ -#include -#include - #include #include "util/check.hh" #include "PhraseDictionaryMemory.h" @@ -1365,16 +1362,24 @@ void StaticData::ClearTransOptionCache() const { void StaticData::SetExecPath(const std::string &path) { - namespace fs = boost::filesystem; - - fs::path full_path( fs::initial_path() ); + /* + namespace fs = boost::filesystem; + + fs::path full_path( fs::initial_path() ); + + full_path = fs::system_complete( fs::path( path ) ); + + //Without file name + m_binPath = full_path.parent_path().string(); + */ - full_path = fs::system_complete( fs::path( path ) ); - - //Without file name - m_binPath = full_path.parent_path().string(); + // NOT TESTED + size_t pos = path.rfind("/"); + if (pos != string::npos) + { + m_binPath = path.substr(0, pos); + } cerr << m_binPath << endl; - } const string &StaticData::GetBinDirectory() const diff --git a/regression-testing/tests b/regression-testing/tests index f0bb48dad..5e518a84c 160000 --- a/regression-testing/tests +++ b/regression-testing/tests @@ -1 +1 @@ -Subproject commit f0bb48dad05db4a12b41f5c8def9c2d097b2e3b4 +Subproject commit 5e518a84c07263e387268e9db1004a134e40f6f6 -- cgit v1.2.3