Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to build HPX with APEX using clang #3376

Closed
tianyizhangcs opened this issue Jul 12, 2018 · 4 comments
Closed

Failed to build HPX with APEX using clang #3376

tianyizhangcs opened this issue Jul 12, 2018 · 4 comments

Comments

@tianyizhangcs
Copy link
Member

tianyizhangcs commented Jul 12, 2018

@khuck Could you please check the following issue I encountered when I was trying to build HPX with APEX.

Expected Behavior

Build HPX with APEX using clang

Actual Behavior

Compiling errors whiile building.

Steps to Reproduce the Problem

1.script

cmake -DCMAKE_CXX_COMPILER=/usr/bin/clang++ \
-DCMAKE_C_COMPILER=/usr/bin/clang \
-DBOOST_ROOT=/opt/boost/boost-boost-1.67.0/1.67.0/debug \
-DCMAKE_BUILD_TYPE=Debug \
-DHWLOC_ROOT=/opt/hwloc/1.11.10 \
-DHPX_WITH_APEX=TRUE \
-DAPEX_WITH_ACTIVEHARMONY=OFF \
-DAPEX_WITH_PAPI=OFF \
-DAPEX_WITH_MSR=OFF \
-DAPEX_WITH_OTF2=OFF \
  1. error info
In file included from /home/tianyi/fix_hpx/repos/hpx_apex/apex/src/apex/concurrency_handler.cpp:6:
In file included from /home/tianyi/fix_hpx/repos/hpx_apex/apex/src/apex/apex.hpp:43:
/home/tianyi/fix_hpx/repos/hpx_apex/apex/src/apex/proc_read.h:167:7: error: 
      variable 'tmplong' is used uninitialized whenever 'if' condition is true
      [-Werror,-Wsometimes-uninitialized]

Specifications

... Please describe your environment

  • HPX Version: 1.2.0
  • Platform (compiler, OS):clang 6.0.0, solus
@khuck
Copy link
Contributor

khuck commented Jul 12, 2018

This is fixed in the develop branch of APEX. go to the "apex" directory in your hpx source tree, and do:
git checkout develop ; git pull
Then add this option to your HPX configuration: -DDHPX_WITH_APEX_NO_UPDATE=ON to prevent building against the v2.0.1 tag of APEX.

@khuck khuck closed this as completed Jul 12, 2018
@tianyizhangcs
Copy link
Member Author

I tried it following the instructions, but it is still not working for me.

In file included from /home/tianyi/fix_hpx/repos/hpx_apex_clang/apex/src/apex/apex.hpp:43:
/home/tianyi/fix_hpx/repos/hpx_apex_clang/apex/src/apex/proc_read.h:182:7: error: 
      variable 'tmplong' is used uninitialized whenever 'if' condition is true
      [-Werror,-Wsometimes-uninitialized]
  if (fff==NULL) {
      ^~~~~~~~~
/home/tianyi/fix_hpx/repos/hpx_apex_clang/apex/src/apex/proc_read.h:188:10: note: 
      uninitialized use occurs here
  return tmplong/1000000;
         ^~~~~~~
/home/tianyi/fix_hpx/repos/hpx_apex_clang/apex/src/apex/proc_read.h:182:3: note: 
      remove the 'if' if its condition is always false
  if (fff==NULL) {
  ^~~~~~~~~~~~~~~~
/home/tianyi/fix_hpx/repos/hpx_apex_clang/apex/src/apex/proc_read.h:179:21: note: 
      initialize the variable 'tmplong' to silence this warning
  long long  tmplong;
                    ^
                     = 0
In file included from /home/tianyi/fix_hpx/repos/hpx_apex_clang/apex/src/apex/concurrency_handler.cpp:6:
In file included from /home/tianyi/fix_hpx/repos/hpx_apex_clang/apex/src/apex/apex.hpp:43:
/home/tianyi/fix_hpx/repos/hpx_apex_clang/apex/src/apex/proc_read.h:182:7: error: 
      variable 'tmplong' is used uninitialized whenever 'if' condition is true
      [-Werror,-Wsometimes-uninitialized]
  if (fff==NULL) {
      ^~~~~~~~~
/home/tianyi/fix_hpx/repos/hpx_apex_clang/apex/src/apex/proc_read.h:188:10: note: 
      uninitialized use occurs here
  return tmplong/1000000;
         ^~~~~~~
/home/tianyi/fix_hpx/repos/hpx_apex_clang/apex/src/apex/proc_read.h:182:3: note: 
      remove the 'if' if its condition is always false
  if (fff==NULL) {
  ^~~~~~~~~~~~~~~~
/home/tianyi/fix_hpx/repos/hpx_apex_clang/apex/src/apex/proc_read.h:179:21: note: 
      initialize the variable 'tmplong' to silence this warning
  long long  tmplong;
                    ^
                     = 0
In file included from /home/tianyi/fix_hpx/repos/hpx_apex_clang/apex/src/apex/apex_options.cpp:9:
In file included from /home/tianyi/fix_hpx/repos/hpx_apex_clang/apex/src/apex/apex.hpp:43:
/home/tianyi/fix_hpx/repos/hpx_apex_clang/apex/src/apex/proc_read.h:182:7: error: 
      variable 'tmplong' is used uninitialized whenever 'if' condition is true
      [-Werror,-Wsometimes-uninitialized]
  if (fff==NULL) {
      ^~~~~~~~~
/home/tianyi/fix_hpx/repos/hpx_apex_clang/apex/src/apex/proc_read.h:188:10: note: 
      uninitialized use occurs here
  return tmplong/1000000;
         ^~~~~~~
In file included from /home/tianyi/fix_hpx/repos/hpx_apex_clang/apex/src/apex/apex_policies.cpp:5:
In file included from /home/tianyi/fix_hpx/repos/hpx_apex_clang/apex/src/apex/apex.hpp:43:
/home/tianyi/fix_hpx/repos/hpx_apex_clang/apex/src/apex/proc_read.h:182:7: error: 
      variable 'tmplong' is used uninitialized whenever 'if' condition is true
      [-Werror,-Wsometimes-uninitialized]
/home/tianyi/fix_hpx/repos/hpx_apex_clang/apex/src/apex/proc_read.h  if (fff==NULL) {:
182:      ^~~~~~~~~3
: note/home/tianyi/fix_hpx/repos/hpx_apex_clang/apex/src/apex/proc_read.h: :188
:      10remove:  the 'if'note : if 
its       uninitializedcondition  useis  occursalways  herefalse

  return tmplong/1000000;  if (fff==NULL) {

         ^~~~~~~  ^~~~~~~~~~~~~~~~

/home/tianyi/fix_hpx/repos/hpx_apex_clang/apex/src/apex/proc_read.h:179:21: note: 
      initialize the variable 'tmplong' to silence this warning
  long long  tmplong;
                    ^
                     = 0
/home/tianyi/fix_hpx/repos/hpx_apex_clang/apex/src/apex/proc_read.h:182:3: note: 
      remove the 'if' if its condition is always false
  if (fff==NULL) {
  ^~~~~~~~~~~~~~~~
/home/tianyi/fix_hpx/repos/hpx_apex_clang/apex/src/apex/proc_read.h:179:21: note: 
      initialize the variable 'tmplong' to silence this warning
  long long  tmplong;
                    ^
                     = 0
[  0%] Building CXX object apex/src/apex/CMakeFiles/apex_lib.dir/policy_handler.cpp.o
1 error generated.
make[2]: *** [apex/src/apex/CMakeFiles/apex_lib.dir/build.make:76: apex/src/apex/CMakeFiles/apex_lib.dir/apex_options.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
1 error generated.
make[2]: *** [apex/src/apex/CMakeFiles/apex_lib.dir/build.make:63: apex/src/apex/CMakeFiles/apex_lib.dir/apex.cpp.o] Error 1
1 error generated.
make[2]: *** [apex/src/apex/CMakeFiles/apex_lib.dir/build.make:89: apex/src/apex/CMakeFiles/apex_lib.dir/apex_policies.cpp.o] Error 1
1 error generated.
make[2]: *** [apex/src/apex/CMakeFiles/apex_lib.dir/build.make:102: apex/src/apex/CMakeFiles/apex_lib.dir/concurrency_handler.cpp.o] Error 1
[  0%] Linking CXX static library ../lib/libhpx_initd.a
[  0%] Built target hpx_init
In file included from /home/tianyi/fix_hpx/repos/hpx_apex_clang/apex/src/apex/policy_handler.cpp:12:
In file included from /home/tianyi/fix_hpx/repos/hpx_apex_clang/apex/src/apex/apex.hpp:43:
/home/tianyi/fix_hpx/repos/hpx_apex_clang/apex/src/apex/proc_read.h:182:7: error: 
      variable 'tmplong' is used uninitialized whenever 'if' condition is true
      [-Werror,-Wsometimes-uninitialized]
  if (fff==NULL) {
      ^~~~~~~~~
/home/tianyi/fix_hpx/repos/hpx_apex_clang/apex/src/apex/proc_read.h:188:10: note: 
      uninitialized use occurs here
  return tmplong/1000000;
         ^~~~~~~
/home/tianyi/fix_hpx/repos/hpx_apex_clang/apex/src/apex/proc_read.h:182:3: note: 
      remove the 'if' if its condition is always false
  if (fff==NULL) {
  ^~~~~~~~~~~~~~~~
/home/tianyi/fix_hpx/repos/hpx_apex_clang/apex/src/apex/proc_read.h:179:21: note: 
      initialize the variable 'tmplong' to silence this warning
  long long  tmplong;
                    ^
                     = 0
1 error generated.
make[2]: *** [apex/src/apex/CMakeFiles/apex_lib.dir/build.make:128: apex/src/apex/CMakeFiles/apex_lib.dir/policy_handler.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1280: apex/src/apex/CMakeFiles/apex_lib.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[  0%] Linking CXX static library ../lib/libhpx_wrapd.a
[  0%] Built target hpx_wrap
make: *** [Makefile:141: all] Error 2

@khuck
Copy link
Contributor

khuck commented Jul 12, 2018

OK, I'll install Clang 6.0 and make sure all code compiles with -Wall -Werror.

@khuck
Copy link
Contributor

khuck commented Jul 13, 2018

This should all be fixed in the develop branch, same instructions as above.

@msimberg msimberg added this to the 1.2.0 milestone Sep 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants