diff --git a/ports/liblinear/CMakeLists.txt b/ports/liblinear/CMakeLists.txt new file mode 100644 index 0000000000..6e6928a914 --- /dev/null +++ b/ports/liblinear/CMakeLists.txt @@ -0,0 +1,47 @@ +cmake_minimum_required(VERSION 3.9) +project(liblinear) + +add_definitions(-D_CRT_SECURE_NO_DEPRECATE) + +add_library(blas OBJECT + blas/daxpy.c + blas/ddot.c + blas/dnrm2.c + blas/dscal.c +) + +add_library(liblinear + linear.cpp + tron.cpp + $ +) +target_include_directories(liblinear PRIVATE .) +if(BUILD_SHARED_LIBS) + target_link_libraries(liblinear PRIVATE "-DEF:${CMAKE_CURRENT_SOURCE_DIR}/linear.def") +endif() + +add_executable(train train.c $) +target_link_libraries(train liblinear) + +add_executable(predict predict.c $) +target_link_libraries(predict liblinear) + +install( + TARGETS liblinear + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib +) + +if(NOT DISABLE_INSTALL_TOOLS) + install( + TARGETS train predict + RUNTIME DESTINATION tools/liblinear + ) +endif() + +if(NOT DISABLE_INSTALL_HEADERS) + install( + FILES linear.h tron.h + DESTINATION include/liblinear) +endif() \ No newline at end of file diff --git a/ports/liblinear/CONTROL b/ports/liblinear/CONTROL new file mode 100644 index 0000000000..3e83e601d4 --- /dev/null +++ b/ports/liblinear/CONTROL @@ -0,0 +1,3 @@ +Source: liblinear +Version: 2.20 +Description: A Library for Large Linear Classification diff --git a/ports/liblinear/portfile.cmake b/ports/liblinear/portfile.cmake new file mode 100644 index 0000000000..4d662d0a5d --- /dev/null +++ b/ports/liblinear/portfile.cmake @@ -0,0 +1,26 @@ +include(vcpkg_common_functions) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO cjlin1/liblinear + REF v220 + SHA512 cde798b7cb221513cf2b8bbe134d6c3dce1ed26c43504d8c09dbed93b82ca47bfd271d4dd3d03384187273906ce140d4ce4418a4a8c21410015ec1631c1042c6 + HEAD_REF master +) + +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS_DEBUG + -DDISABLE_INSTALL_HEADERS=ON + -DDISABLE_INSTALL_TOOLS=ON +) + +vcpkg_install_cmake() +vcpkg_copy_pdbs() +vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/liblinear) + +file(INSTALL ${SOURCE_PATH}/COPYRIGHT DESTINATION ${CURRENT_PACKAGES_DIR}/share/liblinear RENAME copyright) +file(INSTALL ${SOURCE_PATH}/README DESTINATION ${CURRENT_PACKAGES_DIR}/share/liblinear)