Project

General

Profile

Bug #1377

linking megatest on Eos fails with undefined references to ceil and floor from hashtable_c++0x.cc

Added by Jim Phillips over 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Machine Layers
Target version:
Start date:
01/22/2017
Due date:
% Done:

0%


Description

The trick for C++ 11 that works on Edison (Cray XC) fails to link C++ on OLCF Eos:

module load fftw; module load rca; module load craype-hugepages8M; module load gcc/4.9.3; module list;
./build charm++ gni-crayxc persistent --no-build-shared --with-production
cd gni-crayxc-persistent/tests/charm++/megatest
make pgm
...
../../../bin/charmc  -o pgm  megatest.o groupring.o nodering.o varsizetest.o varsizetest2.o varraystest.o groupcast.o groupmulti.o groupsectiontest.o multisectiontest.o nodecast.o synctest.o fib.o arrayring.o tempotest.o packtest.o queens.o migration.o marshall.o priomsg.o priotest.o rotest.o statistics.o templates.o inherit.o reduction.o bitvector.o immediatering.o callback.o inlineem.o completion_test.o -language charm++ -module completion
icpc -mavx -static -D__CRAYXC -D__CRAY_SANDYBRIDGE -D__CRAYXT_COMPUTE_LINUX_TARGET -o pgm -L../../../bin/../lib -I../../../bin/../include megatest.o groupring.o nodering.o varsizetest.o varsizetest2.o varraystest.o groupcast.o groupmulti.o groupsectiontest.o multisectiontest.o nodecast.o synctest.o fib.o arrayring.o tempotest.o packtest.o queens.o migration.o marshall.o priomsg.o priotest.o rotest.o statistics.o templates.o inherit.o reduction.o bitvector.o immediatering.o callback.o inlineem.o completion_test.o moduleinit29942.o -lmodulecompletion -lckmain -lck -lmemory-default -lthreads-default -lconv-cplus-y -lconv-core -ltmgr -lconv-util -lconv-partition -lmemory-default -lthreads-default -lldb-rand -lconv-ldb -lckqt -lz -ldl -lrt -lmodulecompletion -lm -I/opt/cray/mpt/7.2.5/gni/mpich2-intel/14.0/include -I/opt/cray/fftw/3.3.4.5/sandybridge/include -I/opt/cray/libsci/13.2.0/INTEL/14.0/x86_64/include -I/opt/cray/rca/1.0.0-2.0502.60530.1.62.ari/include -I/opt/cray/alps/5.2.4-2.0502.9774.31.11.ari/include -I/opt/cray/xpmem/0.1-2.0502.64982.5.3.ari/include -I/opt/cray/gni-headers/4.0-1.0502.10859.7.8.ari/include -I/opt/cray/pmi/5.0.7-1.0000.10678.155.25.ari/include -I/opt/cray/ugni/6.0-1.0502.10863.8.29.ari/include -I/opt/cray/udreg/2.3.2-1.0502.10518.2.17.ari/include -I/opt/cray/wlm_detect/1.0-1.0502.64649.2.1.ari/include -I/opt/cray/krca/1.0.0-2.0502.63139.4.31.ari/include -I/opt/cray-hss-devel/7.2.0/include -L/opt/cray/dmapp/default/lib64 -L/opt/cray/mpt/7.2.5/gni/mpich2-intel/14.0/lib -L/opt/cray/dmapp/default/lib64 -L/opt/cray/mpt/7.2.5/gni/mpich2-intel/14.0/lib -L/opt/cray/fftw/3.3.4.5/sandybridge/lib -L/opt/cray/libsci/13.2.0/INTEL/14.0/x86_64/lib -L/opt/cray/rca/1.0.0-2.0502.60530.1.62.ari/lib64 -L/opt/cray/alps/5.2.4-2.0502.9774.31.11.ari/lib64 -L/opt/cray/xpmem/0.1-2.0502.64982.5.3.ari/lib64 -L/opt/cray/pmi/5.0.7-1.0000.10678.155.25.ari/lib64 -L/opt/cray/ugni/6.0-1.0502.10863.8.29.ari/lib64 -L/opt/cray/udreg/2.3.2-1.0502.10518.2.17.ari/lib64 -L/opt/cray/atp/1.8.3/libApp -L/opt/cray/wlm_detect/1.0-1.0502.64649.2.1.ari/lib64 -Wl,-Ttext-segment=0x20000000,-zmax-page-size=0x20000000 -Wl,--whole-archive,-lhugetlbfs,--no-whole-archive -lfftw3f_mpi -lfftw3f_threads -lfftw3f -lfftw3_mpi -lfftw3_threads -lfftw3 -Wl,--no-as-needed,-lAtpSigHandler,-lAtpSigHCommData -Wl,--undefined=_ATP_Data_Globals -Wl,--undefined=__atpHandlerInstall -lpthread -lsci_intel_mpi -lsci_intel -lm -ldl -lsci_intel -lm -ldl -lmpichcxx_intel -lrt -lugni -lpthread -lpmi -lm -ldl -lmpich_intel -lrt -lugni -lpthread -lpmi -lm -ldl -lpmi -lpthread -lalpslli -lpthread -lwlm_detect -lalpsutil -lpthread -lrca -lugni -lpthread -lxpmem -ludreg -Wl,--as-needed,-limf,--no-as-needed -Wl,--as-needed,-lm,--no-as-needed -Wl,--as-needed,-lifcore,--no-as-needed -Wl,--as-needed,-lifport,--no-as-needed -Wl,--as-needed,-lpthread,--no-as-needed
/usr/lib/../lib64/libpthread.a(sem_open.o): In function `sem_open':
/usr/src/packages/BUILD/glibc-2.11.3/nptl/sem_open.c:333: warning: the use of `mktemp' is dangerous, better use `mkstemp'
../../../bin/../lib/libconv-util.a(sockRoutines.o): In function `skt_my_ip':
sockRoutines.c:(.text+0x3be): warning: Using 'gethostbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/opt/gcc/4.9.3/snos/lib/gcc/x86_64-suse-linux/4.9.3/../../../../lib64/libstdc++.a(hashtable_c++0x.o): In function `std::__detail::_Prime_rehash_policy::_M_next_bkt(unsigned long) const':
/tmp/peint/cray-gcc/cray-gcc/BUILD/snos_objdir/x86_64-suse-linux/libstdc++-v3/src/c++11/../../../../../cray-gcc-4.9.3/libstdc++-v3/src/c++11/hashtable_c++0x.cc:62: undefined reference to `ceil'
/tmp/peint/cray-gcc/cray-gcc/BUILD/snos_objdir/x86_64-suse-linux/libstdc++-v3/src/c++11/../../../../../cray-gcc-4.9.3/libstdc++-v3/src/c++11/hashtable_c++0x.cc:55: undefined reference to `ceil'
/opt/gcc/4.9.3/snos/lib/gcc/x86_64-suse-linux/4.9.3/../../../../lib64/libstdc++.a(hashtable_c++0x.o): In function `std::__detail::_Prime_rehash_policy::_M_need_rehash(unsigned long, unsigned long, unsigned long) const':
/tmp/peint/cray-gcc/cray-gcc/BUILD/snos_objdir/x86_64-suse-linux/libstdc++-v3/src/c++11/../../../../../cray-gcc-4.9.3/libstdc++-v3/src/c++11/hashtable_c++0x.cc:86: undefined reference to `floor'
/tmp/peint/cray-gcc/cray-gcc/BUILD/snos_objdir/x86_64-suse-linux/libstdc++-v3/src/c++11/../../../../../cray-gcc-4.9.3/libstdc++-v3/src/c++11/hashtable_c++0x.cc:90: undefined reference to `floor'
/usr/bin/ld: link errors found, deleting executable `pgm'
Fatal Error by charmc in directory /usr/tmp/jimp/charm-6.8.0-pre/gni-crayxc-persistent/tests/charm++/megatest
   Command CC -o pgm -L../../../bin/../lib -I../../../bin/../include megatest.o groupring.o nodering.o varsizetest.o varsizetest2.o varraystest.o groupcast.o groupmulti.o groupsectiontest.o multisectiontest.o nodecast.o synctest.o fib.o arrayring.o tempotest.o packtest.o queens.o migration.o marshall.o priomsg.o priotest.o rotest.o statistics.o templates.o inherit.o reduction.o bitvector.o immediatering.o callback.o inlineem.o completion_test.o moduleinit29942.o -lmodulecompletion -lckmain -lck -lmemory-default -lthreads-default -lconv-cplus-y -lconv-core -ltmgr -lconv-util -lconv-partition -lmemory-default -lthreads-default -lldb-rand -lconv-ldb -lckqt -lz -ldl -lrt -lmodulecompletion -craype-verbose -lm returned error code 1
charmc exiting...

The issue can be reproduced in a short program:
home/jimp> cat badc++.C

#include <memory>
#include <unordered_map>

int main(int, char**) {

std::unique_ptr<int> b;

std::unordered_map<int,int> a;

a[1] = 2;

return 0;

}

home/jimp> CC -std=c++0x badc++.C
badc++.C(7): error: namespace "std" has no member "unique_ptr" 
  std::unique_ptr<int> b;
       ^

badc++.C(7): error: type name is not allowed
  std::unique_ptr<int> b;
                  ^

badc++.C(7): error: identifier "b" is undefined
  std::unique_ptr<int> b;
                       ^

compilation aborted for badc++.C (code 2)
home/jimp> module load gcc/4.9.3
home/jimp> CC -std=c++0x badc++.C
/opt/gcc/4.9.3/snos/lib/gcc/x86_64-suse-linux/4.9.3/../../../../lib64/libstdc++.a(hashtable_c++0x.o): In function `std::__detail::_Prime_rehash_policy::_M_next_bkt(unsigned long) const':
/tmp/peint/cray-gcc/cray-gcc/BUILD/snos_objdir/x86_64-suse-linux/libstdc++-v3/src/c++11/../../../../../cray-gcc-4.9.3/libstdc++-v3/src/c++11/hashtable_c++0x.cc:62: undefined reference to `ceil'
/tmp/peint/cray-gcc/cray-gcc/BUILD/snos_objdir/x86_64-suse-linux/libstdc++-v3/src/c++11/../../../../../cray-gcc-4.9.3/libstdc++-v3/src/c++11/hashtable_c++0x.cc:55: undefined reference to `ceil'
/opt/gcc/4.9.3/snos/lib/gcc/x86_64-suse-linux/4.9.3/../../../../lib64/libstdc++.a(hashtable_c++0x.o): In function `std::__detail::_Prime_rehash_policy::_M_need_rehash(unsigned long, unsigned long, unsigned long) const':
/tmp/peint/cray-gcc/cray-gcc/BUILD/snos_objdir/x86_64-suse-linux/libstdc++-v3/src/c++11/../../../../../cray-gcc-4.9.3/libstdc++-v3/src/c++11/hashtable_c++0x.cc:86: undefined reference to `floor'
/tmp/peint/cray-gcc/cray-gcc/BUILD/snos_objdir/x86_64-suse-linux/libstdc++-v3/src/c++11/../../../../../cray-gcc-4.9.3/libstdc++-v3/src/c++11/hashtable_c++0x.cc:90: undefined reference to `floor'
/usr/bin/ld: link errors found, deleting executable `a.out'

If gcc is not loaded the unordered_map will link but unique_ptr won't.
If gcc is loaded the unique_ptr will compile but unordered_map won't.
The workaround is to module swap intel/16.0.3.210 and module load gcc/4.9.3.

Related issues

Related to Charm++ - Bug #1560: icc build fails on NASA Pleiades Merged 05/14/2017

History

#1 Updated by Phil Miller about 2 years ago

  • Related to Bug #1560: icc build fails on NASA Pleiades added

Also available in: Atom PDF