Skip to content

Commit

Permalink
Fix dependency issues when included in NRN. (BlueBrain#1243)
Browse files Browse the repository at this point in the history
In NRN we depend on the target `nmodl` to ensure that when we run `nrnivmodl -coreneuron` the binary `nmodl` exists. We need to also ensure that everything `nmodl` needs to works is present.

This fixes a dependency bug on certain copied files by making the target for copying the files a dependency of `nmodl`.
  • Loading branch information
1uc authored Apr 18, 2024
1 parent bb5355f commit b78c3f3
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ target_link_libraries(
util
lexer
${NMODL_WRAPPER_LIBS})
add_dependencies(nmodl nmodl_copy_python_files nmodl_copy_solver_files)
cpp_cc_configure_sanitizers(TARGET nmodl)

# =============================================================================
Expand Down
2 changes: 2 additions & 0 deletions src/pybind/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ file(
foreach(file IN LISTS NMODL_PYTHON_FILES)
cpp_cc_build_time_copy(INPUT ${NMODL_PROJECT_SOURCE_DIR}/python/nmodl/${file} OUTPUT
${CMAKE_BINARY_DIR}/lib/nmodl/${file})
list(APPEND nmodl_python_binary_dir_files "${CMAKE_BINARY_DIR}/lib/nmodl/${file}")
endforeach()
add_custom_target(nmodl_copy_python_files ALL DEPENDS ${nmodl_python_binary_dir_files})
file(COPY ${NMODL_PROJECT_SOURCE_DIR}/python/nmodl/ext DESTINATION ${CMAKE_BINARY_DIR}/lib/nmodl/)

# =============================================================================
Expand Down
4 changes: 4 additions & 0 deletions src/solver/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ cpp_cc_build_time_copy(INPUT "${CMAKE_CURRENT_SOURCE_DIR}/newton/newton.hpp" OUT
cpp_cc_build_time_copy(INPUT "${CMAKE_CURRENT_SOURCE_DIR}/crout/crout.hpp" OUTPUT
"${CMAKE_BINARY_DIR}/include/crout/crout.hpp")

add_custom_target(
nmodl_copy_solver_files ALL DEPENDS "${CMAKE_BINARY_DIR}/include/newton/newton.hpp"
"${CMAKE_BINARY_DIR}/include/crout/crout.hpp")

# Eigen
file(COPY ${NMODL_PROJECT_SOURCE_DIR}/ext/eigen/Eigen DESTINATION ${CMAKE_BINARY_DIR}/include/)

Expand Down

0 comments on commit b78c3f3

Please sign in to comment.