/mnt/datadisk0/chenqi/doris.git clone https://github.com/apache/doris.git
Modify the env.sh file located in the root directory of the Doris code on the remote server. Add the configuration for DORIS_HOME at the beginning, for example, DORIS_HOME=/mnt/datadisk0/chenqi/doris.
Execute commands to compile the code. The detailed compilation process compilation-with-ldb-toolchain.
cd /mnt/datadisk0/chenqi/doris ./build.sh
Download and install Clion on your local env, then import the Doris BE source code.
Set up a remote development environment on your local env by navigating to Preferences -> Build, Execution, Deployment -> Deployment in Clion. Add the connection and login information for the remote development server using SFTP and set the Mappings paths. For example, where Local Path is the local path /User/kaka/Programs/doris/be and Deployment Path is the remote server path /mnt/datadisk0/chenqi/clion/doris/be.
gensrc path on the remote server, for example /mnt/datadisk0/chenqi/doris/gensrc, to the parent directory of the Deployment Path. For example, the final directory path on the remote server should be /mnt/datadisk0/chenqi/clion/doris/gensrc.cp -R /mnt/datadisk0/chenqi/doris/gensrc /mnt/datadisk0/chenqi/clion/doris/gensrc
In Clion, navigate to Preferences -> Build, Execution, Deployment -> CMake and add the compilation option -DDORIS_JAVA_HOME=/path/to/remote/JAVA_HOME in CMake options, set DORIS_JAVA_HOME to the JAVA_HOME path of the remote server, otherwise jni.h will not be found.
Right-click on Load Cmake Project in Clion. This will synchronize the code to the remote server and generate the Cmake build files.
Configure CMake in Preferences -> Build, Execution, Deployment -> CMake. Different targets such as Debug / Release can be configured, and the ToolChain should be set to the previously configured. If you want to run and debug Unit Tests, you need to add ·-DMAKE_TEST=ON· to CMake Options (this option is disabled by default, and needs to be enabled to compile the Test code) Copy the output directory in Doris source code to a separate path on the remote server, such as /mnt/datadisk0/chenqi/clion/doris/doris_be/.
Copy the output directory in Doris source code to a separate path on the remote server, such as /mnt/datadisk0/chenqi/clion/doris/doris_be/.
cp -R /mnt/datadisk0/chenqi/doris/output /mnt/datadisk0/chenqi/clion/doris/doris_be
Refer to the environment variables exported in be/bin/start_be.sh in the Doris root directory for environment variable configuration. The value of each environment variable should point to the corresponding path on the remote server.** Environment variables reference: