You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kvrocks.apache.org by GitBox <gi...@apache.org> on 2022/05/12 07:45:14 UTC

[GitHub] [incubator-kvrocks] PragmaTwice opened a new issue, #575: Tracking issue for build system enhancements

PragmaTwice opened a new issue, #575:
URL: https://github.com/apache/incubator-kvrocks/issues/575

   ### Search before asking
   
   - [X] I had searched in the [issues](https://github.com/apache/incubator-kvrocks/issues) and found no similar issues.
   
   
   ### Motivation
   
   Modern CMake provides many amazing features to organize the build structure of a project in a more convenient way, and we can make full use of them to improve the development experience!
   @tisonkun had a good suggestion in https://github.com/apache/incubator-kvrocks/issues/562#issuecomment-1123771508 of creating a tracking issue to help keep the discussion more focused, so this issue is created for that purpose.
   
   ### Solution
   
   The list below tracks some of the improvements that have been proposed so far, and I'd appreciate it if anyone came up with new ideas for improvements, PRs for current improvements, or participated in this discussion!
   
   - [ ] #561
   - [ ] #562
   - [ ] #574
   - [ ] #569
   - [ ] #563
   
   ### Are you willing to submit a PR?
   
   - [X] I'm willing to submit a PR!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@kvrocks.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-kvrocks] PragmaTwice commented on issue #575: Tracking issue for build system enhancements

Posted by GitBox <gi...@apache.org>.
PragmaTwice commented on issue #575:
URL: https://github.com/apache/incubator-kvrocks/issues/575#issuecomment-1125039356

   Can you locate `libstdc++.a` in your environment?
   Refer to [here](https://www.linuxquestions.org/questions/fedora-35/fedora-22-ld-cannot-find-lstdc-4175555440/), the command in fedora maybe `dnf provides */libstdc++.a`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-kvrocks] PragmaTwice commented on issue #575: Tracking issue for build system enhancements

Posted by GitBox <gi...@apache.org>.
PragmaTwice commented on issue #575:
URL: https://github.com/apache/incubator-kvrocks/issues/575#issuecomment-1125064568

   > The problem is caused by that `-static-libstdc++` is added as a flag to the compiler in [CMakeLists.txt#L72](https://github.com/apache/incubator-kvrocks/blob/unstable/CMakeLists.txt#L72), which is not added in makefiles, so a static library of libstdc++ is needed.
   
   Maybe some tips should be added to README to let users know that kvrocks need libstdc++.a for build. @git-hulk 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-kvrocks] PragmaTwice closed issue #575: Tracking issue for build system enhancements

Posted by GitBox <gi...@apache.org>.
PragmaTwice closed issue #575: Tracking issue for build system enhancements
URL: https://github.com/apache/incubator-kvrocks/issues/575


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-kvrocks] torwig commented on issue #575: Tracking issue for build system enhancements

Posted by GitBox <gi...@apache.org>.
torwig commented on issue #575:
URL: https://github.com/apache/incubator-kvrocks/issues/575#issuecomment-1124992149

   I'm trying to build kvrocks on Fedora35 with CMake:
   
   ```
   mkdir build
   cd build
   cmake ../
   make -j8
   
   [ 96%] Linking CXX executable kvrocks
   [ 96%] Building CXX object CMakeFiles/kvrocks2redis.dir/tools/kvrocks2redis/sync.cc.o
   [ 96%] Building CXX object CMakeFiles/kvrocks2redis.dir/tools/kvrocks2redis/redis_writer.cc.o
   [ 96%] Building CXX object CMakeFiles/unittest.dir/tests/string_util_test.cc.o
   [ 97%] Building CXX object CMakeFiles/unittest.dir/tests/rwlock_test.cc.o
   [ 97%] Building CXX object CMakeFiles/unittest.dir/tests/cron_test.cc.o
   [ 97%] Building CXX object CMakeFiles/kvrocks2redis.dir/tools/kvrocks2redis/writer.cc.o
   [ 98%] Building CXX object CMakeFiles/kvrocks2redis.dir/tools/kvrocks2redis/parser.cc.o
   /usr/bin/ld: cannot find -lstdc++
   collect2: error: ld returned 1 exit status
   make[2]: *** [CMakeFiles/kvrocks.dir/build.make:761: kvrocks] Error 1
   make[1]: *** [CMakeFiles/Makefile2:314: CMakeFiles/kvrocks.dir/all] Error 2
   make[1]: *** Waiting for unfinished jobs....
   [ 98%] Building CXX object CMakeFiles/unittest.dir/tests/config_test.cc.o
   [ 98%] Building CXX object CMakeFiles/unittest.dir/tests/task_runner_test.cc.o
   [ 98%] Building CXX object CMakeFiles/unittest.dir/tests/t_bitmap_test.cc.o
   [ 98%] Building CXX object CMakeFiles/unittest.dir/tests/compact_test.cc.o
   [100%] Building CXX object CMakeFiles/unittest.dir/tests/log_collector_test.cc.o
   [100%] Building CXX object CMakeFiles/unittest.dir/src/sha1.cc.o
   [100%] Building CXX object CMakeFiles/unittest.dir/src/rand.cc.o
   [100%] Linking CXX executable kvrocks2redis
   /usr/bin/ld: cannot find -lstdc++
   collect2: error: ld returned 1 exit status
   make[2]: *** [CMakeFiles/kvrocks2redis.dir/build.make:841: kvrocks2redis] Error 1
   make[1]: *** [CMakeFiles/Makefile2:346: CMakeFiles/kvrocks2redis.dir/all] Error 2
   [100%] Linking CXX executable unittest
   /usr/bin/ld: cannot find -lstdc++
   collect2: error: ld returned 1 exit status
   make[2]: *** [CMakeFiles/unittest.dir/build.make:1067: unittest] Error 1
   make[1]: *** [CMakeFiles/Makefile2:380: CMakeFiles/unittest.dir/all] Error 2
   make: *** [Makefile:156: all] Error 2
   ```
   
   
   However, just doing `make -j8` successfully builds the application.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-kvrocks] git-hulk commented on issue #575: Tracking issue for build system enhancements

Posted by GitBox <gi...@apache.org>.
git-hulk commented on issue #575:
URL: https://github.com/apache/incubator-kvrocks/issues/575#issuecomment-1125573980

   agree, explicitly always better than implicitly.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-kvrocks] git-hulk commented on issue #575: Tracking issue for build system enhancements

Posted by GitBox <gi...@apache.org>.
git-hulk commented on issue #575:
URL: https://github.com/apache/incubator-kvrocks/issues/575#issuecomment-1128276497

   I checked the generated defs, seems ok:
   ```c
   #define LG_VADDR 0
   
   /* One page is 2^LG_PAGE bytes. */
   #define LG_PAGE 12
   ```
   I will compare the normal version on ubuntu later.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-kvrocks] git-hulk commented on issue #575: Tracking issue for build system enhancements

Posted by GitBox <gi...@apache.org>.
git-hulk commented on issue #575:
URL: https://github.com/apache/incubator-kvrocks/issues/575#issuecomment-1127730211

   I try to build on CentOS8(also CentOS7) and got the error:
   ```
   /root/incubator-kvrocks/build/_deps/jemalloc-src/include/jemalloc/internal/rtree.h:109:19: error: variably modified ‘root’ at file scope
     rtree_leaf_elm_t root[1U << (RTREE_NSB/RTREE_HEIGHT)];
   ```
   But I didn't find the root cause, just commented first.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-kvrocks] PragmaTwice commented on issue #575: Tracking issue for build system enhancements

Posted by GitBox <gi...@apache.org>.
PragmaTwice commented on issue #575:
URL: https://github.com/apache/incubator-kvrocks/issues/575#issuecomment-1144778361

   > Given that all subtasks done, @PragmaTwice do you think that we can close this issue as resolved?
   
   Yeah, althought there is some issue in #615, I temporarily have no more enhancement idea, so I think we can close it.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-kvrocks] tisonkun commented on issue #575: Tracking issue for build system enhancements

Posted by GitBox <gi...@apache.org>.
tisonkun commented on issue #575:
URL: https://github.com/apache/incubator-kvrocks/issues/575#issuecomment-1144585472

   Given that all subtasks done, @PragmaTwice do you think that we can close this issue as resolved?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-kvrocks] torwig commented on issue #575: Tracking issue for build system enhancements

Posted by GitBox <gi...@apache.org>.
torwig commented on issue #575:
URL: https://github.com/apache/incubator-kvrocks/issues/575#issuecomment-1125131582

   @PragmaTwice 
   Thank you, `sudo dnf install libstdc++-static` solved the issue, and now the application is successfully built.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-kvrocks] PragmaTwice commented on issue #575: Tracking issue for build system enhancements

Posted by GitBox <gi...@apache.org>.
PragmaTwice commented on issue #575:
URL: https://github.com/apache/incubator-kvrocks/issues/575#issuecomment-1128369529

   ```
   $ bat include/jemalloc/internal/jemalloc_internal_defs.h | rg "LG_(VADDR|PAGE)"
   #define LG_VADDR 48
   /* One page is 2^LG_PAGE bytes. */
   #define LG_PAGE 12
   ```
   These two macro definition in my side. Maybe the reason is that `0` can lead `RTREE_NSB` to be a negitive number.
   
   > In any case, if the value of the right operand is negative or is greater or equal to the number of bits in the promoted left operand, the behavior is undefined.
   Refer to https://en.cppreference.com/w/cpp/language/operator_arithmetic#Bitwise_shift_operators.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-kvrocks] git-hulk commented on issue #575: Tracking issue for build system enhancements

Posted by GitBox <gi...@apache.org>.
git-hulk commented on issue #575:
URL: https://github.com/apache/incubator-kvrocks/issues/575#issuecomment-1127882568

   > I try to build on CentOS8(also CentOS7) and got the error:
   > 
   > ```
   > /root/incubator-kvrocks/build/_deps/jemalloc-src/include/jemalloc/internal/rtree.h:109:19: error: variably modified ‘root’ at file scope
   >   rtree_leaf_elm_t root[1U << (RTREE_NSB/RTREE_HEIGHT)];
   > ```
   > 
   > But I didn't find the root cause, just commented first.
   
   It also failed on the old version, so NOT related with the new build system.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-kvrocks] PragmaTwice commented on issue #575: Tracking issue for build system enhancements

Posted by GitBox <gi...@apache.org>.
PragmaTwice commented on issue #575:
URL: https://github.com/apache/incubator-kvrocks/issues/575#issuecomment-1127908295

   That's weird. I think it is probably due to the macro `RTREE_NSB` or `RTREE_HEIGHT`, which are original `LG_VADDR` and `LG_PAGE`. Could you check you `include/jemalloc/internal/jemalloc_internal_defs.h` generated by `configure` which includes these two macro definition?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-kvrocks] git-hulk commented on issue #575: Tracking issue for build system enhancements

Posted by GitBox <gi...@apache.org>.
git-hulk commented on issue #575:
URL: https://github.com/apache/incubator-kvrocks/issues/575#issuecomment-1125097324

   > > The problem is caused by that `-static-libstdc++` is added as a flag to the compiler in [CMakeLists.txt#L72](https://github.com/apache/incubator-kvrocks/blob/unstable/CMakeLists.txt#L72), which is not added in makefiles, so a static library of libstdc++ is needed.
   > 
   > Maybe some tips should be added to README to let users know that kvrocks need libstdc++.a for build. @git-hulk
   
   Yes, you are right. Do you think it's a good idea to search library first before linking?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-kvrocks] git-hulk commented on issue #575: Tracking issue for build system enhancements

Posted by GitBox <gi...@apache.org>.
git-hulk commented on issue #575:
URL: https://github.com/apache/incubator-kvrocks/issues/575#issuecomment-1128383950

   Yes, you're right. I also find this on my side and this only appears in MacOSX docker environment.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-kvrocks] PragmaTwice commented on issue #575: Tracking issue for build system enhancements

Posted by GitBox <gi...@apache.org>.
PragmaTwice commented on issue #575:
URL: https://github.com/apache/incubator-kvrocks/issues/575#issuecomment-1125047734

   The problem is due to that `-static-libstdc++` is added as a flag to the compiler in [CMakeLists.txt#L72](https://github.com/apache/incubator-kvrocks/blob/unstable/CMakeLists.txt#L72).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-kvrocks] PragmaTwice commented on issue #575: Tracking issue for build system enhancements

Posted by GitBox <gi...@apache.org>.
PragmaTwice commented on issue #575:
URL: https://github.com/apache/incubator-kvrocks/issues/575#issuecomment-1125220948

   > > > The problem is caused by that `-static-libstdc++` is added as a flag to the compiler in [CMakeLists.txt#L72](https://github.com/apache/incubator-kvrocks/blob/unstable/CMakeLists.txt#L72), which is not added in makefiles, so a static library of libstdc++ is needed.
   > > 
   > > 
   > > Maybe some tips should be added to README to let users know that kvrocks need libstdc++.a for build. @git-hulk
   > 
   > Yes, you are right. Do you think it's a good idea to search library first before linking?
   
   I think it is a good idea, there are two solutions for searching library:
   1. find library, and give an error or warning if not found; give an option to user of whether `-static-libstdc++` is enabled
   2. find library, do not enable `-static-libstdc++` if not found
   
   I prefer the first solution, because I think the second is more implicit, users may not know whether `-static-libstdc++` is enabled while they are building the project (it is totally depend on the environment).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org