GithubHelp home page GithubHelp logo

Comments (5)

joto avatar joto commented on June 28, 2024

Looks like there is an error somewhere in what you did but from your vague description ("latest version of libosmium and protozero", "set up everything properly", "manually edited the protozero include path") we can't figure out what that is. Show us all the commands you used and their output. Maybe we can figure it out then.

from libosmium.

Selina22 avatar Selina22 commented on June 28, 2024

I cloned the latest version of libosmium and protozero from GitHub, and they are saved in the same directory. Then in the libosmium directory, I created the build directory and ran cmake .. and make within, and here is the output result from ccmake .. under the build directory:

 BUILD_BENCHMARKS                 OFF                                                                                                               
 BUILD_DATA_TESTS                 OFF                                                                                                               
 BUILD_EXAMPLES                   ON                                                                                                                
 BUILD_HEADERS                    OFF                                                                                                               
 BUILD_TESTING                    ON                                                                                                                
 BUILD_WITH_CCACHE                OFF                                                                                                               
 CLANG_TIDY                       CLANG_TIDY-NOTFOUND                                                                                               
 CMAKE_BUILD_TYPE                 RelWithDebInfo                                                                                                    
 CMAKE_CONFIGURATION_TYPES        Debug;Release;RelWithDebInfo;MinSizeRel;Dev;Coverage                                                              
 CMAKE_CXX_FLAGS_COVERAGE         -g -O0 -fno-inline-functions -fno-inline --coverage                                                               
 CMAKE_EXECUTABLE_FORMAT          MACHO                                                                                                             
 CMAKE_EXE_LINKER_FLAGS_COVERAG   --coverage                                                                                                        
 CMAKE_INSTALL_PREFIX             /usr/local                                                                                                        
 CMAKE_OSX_ARCHITECTURES                                                                                                                            
 CMAKE_OSX_DEPLOYMENT_TARGET                                                                                                                        
 CMAKE_OSX_SYSROOT                /Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk                                                           
 CPPCHECK                         CPPCHECK-NOTFOUND                                                                                                 
 EXAMPLES                         amenity_list;area_test;change_tags;convert;count;create_pois;debug;dump_internal;filter_discussions;index_lookup;l
 GDAL_CONFIG                      GDAL_CONFIG-NOTFOUND                                                                                              
 GDAL_INCLUDE_DIR                 GDAL_INCLUDE_DIR-NOTFOUND                                                                                         
 GDAL_LIBRARY                     GDAL_LIBRARY-NOTFOUND                                                                                             
 GEOS_INCLUDE_DIR                 GEOS_INCLUDE_DIR-NOTFOUND                                                                                         
 GEOS_LIBRARY                     GEOS_LIBRARY-NOTFOUND                                                                                             
 INSTALL_GDALCPP                  OFF                                                                                                               
 MEMORYCHECK_COMMAND              MEMORYCHECK_COMMAND-NOTFOUND                                                                                      
 OSMIUM_SKIPPED_TESTS              geom/test_crs                                                                                                    
 OSMIUM_WARNING_OPTIONS           -Wall -Wextra -pedantic -Wredundant-decls -Wdisabled-optimization -Wctor-dtor-privacy -Wnon-virtual-dtor -Woverloa
 PROJ_INCLUDE_DIR                 PROJ_INCLUDE_DIR-NOTFOUND                                                                                         
 PROJ_LIBRARY                     PROJ_LIBRARY-NOTFOUND                                                                                             
 PROTOZERO_INCLUDE_DIR            /Users/selinawan/work/protozero/include                                                                           
 WITH_PROFILING                   OFF                                                                                                               
 WITH_PROJ                        ON   

After that, I compiled the script under examples (g++ examples/osmium_read.cpp -std=c++11) and got the file not found error; however, I did clone protozero and the PROTOZERO_INCLUDE_DIR is correct.

That's pretty much all the steps I took just to try running osmium_read.cpp under the examples directory. Here is the version of GCC and Clang that I have:

Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 12.0.0 (clang-1200.0.32.29)
Target: x86_64-apple-darwin20.2.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

I'm not sure where I messed up, and I hope that's enough information.

from libosmium.

joto avatar joto commented on June 28, 2024

You can't just compile a program using g++ examples/osmium_read.cpp -std=c++11, because that way it will not use the configuration you created with cmake. Simply call make in your build directory to compily everything. Or, if you only want to compile one part of the whole thing, use that as parameter to make: make osmium_read in this case.

from libosmium.

Selina22 avatar Selina22 commented on June 28, 2024

Ok I see. That works for me now, thanks!

Now, I still have the same file not found problem when I try to create my own project using osmium. I simply just inserted #include <osmium/io/any_input.hpp> in one of my .hpp files just to make sure everything is set up properly. I downloaded FindOsmium.cmake and FindProtozero.cmake and saved them to the project cmake directory. Here is my ccmake output:

 CMAKE_BUILD_TYPE                                                                
 CMAKE_EXECUTABLE_FORMAT          MACHO                                          
 CMAKE_INSTALL_PREFIX             /usr/local                                     
 CMAKE_OSX_ARCHITECTURES                                                         
 CMAKE_OSX_DEPLOYMENT_TARGET                                                     
 CMAKE_OSX_SYSROOT                /Library/Developer/CommandLineTools/SDKs/MacOSX
 OSMIUM_INCLUDE_DIR               /Users/selinawan/work/libosmium/include        
 OSMIUM_WARNING_OPTIONS           -Wall -Wextra -pedantic -Wredundant-decls -Wdis
 PROTOZERO_INCLUDE_DIR            /Users/selinawan/work/protozero/include  

When I compiled with make, I still got the file not found error:

/Users/selinawan/work/libosmium/include/osmium/io/detail/o5m_input_format.hpp:56:10: fatal error: 
      'protozero/exception.hpp' file not found
#include <protozero/exception.hpp>
         ^~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

from libosmium.

joto avatar joto commented on June 28, 2024

Sorry, this isn't a C++ help line, but a bug tracker for Osmium. Help on how to set up your own CMake configuration is waay beyond what we can provide here.

from libosmium.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.