SoftwareNetwork / sw

Software Manager. Build System, Build System Generator and Package Manager. C/C++ and other languages. Tools and libraries for Software Management.
https://software-network.org
Other
113 stars 23 forks source link

Build davisking.dlib failed, not exist zlib.h and mex.h #78

Open z-pc opened 3 years ago

z-pc commented 3 years ago

Describe the bug I add "org.sw.demo.davisking.dlib", the compiler (VS2019 16.10.1) not found "zlib.h " and "mex.h" This's some last error lines:

1>[148/3934] [org.sw.demo.davisking.dlib-19.17.0]/dlib/test/probabilistic.cpp
1>[149/3934] [org.sw.demo.davisking.dlib-19.17.0]/dlib/cmake_utils/test_for_cpp11/cpp11_test.cpp
1>Exception in file D:/dev/cppan2/client2/src/sw/builder/command.cpp:764, function execute1: When executing: [org.sw.demo.davisking.dlib-19.17.0]/dlib/test/blas_bindings/vector.cpp
1>C:/Users/TuanAnh/.sw/storage/pkg/0a/aa/5e2e/src/sdir/dlib/test/blas_bindings/vector.cpp(9): fatal error C1189: #error:  "BLAS bindings must be used for this test to make any sense"
1>command failed: exit code = 2
1>Exception in file D:/dev/cppan2/client2/src/sw/builder/command.cpp:764, function execute1: When executing: [org.sw.demo.davisking.dlib-19.17.0]/dlib/external/libpng/pngpread.c
1>C:\Users\TuanAnh\.sw\storage\pkg\0a\aa\5e2e\src\sdir\dlib\external\libpng\pngstruct.h(31): fatal error C1083: Cannot open include file: 'zlib.h': No such file or directory
1>command failed: exit code = 2
1>Exception in file D:/dev/cppan2/client2/src/sw/builder/command.cpp:764, function execute1: When executing: [org.sw.demo.davisking.dlib-19.17.0]/dlib/matlab/example_mex_class.cpp
1>C:\Users\TuanAnh\.sw\storage\pkg\0a\aa\5e2e\src\sdir\dlib\matlab\mex_wrapper.cpp(114): fatal error C1083: Cannot open include file: 'mex.h': No such file or directory
1>command failed: exit code = 2
1>Total errors: 3
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(241,5): error MSB8066: Custom build for 'G:\OCR\OCREngine\buildvs2019\CMakeFiles\cb97bb6989e5eaed4086d4f11b2765ae\sw_build_dependencies.rule' exited with code 1.
1>Done building project "sw_build_dependencies.vcxproj" -- FAILED.

I tried again by "Actions" from website, same error. Some main lines in CMakeFile:

cmake_minimum_required(VERSION 3.17 FATAL_ERROR)
set(SW_BUILD_SHARED_LIBS 0)
find_package(SW REQUIRED)
sw_add_package(
    ${LIBTESSERACT}
    #org.sw.demo.boost.geometry
    org.sw.demo.danbloomberg.leptonica
    org.sw.demo.artifexsoftware.mupdf
    org.sw.demo.davisking.dlib
    )
sw_execute()

add_executable(example_classifier
    example/example_classifier.cpp)

target_link_libraries(example_classifier
    PUBLIC org.sw.demo.davisking.dlib)

Did I miss something? Thanks.

Information: " sw.client.sw version 1.0.0 git revision db82472ee934dfb8e064af419d4d8d4254b724a3 assembled on 02.06.2021 21:58:26 UTC 03.06.2021 04:58:26 SE Asia Standard Time " VS2019 16.10.1

egorpugin commented 3 years ago

Hi,

dlib was not packaged properly. It is huge. I added it only as a stub.

egorpugin commented 3 years ago

If you want to use it within sw, I need help in packaging.

Instruction:

  1. Create sw.cpp with contents from https://software-network.org/org.sw.demo.davisking.dlib/specification
  2. Update dlib version there to get the latest release (19.22).
  3. Run sw build --fetch in the directory with sw.cpp.
  4. Fix raised issues in build script (sw.cpp).