## Pika å¼åè°è¯ç¯å¢æ建 æ¬ç¯é¢åå¼åè ï¼ä»ç»å¦ä½ä½¿ç¨ CLion æ建 Pika çå¼åè°è¯ç¯å¢ã ### 1. ä¸è½½å®è£ CLion CLion æ¯ JetBrains æ¨åºç C/C++ IDEï¼æ¯æ LinuxãWindowsãmacOS çå¤ä¸ªå¹³å°ï¼æ¯æå¤ç§ç¼è¯å¨ï¼å æ¬ GCCãClang çã - ä¸è½½å°åï¼[https://www.jetbrains.com/clion/download/](https://www.jetbrains.com/clion/download/) ### 2. clone Pika æºç ```bash $ git clone https://github.com/OpenAtomFoundation/pika.git ``` ### 3. æå¼ Pika é¡¹ç® éæ© Openï¼æå¼ Pika 并éæ© CMake 项ç®ã ![](../images/clion-open-project.png) ### 4. é ç½® CLion CLion é»è®¤ä¼ä½¿ç¨ Ninja ä½ä¸ºæå»ºå·¥å ·ï¼ä½ Pika 使ç¨çæ¯ Makefileï¼æ以éè¦ä¿®æ¹ CLion çé ç½®ã ![](../images/clion-cmake-settings.png) ### 5. ç¼è¯ Pika å¨ Run/Debug Configuration -> Cmake Application ééä¸ Pikaï¼ ç¹å» Debug æé®ï¼å¼å§ç¼è¯ Pikaãç¼è¯å®æåï¼çå°å¦ä¸è¾åºï¼è¯´æç¼è¯æåã ``` Pika module 3.5.0 usage: pika [-hv] [-c conf/file] -h -- show this help -c conf/file -- config file -v -- show version example: ./output/bin/pika -c ./conf/pika.conf ``` ![](../images/clion-build.png) ### 6. è¿è¡å¹¶è°è¯ Pika è¿è¡ Pika æ¶ï¼éè¦è®¾ç½® Pika çé ç½®æ件ãå¨ Run/Debug Configuration -> Cmake Application -> Pika éé ç½® Pika çé ç½®æ件 `-c ../conf/pika.conf`ï¼å¦ä¸å¾æ示ã ![](../images/clion-run-config.png) é 置好åç¹å» Debug æé®ï¼å¼å§è¿è¡ Pikaãè¿è¡æååï¼å¯ä»¥å¨ CLion çæ§å¶å°çå° Pika çè¾åºã ```log ............. .... ..... ..... ..... ################# #### ##### ##### ####### #### ##### #### ##### ##### ######### #### ##### #### ##### ##### #### ##### #### ##### #### ##### ##### #### ##### ################ #### ##### ##### #### ##### #### #### ##### ##### ################# #### #### ##### ###### ##### ##### #### #### ##### ###### ##### ##### -----------Pika config end---------- W20230921 17:13:42.294183 20438988 pika.cc:188] your 'limit -n ' of 10240 is not enough for Redis to start. pika have successfully reconfig it to 25000 I20230921 17:13:42.294448 20438988 pika.cc:207] Server at: ../conf/pika.conf I20230921 17:13:42.295454 20438988 net_interfaces.cc:62] got interface lo0 I20230921 17:13:42.295512 20438988 net_interfaces.cc:104] Using Networker Interface: lo0 I20230921 17:13:42.295610 20438988 net_interfaces.cc:148] got ip 127.0.0.1 I20230921 17:13:42.295637 20438988 pika_server.cc:137] host: 127.0.0.1 port: 9221 I20230921 17:13:42.295723 20438988 pika_server.cc:79] Worker queue limit is 20100 W20230921 17:13:42.295754 20438988 pika_server.cc:80] 0.0.0.0 I20230921 17:13:42.296372 20438988 net_kqueue.cc:23] create kqueue I20230921 17:13:42.297199 20438988 net_kqueue.cc:23] create kqueue I20230921 17:13:42.297837 20438988 net_kqueue.cc:23] create kqueue I20230921 17:13:42.298482 20438988 net_kqueue.cc:23] create kqueue I20230921 17:13:42.299120 20438988 net_kqueue.cc:23] create kqueue I20230921 17:13:42.299800 20438988 net_kqueue.cc:23] create kqueue I20230921 17:13:42.300457 20438988 net_kqueue.cc:23] create kqueue I20230921 17:13:42.301016 20438988 pika_binlog.cc:80] Binlog: Manifest file not exist, we create a new one. I20230921 17:13:42.302006 20438988 net_kqueue.cc:23] create kqueue I20230921 17:13:44.301479 20438988 pika_slot.cc:63] db0 DB Success I20230921 17:13:44.301918 20438988 net_util.cc:128] TimerTaskThread Starting... I20230921 17:13:44.302228 20438988 pika_server.cc:204] Pika Server going to start I20230921 17:13:44.302265 20438988 rsync_server.cc:48] start RsyncServer ... ``` æ¤æ¶ï¼Pika å·²ç»å¨ CLion ä¸è¿è¡ï¼å¯ä»¥ä½¿ç¨ redis-cli è¿æ¥ Pikaï¼é»è®¤ç«¯å£ 9221ï¼è¿è¡è°è¯ã ![](../images/clion-debug.png) è¿å ¥æç¹åï¼è¯´æ Pika è°è¯æ¨¡å¼è¿è¡æåã