Open mmokrejs opened 5 years ago
Thanks @mmokrejs for the detailed report.
Do you remember how you configured your installation of sparsehash? It should not be looking for std::hash and should have no problems compiling with -std=c++98
. I see you've reported a very similar issue here: https://github.com/bcgsc/abyss/issues/225. Was this ever resolved?
>>> Preparing source in /scratch/var/tmp/portage/dev-cpp/sparsehash-2.0.3-r1/work/sparsehash-sparsehash-2.0.3 ...
* Applying sparsehash-2.0.3-fix-buildsystem.patch ... [ ok ]
* Running eautoreconf in '/scratch/var/tmp/portage/dev-cpp/sparsehash-2.0.3-r1/work/sparsehash-sparsehash-2.0.3' ...
* Running aclocal -I m4 ... [ ok ]
* Running autoconf --force ... [ ok ]
* Running autoheader ... [ ok ]
* Running automake --add-missing --copy --force-missing ... [ ok ]
* Running elibtoolize in: sparsehash-sparsehash-2.0.3/
>>> Source prepared.
>>> Configuring source in /scratch/var/tmp/portage/dev-cpp/sparsehash-2.0.3-r1/work/sparsehash-sparsehash-2.0.3 ...
* econf: updating sparsehash-sparsehash-2.0.3/config.sub with /usr/share/gnuconfig/config.sub
* econf: updating sparsehash-sparsehash-2.0.3/config.guess with /usr/share/gnuconfig/config.guess
./configure --prefix=/usr --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --disable-dependency-tracking --disable-silent-rules --docdir=/usr/share/doc/sparsehash-2.0.3-r1 --htmldir=/usr/share/doc/sparsehash-2.0.3-r1/html --libdir=/usr/lib64
...
It was built with gcc-8.2.0
or 8.3.0
. No special CFLAGS/CXXFLAGS
fiddling with -std
or similar.
No, the issue in abyss was not solved.
Thanks. I don't see anything there would cause a problem. Can you paste the contents of your sparsehash/internal/sparseconfig.h file?
$ cat /usr/include/sparsehash/internal/sparseconfig.h
/*
* NOTE: This file is for internal use only.
* Do not use these #defines in your own program!
*/
/* Namespace for Google classes */
#define GOOGLE_NAMESPACE ::google
/* the location of the header defining hash functions */
#define HASH_FUN_H <functional>
/* the namespace of the hash<> function */
#define HASH_NAMESPACE std
/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1
/* Define to 1 if the system has the type `long long'. */
#define HAVE_LONG_LONG 1
/* Define to 1 if you have the `memcpy' function. */
#define HAVE_MEMCPY 1
/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1
/* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1
/* Define to 1 if the system has the type `uint16_t'. */
#define HAVE_UINT16_T 1
/* Define to 1 if the system has the type `u_int16_t'. */
#define HAVE_U_INT16_T 1
/* Define to 1 if the system has the type `__uint16'. */
/* #undef HAVE___UINT16 */
/* The system-provided hash function including the namespace. */
#define SPARSEHASH_HASH HASH_NAMESPACE::hash
/* Stops putting the code inside the Google namespace */
#define _END_GOOGLE_NAMESPACE_ }
/* Puts following code inside the Google namespace */
#define _START_GOOGLE_NAMESPACE_ namespace google {
$
Ok, that confirms your sparsehash is configured to assume c++11 hash functions are available.
I am reluctant to change the dialect to c++11 just over this issue. SGA is no longer used for assembly very often but some subprograms it contains are still useful. Perhaps I should default to using the standard hash map if sparsehash is unavailable instead of dying.
FWIW, I was able to compile with c++11 with the following changes:
configure.ac
AC_SUBST(CXXFLAGS, "-std=c++11 -O3")
ClusterReader.cpp
bool good = static_cast<bool>(getline(*m_pReader, line));
rmdup.cpp
bool valid = static_cast<bool>(getline(*reader_vec[currReaderIdx], line));
For me configure does not detect sparsehash-2.0.3 not even with current git master at commit af73db617738ff3e4c85cb370f485b208d6be15c :
The
config.log
states:I dropped the
-std=c++98
and now configure checks passed:Now
configure
works:But, the
sga
code needs some more tweaks orsrc/Util/Makefile and src/SGA/Makefile
need to append-std=c++98
toCXXFLAGS
: