SuperMalloc icon indicating copy to clipboard operation
SuperMalloc copied to clipboard

Unable to build on CentOS 6.5

Open dgotwisner opened this issue 8 years ago • 4 comments

Nothing in the documentation indicates what platforms are supported, or minimum requirements (which is an advantage of using autotools or cmake). What minimum version of G++, etc.?

Platform is running Linux 2.6.32-431.23.3.el6.x86_64, and the code fails to compile from doing a make from the release directory. The actual failure is the code in huge_malloc (huge_malloc.cc) as MADV_HUGEPAGE and MADV_NOHUGEPAGE don't exist. Since it explicitly sets one mode or the other, the assumption is the default on my system is no huge page support, so I commented out the entire block to get it to compile.

Now, I get further. But still no go. When compiling huge_malloc.cc: g++ -W -Wall -Werror -O3 -flto -ggdb -pthread -fPIC -mrtm -std=c++11 -I../release -I../src -c ../src/huge_malloc.cc -o ../release/huge_malloc.o

Gives the following error: /tmp/ccX5VXF3.s: Assembler messages: /tmp/ccX5VXF3.s:1614: Error: no such instruction: xbegin .L37' /tmp/ccX5VXF3.s:2237: Error: no such instruction: xabort $9' /tmp/ccX5VXF3.s:2267: Error: no such instruction: xend' /tmp/ccX5VXF3.s:2381: Error: no such instruction: xbegin .L28' /tmp/ccX5VXF3.s:2407: Error: no such instruction: `xabort $9' make: *** [../release/huge_malloc.o] Error 1

If I comment out most of this file, we get a similar error building large_malloc.cc: g++ -W -Wall -Werror -O3 -flto -ggdb -pthread -fPIC -mrtm -std=c++11 -I../release -I../src -c ../src/large_malloc.cc -o ../release/large_malloc.o /tmp/ccYsHMMz.s: Assembler messages: /tmp/ccYsHMMz.s:2681: Error: no such instruction: xbegin .L74' /tmp/ccYsHMMz.s:2838: Error: no such instruction: xbegin .L66' /tmp/ccYsHMMz.s:2869: Error: no such instruction: xabort $9' /tmp/ccYsHMMz.s:2881: Error: no such instruction: xend' make: *** [../release/large_malloc.o] Error 1

dgotwisner avatar Dec 09 '17 02:12 dgotwisner

I got it building on centos 7. Also need to install valgrind-devel which is not documented, in order to build the benchmarks. This is from the zip file downloaded within an hour of getting these issues.

dgotwisner avatar Dec 09 '17 02:12 dgotwisner

Can you provide more information about how the centos 6.5 install failed? I don't have a centos 6.5 installation, and it seems strange that g++ would accept -mrtm and then fail to understand the resulting xbegin assembly instruction. What version of gcc and gas does that installation use?

kuszmaul avatar Dec 13 '17 16:12 kuszmaul

6.5 behavior:

  1. cd release
  2. make ../src/huge_malloc.cc:109:36: error: \u2018MADV_HUGEPAGE\u2019 was not declared in this scope madvise(c, n_chunkschunksize, MADV_HUGEPAGE); // ignore any error code. In future skip this call if we always get an error? Also if we are in madvise=always we shouldn't bother. ^ ../src/huge_malloc.cc:114:44: error: \u2018MADV_HUGEPAGE\u2019 was not declared in this scope madvise(c, n_whole_chunkschunksize, MADV_HUGEPAGE); ^ ../src/huge_malloc.cc:118:6: error: \u2018MADV_NOHUGEPAGE\u2019 was not declared in this scope MADV_NOHUGEPAGE); ^ make: *** [../release/huge_malloc.o] Error 1

Note, uname -a returns: Linux nfw-devperf-01.newwireless.com 2.6.32-431.23.3.el6.x86_64 #1 SMP Thu Jul 31 17:20:51 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

On a newer system (CentOS 7), "man madvise" indicates that MADV_HUGEPAGE and MADV_NOHUGEPAGE are available starting in 2.6.38.

I am using g++ 4.8.1, which is newer than the stock C++ compiler on 6.5 (we needed C++11 features).

To get around the MADV issue, I commented out the block dealing with it in the huge_malloc() function: starting on the line after the MADV_DONTNEED, and going up to (and not including) the chunknum = address_2_chunknumber(c) statement.

That gets me further, now I get the following block: set -e; rm -f ../release/huge_malloc.d;
g++ -MM -W -Wall -Werror -O3 -flto -ggdb -pthread -fPIC -mrtm -std=c++11 -I../release -I../src ../src/huge_malloc.cc -MG -MF ../release/huge_malloc.d.$$;
sed 's,(huge_malloc).o[ :]*,../release/\1.o ../release/huge_malloc.d : ,g' < ../release/huge_malloc.d.$$
| sed 's,generated_constants.h,../release/generated_constants.h,' > ../release/huge_malloc.d;
rm -f ../release/huge_malloc.d.$$ g++ -W -Wall -Werror -O3 -flto -ggdb -pthread -fPIC -mrtm -std=c++11 -I../release -I../src -c ../src/huge_malloc.cc -o ../release/huge_malloc.o /tmp/cc0m2Emj.s: Assembler messages: /tmp/cc0m2Emj.s:1614: Error: no such instruction: xbegin .L37' /tmp/cc0m2Emj.s:2237: Error: no such instruction: xabort $9' /tmp/cc0m2Emj.s:2267: Error: no such instruction: xend' /tmp/cc0m2Emj.s:2381: Error: no such instruction: xbegin .L28' /tmp/cc0m2Emj.s:2407: Error: no such instruction: `xabort $9' make: *** [../release/huge_malloc.o] Error 1

dgotwisner avatar Dec 13 '17 19:12 dgotwisner

CentOS 7 appears to build and run clean now (I added the MADV code back in).

dgotwisner avatar Dec 13 '17 19:12 dgotwisner