Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
7d0e7ec
remove duplicated lines
jgsogo Apr 18, 2020
c0b9627
naive run
jgsogo Apr 18, 2020
93b347e
touch
jgsogo Apr 18, 2020
5156a26
try if python and pip
jgsogo Apr 18, 2020
ddfe479
maybe there is py3 too
jgsogo Apr 18, 2020
2bcbe94
use py3
jgsogo Apr 18, 2020
4a4d651
looking for pip3
jgsogo Apr 18, 2020
31233dc
more packages
jgsogo Apr 18, 2020
7790374
use conanfile.txt
jgsogo Apr 18, 2020
105cc8a
fix typo
jgsogo Apr 18, 2020
9861be0
add python3-dev
jgsogo Apr 18, 2020
50119d9
upgrade pip
jgsogo Apr 18, 2020
5f424a7
show detected profile
jgsogo Apr 18, 2020
69bffd0
add python3-wheel
jgsogo Apr 18, 2020
41054f2
use matrix to update libcxx in gcc
jgsogo Apr 18, 2020
6eac8f7
add macos
jgsogo Apr 18, 2020
7e5a2fe
use always virtualenv
jgsogo Apr 18, 2020
725fa8a
clang in macos
jgsogo Apr 18, 2020
65ed55f
change build dir
jgsogo Apr 18, 2020
7b9435a
Merge branch 'feat/cmake-targets' into feat/ci-travis
jgsogo Apr 18, 2020
6bb1633
use cmake targets
jgsogo Apr 18, 2020
0e128cb
use targets in dynet too
jgsogo Apr 18, 2020
a9d3ee7
link to eigen
jgsogo Apr 18, 2020
4b1ace4
first try with appveyor [skip travisci]
jgsogo Apr 18, 2020
1ec71ae
py3 [skip travisci]
jgsogo Apr 18, 2020
8f7190d
reorder commands
jgsogo Apr 18, 2020
8ce7cb6
use stack [skip travisci]
jgsogo Apr 18, 2020
597885f
use py38 [skip travisci]
jgsogo Apr 18, 2020
9a4511a
add to path [skip travisci]
jgsogo Apr 18, 2020
b70adf9
use workingdir [skip travisci]
jgsogo Apr 18, 2020
83f0993
use forward slash [skip travisci]
jgsogo Apr 18, 2020
5651d41
use nmake [skip travisci]
jgsogo Apr 18, 2020
3100631
activate vcvars [skip travisci]
jgsogo Apr 18, 2020
3ef4219
use icu for i18n backend for boost
jgsogo Apr 30, 2020
68f84fd
build on-the-fly
jgsogo Apr 30, 2020
7fa0d12
add travis_wait
jgsogo Apr 30, 2020
f7fff7b
output too log
jgsogo Apr 30, 2020
9b447d1
workaround
jgsogo Apr 30, 2020
327a9a1
require https://github.com/conan-io/conan-center-index/pull/1502
jgsogo Apr 30, 2020
bc0ae8c
Fix #96. Define global objects, needed for static linking
jgsogo May 18, 2020
b458726
Merge branch 'feat/ci-travis' of github.com:jgsogo/FreeLing into feat…
jgsogo May 18, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .ci/conanfile.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[requires]
boost/1.72.0
icu/64.2
eigen/3.3.7

[options]
boost:shared=True
boost:i18n_backend=icu
icu:with_dyload=False

[generators]
cmake_find_package
42 changes: 42 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
language: cpp

addons:
apt:
packages:
- python3
- python3-pip
- python3-setuptools
- python3-wheel

matrix:
include:
- os: linux
compiler: gcc
before_script:
- conan profile update settings.compiler.libcxx=libstdc++11 default

- os: linux
compiler: clang

- os: osx
osx_image: xcode11.3
env:
- CC=clang
- CXX=clang++


before_install:
- pip3 install -U pip virtualenv
- virtualenv -p python3 ~/venv
- source ~/venv/bin/activate

install:
# Use Conan to install dependencies
- pip3 install -U conan
- conan profile new --detect default

script:
- mkdir build && cd build
- 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 .
16 changes: 7 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down Expand Up @@ -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")
Expand Down
16 changes: 16 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
image: Visual Studio 2017

install:
- C:\Python38-x64\python --version
- set PATH=C:\Python38-x64\Scripts;%PATH%
- C:\Python38-x64\python -m pip install conan

before_build:
- conan profile new --detect default

build_script:
- mkdir build && cd build
- 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
19 changes: 0 additions & 19 deletions src/libdynet/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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})
Expand Down
9 changes: 3 additions & 6 deletions src/libdynet/dynet/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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 Eigen3::Eigen3)
else()
# Build cpu library
add_library(dynet ${dynet_library_SRCS} ${dynet_library_HDRS})
target_link_libraries(dynet ${LIBS})
target_link_libraries(dynet Boost::Boost Eigen3::Eigen3)
endif(WITH_CUDA_BACKEND)

install(FILES ${dynet_library_HDRS} DESTINATION include/dynet)
Expand Down
4 changes: 1 addition & 3 deletions src/libfoma/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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()
Expand All @@ -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 .)

Expand Down
4 changes: 2 additions & 2 deletions src/libfoma/foma/foma.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
9 changes: 1 addition & 8 deletions src/libfreeling/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
Expand Down Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions src/libtreeler/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/libtreeler/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 0 additions & 5 deletions src/main/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
9 changes: 3 additions & 6 deletions src/utilities/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -12,19 +9,19 @@ 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)
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)
Expand Down