Skip to content

general crayCC compilation failure #1091

Description

@cpranger

I am very interested to use this amazing JSON library for my project. However, I am virtually tied to using the Cray Compiling Environment (CCE) and the Cray C++ compiler (crayCC). I realise that what I am reporting below may well be outside the scope of the developer(s), and that moreover, CrayCC is not on the list of supported compilers. Yet I want to make mention of this, and leave it up to the author to decide what to do with this information. Any help would be appreciated!

I have constructed a minimal working example (hello world) which does absolutely nothing with JSON except include the single header file:

#include <iostream>
#include "nlohmann/json.hpp"

int main()
	{ std::cout << "hello world!" << std::endl; }

this program is compiled with either gcc 7.2.0 producing expected behaviour (hello world!), and with crayCC 8.6.5 (https://pubs.cray.com/content/S-2179/8.6/cray-c-and-c++-reference-manual-s-2179-86/about-the-cray-and-c++-reference-manual).

> CC hello_json.cpp

the output is:

/tmp/pe_38754/hello_json_1.o: In function `std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release()':
/opt/gcc/6.1.0/snos/include/g++/bits/shared_ptr_base.h:147: undefined reference to `_ZN23_INTERNAL_b13fd261_main9__gnu_cxx27__exchange_and_add_dispatchEPii$$CFE_id_b13fd261_main'
/opt/gcc/6.1.0/snos/include/g++/bits/shared_ptr_base.h:162: undefined reference to `_ZN23_INTERNAL_b13fd261_main9__gnu_cxx27__exchange_and_add_dispatchEPii$$CFE_id_b13fd261_main'
/tmp/pe_38754/hello_json_1.o: In function `std::__shared_ptr<nlohmann::detail::input_adapter_protocol, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr()':
/users/cpranger/garnet/experiments/json_compilation/hello_json.cpp:1: undefined reference to `_ZN23_INTERNAL_b13fd261_main9__gnu_cxx27__exchange_and_add_dispatchEPii$$CFE_id_b13fd261_main'
/users/cpranger/garnet/experiments/json_compilation/hello_json.cpp:1: undefined reference to `_ZN23_INTERNAL_b13fd261_main9__gnu_cxx27__exchange_and_add_dispatchEPii$$CFE_id_b13fd261_main'
/tmp/pe_38754/hello_json_1.o: In function `std::__shared_ptr<nlohmann::detail::output_adapter_protocol<char>, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr()':
/users/cpranger/garnet/experiments/json_compilation/hello_json.cpp:7488: undefined reference to `_ZN23_INTERNAL_b13fd261_main9__gnu_cxx27__exchange_and_add_dispatchEPii$$CFE_id_b13fd261_main'
/tmp/pe_38754/hello_json_1.o:/users/cpranger/garnet/experiments/json_compilation/hello_json.cpp:7488: more undefined references to `_ZN23_INTERNAL_b13fd261_main9__gnu_cxx27__exchange_and_add_dispatchEPii$$CFE_id_b13fd261_main' follow
/tmp/pe_38754/hello_json_1.o: In function `std::unique_ptr<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >* nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::adl_serializer>::create<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)::{lambda(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)#1}>::~unique_ptr()':
/opt/gcc/6.1.0/snos/include/g++/bits/unique_ptr.h:236: undefined reference to `_ZZN8nlohmann10basic_jsonISt3mapSt6vectorNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEblmdSaNS_14adl_serializerEE6createIS8_JRKS8_EEEPT_DpOT0_ENKUlPS8_E_clESJ_$$CFE_id_b13fd261_main'
/opt/cray/pe/cce/8.6.5/binutils/x86_64/x86_64-pc-linux-gnu/bin/ld: link errors found, deleting executable `a.out'
/usr/bin/X11/sha1sum: a.out: No such file or directory

FYI, _ZN23_INTERNAL_b13fd261_main9__gnu_cxx27__exchange_and_add_dispatchEPii$$CFE_id_b13fd261_main demangles to

_INTERNAL_b13fd261_main::__gnu_cxx::__exchange_and_add_dispatch(int*, int)$$CFE_id_b13fd261_main

and _ZZN8nlohmann10basic_jsonISt3mapSt6vectorNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEblmdSaNS_14adl_serializerEE6createIS8_JRKS8_EEEPT_DpOT0_ENKUlPS8_E_clESJ_$$CFE_id_b13fd261_main demangles to

std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >* nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::adl_serializer>::create<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)::{lambda(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)#1}::operator()(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*) const$$CFE_id_b13fd261_main

Please let me know if any more information is required!

Casper

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions