Menu

vcpkg support out of date

2020-07-08
2020-07-21
  • John Coffey

    John Coffey - 2020-07-08

    GeographicLib is available in microsoft's vcpkg utility. I'm not sure where this 'portfile' is maintained (probably by some volunteer), however, it is a little out of date (1.47-patch1-16) instead of the latest release (1.51).

    geographiclib:x64-windows 1.47-patch1-16 a small set of C++ classes for performing conver...

    When these repositories are hosted on GitHub, adding the vcpkg option --head downloads, builds and installs the code from the repo's head (this is not an option for geographiclib, as the files are hosted in https://git.code.sf.net/p/geographiclib). I'm not sure if there are plans to update the portfile to the latest version.

    The vcpkg packaging utility is extremely convenient (almost linux like), especially when coupled with windows hosted CMake projects. All that is needed to integrate them with other cmake projects is to add.

    "-DCMAKE_TOOLCHAIN_FILE=..../vcpkg/scripts/buildsystems/vcpkg.cmake"

    to the CMake command line when configuring a project.

    John

     

    Last edit: John Coffey 2020-07-09
  • Charles Karney

    Charles Karney - 2020-07-10

    I see that there's a pull request in to support GeographicLib 1.50.1. I'll see about getting the errors in this pull request resolved. Don't hold your breath... but I'll try to get to this within the next 2 weeks.

     
  • Charles Karney

    Charles Karney - 2020-07-12

    I've submitted a pull request for geographiclib-1.50.1 on vcpkg. See

    https://github.com/microsoft/vcpkg/pull/12379

    If you can you should check this out and report your success/failure as a comment to the PR. This might hurry along the merge of the PR.

     
    • John Coffey

      John Coffey - 2020-07-13

      Thanks,

      there was a problem building with the latest pull request. I have not used pull requests before so I kind of ploughed my way through it.

      To reproduce the error, I started with a clean repository with only your pull request (12397) merged locally with the master vcpkg. I then ran the .\bootstrap-vcpkg.bat command to build vcpkg with your changes.

      Typically afterwards, I perform a library search for geographiclib, however due to the presence of a trailing comma in the vcpkg.json file, vcpkg got confused and terminated the search early.

      After fixing that the trailing comma, search, install and remove succeeded (however you might want to review the usage string) which contains an unexpanded variable ${GographicLib_LIBRARIES} rather than the usual geographic:: aliases - see below. There are additional details over in the pull request, Thanks for doing this so quickly. Nice job. Attached - fixed json file.

      John

      The package geographiclib:x64-windows provides CMake targets:

      find_package (GeographicLib CONFIG REQUIRED)
      target_link_libraries (main PRIVATE ${GeographicLib_LIBRARIES})
      

      On Sun, Jul 12, 2020 at 7:34 AM Charles Karney karney@users.sourceforge.net
      wrote:

      I've submitted a pull request for geographiclib-1.50.1 on vcpkg. See

      https://github.com/microsoft/vcpkg/pull/12379

      If you can you should check this out and report your success/failure as a
      comment to the PR. This might hurry along the merge of the PR.


      vcpkg support out of date
      https://sourceforge.net/p/geographiclib/discussion/1026620/thread/4358ffd742/?limit=25#b2c7


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/geographiclib/discussion/1026620/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       

      Last edit: John Coffey 2020-07-13
  • John Coffey

    John Coffey - 2020-07-13

    Charles, looks like the usage string still needs to be addressed, I just tested the latest updates to your pull request which works fine as far as installation goes (search now returns 3 items per your updated vcpkg json file).

    geographiclib 1.50.1 a small set of C++ classes for performing conversions between geographic, UTM,...
    geographiclib[default-features] Features installed by default
    geographiclib[tools] Build the geographiclib tools

    However the resulting usage string is still incorrect - maybe like before you need to consider whether it is static or otherwise to give back the correct alias

    The package geographiclib:x64-windows provides CMake targets:

    find_package (GeographicLib CONFIG REQUIRED)
    target_link_libraries (main PRIVATE ${GeographicLib_LIBRARIES})
    

    FYI the previous one used the following usage

    The package geographiclib:x64-linux provides CMake targets:

    find_package(GeographicLib CONFIG REQUIRED)
    #dynamic
    target_link_libraries(main PRIVATE GeographicLib GeographicLib::GeographicLib)
    #static
    target_link_libraries(main PRIVATE GeographicLib_STATIC GeographicLib::GeographicLib_STATIC)
    

    John

     
  • Charles Karney

    Charles Karney - 2020-07-13

    The usage

    target_link_libraries (main PRIVATE ${GeographicLib_LIBRARIES})
    

    is what I document on https://geographiclib.sourceforge.io/html/start.html

    Please let me know if this doesn't work for you.

    The whole point of using the unexpanded variable, is that this form would continue to work as things changed under the hood. (The older documentation is already out of date.) Given that vcpkg seems to deal with either shared or static libraries (but not both), there's no need to get any more complicated than this. (But the web site does tell you how to select shared/static libraries in more complex setups.)

     
  • John Coffey

    John Coffey - 2020-07-13

    Charles, I am using the ${GeographicLib_LIBRARIES} and although it finds the library, I encountered the following errors associated with one of the tools.

    John

    -- Reading C:/Users/johnc/main/extlibs/vcpkg1/installed/x64-windows/share/geographiclib/geographiclib-config.cmake
    -- GeographicLib configuration, version 1.50.1
    CMake Error at C:/Users/johnc/main/extlibs/vcpkg1/installed/x64-windows/share/geographiclib/geographiclib-targets.cmake:118 (message):
      The imported target "CartConvert" references the file
    
         "C:/Users/johnc/main/extlibs/vcpkg1/installed/x64-windows/tools/CartConvert_d.exe"
    
      but this file does not exist.  Possible reasons include:
    
      * The file was deleted, renamed, or moved to another location.
    
      * An install or uninstall procedure did not complete successfully.
    
      * The installation package was faulty and contained
    
         "C:/Users/johnc/main/extlibs/vcpkg1/installed/x64-windows/share/geographiclib/geographiclib-targets.cmake"
    
      but not all the files it references.
    
    Call Stack (most recent call first):
      C:/Users/johnc/main/extlibs/vcpkg1/installed/x64-windows/share/geographiclib/geographiclib-config.cmake:55 (include)
      C:/Users/johnc/main/extlibs/vcpkg1/scripts/buildsystems/vcpkg.cmake:439 (_find_package)
      CMakeLists.txt:33 (find_package)
    
    
    -- Configuring incomplete, errors occurred!
    See also "C:/Users/johnc/main/tcdu/build/CMakeFiles/CMakeOutput.log".
    See also "C:/Users/johnc/main/tcdu/build/CMakeFiles/CMakeError.log".
    
     
  • Charles Karney

    Charles Karney - 2020-07-13

    How annoying! The problem is that the tools are all registered as targets and the find_package scripts checks that it can the targets are where they are expected to be. But they aren't because they got moved to tools/geographiclib (from tools). I fix. And thanks for catching this.

     
  • John Coffey

    John Coffey - 2020-07-14

    Charles, I also tried it out on linux and it works there too (defaulting to the static library)

    -- Reading /home/jcoffey/tools/vcpkg/installed/x64-linux/share/geographiclib/geographiclib-config.cmake
    -- GeographicLib configuration, version 1.50.1
    --   ${GeographicLib_LIBRARIES} set to static library
    -- ------------------ General configuration for tcdu  -----------------
    --
    -- CMake Generator =       Ninja Multi-Config
    -- Compiler =              GNU
    -- Build type =
    -- CMAKE_INSTALL_PREFIX =  /usr/local
    -
    
     
  • Charles Karney

    Charles Karney - 2020-07-14

    Yes, static libraries seem to be the only (supported) option offered for Linux and MacOS.

     
  • John Coffey

    John Coffey - 2020-07-20

    I re-checked the Linux vcpkg for GeographicLib and it appears something regressed since the successful linux find_package from my last email 7 days ago.

    I don’t usually build on Linux, so when I saw the final merge in vcpkg I thought I would give it a quick try agin. The offending line from my CMakeLists.txt is shown below:

    find_package(GeographicLib CONFIG REQUIRED)

    And here is the corresponding console output:

    I suspect a case sensitivity issue, (_find_package) has "GeographicLib" as an argument.

    Hope this helps narrow the problem down.

    . . .
    -- Looking for pthread_create in pthreads
    -- Looking for pthread_create in pthreads - not found
    -- Looking for pthread_create in pthread
    -- Looking for pthread_create in pthread - found
    -- Found Threads: TRUE
    -- Found Boost: /home/jcoffey/tools/vcpkg/installed/x64-linux/include (found suitable version "1.73.0", minimum required is "1.73.0") found components: program_options date_time log log_setup filesystem thread regex chrono atomic
    -- Found xlnt: /home/jcoffey/tools/vcpkg/installed/x64-linux/include
    -- xlnt_LIBRARY_DEBUG=/home/jcoffey/tools/vcpkg/installed/x64-linux/debug/lib/libxlntd.a
    -- xlnt_LIBRARY_RELEASE=/home/jcoffey/tools/vcpkg/installed/x64-linux/lib/libxlnt.a
    -- Found GLUT: /home/jcoffey/tools/vcpkg/installed/x64-linux/debug/lib/libglut.a
    CMake Error at **/home/jcoffey/tools/vcpkg/scripts/buildsystems/vcpkg.cmake:439 (_find_package):**
      Could not find a package configuration file provided by "GeographicLib"
      with any of the following names:
    
        **GeographicLibConfig.cmake
        geographiclib-config.cmake**
    
      Add the installation prefix of "GeographicLib" to CMAKE_PREFIX_PATH or set
      "GeographicLib_DIR" to a directory containing one of the above files.  If
      "GeographicLib" provides a separate development package or SDK, be sure it
      has been installed.
    Call Stack (most recent call first):
      CMakeLists.txt:33 (find_package)
    

    I'm not sure if it is helpful but I did a recursive search for Geographic*

    jcoffey@POLARINC:~/main/tcdu/build$ find ~/tools/vcpkg/ -name GeographicLib*
    /home/jcoffey/tools/vcpkg/buildtrees/geographiclib/src/1db874f309-493db02bdb.clean/include/GeographicLib
    /home/jcoffey/tools/vcpkg/buildtrees/geographiclib/src/1db874f309-493db02bdb.clean/doc/GeographicLib.dox.in
    /home/jcoffey/tools/vcpkg/buildtrees/geographiclib/src/1db874f309-493db02bdb.clean/js/GeographicLib.md
    /home/jcoffey/tools/vcpkg/buildtrees/geographiclib/src/1db874f309-493db02bdb.clean/windows/GeographicLib-vc10x.sln
    /home/jcoffey/tools/vcpkg/buildtrees/geographiclib/src/1db874f309-493db02bdb.clean/windows/GeographicLib-vc10.sln
    /home/jcoffey/tools/vcpkg/buildtrees/geographiclib/src/d8fdfd7ae0-ea35230417.clean/include/GeographicLib
    /home/jcoffey/tools/vcpkg/buildtrees/geographiclib/src/d8fdfd7ae0-ea35230417.clean/doc/GeographicLib.dox.in
    /home/jcoffey/tools/vcpkg/buildtrees/geographiclib/src/d8fdfd7ae0-ea35230417.clean/js/GeographicLib.md
    /home/jcoffey/tools/vcpkg/buildtrees/geographiclib/src/d8fdfd7ae0-ea35230417.clean/windows/GeographicLib-vc10x.sln
    /home/jcoffey/tools/vcpkg/buildtrees/geographiclib/src/d8fdfd7ae0-ea35230417.clean/windows/GeographicLib-vc10.sln
    /home/jcoffey/tools/vcpkg/buildtrees/geographiclib/src/d8fdfd7ae0-ea35230417.clean/windows/GeographicLib-vc9.sln
    /home/jcoffey/tools/vcpkg/buildtrees/geographiclib/x64-linux-rel/src/CMakeFiles/GeographicLib_STATIC.dir
    /home/jcoffey/tools/vcpkg/buildtrees/geographiclib/x64-linux-rel/include/GeographicLib
    /home/jcoffey/tools/vcpkg/buildtrees/geographiclib/x64-linux-dbg/src/CMakeFiles/GeographicLib_STATIC.dir
    /home/jcoffey/tools/vcpkg/buildtrees/geographiclib/x64-linux-dbg/include/GeographicLib
    /home/jcoffey/tools/vcpkg/downloads/GeographicLib-1.50.1.tar.gz
    /home/jcoffey/tools/vcpkg/downloads/GeographicLib-1.47-patch1.zip
    

    Then I did it for the lower case equivalent

    jcoffey@POLARINC:~/main/tcdu/build$ find ~/tools/vcpkg/ -name geographic*
    /home/jcoffey/tools/vcpkg/installed/x64-linux/include/boost/geometry/formulas/geographic.hpp
    /home/jcoffey/tools/vcpkg/installed/x64-linux/include/boost/geometry/strategies/geographic
    /home/jcoffey/tools/vcpkg/buildtrees/geographiclib
    /home/jcoffey/tools/vcpkg/buildtrees/geographiclib/src/1db874f309-493db02bdb.clean/matlab/geographiclib
    /home/jcoffey/tools/vcpkg/buildtrees/geographiclib/src/1db874f309-493db02bdb.clean/matlab/geographiclib/geographiclib_test.m
    /home/jcoffey/tools/vcpkg/buildtrees/geographiclib/src/1db874f309-493db02bdb.clean/matlab/geographiclib-legacy
    /home/jcoffey/tools/vcpkg/buildtrees/geographiclib/src/1db874f309-493db02bdb.clean/java/src/test/java/net/sf/geographiclib
    /home/jcoffey/tools/vcpkg/buildtrees/geographiclib/src/1db874f309-493db02bdb.clean/java/src/main/java/net/sf/geographiclib
    /home/jcoffey/tools/vcpkg/buildtrees/geographiclib/src/1db874f309-493db02bdb.clean/python/geographiclib
    /home/jcoffey/tools/vcpkg/buildtrees/geographiclib/src/1db874f309-493db02bdb.clean/wrapper/matlab/geographiclibinterface.m
    /home/jcoffey/tools/vcpkg/buildtrees/geographiclib/src/1db874f309-493db02bdb.clean/tools/geographiclib-get-geoids.sh
    /home/jcoffey/tools/vcpkg/buildtrees/geographiclib/src/1db874f309-493db02bdb.clean/tools/geographiclib-get-gravity.sh
    /home/jcoffey/tools/vcpkg/buildtrees/geographiclib/src/1db874f309-493db02bdb.clean/tools/geographiclib-get-magnetic.sh
    /home/jcoffey/tools/vcpkg/buildtrees/geographiclib/src/d8fdfd7ae0-ea35230417.clean/matlab/geographiclib
    /home/jcoffey/tools/vcpkg/buildtrees/geographiclib/src/d8fdfd7ae0-ea35230417.clean/matlab/geographiclib/geographiclib_test.m
    /home/jcoffey/tools/vcpkg/buildtrees/geographiclib/src/d8fdfd7ae0-ea35230417.clean/matlab/geographiclib-legacy
    /home/jcoffey/tools/vcpkg/buildtrees/geographiclib/src/d8fdfd7ae0-ea35230417.clean/java/src/test/java/net/sf/geographiclib
    /home/jcoffey/tools/vcpkg/buildtrees/geographiclib/src/d8fdfd7ae0-ea35230417.clean/java/src/main/java/net/sf/geographiclib
    /home/jcoffey/tools/vcpkg/buildtrees/geographiclib/src/d8fdfd7ae0-ea35230417.clean/python/geographiclib
    /home/jcoffey/tools/vcpkg/buildtrees/geographiclib/src/d8fdfd7ae0-ea35230417.clean/wrapper/matlab/geographiclibinterface.m
    /home/jcoffey/tools/vcpkg/buildtrees/geographiclib/src/d8fdfd7ae0-ea35230417.clean/tools/geographiclib-get-geoids.sh
    /home/jcoffey/tools/vcpkg/buildtrees/geographiclib/src/d8fdfd7ae0-ea35230417.clean/tools/geographiclib-get-gravity.sh
    /home/jcoffey/tools/vcpkg/buildtrees/geographiclib/src/d8fdfd7ae0-ea35230417.clean/tools/geographiclib-get-magnetic.sh
    /home/jcoffey/tools/vcpkg/buildtrees/geographiclib/x64-linux-rel/geographiclib-targets.cmake
    /home/jcoffey/tools/vcpkg/buildtrees/geographiclib/x64-linux-rel/geographiclib-namespace-targets.cmake
    /home/jcoffey/tools/vcpkg/buildtrees/geographiclib/x64-linux-rel/cmake/geographiclib.pc
    /home/jcoffey/tools/vcpkg/buildtrees/geographiclib/x64-linux-rel/cmake/CMakeFiles/Export/share/geographiclib
    /home/jcoffey/tools/vcpkg/buildtrees/geographiclib/x64-linux-rel/cmake/CMakeFiles/Export/share/geographiclib/geographiclib-targets.cmake
    /home/jcoffey/tools/vcpkg/buildtrees/geographiclib/x64-linux-rel/cmake/CMakeFiles/Export/share/geographiclib/geographiclib-namespace-targets-release.cmake
    /home/jcoffey/tools/vcpkg/buildtrees/geographiclib/x64-linux-rel/cmake/CMakeFiles/Export/share/geographiclib/geographiclib-namespace-targets.cmake
    /home/jcoffey/tools/vcpkg/buildtrees/geographiclib/x64-linux-rel/cmake/CMakeFiles/Export/share/geographiclib/geographiclib-targets-release.cmake
    /home/jcoffey/tools/vcpkg/buildtrees/geographiclib/x64-linux-rel/geographiclib-config-version.cmake
    /home/jcoffey/tools/vcpkg/buildtrees/geographiclib/x64-linux-rel/geographiclib-config.cmake
    /home/jcoffey/tools/vcpkg/buildtrees/geographiclib/x64-linux-dbg/geographiclib-targets.cmake
    /home/jcoffey/tools/vcpkg/buildtrees/geographiclib/x64-linux-dbg/geographiclib-namespace-targets.cmake
    /home/jcoffey/tools/vcpkg/buildtrees/geographiclib/x64-linux-dbg/cmake/geographiclib.pc
    /home/jcoffey/tools/vcpkg/buildtrees/geographiclib/x64-linux-dbg/cmake/CMakeFiles/Export/share/geographiclib
    /home/jcoffey/tools/vcpkg/buildtrees/geographiclib/x64-linux-dbg/cmake/CMakeFiles/Export/share/geographiclib/geographiclib-targets.cmake
    /home/jcoffey/tools/vcpkg/buildtrees/geographiclib/x64-linux-dbg/cmake/CMakeFiles/Export/share/geographiclib/geographiclib-namespace-targets.cmake
    /home/jcoffey/tools/vcpkg/buildtrees/geographiclib/x64-linux-dbg/cmake/CMakeFiles/Export/share/geographiclib/geographiclib-namespace-targets-debug.cmake
    /home/jcoffey/tools/vcpkg/buildtrees/geographiclib/x64-linux-dbg/cmake/CMakeFiles/Export/share/geographiclib/geographiclib-targets-debug.cmake
    /home/jcoffey/tools/vcpkg/buildtrees/geographiclib/x64-linux-dbg/geographiclib-config-version.cmake
    /home/jcoffey/tools/vcpkg/buildtrees/geographiclib/x64-linux-dbg/geographiclib-config.cmake
    /home/jcoffey/tools/vcpkg/ports/geographiclib
    /home/jcoffey/tools/vcpkg/ports/geographiclib.tar.gz
    
     
  • Charles Karney

    Charles Karney - 2020-07-21

    It looks to me like geographiclib isn't installed on you system. find_package(GeographicLib) should find the config files it need in installed/x64-linux/share/geographiclib. What does ./vcpkg list report?

     
  • John Coffey

    John Coffey - 2020-07-21

    You are correct, the package got removed somehow. I suspect it was uninstalled when I ran a command to cleanup my unused packages with a --recurse flag (I was doing a boost cleanup).

    BTW I noticed both these entries this in my CMake variable cache, not sure if the geographiclib_DIR is a leftover vestige.

    cmake -LA
    ...
    GeographicLib_DIR:PATH=/home/jcoffey/tools/vcpkg/installed/x64-linux/share/geographiclib
    geographiclib_DIR:PATH=geographiclib_DIR-NOTFOUND
    ...
    

    and with more detail...

    cmake -LAH
    ...
    // The directory containing a CMake configuration file for GeographicLib.
    GeographicLib_DIR:PATH=/home/jcoffey/tools/vcpkg/installed/x64-linux/share/geographiclib
    ...
    // The directory containing a CMake configuration file for geographiclib.
    geographiclib_DIR:PATH=geographiclib_DIR-NOTFOUND
    ...
    

    I'm not sure where the geographiclib_DIR path variable comes from.

    John

     
  • Charles Karney

    Charles Karney - 2020-07-21

    geographiclib_DIR might be given because you previously did find_package (geographiclib) or some such. Try removing the entire contents of your build directory and trying again.

     

Anonymous
Anonymous

Add attachments
Cancel