Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,30 @@ option(DEBUG_INFO "Print message for developers to debug." OFF)
option(ENABLE_NATIVE_OPTIMIZATION "Enable compilation optimization for the native machine's CPU type" OFF)
option(COMMIT_INFO "Print commit information in log" ON)
option(ENABLE_FFT_TWO_CENTER "Enable FFT-based two-center integral method." ON)
option(ENABLE_RAPIDJSON "Enable rapid-json usage." OFF)



# enable json support
if(ENABLE_RAPIDJSON)
find_package(RapidJSON REQUIRED)
if(NOT RapidJSON_FOUND)
message(WARNING "Rapidjson is not found, trying downloading from github, or you can install Rapidjson first and reinstall abacus.")
include(FetchContent)
FetchContent_Declare(
rapidjson
GIT_REPOSITORY https://github.com/Tencent/rapidjson.git
GIT_TAG "origin/master"
GIT_SHALLOW TRUE
GIT_PROGRESS TRUE
)
FetchContent_MakeAvailable(googletest)
endif()
add_compile_definitions(__RAPIDJSON)
include_directories(${RapidJSON_INCLUDE_PATH})
endif()


if (USE_CUDA)
set(USE_CUSOLVER_LCAO ON)
else()
Expand Down
7 changes: 5 additions & 2 deletions source/module_base/para_json.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

#include "para_json.h"
#include "module_base/global_variable.h"

#ifdef __RAPIDJSON

namespace Para_Json
{
Expand Down Expand Up @@ -971,4 +971,7 @@ namespace Para_Json



}
}


#endif
3 changes: 3 additions & 0 deletions source/module_base/para_json.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#include <sstream>
#include <vector>

#ifdef __RAPIDJSON

#include <rapidjson/document.h>
#include <rapidjson/writer.h>
#include <rapidjson/stringbuffer.h>
Expand Down Expand Up @@ -555,3 +557,4 @@ namespace Para_Json
}
}

#endif
6 changes: 4 additions & 2 deletions source/module_base/parallel_global.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
#include "module_base/global_function.h"
#include "module_base/parallel_common.h"
#include "module_base/parallel_reduce.h"
#ifdef __RAPIDJSON
#include "module_base/para_json.h"
#endif
#include "version.h"

#if defined __MPI
Expand Down Expand Up @@ -96,11 +98,11 @@ void Parallel_Global::split_diag_world(const int &diag_np)
GlobalV::DRANK=0;
GlobalV::DSIZE=1;
#endif

#ifdef __RAPIDJSON
Para_Json::set_json_value(Para_Json::drank,&GlobalV::DRANK);
Para_Json::set_json_value(Para_Json::dsize,&GlobalV::DSIZE);
Para_Json::set_json_value(Para_Json::dcolor,&GlobalV::DCOLOR);

#endif
return;
}

Expand Down
Loading