JuliaGraphics / jlqml

C++ component of the QML.jl package
Other
9 stars 4 forks source link

Error running cmake #3

Closed darivianos closed 5 years ago

darivianos commented 5 years ago

Hi,

I am trying to compile jlqml package but I am keep getting the following error message.

C:\Users\CHGEDAR\jlqml-build>cmake -G"MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="C:\Users\CHGEDAR\.julia\packages\CxxWrap\sarOk\deps\usr" ../jlqml -- The C compiler identification is GNU 8.2.0 -- The CXX compiler identification is GNU 8.2.0 -- Check for working C compiler: C:/MinGW/bin/gcc.exe -- Check for working C compiler: C:/MinGW/bin/gcc.exe -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: C:/MinGW/bin/g++.exe -- Check for working CXX compiler: C:/MinGW/bin/g++.exe -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done CMake Warning at CMakeLists.txt:14 (find_package): Could not find a configuration file for package "JlCxx" that is compatible with requested version "".

The following configuration files were considered but not accepted:

C:/Users/CHGEDAR/.julia/packages/CxxWrap/sarOk/deps/usr/lib/cmake/JlCxx/JlCxxConfig.cmake, version: 0.5.3 (64bit)

CMake Warning (dev) at CMakeLists.txt:18 (get_target_property): Policy CMP0045 is not set: Error on non-existent target in get_target_property. Run "cmake --help-policy CMP0045" for policy details. Use the cmake_policy command to set the policy and suppress this warning.

get_target_property() called with non-existent target "JlCxx::cxxwrap_julia". This warning is for project developers. Use -Wno-dev to suppress it.

-- Found JlCxx at -- Configuring done CMake Warning (dev) at CMakeLists.txt:58 (add_library): Policy CMP0028 is not set: Double colon in target name means ALIAS or IMPORTED target. Run "cmake --help-policy CMP0028" for policy details. Use the cmake_policy command to set the policy and suppress this warning.

Target "jlqml" links to target "JlCxx::cxxwrap_julia" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing? This warning is for project developers. Use -Wno-dev to suppress it.

-- Generating done -- Build files have been written to: C:/Users/CHGEDAR/jlqml-build

Is it possible to help me on this?

Thank you in advance!

barche commented 5 years ago

The problem is that it can't find the C++ part of CxxWrap. If you did a standard install of CxxWrap, you can find the base path using:

julia> using CxxWrap
julia> pathof(CxxWrap)

From the result of pathof you need to remove the src/CxxWrap.jl and then append deps/usr to finally set CMAKE_PREFIX_PATH on the cmake command line, e.g:

-DCMAKE_PREFIX_PATH="~/tmp/clean_julia_depot/packages/CxxWrap/sarOk/deps/usr
darivianos commented 5 years ago

The problem is that it can't find the C++ part of CxxWrap. If you did a standard install of CxxWrap, you can find the base path using: julia> using CxxWrap julia> pathof(CxxWrap) From the result of pathof you need to remove the src/CxxWrap.jl and then append deps/usr to finally set CMAKE_PREFIX_PATH on the cmake command line, e.g: -DCMAKE_PREFIX_PATH="~/tmp/clean_julia_depot/packages/CxxWrap/sarOk/deps/usr

Thanks for the prompt reply. I actually set CMAKE_PREFIX_PATH as you indicate from the beginning (check my original post) and unfortunately I am getting the error I reported.

barche commented 5 years ago

Ah, yes, I see now. I haven't personally tried this on Windows, but since it says that the JlCxxConfig.cmake is not accepted it might be a problem with compiler version compatibility, since the distributed libcxxwrap libraries are cross-compiled. You could try compiling libcxxwrap with your compiler and then point CxxWrap to it using the JLCXX_DIR environment variable.

darivianos commented 5 years ago

Ah, yes, I see now. I haven't personally tried this on Windows, but since it says that the JlCxxConfig.cmake is not accepted it might be a problem with compiler version compatibility, since the distributed libcxxwrap libraries are cross-compiled. You could try compiling libcxxwrap with your compiler and then point CxxWrap to it using the JLCXX_DIR environment variable.

Thank you. This made everything to work nicely!