Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake #7

Open
zumm opened this issue Jun 7, 2019 · 41 comments

Comments

Projects
None yet
2 participants
@zumm
Copy link

commented Jun 7, 2019

Hi. I'm trying to use SW with CMake, but there is some issue:

"C:\Program Files\JetBrains\CLion\bin\cmake\win\bin\cmake.exe" -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - NMake Makefiles" C:\Users\zumm\Projects\CPP\untitled
-- sw: processing dependencies
Exception in file D:\dev\cppan2\client\src\sw\client\integration.cpp:59, function cli_integrate: TODO: unimplemented
sw command: C:/Windows/SW.exe -shared -platform x86 -d C:/Users/zumm/Projects/CPP/untitled/cmake-build-debug/.sw/cmake integrate -cmake-deps C:/Users/zumm/Projects/CPP/untitled/cmake-build-debug/.sw/cmake/sw.txt
CMake Error at C:/Users/zumm/.sw/storage/etc/sw/static/SWConfig.cmake:112 (message):
sw: non-zero exit code - 1
Call Stack (most recent call first):
CMakeLists.txt:18 (sw_execute)

-- Configuring incomplete, errors occurred!
See also "C:/Users/zumm/Projects/CPP/untitled/cmake-build-debug/CMakeFiles/CMakeOutput.log".

[Failed to reload]

My CMakeLists.txt is:

cmake_minimum_required(VERSION 3.13)

project(untitled)

set(CMAKE_CXX_STANDARD 14)
set(SW_BUILD_SHARED_LIBS 1)
set(DEPENDENCIES
    org.sw.demo.google.tesseract.libtesseract
)

find_package(SW REQUIRED)
sw_add_package(${DEPENDENCIES})
sw_execute()

add_executable(${PROJECT_NAME} main.cpp)
target_link_libraries(${PROJECT_NAME} ${DEPENDENCIES})
@egorpugin

This comment has been minimized.

Copy link
Contributor

commented Jun 7, 2019

Hi,

Sorry for that, sw is now reorganizing a bit, so this functionality was turned off for some time.
I'll try to turn on it back and ping you here.

@zumm

This comment has been minimized.

Copy link
Author

commented Jun 7, 2019

I will wait. Thank you.

@egorpugin

This comment has been minimized.

Copy link
Contributor

commented Jun 7, 2019

Hopefully fixed in 08d8b64
(test from https://github.com/SoftwareNetwork/sw/tree/b0.3.0/test/integrations works for me now)

Please, try it and report any issues.

Run sw --self-upgrade to update sw client.

@zumm

This comment has been minimized.

Copy link
Author

commented Jun 8, 2019

I have tested it. Now i got this error:

Exception in file D:\dev\cppan2\client\src\sw\builder\command.cpp:616, function execute1: When executing: "[org.sw.demo.google.tesseract.libtesseract-master]/[config]"
C:/Users/zumm/.sw/storage/pkg/1d/13/e4d8/src/sdir/sw.cpp(70): error C2039: 'Settings': is not a member of 'sw::Build'
C:\Users\zumm.sw\storage\pkg\56\25\3e4e\src\sdir\src\sw\driver\build.h(232): note: see declaration of 'sw::Build'
Exception in file D:\dev\primitives\src\command\src\command.cpp:772, function execute1: command failed: "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.20.27508\bin\Hostx64\x64\cl.exe" "@C:\Users\zumm\AppData\Local\Temp\sw\sw.client.sw\rsp\3ad5-506d-7bff-80ba.rsp", exit code = 2
Exception in file D:\dev\cppan2\client\src\sw\builder\command.cpp:616, function execute1: When executing: "[org.sw.demo.danbloomberg.leptonica-1.78.0]/[config]"
C:/Users/zumm/.sw/storage/pkg/db/d8/73b6/src/sdir/sw.cpp(46): error C2039: 'Settings': is not a member of 'sw::Build'
C:\Users\zumm.sw\storage\pkg\56\25\3e4e\src\sdir\src\sw\driver\build.h(232): note: see declaration of 'sw::Build'
C:/Users/zumm/.sw/storage/pkg/db/d8/73b6/src/sdir/sw.cpp(52): error C2039: 'Settings': is not a member of 'sw::Build'
C:\Users\zumm.sw\storage\pkg\56\25\3e4e\src\sdir\src\sw\driver\build.h(232): note: see declaration of 'sw::Build'
C:/Users/zumm/.sw/storage/pkg/db/d8/73b6/src/sdir/sw.cpp(67): error C2039: 'Settings': is not a member of 'sw::Build'
C:\Users\zumm.sw\storage\pkg\56\25\3e4e\src\sdir\src\sw\driver\build.h(232): note: see declaration of 'sw::Build'
C:/Users/zumm/.sw/storage/pkg/db/d8/73b6/src/sdir/sw.cpp(67): error C2039: '__this': is not a member of 'sw::Build'
C:\Users\zumm.sw\storage\pkg\56\25\3e4e\src\sdir\src\sw\driver\build.h(232): note: see declaration of 'sw::Build'
Exception in file D:\dev\primitives\src\command\src\command.cpp:772, function execute1: command failed: "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.20.27508\bin\Hostx64\x64\cl.exe" "@C:\Users\zumm\AppData\Local\Temp\sw\sw.client.sw\rsp\2d48-3d10-608d-7acf.rsp", exit code = 2

@egorpugin

This comment has been minimized.

Copy link
Contributor

commented Jun 8, 2019

I think you need to set -master branch for tess in your cmake:

set(DEPENDENCIES
    org.sw.demo.google.tesseract.libtesseract-master
)
@zumm

This comment has been minimized.

Copy link
Author

commented Jun 8, 2019

Yes, it with master. I had another error without that.

@egorpugin

This comment has been minimized.

Copy link
Contributor

commented Jun 8, 2019

Oh, I see. Working on it.

@egorpugin

This comment has been minimized.

Copy link
Contributor

commented Jun 8, 2019

Ok, I've tested your example, fixed some issues. Now you could try it again.
Update the client before you go (sw --self-upgrade).

@zumm

This comment has been minimized.

Copy link
Author

commented Jun 8, 2019

There is new error:

Exception in file D:\dev\cppan2\client\src\sw\driver\module.h:56, function operator (): error in module (C:/Users/zumm/Projects/CPP/untitled/cmake-build-debug/.sw/cmake/.sw/cfg/50eea5/loc.sw.self.0455d1-local.dll): org.sw.demo.tiff-4.0.10: tiff: no type

@egorpugin

This comment has been minimized.

Copy link
Contributor

commented Jun 8, 2019

Ok, I saw this from some user earlier, but cannot repro locally. I've added more specific error message for libtiff, so re-run please, and send me new error.

@zumm

This comment has been minimized.

Copy link
Author

commented Jun 8, 2019

Exception in file D:\dev\cppan2\client\src\sw\driver\module.h:56, function operator (): error in module (C:/Users/zumm/Projects/CPP/untitled/cmake-build-debug/.sw/cmake/.sw/cfg/50eea5/loc.sw.self.0455d1-local.dll): org.sw.demo.tiff-4.0.10: Exception in file C:/Users/zumm/.sw/storage/pkg/9e/48/3628/src/sdir/sw.cpp:104, function build_2639134887917130854: no type

@egorpugin

This comment has been minimized.

Copy link
Contributor

commented Jun 8, 2019

Thank you.
Try to delete C:/Users/zumm/.sw/storage/etc/sw/checks dir and try again.

@zumm

This comment has been minimized.

Copy link
Author

commented Jun 8, 2019

Yes, it works. I did successfully build test project. But still can't build main project with this deps:

org.sw.demo.google.tesseract.libtesseract-master
org.sw.demo.intel.opencv.imgproc-4.1.0
org.sw.demo.intel.opencv.highgui-4.1.0

There is that error:

NMAKE : fatal error U1073: don't know how to make 'C:\Users\zumm.sw\storage\pkg\57\05\4062\obj\bld\bdabf0\lib\org.sw.demo.openexr.config-2.3.0.lib'

Don't sure that error still related with subject issue.

@egorpugin

This comment has been minimized.

Copy link
Contributor

commented Jun 9, 2019

Ok, I'll check!

@egorpugin

This comment has been minimized.

Copy link
Contributor

commented Jun 9, 2019

Works for me now. Try it.
Don't forget to update sw client and report any further issues!

@zumm

This comment has been minimized.

Copy link
Author

commented Jun 9, 2019

Now i got this:

Exception in file D:\dev\cppan2\client\src\sw\builder\command.cpp:610, function execute1: When executing: "[org.sw.demo.intel.opencv.highgui-4.1.0]/[config]"
C:\Users\zumm.sw\storage\pkg\56\25\3e4e\src\sdir\src\sw\driver\command.h(490): error C2664: 'void sw::driver::<<::<lambda_57e53cf0ab945c573462386e144ce459>::operator ()(const String &) const': cannot convert argument 1 from 'const T' to 'const String &'
with
[
T=gen_protobuf::<lambda_bea51bf6ad27b6df4fef63736ba57a04>
]
C:\Users\zumm.sw\storage\pkg\56\25\3e4e\src\sdir\src\sw\driver\command.h(490): note: Reason: cannot convert from 'const T' to 'const String'
with
[
T=gen_protobuf::<lambda_bea51bf6ad27b6df4fef63736ba57a04>
]
C:\Users\zumm.sw\storage\pkg\56\25\3e4e\src\sdir\src\sw\driver\command.h(490): note: No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
C:\Users\zumm\.sw\storage\pkg\38\bc\eb55\src\gen\pkg_header_3010d9.h(34): note: see reference to function template instantiation 'sw::driver::CommandBuilder &sw::driver::operator <<<gen_protobuf::<lambda_bea51bf6ad27b6df4fef63736ba57a04>>(sw::driver::CommandBuilder &,const T &)' being compiled
with
[
T=gen_protobuf::<lambda_bea51bf6ad27b6df4fef63736ba57a04>
]
Exception in file D:\dev\primitives\src\command\src\command.cpp:791, function execute1: command failed: "C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.20.27508/bin/Hostx64/x64/cl.exe" "@C:\Users\zumm\AppData\Local\Temp\sw\sw.client.sw\rsp\5d5a-2c83-2b4d-bcc0.rsp", exit code = 2

@egorpugin

This comment has been minimized.

Copy link
Contributor

commented Jun 9, 2019

Oh, yes, sorry. I did not update deps.
Try again in 5-15 mins.

@zumm

This comment has been minimized.

Copy link
Author

commented Jun 9, 2019

There is old error again:

Exception in file D:\dev\cppan2\client\src\sw\driver\module.h:56, function operator (): error in module (C:/Users/zumm/Projects/CPP/untitled/cmake-build-debug/.sw/cmake/.sw/cfg/50eea5/loc.sw.self.0baeaf-local.dll): org.sw.demo.tiff-4.0.10: Exception in file C:/Users/zumm/.sw/storage/pkg/9e/48/3628/src/sdir/sw.cpp:104, function build_2639134887917130854: no type
sw command: C:/Windows/SW.exe -shared -platform x86 -d C:/Users/zumm/Projects/CPP/untitled/cmake-build-debug/.sw/cmake integrate -cmake-deps C:/Users/zumm/Projects/CPP/untitled/cmake-build-debug/.sw/cmake/sw.txt

I have tried to delete .sw folder (as last time), but at this time it didn't help.

@egorpugin

This comment has been minimized.

Copy link
Contributor

commented Jun 9, 2019

I have tried to delete .sw folder (as last time), but at this time it didn't help.

This one C:/Users/zumm/.sw/storage/etc/sw/checks?

@zumm

This comment has been minimized.

Copy link
Author

commented Jun 10, 2019

Whole folder C:/Users/zumm/.sw/ was deleted.
Tried to delete only C:/Users/zumm/.sw/storage/etc/sw/checks right now, but this didn't help too.

@egorpugin

This comment has been minimized.

Copy link
Contributor

commented Jun 10, 2019

Could you send me your C:/Users/zumm/.sw/storage/etc/sw/checks dir?

@zumm

This comment has been minimized.

Copy link
Author

commented Jun 10, 2019

Ofc.
checks.zip

@egorpugin

This comment has been minimized.

Copy link
Contributor

commented Jun 10, 2019

For some reason checks are not passing on your system.
To investigate please do following:

  1. Delete C:/Users/zumm/.sw/storage/etc/sw/checks
  2. Run after failed cmake command:
C:/Windows/SW.exe --trace --print-checks -shared -platform x86 -d C:/Users/zumm/Projects/CPP/untitled/cmake-build-debug/.sw/cmake integrate -cmake-deps C:/Users/zumm/Projects/CPP/untitled/cmake-build-debug/.sw/cmake/sw.txt > swlog.txt
  1. Send me checks dir and swlog.txt file.
@egorpugin

This comment has been minimized.

Copy link
Contributor

commented Jun 10, 2019

Also maybe you could try to update to the latest VS16.1? Seems now you have VS16.0.

@zumm

This comment has been minimized.

Copy link
Author

commented Jun 10, 2019

Oh, i have updated to 16.1.2 and it finally works. Thanks you for help!

Now i will try to publish some another deps to use only SW in this project. Is it ok if i publish third party (i'm not author of it) library?

And also one more question about SM and CMake. CPPAN has CPPAN_BUILD_OUTPUT_DIR option to control dll output. Has SW something like that? I want to get rid "Debug/Release" folders for dll output.

@egorpugin

This comment has been minimized.

Copy link
Contributor

commented Jun 10, 2019

Now i will try to publish some another deps to use only SW in this project. Is it ok if i publish third party (i'm not author of it) library?

Completely fine.

I want to get rid "Debug/Release" folders for dll output.

I see.
So, you generate NMake project and you need dlls to be near exe?
This is just SW issue at the moment. I'll fix it.

@zumm

This comment has been minimized.

Copy link
Author

commented Jun 10, 2019

Can you notify me when this issue is fixed please?

@egorpugin

This comment has been minimized.

Copy link
Contributor

commented Jun 10, 2019

Done.

  1. Upgrade sw - sw --self-upgrade
  2. Run setup again - sw setup
@zumm

This comment has been minimized.

Copy link
Author

commented Jun 10, 2019

Thank you again!

@zumm

This comment has been minimized.

Copy link
Author

commented Jun 13, 2019

Oh, seems like this issue still not solved. I'm trying to build release version of project, but there is this:

error:
[2119/2909] generate: "C:/Users/zumm/.sw/storage/pkg/c8/65/6faa/obj/bld/cf4317/bd/b44ExpLogTable.h"
Exception in file D:\dev\cppan2\client\src\sw\builder\command.cpp:610, function execute1: When executing: generate: "C:/Users/zumm/.sw/storage/pkg/c8/65/6faa/obj/bld/cf4317/bd/b44ExpLogTable.h"
Exception in file D:\dev\primitives\src\command\src\command.cpp:791, function execute1: command failed: "C:/Users/zumm/.sw/storage/pkg/24/43/9af2/obj/bld/cf4317/bin/org.sw.demo.openexr.b44ExpLogTable-2.3.0.exe", exit code = 3221225781 (0xC0000135)

It isn't happening when i build debug version.

@zumm

This comment has been minimized.

Copy link
Author

commented Jun 13, 2019

Hm, i did delete sw folder and try to build debug version again. Same error.
Seems like some deps update broke it.

@egorpugin

This comment has been minimized.

Copy link
Contributor

commented Jun 13, 2019

Could you run "C:/Users/zumm/.sw/storage/pkg/24/43/9af2/obj/bld/cf4317/bin/org.sw.demo.openexr.b44ExpLogTable-2.3.0.exe" in cmd? What does it say?

I'll check the issue, but last time I tried including opencv libs, it worked fine for me.

@zumm

This comment has been minimized.

Copy link
Author

commented Jun 13, 2019

That exe needs org.sw.demo.openext.ilmbase.Half-2.3.0.dll to run.

@egorpugin

This comment has been minimized.

Copy link
Contributor

commented Jun 13, 2019

I see. Ok, I'll check.

@egorpugin

This comment has been minimized.

Copy link
Contributor

commented Jun 14, 2019

It seems it's a long standing issue. I also experience it in different places.
It will be fixed only with the next major update.

@zumm

This comment has been minimized.

Copy link
Author

commented Jun 14, 2019

So there is no way to build it with sw now, right? Sad.
I will waiting for major update then.

@egorpugin

This comment has been minimized.

Copy link
Contributor

commented Jun 14, 2019

It is working, if you run sw build org.sw.demo.google.tesseract.libtesseract-master for all your deps.

org.sw.demo.intel.opencv.imgproc-4.1.0
org.sw.demo.intel.opencv.highgui-4.1.0

The bug is that sw mistaking debug/release configs. So if you do not invoke command before it might fail.

@zumm

This comment has been minimized.

Copy link
Author

commented Jun 14, 2019

All of deps passed fine with this command, but building of project is still failing with same error.

@egorpugin

This comment has been minimized.

Copy link
Contributor

commented Jun 14, 2019

Try again those commands but now with config option:
sw -config d,r,rwdi,msr build YOUR_DEPENDENCY_NAME

And then your cmake build.

@zumm

This comment has been minimized.

Copy link
Author

commented Jun 14, 2019

Unfortunately, it didn't help. :(

@egorpugin

This comment has been minimized.

Copy link
Contributor

commented Jun 14, 2019

Ok, I'll ping when new version is ready (it is almost actually).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.