diff --git a/arbor/include/CMakeLists.txt b/arbor/include/CMakeLists.txt index a5b2c3b01ff6db900fa65f8e2345c5aca098ce36..ebc48ee4f0b0b2bf97adb790e30175fb15a675da 100644 --- a/arbor/include/CMakeLists.txt +++ b/arbor/include/CMakeLists.txt @@ -42,11 +42,14 @@ if(ARB_WITH_PROFILING) # define ARB_PROFILE_ENABLED in version.hpp list(APPEND arb_features PROFILE) endif() +if(ARB_VECTORIZE) + list(APPEND arb_features VECTORIZE) +endif() add_custom_command( OUTPUT version.hpp-test DEPENDS _always_rebuild - COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/git-source-id ${FULL_VERSION_STRING} ${arb_features} > version.hpp-test + COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/git-source-id ${FULL_VERSION_STRING} ${ARB_ARCH} ${arb_features} > version.hpp-test ) set(version_hpp_path arbor/version.hpp) diff --git a/arbor/include/git-source-id b/arbor/include/git-source-id index dcfe9b710d899c81683736deb99bbf5173792305..7946b82330d40b419c9c91bdaac0a7cf75c92699 100755 --- a/arbor/include/git-source-id +++ b/arbor/include/git-source-id @@ -3,7 +3,8 @@ # arguments: version-string [feature...] version="$1" -shift +arch="$2" +shift 2 if gitlog=$(git log -1 --pretty=format:'%ci %H' 2>/dev/null); then git diff --quiet HEAD 2>/dev/null || gitlog="${gitlog} modified" @@ -16,10 +17,12 @@ cat << __end__ #define ARB_VERSION "${version}" #define ARB_SOURCE_ID "${gitlog}" +#define ARB_ARCH "${arch}" namespace arb { extern const char version[]; extern const char source_id[]; +extern const char arch[]; } __end__ diff --git a/arbor/version.cpp b/arbor/version.cpp index de8ba1833d513d858f2b6c706e48592642b1f5cf..e3b689cf01268cef4ca6657919cace9b5b057b73 100644 --- a/arbor/version.cpp +++ b/arbor/version.cpp @@ -3,4 +3,5 @@ namespace arb { const char version[] = ARB_VERSION; const char source_id[] = ARB_SOURCE_ID; +const char arch[] = ARB_ARCH; } diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index 12e7c388e864d1a3ad07923abc803bac1c94b7bf..0b90b6d0e47e5667457adf2a38ca1dcc5b78e060 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -60,8 +60,8 @@ target_link_libraries(pyarb PRIVATE arbor pybind11::module) if (ARB_WITH_MPI) find_python_module(mpi4py) if (HAVE_MPI4PY) - target_include_directories(pyarb PRIVATE "${PY_MPI4PY}/include") - target_compile_definitions(pyarb PRIVATE -DARB_WITH_MPI4PY) + target_include_directories(pyarb_obj PRIVATE "${PY_MPI4PY}/include") + target_compile_definitions(pyarb_obj PRIVATE -DARB_WITH_MPI4PY) endif() endif() diff --git a/python/config.cpp b/python/config.cpp index 78d0a7baea54737cca5381a422210ee577c9fae7..69188a7a2405ff9d37b1ec1d58c6fd03226488bb 100644 --- a/python/config.cpp +++ b/python/config.cpp @@ -28,8 +28,15 @@ pybind11::dict config() { dict[pybind11::str("gpu")] = pybind11::bool_(true); #else dict[pybind11::str("gpu")] = pybind11::bool_(false); +#endif +#ifdef ARB_VECTORIZE_ENABLED + dict[pybind11::str("vectorize")] = pybind11::bool_(true); +#else + dict[pybind11::str("vectorize")] = pybind11::bool_(false); #endif dict[pybind11::str("version")] = pybind11::str(ARB_VERSION); + dict[pybind11::str("source")] = pybind11::str(ARB_SOURCE_ID); + dict[pybind11::str("arch")] = pybind11::str(ARB_ARCH); return dict; }