From 7d0e7ecc7aac0bed9b1c969116e186e3b52178b4 Mon Sep 17 00:00:00 2001 From: jgsogo Date: Sat, 18 Apr 2020 13:19:56 +0200 Subject: [PATCH 01/39] remove duplicated lines --- CMakeLists.txt | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 02ae01bf..62f0a38f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,9 +10,8 @@ if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR}) endif() project(FreeLing) -set(PACKAGE_NAME "FreeLing") set(VERSION "4.1") -set(PACKAGE_STRING "\"${PACKAGE_NAME} ${VERSION}\"") +set(PACKAGE_STRING "\"${CMAKE_PROJECT_NAME} ${VERSION}\"") set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") # Needed to find libraries if not installed in system path # Add compiler definitions @@ -28,10 +27,9 @@ option(TRACES "Enable traces" OFF) option(WARNINGS "Enable warnings" ON) option(XPRESSIVE "Xpressive regex" OFF) option(JAVA_API "Build Java API" OFF) -option(JAVA_API "Build Java API" OFF) option(PERL_API "Build Perl API" OFF) option(PYTHON2_API "Build Python 2.7 API" OFF) -option(PERL_API "Build Perl API" OFF) +option(PYTHON3_API "Build Python 3 API" OFF) # Check for dependencies -- ZLIB find_package(ZLIB REQUIRED) @@ -63,11 +61,11 @@ endif() install(DIRECTORY data/ DESTINATION share/freeling PATTERN "dictionary" EXCLUDE - PATTERN "parameters.*.gz.*" EXCLUDE - PATTERN "model*.gz.*" EXCLUDE - PATTERN "*embeddings*.gz.*" EXCLUDE - PATTERN "model*.crf.*" EXCLUDE - PATTERN "Makefile*" EXCLUDE) + PATTERN "parameters.*.gz.*" EXCLUDE + PATTERN "model*.gz.*" EXCLUDE + PATTERN "*embeddings*.gz.*" EXCLUDE + PATTERN "model*.crf.*" EXCLUDE + PATTERN "Makefile*" EXCLUDE) #### Data installation hooks SET(languages "as;ca;cs;cy;de;en;es;fr;gl;hr;it;nb;pt;ru;sl") From c0b96275bb11979821076fb824414c934b50206a Mon Sep 17 00:00:00 2001 From: jgsogo Date: Sat, 18 Apr 2020 13:26:32 +0200 Subject: [PATCH 02/39] naive run --- .travis.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..d5f4e427 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,10 @@ +language: cpp + +compiler: + - clang + - gcc + +script: + - mkdir _build && cd _build + - cmake .. -DCMAKE_BUILD_TYPE=Release + - cmake --build . From 93b347ea911aba68671afa9368a5bf76873c4fcc Mon Sep 17 00:00:00 2001 From: jgsogo Date: Sat, 18 Apr 2020 13:29:39 +0200 Subject: [PATCH 03/39] touch From 5156a2671f1a8fed436f4f92dc086b455908533f Mon Sep 17 00:00:00 2001 From: jgsogo Date: Sat, 18 Apr 2020 13:36:55 +0200 Subject: [PATCH 04/39] try if python and pip --- .travis.yml | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index d5f4e427..54d02a94 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,17 @@ language: cpp compiler: - - clang - - gcc + - clang + - gcc + +install: + - python --version + - pip --version + - pip install conan + - conan profile show defalt + - conan install boost/1.72.0@ -s build_type=Release -o boost:shared=True script: - - mkdir _build && cd _build - - cmake .. -DCMAKE_BUILD_TYPE=Release - - cmake --build . + - mkdir _build && cd _build + - cmake .. -DCMAKE_BUILD_TYPE=Release + - cmake --build . From ddfe4796c3acb7ed9dd6bb70eac00b9edee83eb3 Mon Sep 17 00:00:00 2001 From: jgsogo Date: Sat, 18 Apr 2020 13:43:37 +0200 Subject: [PATCH 05/39] maybe there is py3 too --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 54d02a94..d745f575 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,6 +6,7 @@ compiler: install: - python --version + - python3 --version - pip --version - pip install conan - conan profile show defalt From 2bcbe94893b9d5ea807ab96b1b82a6b50b7dbf42 Mon Sep 17 00:00:00 2001 From: jgsogo Date: Sat, 18 Apr 2020 13:47:54 +0200 Subject: [PATCH 06/39] use py3 --- .travis.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index d745f575..b4d5450f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,10 +5,9 @@ compiler: - gcc install: - - python --version - python3 --version - - pip --version - - pip install conan + - pip3 --version + - pip3 install conan --user - conan profile show defalt - conan install boost/1.72.0@ -s build_type=Release -o boost:shared=True From 4a4d651dfd10419371e11985f0182cdd0ffacd52 Mon Sep 17 00:00:00 2001 From: jgsogo Date: Sat, 18 Apr 2020 13:55:36 +0200 Subject: [PATCH 07/39] looking for pip3 --- .travis.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index b4d5450f..08bc3670 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,15 +1,21 @@ language: cpp +addons: + apt: + packages: + - "python3" + - "python3-pip" + compiler: - clang - gcc install: - - python3 --version - - pip3 --version + # Use Conan to install dependencies - pip3 install conan --user - conan profile show defalt - - conan install boost/1.72.0@ -s build_type=Release -o boost:shared=True + - conan install icu/64.2@ -g cmake_find_package -s build_type=Release -o boost:shared=True + - conan install boost/1.72.0@ -g cmake_find_package -s build_type=Release -o boost:shared=True script: - mkdir _build && cd _build From 31233dc32f2a4f47f873cc7e69fa523ff714fb2d Mon Sep 17 00:00:00 2001 From: jgsogo Date: Sat, 18 Apr 2020 14:01:10 +0200 Subject: [PATCH 08/39] more packages --- .travis.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 08bc3670..f26d898b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,9 +3,10 @@ language: cpp addons: apt: packages: - - "python3" - - "python3-pip" - + - python3 + - python3-pip + - python3-setuptools + compiler: - clang - gcc From 77903746b01c980b3ed872f99f7a9ee86263b1e9 Mon Sep 17 00:00:00 2001 From: jgsogo Date: Sat, 18 Apr 2020 14:04:48 +0200 Subject: [PATCH 09/39] use conanfile.txt --- .ci/conanfile.txt | 9 +++++++++ .travis.yml | 3 +-- 2 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 .ci/conanfile.txt diff --git a/.ci/conanfile.txt b/.ci/conanfile.txt new file mode 100644 index 00000000..ced59b87 --- /dev/null +++ b/.ci/conanfile.txt @@ -0,0 +1,9 @@ +[requires] +boost/1.72.0 +icu/64.2 + +[options] +boost:shared=True + +[generators] +cmake_find_package diff --git a/.travis.yml b/.travis.yml index f26d898b..0f07c266 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,10 +15,9 @@ install: # Use Conan to install dependencies - pip3 install conan --user - conan profile show defalt - - conan install icu/64.2@ -g cmake_find_package -s build_type=Release -o boost:shared=True - - conan install boost/1.72.0@ -g cmake_find_package -s build_type=Release -o boost:shared=True script: - mkdir _build && cd _build + - conan install ../.ci/conanfile.txt -s build_type=Release - cmake .. -DCMAKE_BUILD_TYPE=Release - cmake --build . From 105cc8aa82de1f7e07fbcede4a30388bd5329954 Mon Sep 17 00:00:00 2001 From: jgsogo Date: Sat, 18 Apr 2020 14:07:06 +0200 Subject: [PATCH 10/39] fix typo --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 0f07c266..d384d717 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,7 +14,7 @@ compiler: install: # Use Conan to install dependencies - pip3 install conan --user - - conan profile show defalt + - conan profile show default script: - mkdir _build && cd _build From 9861be0c0c32a689a067c27a09a088b8bb905ec2 Mon Sep 17 00:00:00 2001 From: jgsogo Date: Sat, 18 Apr 2020 14:08:36 +0200 Subject: [PATCH 11/39] add python3-dev --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index d384d717..f3265ecd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,6 +6,7 @@ addons: - python3 - python3-pip - python3-setuptools + - python3-dev compiler: - clang From 50119d90f14f5b3242e536388fb8784f26575371 Mon Sep 17 00:00:00 2001 From: jgsogo Date: Sat, 18 Apr 2020 14:09:01 +0200 Subject: [PATCH 12/39] upgrade pip --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index f3265ecd..7cd31e6f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,7 +14,7 @@ compiler: install: # Use Conan to install dependencies - - pip3 install conan --user + - pip3 install -U pip conan --user - conan profile show default script: From 5f424a77f38fb6c1d8b7f7e43a4364243c0fab7a Mon Sep 17 00:00:00 2001 From: jgsogo Date: Sat, 18 Apr 2020 14:16:54 +0200 Subject: [PATCH 13/39] show detected profile --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 7cd31e6f..8f1d4945 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,10 +15,11 @@ compiler: install: # Use Conan to install dependencies - pip3 install -U pip conan --user + - conan profile new --detect default - conan profile show default script: - mkdir _build && cd _build - conan install ../.ci/conanfile.txt -s build_type=Release - - cmake .. -DCMAKE_BUILD_TYPE=Release + - cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_MODULE_PATH=$(pwd) - cmake --build . From 69bffd060d3c35c89cab8e645f069d7ab0a7de79 Mon Sep 17 00:00:00 2001 From: jgsogo Date: Sat, 18 Apr 2020 14:19:49 +0200 Subject: [PATCH 14/39] add python3-wheel --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 8f1d4945..07a45005 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,7 @@ addons: - python3 - python3-pip - python3-setuptools - - python3-dev + - python3-wheel compiler: - clang From 41054f238956a6e17fc55073227c350c7ab58c53 Mon Sep 17 00:00:00 2001 From: jgsogo Date: Sat, 18 Apr 2020 14:30:37 +0200 Subject: [PATCH 15/39] use matrix to update libcxx in gcc --- .travis.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 07a45005..5b590abe 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,15 +8,20 @@ addons: - python3-setuptools - python3-wheel -compiler: - - clang - - gcc +matrix: + include: + - os: linux + compiler: gcc + before_script: + - conan profile update settings.compiler.libcxx=libstdc++11 default + + - os: linux + compiler: clang install: # Use Conan to install dependencies - pip3 install -U pip conan --user - conan profile new --detect default - - conan profile show default script: - mkdir _build && cd _build From 6eac8f7700f3d298b80712759c80eba2e4dfa96f Mon Sep 17 00:00:00 2001 From: jgsogo Date: Sat, 18 Apr 2020 16:48:36 +0200 Subject: [PATCH 16/39] add macos --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index 5b590abe..3521d8b5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,6 +18,10 @@ matrix: - os: linux compiler: clang + - os: osx + osx_image: xcode11.3 + + install: # Use Conan to install dependencies - pip3 install -U pip conan --user From 7e5a2fe56b08ca562a6020703a9cd0ffa7f0ad88 Mon Sep 17 00:00:00 2001 From: jgsogo Date: Sat, 18 Apr 2020 17:05:01 +0200 Subject: [PATCH 17/39] use always virtualenv --- .travis.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 3521d8b5..2aa53716 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,9 +22,14 @@ matrix: osx_image: xcode11.3 +before_install: + - pip3 install -U pip virtualenv + - virtualenv -p python3 ~/venv + - source ~/venv/bin/activate + install: # Use Conan to install dependencies - - pip3 install -U pip conan --user + - pip3 install -U conan - conan profile new --detect default script: From 725fa8a8db7f57b6908f98ad70b88f9a653dc81f Mon Sep 17 00:00:00 2001 From: jgsogo Date: Sat, 18 Apr 2020 17:18:10 +0200 Subject: [PATCH 18/39] clang in macos --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index 2aa53716..1ae1bfec 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,6 +20,9 @@ matrix: - os: osx osx_image: xcode11.3 + env: + - CC=clang + - CXX=clang++ before_install: From 65ed55fe11dcbbf0b5ba9796c2625646f63a5687 Mon Sep 17 00:00:00 2001 From: jgsogo Date: Sat, 18 Apr 2020 17:20:10 +0200 Subject: [PATCH 19/39] change build dir --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 1ae1bfec..545e474c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -36,7 +36,7 @@ install: - conan profile new --detect default script: - - mkdir _build && cd _build + - mkdir build && cd build - conan install ../.ci/conanfile.txt -s build_type=Release - cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_MODULE_PATH=$(pwd) - cmake --build . From 6bb1633d58766bfa8e262160916ba3df605d41e5 Mon Sep 17 00:00:00 2001 From: jgsogo Date: Sat, 18 Apr 2020 17:26:22 +0200 Subject: [PATCH 20/39] use cmake targets --- src/libfoma/CMakeLists.txt | 4 +--- src/libfreeling/CMakeLists.txt | 9 +-------- src/libtreeler/CMakeLists.txt | 4 +--- src/main/CMakeLists.txt | 5 ----- src/utilities/CMakeLists.txt | 9 +++------ 5 files changed, 6 insertions(+), 25 deletions(-) diff --git a/src/libfoma/CMakeLists.txt b/src/libfoma/CMakeLists.txt index 8c847830..0dd733ac 100644 --- a/src/libfoma/CMakeLists.txt +++ b/src/libfoma/CMakeLists.txt @@ -1,6 +1,4 @@ -include_directories( ${ZLIB_INCLUDE_DIRS} ) - if (WIN32) add_definitions(-DFOMA_EXPORTS=1 -D_CRT_SECURE_NO_WARNINGS=1 -D_CRT_NONSTDC_NO_DEPRECATE=1 -DYY_NO_UNISTD_H=1 -DNDEBUG=1 -D_WINDOWS=1 -D_USRDLL=1 -DLIBFOMA_EXPORTS=1 -DWIN32=1) endif() @@ -10,7 +8,7 @@ foma/apply.c foma/coaccessible.c foma/constructions.c foma/define.c foma/determi ) add_library(foma ${sources}) -target_link_libraries(foma ${ZLIB_LIBRARIES}) +target_link_libraries(foma ZLIB::ZLIB) set_target_properties(foma PROPERTIES LINKER_LANGUAGE CXX) target_include_directories(foma PUBLIC .) diff --git a/src/libfreeling/CMakeLists.txt b/src/libfreeling/CMakeLists.txt index 667f7b61..2485a07b 100644 --- a/src/libfreeling/CMakeLists.txt +++ b/src/libfreeling/CMakeLists.txt @@ -1,11 +1,4 @@ -include_directories(${Boost_INCLUDE_DIRS}) -include_directories(${ICU_INCLUDE_DIRS}) -include_directories(${ZLIB_INCLUDE_DIRS}) - -link_directories(${Boost_LIBRARY_DIRS}) -link_directories(${ICU_LIBRARY_DIRS}) - if (WIN32) # compiler definitions for windows add_definitions(-DFL_EXPORTS=1 -D_CRT_SECURE_NO_WARNINGS=1 -D_CRT_NONSTDC_NO_DEPRECATE=1 -DNOMINMAX -DNDEBUG=1 -D_WINDOWS=1 -D_USRDLL=1 -DLIBFREELING_EXPORTS=1 -DWIN32=1) @@ -39,7 +32,7 @@ version.cc util.cc regexp.cc traces.cc language.cc configfile.cc analyzer.cc ana ) add_library(freeling ${freeling_SRCS}) -target_link_libraries(freeling foma treeler dynet crfsuite ${Boost_LIBRARIES} ${ICU_UC_LIBRARY} ${ICU_I18N_LIBRARY}) +target_link_libraries(freeling foma treeler dynet crfsuite Boost::Boost ICU::ICU) install(TARGETS freeling RUNTIME DESTINATION bin diff --git a/src/libtreeler/CMakeLists.txt b/src/libtreeler/CMakeLists.txt index ef7250d5..e42e22ad 100644 --- a/src/libtreeler/CMakeLists.txt +++ b/src/libtreeler/CMakeLists.txt @@ -3,8 +3,6 @@ file(GLOB_RECURSE treeler_SRC treeler/base/token.cc treeler/base/fidx.cc treeler/base/dictionary.cc treeler/util/options.cc treeler/util/char-utils.cc treeler/util/timer.cc treeler/io/io-basic.cc treeler/control/factory-base.cc treeler/dep/part-dep1.cc treeler/dep/parser-projdep1.cc treeler/dep/part-dep2.cc treeler/dep/part-dep2-index.cc treeler/dep/parser-projdep2.cc treeler/dep/pos-symbols.cc treeler/dep/dependency_parser.cc treeler/tag/part-tag.cc treeler/tag/tuple-seq.cc treeler/tag/io-tag.cc treeler/class/class-basic.cc treeler/class/io-class.cc treeler/class/fgen-class.cc treeler/class/model-mc.cc treeler/srl/part-srl0.cc treeler/srl/simple-parser.cc treeler/srl/srl_parser.cc ) -include_directories( ${ZLIB_INCLUDE_DIRS} ) - if (WIN32) list(APPEND treeler_SRC treeler/base/windll.cc) add_definitions(-DTREELER_EXPORTS=1 -D_CRT_SECURE_NO_WARNINGS=1 -DNDEBUG=1 -D_WINDOWS=1 -DWIN32=1 -DNOMINMAX=1) @@ -21,7 +19,7 @@ endif() add_library(treeler ${treeler_SRC}) set_target_properties(treeler PROPERTIES LINKER_LANGUAGE CXX) -target_link_libraries(treeler ${ZLIB_LIBRARIES}) +target_link_libraries(treeler ZLIB::ZLIB) target_include_directories(treeler PUBLIC .) # TODO: Here we are also including 'main' install(TARGETS treeler diff --git a/src/main/CMakeLists.txt b/src/main/CMakeLists.txt index 1b95b8a0..83156891 100644 --- a/src/main/CMakeLists.txt +++ b/src/main/CMakeLists.txt @@ -1,9 +1,4 @@ -# Dependencies -include_directories(${Boost_INCLUDE_DIR}) -include_directories(${ICU_INCLUDE_DIRS}) -include_directories(${ZLIB_INCLUDE_DIRS}) - if (WIN32) # compiler defintions for windows add_definitions(-D_CRT_SECURE_NO_WARNINGS=1 -D_CRT_NONSTDC_NO_DEPRECATE=1 -DNOMINMAX -DNDEBUG=1 -DWIN32=1 -D_CONSOLE=1) diff --git a/src/utilities/CMakeLists.txt b/src/utilities/CMakeLists.txt index 2b070e9e..80e8d1d9 100644 --- a/src/utilities/CMakeLists.txt +++ b/src/utilities/CMakeLists.txt @@ -1,7 +1,4 @@ -include_directories(${Boost_INCLUDE_DIR}) -include_directories(${ICU_INCLUDE_DIRS}) - if (WIN32) # compiler defintions for windows add_definitions(-D_CRT_SECURE_NO_WARNINGS=1 -D_CRT_NONSTDC_NO_DEPRECATE=1 -DNOMINMAX -DNDEBUG=1 -DWIN32=1 -D_CONSOLE=1) @@ -12,11 +9,11 @@ endif() # build-dict add_executable(build-dict installation/build-dict.cc) -target_link_libraries(build-dict ${Boost_LIBRARIES}) +target_link_libraries(build-dict Boost::Boost) # fusion-mw add_executable(fusion-mw installation/fusion-mw.cc) -target_link_libraries(fusion-mw ${Boost_LIBRARIES}) +target_link_libraries(fusion-mw Boost::Boost) # dicc2phon add_executable(dicc2phon installation/dicc2phon.cc) @@ -24,7 +21,7 @@ target_link_libraries(dicc2phon freeling) # gz-cat add_executable(gz-cat installation/gz-cat.cc) -target_link_libraries(gz-cat freeling ${Boost_LIBRARIES}) +target_link_libraries(gz-cat freeling Boost::Boost) # convert_model add_executable(convert_model embeddings/convert_model.cc) From 0e128cbe673759a2d7f489fcec4a763675abaeda Mon Sep 17 00:00:00 2001 From: jgsogo Date: Sat, 18 Apr 2020 17:41:25 +0200 Subject: [PATCH 21/39] use targets in dynet too --- .ci/conanfile.txt | 1 + src/libdynet/CMakeLists.txt | 19 ------------------- src/libdynet/dynet/CMakeLists.txt | 9 +++------ 3 files changed, 4 insertions(+), 25 deletions(-) diff --git a/.ci/conanfile.txt b/.ci/conanfile.txt index ced59b87..71b81050 100644 --- a/.ci/conanfile.txt +++ b/.ci/conanfile.txt @@ -1,6 +1,7 @@ [requires] boost/1.72.0 icu/64.2 +eigen/3.3.7 [options] boost:shared=True diff --git a/src/libdynet/CMakeLists.txt b/src/libdynet/CMakeLists.txt index f592036b..78f7cb06 100644 --- a/src/libdynet/CMakeLists.txt +++ b/src/libdynet/CMakeLists.txt @@ -1,8 +1,6 @@ project(dynet) cmake_minimum_required(VERSION 2.8 FATAL_ERROR) -set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) - # DYNET uses Eigen which exploits modern CPU architectures. To get the # best possible performance, the following are recommended: # 1. use very recent versions of gcc or Clang to build @@ -126,13 +124,6 @@ if(ENABLE_BOOST) set(Boost_REALPATH ON) find_package(Boost COMPONENTS program_options regex serialization REQUIRED) message("-- Boost dir is " ${Boost_INCLUDE_DIR}) - include_directories(${Boost_INCLUDE_DIR}) - if(MSVC) - 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() endif() if(BACKEND) @@ -171,17 +162,7 @@ if (WITH_CUDA_BACKEND) endif() # look for Eigen -if (DEFINED ENV{EIGEN3_INCLUDE_DIR} AND NOT DEFINED EIGEN3_INCLUDE_DIR) # use env variable if not set - set(EIGEN3_INCLUDE_DIR $ENV{EIGEN3_INCLUDE_DIR}) -endif() -get_filename_component(EIGEN3_INCLUDE_DIR "${EIGEN3_INCLUDE_DIR}" REALPATH BASE_DIR "${CMAKE_BINARY_DIR}") -set(EIGEN3_INCLUDE_DIR ${EIGEN3_INCLUDE_DIR} CACHE STRING "" FORCE) -message("-- Eigen dir is " ${EIGEN3_INCLUDE_DIR}) find_package(Eigen3 REQUIRED) -include_directories(${EIGEN3_INCLUDE_DIR}) - -FIND_PACKAGE(Threads REQUIRED) -set(LIBS ${LIBS} ${CMAKE_THREAD_LIBS_INIT}) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h) include_directories(${CMAKE_CURRENT_BINARY_DIR}) diff --git a/src/libdynet/dynet/CMakeLists.txt b/src/libdynet/dynet/CMakeLists.txt index 5a69b89c..b5f11e82 100644 --- a/src/libdynet/dynet/CMakeLists.txt +++ b/src/libdynet/dynet/CMakeLists.txt @@ -207,9 +207,6 @@ set(dynet_gpu_SRCS gpu-ops.cu) file(GLOB TEST_SRCS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} tests/*.cc) -if (NOT MSVC) - set(BUILD_SHARED_LIBS ON) -endif() #foreach(test_src ${TEST_SRCS}) #Extract the filename without an extension (NAME_WE) @@ -219,7 +216,7 @@ endif() # add_executable(${testName} ${test_src}) #link to Boost libraries AND your targets and dependencies -# target_link_libraries(${testName} dynet ${LIBS}) +# target_link_libraries(${testName} dynet Boost::Boost) # set_target_properties(${testName} PROPERTIES # RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/tests.bin) @@ -292,11 +289,11 @@ if(WITH_CUDA_BACKEND) target_compile_definitions(dynet PRIVATE HAVE_CUDNN) endif() cuda_add_cublas_to_target(dynet) - target_link_libraries(dynet ${LIBS}) + target_link_libraries(dynet Boost::Boost) else() # Build cpu library add_library(dynet ${dynet_library_SRCS} ${dynet_library_HDRS}) - target_link_libraries(dynet ${LIBS}) + target_link_libraries(dynet Boost::Boost) endif(WITH_CUDA_BACKEND) install(FILES ${dynet_library_HDRS} DESTINATION include/dynet) From a9d3ee7d882a3e25be7944cdd5f1465eea04c330 Mon Sep 17 00:00:00 2001 From: jgsogo Date: Sat, 18 Apr 2020 18:01:44 +0200 Subject: [PATCH 22/39] link to eigen --- src/libdynet/dynet/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libdynet/dynet/CMakeLists.txt b/src/libdynet/dynet/CMakeLists.txt index b5f11e82..e39253f5 100644 --- a/src/libdynet/dynet/CMakeLists.txt +++ b/src/libdynet/dynet/CMakeLists.txt @@ -289,11 +289,11 @@ if(WITH_CUDA_BACKEND) target_compile_definitions(dynet PRIVATE HAVE_CUDNN) endif() cuda_add_cublas_to_target(dynet) - target_link_libraries(dynet Boost::Boost) + target_link_libraries(dynet Boost::Boost Eigen3::Eigen3) else() # Build cpu library add_library(dynet ${dynet_library_SRCS} ${dynet_library_HDRS}) - target_link_libraries(dynet Boost::Boost) + target_link_libraries(dynet Boost::Boost Eigen3::Eigen3) endif(WITH_CUDA_BACKEND) install(FILES ${dynet_library_HDRS} DESTINATION include/dynet) From 4b1ace438b071ff0fbd4c56198dd810ab0cafab3 Mon Sep 17 00:00:00 2001 From: jgsogo Date: Sat, 18 Apr 2020 18:22:05 +0200 Subject: [PATCH 23/39] first try with appveyor [skip travisci] --- appveyor.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 appveyor.yml diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 00000000..715ef74b --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,15 @@ +image: Visual Studio 2019 + +install: + - python --version + # batch commands start from cmd: + - pip install conan + +before_build: + - conan profile new --detect default + - conan profile show default + - conan install ../.ci/conanfile.txt -s build_type=Release + +build_script: + - cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_MODULE_PATH=$(pwd) + - cmake --build . From 1ec71ae17e05b7d32c152d586353c6bd40330b51 Mon Sep 17 00:00:00 2001 From: jgsogo Date: Sat, 18 Apr 2020 18:28:52 +0200 Subject: [PATCH 24/39] py3 [skip travisci] --- appveyor.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/appveyor.yml b/appveyor.yml index 715ef74b..8c14d21c 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -2,8 +2,12 @@ image: Visual Studio 2019 install: - python --version + - python3 --version # batch commands start from cmd: - pip install conan + - pip3 install -U pip virtualenv + - virtualenv -p python3 ~/venv + - source ~/venv/bin/activate before_build: - conan profile new --detect default From 8f7190da1af73c885c5780506f093ad82aa458e4 Mon Sep 17 00:00:00 2001 From: jgsogo Date: Sat, 18 Apr 2020 18:30:01 +0200 Subject: [PATCH 25/39] reorder commands --- appveyor.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 8c14d21c..90011e29 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -12,8 +12,9 @@ install: before_build: - conan profile new --detect default - conan profile show default - - conan install ../.ci/conanfile.txt -s build_type=Release build_script: + - mkdir build && cd build + - conan install ../.ci/conanfile.txt -s build_type=Release - cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_MODULE_PATH=$(pwd) - cmake --build . From 8ce7cb63e2eb44d01822b04a340f75ac772a29ec Mon Sep 17 00:00:00 2001 From: jgsogo Date: Sat, 18 Apr 2020 18:37:09 +0200 Subject: [PATCH 26/39] use stack [skip travisci] --- appveyor.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/appveyor.yml b/appveyor.yml index 90011e29..e513712e 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,5 @@ image: Visual Studio 2019 +stack: python 3.6 install: - python --version From 597885fa9a0ba1792cf13853bd57405072696a28 Mon Sep 17 00:00:00 2001 From: jgsogo Date: Sat, 18 Apr 2020 18:40:26 +0200 Subject: [PATCH 27/39] use py38 [skip travisci] --- appveyor.yml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index e513712e..448a13bb 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,14 +1,8 @@ image: Visual Studio 2019 -stack: python 3.6 install: - - python --version - - python3 --version - # batch commands start from cmd: - - pip install conan - - pip3 install -U pip virtualenv - - virtualenv -p python3 ~/venv - - source ~/venv/bin/activate + - C:\Python38-x64\python --version + - C:\Python38-x64\python -m pip install conan before_build: - conan profile new --detect default From 9a4511a1e2571faa7ea866d58b1379721d8a5b18 Mon Sep 17 00:00:00 2001 From: jgsogo Date: Sat, 18 Apr 2020 18:45:09 +0200 Subject: [PATCH 28/39] add to path [skip travisci] --- appveyor.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/appveyor.yml b/appveyor.yml index 448a13bb..ccc5f477 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -2,6 +2,7 @@ image: Visual Studio 2019 install: - C:\Python38-x64\python --version + - set PATH=C:\Python38-x64\Scripts;%PATH% - C:\Python38-x64\python -m pip install conan before_build: From b70adf9912942c7d3001acf443faad5a1064f7d7 Mon Sep 17 00:00:00 2001 From: jgsogo Date: Sat, 18 Apr 2020 18:50:54 +0200 Subject: [PATCH 29/39] use workingdir [skip travisci] --- appveyor.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index ccc5f477..1d9c9ec9 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -7,10 +7,9 @@ install: before_build: - conan profile new --detect default - - conan profile show default build_script: - mkdir build && cd build - conan install ../.ci/conanfile.txt -s build_type=Release - - cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_MODULE_PATH=$(pwd) + - cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_MODULE_PATH=%cd% - cmake --build . From 83f0993fb0a2248426c696d8776bee3060026716 Mon Sep 17 00:00:00 2001 From: jgsogo Date: Sat, 18 Apr 2020 18:57:35 +0200 Subject: [PATCH 30/39] use forward slash [skip travisci] --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 1d9c9ec9..d5d51947 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -11,5 +11,5 @@ before_build: build_script: - mkdir build && cd build - conan install ../.ci/conanfile.txt -s build_type=Release - - cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_MODULE_PATH=%cd% + - cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_MODULE_PATH=%cd:\=/% - cmake --build . From 5651d41ebc0c298a49fee37e506dc2ab790f89f9 Mon Sep 17 00:00:00 2001 From: jgsogo Date: Sat, 18 Apr 2020 19:09:15 +0200 Subject: [PATCH 31/39] use nmake [skip travisci] --- appveyor.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index d5d51947..48893ff2 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -11,5 +11,5 @@ before_build: build_script: - mkdir build && cd build - conan install ../.ci/conanfile.txt -s build_type=Release - - cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_MODULE_PATH=%cd:\=/% - - cmake --build . + - cmake .. -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_MODULE_PATH=%cd:\=/% + - nmake install From 31006315e48dedfca9b8ab90859608fd28b31436 Mon Sep 17 00:00:00 2001 From: jgsogo Date: Sat, 18 Apr 2020 19:20:32 +0200 Subject: [PATCH 32/39] activate vcvars [skip travisci] --- appveyor.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 48893ff2..43dd3c0a 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,4 @@ -image: Visual Studio 2019 +image: Visual Studio 2017 install: - C:\Python38-x64\python --version @@ -11,5 +11,6 @@ before_build: build_script: - mkdir build && cd build - conan install ../.ci/conanfile.txt -s build_type=Release + - call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat" - cmake .. -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_MODULE_PATH=%cd:\=/% - nmake install From 3ef42194ca3add51cb4ba9e6b80de2f6e1b0daef Mon Sep 17 00:00:00 2001 From: "Javier G. Sogo" Date: Thu, 30 Apr 2020 15:22:00 +0200 Subject: [PATCH 33/39] use icu for i18n backend for boost --- .ci/conanfile.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/.ci/conanfile.txt b/.ci/conanfile.txt index 71b81050..83b83a4a 100644 --- a/.ci/conanfile.txt +++ b/.ci/conanfile.txt @@ -5,6 +5,7 @@ eigen/3.3.7 [options] boost:shared=True +boost:i18n_backend=icu [generators] cmake_find_package From 68f84fd57978081f00cda69123b5613ed5ee37bc Mon Sep 17 00:00:00 2001 From: "Javier G. Sogo" Date: Thu, 30 Apr 2020 15:33:39 +0200 Subject: [PATCH 34/39] build on-the-fly --- .travis.yml | 2 +- appveyor.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 545e474c..81ed8ffd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,6 +37,6 @@ install: script: - mkdir build && cd build - - conan install ../.ci/conanfile.txt -s build_type=Release + - conan install ../.ci/conanfile.txt -s compiler.cppstd=11 -s build_type=Release --build missing - cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_MODULE_PATH=$(pwd) - cmake --build . diff --git a/appveyor.yml b/appveyor.yml index 43dd3c0a..612fc8c7 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -10,7 +10,7 @@ before_build: build_script: - mkdir build && cd build - - conan install ../.ci/conanfile.txt -s build_type=Release + - conan install ../.ci/conanfile.txt -s compiler.cppstd=11 -s build_type=Release --build missing - call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat" - cmake .. -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_MODULE_PATH=%cd:\=/% - nmake install From 7fa0d12ec08c56ee778df1338201396b5c485dbb Mon Sep 17 00:00:00 2001 From: "Javier G. Sogo" Date: Thu, 30 Apr 2020 16:19:24 +0200 Subject: [PATCH 35/39] add travis_wait --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 81ed8ffd..8a0a526c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,6 +37,6 @@ install: script: - mkdir build && cd build - - conan install ../.ci/conanfile.txt -s compiler.cppstd=11 -s build_type=Release --build missing + - travis_wait conan install ../.ci/conanfile.txt -s compiler.cppstd=11 -s build_type=Release --build missing - cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_MODULE_PATH=$(pwd) - cmake --build . From f7fff7b4ce86a2260773a8a99383b0e30372bbfc Mon Sep 17 00:00:00 2001 From: "Javier G. Sogo" Date: Thu, 30 Apr 2020 16:35:58 +0200 Subject: [PATCH 36/39] output too log --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 8a0a526c..755ed532 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,6 +37,6 @@ install: script: - mkdir build && cd build - - travis_wait conan install ../.ci/conanfile.txt -s compiler.cppstd=11 -s build_type=Release --build missing + - travis_wait conan install ../.ci/conanfile.txt -s compiler.cppstd=11 -s build_type=Release --build missing > build.log - cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_MODULE_PATH=$(pwd) - cmake --build . From 9b447d123e851fdf46a811de70d74abf8b638a74 Mon Sep 17 00:00:00 2001 From: "Javier G. Sogo" Date: Thu, 30 Apr 2020 17:22:03 +0200 Subject: [PATCH 37/39] workaround --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 755ed532..f76b8512 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,6 +37,6 @@ install: script: - mkdir build && cd build - - travis_wait conan install ../.ci/conanfile.txt -s compiler.cppstd=11 -s build_type=Release --build missing > build.log + - travis_wait sh -c 'conan install ../.ci/conanfile.txt -s compiler.cppstd=11 -s build_type=Release --build missing > build.log' - cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_MODULE_PATH=$(pwd) - cmake --build . From 327a9a186b7d537458cb13c87bbb2ec69aa86500 Mon Sep 17 00:00:00 2001 From: "Javier G. Sogo" Date: Thu, 30 Apr 2020 22:13:29 +0200 Subject: [PATCH 38/39] require https://github.com/conan-io/conan-center-index/pull/1502 --- .ci/conanfile.txt | 1 + src/libtreeler/main/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.ci/conanfile.txt b/.ci/conanfile.txt index 83b83a4a..e65959cc 100644 --- a/.ci/conanfile.txt +++ b/.ci/conanfile.txt @@ -6,6 +6,7 @@ eigen/3.3.7 [options] boost:shared=True boost:i18n_backend=icu +icu:with_dyload=False [generators] cmake_find_package diff --git a/src/libtreeler/main/CMakeLists.txt b/src/libtreeler/main/CMakeLists.txt index f7c77915..c2a60c67 100644 --- a/src/libtreeler/main/CMakeLists.txt +++ b/src/libtreeler/main/CMakeLists.txt @@ -8,7 +8,7 @@ endif() add_executable(treeler_bin ${treeler_main_SRC}) target_include_directories(treeler_bin PRIVATE .) -target_link_libraries(treeler_bin treeler ${ZLIB_LIBRARIES}) +target_link_libraries(treeler_bin treeler ZLIB::ZLIB) set_target_properties(treeler_bin PROPERTIES OUTPUT_NAME treeler) install(TARGETS treeler_bin From bc0ae8cb3bcd578cdd96a2bc75e6be250bc68ece Mon Sep 17 00:00:00 2001 From: jgsogo Date: Mon, 18 May 2020 22:15:50 +0200 Subject: [PATCH 39/39] Fix #96. Define global objects, needed for static linking --- src/libfoma/foma/foma.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libfoma/foma/foma.h b/src/libfoma/foma/foma.h index 31bf857a..27a76cc7 100644 --- a/src/libfoma/foma/foma.h +++ b/src/libfoma/foma/foma.h @@ -25,8 +25,8 @@ #define PROMPT_A 1 /* Apply prompt */ #ifdef MAIN_MODULE -struct defined_networks *g_defines; -struct defined_functions *g_defines_f; +struct defined_networks *g_defines = 0; +struct defined_functions *g_defines_f = 0; #else extern struct defined_networks *g_defines; extern struct defined_functions *g_defines_f;