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

compile with MANY_VERTICES and HDF5 at the same time? #38

Open
flomlo opened this issue Mar 26, 2021 · 1 comment
Open

compile with MANY_VERTICES and HDF5 at the same time? #38

flomlo opened this issue Mar 26, 2021 · 1 comment

Comments

@flomlo
Copy link
Contributor

flomlo commented Mar 26, 2021

Hi,

so it might just be that I'm too stupid to use CMake correctly. Sorry, I'm a noob.
I've added this line
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMANY_VERTICES")
into the CMakeLists.txt

and build flagser as described in the readme.

Now the binaries of flagser and flagser-memory are not even generated cause of compile time errors and flagser-count, while compiling, crashes at runtime (again, something with HDF5).

My questions are:

  • Should, by design, flagser support having HDF5 support and MANY_VERTICES enabled at the same time? Or was that never a goal? I've studied the code extensively, but skipped everything regarding HDF5.
  • If so, am I just compiling it wrong? :(
  • Or is it a proper bug?

Best,

Florian

@MonkeyBreaker
Copy link
Collaborator

Hi,

Looking at the issue, when enabling MANY_VERTICES I get the same issue as you, it's because an hard coded type was in the code here, if you change int by index_t it compiles fine on my side. About the output, I don't have anything to check if it breaks something.

About enabling MANY_VERTICES in file CMakeLists.txt I would update like this (line 48):

add_executable(flagser src/flagser.cpp include/algorithms.h)
target_compile_definitions(flagser PRIVATE MANY_VERTICES=1)
add_dependencies(flagser generate_custom_algorithms)
set_target_properties(flagser PROPERTIES LINKER_LANGUAGE CXX)

add_executable(flagser_retrieve_persistence src/flagser.cpp include/algorithms.h)
add_dependencies(flagser_retrieve_persistence generate_custom_algorithms)
target_compile_definitions(flagser_retrieve_persistence PRIVATE RETRIEVE_PERSISTENCE MANY_VERTICES=1)
set_target_properties(flagser_retrieve_persistence PROPERTIES LINKER_LANGUAGE CXX)


add_executable(ripser src/ripser.cpp)
set_target_properties(ripser PROPERTIES LINKER_LANGUAGE CXX)

add_executable(flagser-count src/flagser-count.cpp)
target_compile_definitions(flagser-count PRIVATE MANY_VERTICES=1)
set_target_properties(flagser-count PROPERTIES LINKER_LANGUAGE CXX)

add_executable(er src/er.cpp)
set_target_properties(er PROPERTIES LINKER_LANGUAGE CXX)

IF(NOT MSVC)
add_executable(flagser-coefficients src/flagser.cpp)
add_dependencies(flagser-coefficients generate_custom_algorithms)
target_compile_definitions(flagser-coefficients PRIVATE USE_COEFFICIENTS=1 MANY_VERTICES=1)
set_target_properties(flagser-coefficients PROPERTIES LINKER_LANGUAGE CXX)

add_executable(ripser-coefficients src/ripser.cpp)
target_compile_definitions(ripser-coefficients PRIVATE USE_COEFFICIENTS=1)
set_target_properties(ripser-coefficients PROPERTIES LINKER_LANGUAGE CXX)
ELSE()
  message("On Windows, compilation with coefficients is currently not supported.")
ENDIF()

Best,
Julián

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants