Skip to content

Commit

Permalink
disable boost auto-linking in dynet
Browse files Browse the repository at this point in the history
  • Loading branch information
endyul committed Jun 5, 2017
1 parent 56b3138 commit d5c853e
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 90 deletions.
1 change: 0 additions & 1 deletion src/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#define LTP_VERSION "3.3.2"
#define LTP_COPYRIGHT "(C) 2012-2016 HIT-SCIR"

#define BOOST_ALL_NO_LIB

namespace ltp {

Expand Down
5 changes: 0 additions & 5 deletions src/segmentor/preprocessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@
#include "utils/smartmap.hpp"
#include "utils/chartypes.hpp"

#if _WIN32
// disable auto-link feature in boost
#define BOOST_ALL_NO_LIB
#endif

#include "boost/regex.hpp"

namespace ltp {
Expand Down
13 changes: 1 addition & 12 deletions thirdparty/boost/libs/program_options/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,7 @@ INCLUDE_DIRECTORIES( ./

set (boost_program_options_VERSION "1.61")

set (boost_program_options_SRC
src/cmdline.cpp
src/config_file.cpp
src/convert.cpp
src/options_description.cpp
src/parsers.cpp
src/positional_options.cpp
src/split.cpp
src/utf8_codecvt_facet.cpp
src/value_semantic.cpp
src/variables_map.cpp
src/winmain.cpp)
FILE(GLOB boost_program_options_SRC src/*.cpp)

add_library(boost_program_options_static_lib STATIC ${boost_program_options_SRC})
add_library(boost_program_options_shared_lib SHARED ${boost_program_options_SRC})
Expand Down
21 changes: 1 addition & 20 deletions thirdparty/boost/libs/regex/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,7 @@ INCLUDE_DIRECTORIES( ./

set (boost_regex_VERSION "1.61")

set (boost_regex_SRC
src/c_regex_traits.cpp
src/cpp_regex_traits.cpp
src/cregex.cpp
src/fileiter.cpp
src/icu.cpp
src/instances.cpp
src/internals.hpp
src/posix_api.cpp
src/regex.cpp
src/regex_debug.cpp
src/regex_raw_buffer.cpp
src/regex_traits_defaults.cpp
src/static_mutex.cpp
src/usinstances.cpp
src/w32_regex_traits.cpp
src/wc_regex_traits.cpp
src/wide_posix_api.cpp
src/winstances.cpp
)
FILE(GLOB boost_regex_SRC src/*.cpp src/*.hpp)

add_library(boost_regex_static_lib STATIC ${boost_regex_SRC})

Expand Down
43 changes: 1 addition & 42 deletions thirdparty/boost/libs/serialization/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,48 +3,7 @@ INCLUDE_DIRECTORIES( ./

set (boost_serialization_VERSION "1.61")

set (boost_serialization_SRC
src/archive_exception.cpp
src/basic_archive.cpp
src/basic_iarchive.cpp
src/basic_iserializer.cpp
src/basic_oarchive.cpp
src/basic_oserializer.cpp
src/basic_pointer_iserializer.cpp
src/basic_pointer_oserializer.cpp
src/basic_serializer_map.cpp
src/basic_text_iprimitive.cpp
src/basic_text_oprimitive.cpp
src/basic_text_wiprimitive.cpp
src/basic_text_woprimitive.cpp
src/basic_xml_archive.cpp
src/basic_xml_grammar.ipp
src/binary_iarchive.cpp
src/binary_oarchive.cpp
src/binary_wiarchive.cpp
src/binary_woarchive.cpp
src/codecvt_null.cpp
src/extended_type_info.cpp
src/extended_type_info_no_rtti.cpp
src/extended_type_info_typeid.cpp
src/polymorphic_iarchive.cpp
src/polymorphic_oarchive.cpp
src/singleton.cpp
src/stl_port.cpp
src/text_iarchive.cpp
src/text_oarchive.cpp
src/text_wiarchive.cpp
src/text_woarchive.cpp
src/utf8_codecvt_facet.cpp
src/void_cast.cpp
src/xml_archive_exception.cpp
src/xml_grammar.cpp
src/xml_iarchive.cpp
src/xml_oarchive.cpp
src/xml_wgrammar.cpp
src/xml_wiarchive.cpp
src/xml_woarchive.cpp
)
FILE(GLOB boost_serialization_SRC src/*.cpp src/*.ipp)

add_library (boost_serialization_static_lib STATIC ${boost_serialization_SRC})

Expand Down
5 changes: 1 addition & 4 deletions thirdparty/boost/libs/smart_ptr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@ INCLUDE_DIRECTORIES( ./

set (boost_smart_ptr_VERSION "1.61")

set (boost_smart_ptr_SRC
src/sp_collector.cpp
src/sp_debug_hooks.cpp)

FILE(GLOB boost_smart_ptr_SRC src/*.cpp)

add_library(boost_smart_ptr_static_lib STATIC ${boost_smart_ptr_SRC})
add_library(boost_smart_ptr_shared_lib SHARED ${boost_smart_ptr_SRC})
Expand Down
12 changes: 6 additions & 6 deletions thirdparty/dynet/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,13 @@ set(Boost_LIBRARIES
)
message("-- Boost dir is " ${Boost_INCLUDE_DIR})
include_directories(${Boost_INCLUDE_DIR})
if(MSVC)
#if(MSVC)
# Boost does auto-linking when using a compiler like Microsoft Visual C++, we just need to help it find the libraries
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LIBPATH:${Boost_LIBRARY_DIRS}")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /LIBPATH:${Boost_LIBRARY_DIRS}")
else()
set(LIBS ${LIBS} ${Boost_LIBRARIES})
endif()
# set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LIBPATH:${Boost_LIBRARY_DIRS}")
# set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /LIBPATH:${Boost_LIBRARY_DIRS}")
#else()
set(LIBS ${LIBS} ${Boost_LIBRARIES})
#endif()
# trouble shooting:
# if boost library cannot be found, in addition to install boost library
# check if environment variables are set
Expand Down

0 comments on commit d5c853e

Please sign in to comment.