Build failure of OpenMPI due to _noalias when using mpicxx - c++

I tried to install lammps on my department machine with a newer version of 11Aug17. However, mpicxx gives error to the following lines:
mpicxx -g -O3 -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64 -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1 -I/home/shixx597/codes/kim-api-v1.7.3/lib/kim-api-v1/include -c ../pair_list.cpp
../pair_list.cpp(88): error: expected a ";"
const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0];
^
../pair_list.cpp(89): error: "restrict" has already been declared in the current scope
dbl3_t * _noalias const f = (dbl3_t *) atom->f[0];
^
../pair_list.cpp(89): error: expected a ";"
dbl3_t * _noalias const f = (dbl3_t *) atom->f[0];
^
../pair_list.cpp(114): error: identifier "x" is undefined
const double dx = x[i].x - x[j].x;
^
../pair_list.cpp(160): error: identifier "f" is undefined
f[i].x += dx*fpair;
^
../pair_list.cpp(166): error: identifier "f" is undefined
f[j].x -= dx*fpair;
^
compilation aborted for ../pair_list.cpp (code 2)
make[1]: *** [pair_list.o] Error 2
make[1]: Leaving directory `/home/shixx597/codes/lammps-11Aug17/src/Obj_mpi'
make: *** [mpi] Error 2
My colleagues told me that it is the problem of openmpi. So I tried to install a new openmpi for me. However, I get the following error told me that automake is not installed like this:
cd . && /bin/sh /home/shixx597/codes/openmpi-3.0.0/config/missing automake-1.15 --foreign
/home/shixx597/codes/openmpi-3.0.0/config/missing: line 81: automake-1.15: command not found
WARNING: 'automake-1.15' is missing on your system.
You should only need it if you modified 'Makefile.am' or
'configure.ac' or m4 files included by 'configure.ac'.
The 'automake' program is part of the GNU Automake package:
<http://www.gnu.org/software/automake>
It also requires GNU Autoconf, GNU m4 and Perl in order to run:
<http://www.gnu.org/software/autoconf>
<http://www.gnu.org/software/m4/>
<http://www.perl.org/>
make: *** [Makefile.in] Error 1
When I tried to install automake-1.15, I get the following error:
CDPATH="${ZSH_VERSION+.}:" && cd . && "/home/shixx597/codes/automake-1.15/t/wrap/aclocal-1.15"
Can't locate /home/shixx597/codes/automake-1.15/bin/aclocal in #INC (#INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /home/shixx597/codes/automake-1.15/t/wrap/aclocal-1.15 line 29.
make: *** [aclocal.m4] Error 2
I do not have any sudo privilege to do anything on this weird department machine.
Even I tried to finish installing lammps on the departmental machine, I am wondering if I could finish the run of a large bonded force field model.

Actually, this a fairly well-known issue, and there are three solutions.
Use GCC rather than an Intel compiler (possibly not desirable).
Use the -restrict flag while compiling (I'm assuming by appending it when running make, like make CXX_FLAGS=-restrict
Just remove those two files from the build.
If you really want to try, you could also try to remove the _noalias keyword using sed or awk from the two offending files: pair_list.h and pair_list.cpp, or just define _noalias to be an empty keyword, as suggested by jww in the comments.

Related

pjsip build problems in centos 7

hi I try to build pjsip in centos 7 and has an error.
I has limited experience in Linux, in my new project i have to use pjsip in Centos 7 I download the pjsip library version 2.9 unpacked and try to compile.
I test this two configuration.
$ ./configure
....
checking for cc++... no
checking for cl.exe... no
checking for FCC... no
checking for KCC... no
checking for RCC... no
checking for xlC_r... no
checking for xlC... no
checking whether we are using the GNU C++ compiler... no
checking whether g++ accepts -g... no
aconfigure: error: C++ compiler does not work
I think this is not correct.
I try this
$ ./configure-legacy
CROSS_COMPILE =
LINUX_POLL = select
The configuration for current host has been written to 'build.mak'.
Customizations can be put in:
- 'user.mak'
- 'pjlib/include/pj/config_site.h'
Next, run 'make dep && make clean && make'
could be right but the make fails
$ make
....
../src/pj/sock_bsd.c:147:35: error: ‘TCP_NODELAY’ undeclared here (not in
a function)
const pj_uint16_t PJ_TCP_NODELAY= TCP_NODELAY;
^
make[2]: *** [output/pjlib-x86_64-linux-gcc/sock_bsd.o] Error 1
make[2]: Leaving directory `/mnt/hgfs/sharedfolder/pjproject-
2.9/pjlib/build'
make[1]: *** [libpj-x86_64-linux-gcc.a] Error 2
make[1]: Leaving directory `/mnt/hgfs/sharedfolder/pjproject-
2.9/pjlib/build'
make: *** [all] Error
I need some help with this problem thank a lot.
C compiler missing.
Is gcc available on your system??
sudo yum groupinstall 'Development Tools'

How to install flite for epitran on Windows

I'm trying to use python's package epitran https://pypi.org/project/epitran/0.10/ on windows which returns the IPA representation of words. For english, as the website says, I need to install flite from here http://tts.speech.cs.cmu.edu/awb/flite-2.0.5-current.tar.bz2.
After some research on the web I have gotten to download the file and trying installing it using cygwin.
I also changed both instances of cp -pd to cp -pR as epitran's website and this Error installing flite on Mac OSX suggested.
So far I've executed the following lines in my cygwin terminal.
$ tar xjf flite-2.0.5-current.tar.bz2
$ cd flite-2.0.5-current
But when I execute this:
$ ./configure && make
I get the following error
gcc -I. -DCST_AUDIO_NONE -I../../include -g -O2 -Wall -c auclient.c -o ../../build/x86_64-cygwin/obj/src/audio/auclient.o
In file included from auclient.c:46:0:
../../include/cst_file.h: In function 'c99_vsnprintf':
../../include/cst_file.h:108:20: warning: implicit declaration of function '_vsnprintf_s' [-Wimplicit-function-declaration]
count = _vsnprintf_s(str, size, _TRUNCATE, format, ap);
^~~~~~~~~~~~
../../include/cst_file.h:108:44: error: '_TRUNCATE' undeclared (first use in this function)
count = _vsnprintf_s(str, size, _TRUNCATE, format, ap);
^~~~~~~~~
../../include/cst_file.h:108:44: note: each undeclared identifier is reported only once for each function it appears in
make[2]: *** [../../config/common_make_rules:105: ../../build/x86_64-cygwin/obj/src/audio/auclient.o] Error 1
make[1]: *** [../config/common_make_rules:133: ../build/x86_64-cygwin/obj/src/.make_build_dirs] Error 2
make: *** [config/common_make_rules:133: build/x86_64-cygwin/obj//.make_build_dirs] Error 2
I basically have no idea what I'm doing and what the error might be since I have 0 experience with C++ or Linux so I'd be really grateful if someone gave me some help

gRPC installation fails at "make"

I am following the Built From Source instructions to install grpc
$ git clone -b $(curl -L https://grpc.io/release) https://github.com/grpc/grpc
success
$ cd grpc
success
$ git submodule update --init
success
$ make
fails after building a few source files
third_party/boringssl/crypto/rand/urandom.c:62:2: error: #error "system call number for getrandom is not the expected value"
#error "system call number for getrandom is not the expected value"
^
In file included from /usr/include/x86_64-linux-gnu/sys/syscall.h:31:0,
from third_party/boringssl/crypto/rand/urandom.c:32:
third_party/boringssl/crypto/rand/urandom.c: In function ‘init_once’:
third_party/boringssl/crypto/rand/urandom.c:128:15: error: ‘__NR_getrandom’ undeclared (first use in this function)
syscall(SYS_getrandom, &dummy, sizeof(dummy), GRND_NONBLOCK);
^
third_party/boringssl/crypto/rand/urandom.c:128:15: note: each undeclared identifier is reported only once for each function it appears in
third_party/boringssl/crypto/rand/urandom.c: In function ‘fill_with_entropy’:
third_party/boringssl/crypto/rand/urandom.c:258:21: error: ‘__NR_getrandom’ undeclared (first use in this function)
r = syscall(SYS_getrandom, out, len, 0 /* no flags */);
^
Makefile:2564: recipe for target '/home/usrnm/grpc/objs/opt/third_party/boringssl/crypto/rand/urandom.o' failed
make: *** [/home/usrnm/grpc/objs/opt/third_party/boringssl/crypto/rand/urandom.o] Error 1
OS: Linux 4.4.0-0 SMP Debian 4.4.16-1
GCC version: gcc (Debian 4.9.2-10) 4.9.2
I couldn't find any open issues or any help about this error on the internet.
You might have better luck without the embedded BoringSSL. Try building with:
EMBED_OPENSSL=false make
If you get errors about missing packages, make sure you have libssl-dev installed.
The problem seems to happen while compiling boringssl . We use the version given by $ git submodule, which at the time of this writing is be2ee342d3781ddb954f91f8a7e660c6f59e87e5 third_party/boringssl (version_for_cocoapods_7.0-526-gbe2ee342). Are you able to compile boringssl on its own?

Building Mono from Source (not git) Fails with mcs: Command not found

Building mono from downloaded source on an Android device. Ran make get-monolite-latest and still get the following errors
make[2]: Entering directory `/bld/mono/mono-4.0.0/runtime'
if test -w /bld/mono/mono-4.0.0/mcs; then :; else chmod -R +w /bld/mono/mono-4.0.0/mcs; fi
cd /bld/mono/mono-4.0.0/mcs && make --no-print-directory -s NO_DIR_CHECK=1 PROFILES='binary_reference_assemblies net_4_5 xbuild_12 xbuild_14 monodroid ' CC='gcc --sysroot=/usr/gcc-4.9.2/sysroot' all-profiles
make[6]: mcs: Command not found
make[6]: *** [build/deps/basic-profile-check.exe] Error 127
*** The compiler 'mcs' doesn't appear to be usable.
*** Trying the 'monolite' directory.
Illegal instruction
make[8]: *** [build/deps/basic-profile-check.exe] Error 132
*** The contents of your 'monolite' directory may be out-of-date
*** You may want to try 'make get-monolite-latest'
I've found what I think is the mcs executable in runtime/_tmpdir/bin, but copying it to where the build seems to be looking for it doesn't help.
How do I resolve this?
As the error message suggests: You may want to try the command 'make get-monolite-latest'
You need a certain mono version for building mono 4, I think it was >= 3.8 or so. The monolite should help out in this case.

Building gold linker with MinGW on Windows, FLEX/bison 'YYSTYPE' was not declared in this scope

I'm trying to build the gold linker included with GNU binutils using mingw. The steps I have taken-
Install mingw with all packages using the installer.
Install the windows version of FLEX to the default location using the windows installer.
Run ./configure in the gold linker directory from the mingw shell which seems to work fine
Run make, this is where I'm getting some errors.
I've included the complete output of ./configure and make in a pastebin here:
http://pastebin.com/1XLkZVVm
But the important part is this:
make[2]: Entering directory `c:/binutils-2.23.1/binutils-2.23.1/gold'
g++ -DHAVE_CONFIG_H -I. -I. -I./../include -I./../elfcpp -DLOCALEDIR="\"/usr/lo
cal/share/locale\"" -DBINDIR="\"/usr/local/bin\"" -DTOOLBINDIR="\"/usr/local//bi
n\"" -DTOOLLIBDIR="\"/usr/local//lib\"" -W -Wall -Wno-format -Werror -D_LAR
GEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -frandom-seed=expression.o -MT expression.
o -MD -MP -MF .deps/expression.Tpo -c -o expression.o expression.cc
In file included from expression.cc:33:0:
script-c.h:221:7: エラー: 'yylex' initialized and declared 'extern' [-Werror]
script-c.h:221:7: エラー: 'YYSTYPE' was not declared in this scope
script-c.h:221:15: エラー: expected primary-expression before ',' token
script-c.h:221:17: エラー: expected primary-expression before 'void'
script-c.h:221:30: エラー: expression list treated as compound expression in ini
tializer [-fpermissive]
cc1plus.exe: all warnings being treated as errors
make[2]: *** [expression.o] Error 1
make[2]: Leaving directory `c:/binutils-2.23.1/binutils-2.23.1/gold'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `c:/binutils-2.23.1/binutils-2.23.1/gold'
make: *** [all] Error 2
I've looked in the script-c.h file and it has this function:
/* Called by the bison parser skeleton to return the next token. */
extern int
yylex(YYSTYPE*, void* closure);
However YYSTYPE is not defined anywhere that I can find.
I'm new to using mingw and msys so I may have missed some steps somewhere. Any help getting this to build would be really appreciated.
As this question had lain unanswered for some months, I looked into the problem.
I downloaded binutils-2.25 (latest at this date) and tried to follow your actions.
I discovered that if you only build gold without the rest of binutils it does not build. If you perform a ./configure and make at the top level it builds the gold fine. If you then cd gold and do the ./configure and make (albeit unnecessarily) then it works fine also.
I did find that when it failed on gold alone it got further than your build did.
My attention was also drawn to your phrase FLEX to the default location. The instructions with FLEX make it clear that you should not rely on the default location (which may be /Program Files/ or similar) but must use path that does not contain any spaces. If you had not noticed this, then that is your fault.
As the latest builds, you can get gold working by ensuring you have installed flex (and bison) properly in non-space paths, then downloading 2.25 and building the whole of binutils rather than gold alone.
I hope this analysis is useful for someone who comes later and finds similar issues.