OpenFOAM with MPICH fatal error: mpi.h: No such file or directory - ubuntu-18.04

I am trying to build OpenFOAM from source with MPICH-3.3.2 but got
g++ -std=c++11 -m64 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -Wno-attributes -O3 -DNoRepository -ftemplate-depth-100 -I -IlnInclude -I. -I/home/pranto/OpenFOAM-dev/src/OpenFOAM/lnInclude -I/home/pranto/OpenFOAM-dev/src/OSspecific/POSIX/lnInclude -fPIC -c PstreamGlobals.C -o /home/pranto/OpenFOAM-dev/platforms/linux64GccDPInt32OptSYSTEMMPI/src/Pstream/mpi/PstreamGlobals.o
UPstream.C:30:17: fatal error: mpi.h: No such file or directory
compilation terminated.
/home/pranto/OpenFOAM-dev/wmake/rules/General/transform:25: recipe for target '/home/pranto/OpenFOAM-dev/platforms/linux64GccDPInt32OptSYSTEMMPI/src/Pstream/mpi/UPstream.o' failed
make[4]: *** [/home/pranto/OpenFOAM-dev/platforms/linux64GccDPInt32OptSYSTEMMPI/src/Pstream/mpi/UPstream.o] Error 1
make[4]: *** Waiting for unfinished jobs....
In file included from PstreamGlobals.C:26:0:
PstreamGlobals.H:41:17: fatal error: mpi.h: No such file or directory
compilation terminated.
In file included from UIPread.C:30:0:
PstreamGlobals.H:41:17: fatal error: mpi.h: No such file or directory
compilation terminated.
Although I set export WM_MPLIB=SYSTEMMPI in etc/bashrc.
But with the OpenMPI everything is ok.
What are the additional settings I have to consider to build OpenFOAM with MPICH-3.3.2?

In the "openfoma/etc" directory, there is a setting file for mpi where you can change the version and the location of the mpich you used. Hope this will help you. By the way, it is not necessary to set the bashrc file.

Related

Makefile crashed while making after pass the ./configure --host=mingw32

Everyone: situation: MacOS with x86_64-w64-mingw32 compiling toolchain I tried to compile GDB for Windows from the source code of GDB. But, after ./configure, I got
/bin/sh ./libtool --tag=CC --mode=link x86_64-w64-mingw32-gcc -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wstack-usage=262144 -Wno-format -I./../zlib -Iincludedir -D__USE_MINGW_ACCESS -release `cat libtool-soversion` -Llibdir -Wl,--stack,12582912 -o libbfd.la -rpath /usr/local/lib archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo cache.lo coff-bfd.lo compress.lo corefile.lo elf-properties.lo format.lo hash.lo init.lo libbfd.lo linker.lo merge.lo opncls.lo reloc.lo section.lo simple.lo stab-syms.lo stabs.lo syms.lo targets.lo binary.lo ihex.lo srec.lo tekhex.lo verilog.lo `cat ofiles` -L./../zlib -lz
./libtool: line 5208: cd: libdir: No such file or directory
libtool: link: cannot determine absolute directory name of `libdir'
make[4]: *** [libbfd.la] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-bfd] Error 2
I am sure my MingW32 is fully built and capable.
x86_64-w64-mingw32-addr2line x86_64-w64-mingw32-dllwrap x86_64-w64-mingw32-gcc-ranlib x86_64-w64-mingw32-ld.bfd x86_64-w64-mingw32-size
x86_64-w64-mingw32-ar x86_64-w64-mingw32-elfedit x86_64-w64-mingw32-gcov x86_64-w64-mingw32-lto-dump x86_64-w64-mingw32-strings
x86_64-w64-mingw32-as x86_64-w64-mingw32-g++ x86_64-w64-mingw32-gcov-dump x86_64-w64-mingw32-nm x86_64-w64-mingw32-strip
x86_64-w64-mingw32-c++ x86_64-w64-mingw32-gcc x86_64-w64-mingw32-gcov-tool x86_64-w64-mingw32-objcopy x86_64-w64-mingw32-windmc
x86_64-w64-mingw32-c++filt x86_64-w64-mingw32-gcc-10.2.0 x86_64-w64-mingw32-gfortran x86_64-w64-mingw32-objdump x86_64-w64-mingw32-windres
x86_64-w64-mingw32-cpp x86_64-w64-mingw32-gcc-ar x86_64-w64-mingw32-gprof x86_64-w64-mingw32-ranlib
x86_64-w64-mingw32-dlltool x86_64-w64-mingw32-gcc-nm x86_64-w64-mingw32-ld x86_64-w64-mingw32-readelf
I install it via HomeBrew And here is the config for libdir in my Makefile
prefix = /usr/local
exec_prefix = ${prefix}
libdir = ${exec_prefix}/lib
LDFLAGS = -Llibdir
...
"libdir=$(libdir)" \
...
Totally have no idea how to fix this. Any idea? Or if you need some more information to figure it out, just let me know.
And just download the source code of GDB, I think you could duplicate the same scenario.
./libtool: line 5208: cd: libdir: No such file or directory
libtool: link: cannot determine absolute directory name of `libdir'
make[4]: *** [libbfd.la] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-bfd] Error 2
make: *** [all] Error 2
As the command line and error message say, you give libtool not the right path.
The command line contains -Llibdir and the error message says "cannot determine absolute directory name of 'libdir'".
So you wrote your Makefile to use libdir literally and not as the variable as it should be. Change it into:
LDFLAGS = -L$(libdir)
or
LDFLAGS = -L${libdir}
There is no real difference between parentheses and braces, just don't mix them up. Helpful links are:
The difference between parentheses and curly braces in GNU Make and
What's the difference between parenthesis $() and curly bracket ${} syntax in Makefile?

How to Compile Openssl for linux-mips32 on a windows machine?

I have been struggling to build openssl for linux-mips32 using VS2015x native Tools.
I have set up perl and use the following command to configure:
perl Configure linux-mips32
--prefix=C:\Users\srivaspr\Downloads\openssl-1.0.2k.tar\openssl\builder
--openssldir=C:\Users\srivaspr\Downloads\openssl-1.0.2k.tar\openssl\builder
The configuration command works fine.
But when I use make command it gives the following error:
making all in crypto...
make[1]: Entering directory 'C:/Users/srivaspr/Downloads/openssl-1.0.2k.tar/openssl/crypto'
gcc -I. -I.. -I../include -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -mips2 -mabi=32 -O3 -Wall -DBN_DIV3W -DOPENSSL_BN_ASM_MONT -DSHA1_ASM -DSHA256_ASM -DAES_ASM -c -o cryptlib.o cryptlib.c
gcc: error: unrecognized argument in option '-mabi=32'
gcc: note: valid arguments to '-mabi=' are: ms sysv
gcc: error: unrecognized command line option '-mips2'
make[1]: *** [<builtin>: cryptlib.o] Error 1
make[1]: Leaving directory 'C:/Users/srivaspr/Downloads/openssl-1.0.2k.tar/openssl/crypto'
make: *** [Makefile:287: build_crypto] Error 1
I have searched through the internet multiple times but could not find anything relevant. Any help would be appreciated.

Fatal error: msgsps_common.h: No such file or directory

When I tried build my C project using MQTT (MOSQUITTO) I received this error: "
make all
Building file: ../mosquitto/test/msgsps_pub.c
Invoking: GCC C Compiler
gcc -I"/home/procifalus/workspace/C-Cplusplus/protheus/mosquitto" -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"mosquitto/test/msgsps_pub.d" -MT"mosquitto/test/msgsps_pub.d" -o "mosquitto/test/msgsps_pub.o" "../mosquitto/test/msgsps_pub.c"
../mosquitto/test/msgsps_pub.c:9:27: fatal error: msgsps_common.h: No such file or directory
#include <msgsps_common.h>
^
compilation terminated.
mosquitto/test/subdir.mk:45: recipe for target 'mosquitto/test/msgsps_pub.o' failed
make: *** [mosquitto/test/msgsps_pub.o] Error 1".
Could someone help me ?

fatal error: 'endian.h' file not found

Trying to compile C program, every time I run make or gmake as recommended I get this error.
$ make
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C src all
gcc -g -W -Wall -O3 -D_FILE_OFFSET_BITS=64 -D_REVISION=0 -Iinclude -c -o osdep/radiotap/radiotap.o osdep/radiotap/radiotap.c
In file included from osdep/radiotap/radiotap.c:17:
osdep/radiotap/platform.h:6:10: fatal error: 'endian.h' file not found
#include <endian.h>
^
1 error generated.
make[1]: *** [osdep/radiotap/radiotap.o] Error 1
make: *** [all] Error 2
$ gmake
gmake -C src all
gmake[1]: Entering directory '/Users/silent/Desktop/aircr-1.2-rc1/src'
gcc -g -W -Wall -O3 -D_FILE_OFFSET_BITS=64 -D_REVISION=0 -Iinclude -c -o osdep/radiotap/radiotap.o osdep/radiotap/radiotap.c
In file included from osdep/radiotap/radiotap.c:17:
osdep/radiotap/platform.h:6:10: fatal error: 'endian.h' file not found
#include <endian.h>
^
1 error generated.
<builtin>: recipe for target 'osdep/radiotap/radiotap.o' failed
gmake[1]: *** [osdep/radiotap/radiotap.o] Error 1
gmake[1]: Leaving directory '/Users/silent/Desktop/aircr-1.2-rc1/src'
Makefile:25: recipe for target 'all' failed
gmake: *** [all] Error 2
According to some forms online recommended to check the file in this location ~/usr/include/machine but doesn't say what to do if found or not! nothing else was helpful. Then, I found this http://www.opensource.apple.com/source/CarbonHeaders/CarbonHeaders-18.1/Endian.h
silent:~/usr/include/machine
$ ls
_limits.h _types.h fasttrap_isa.h profile.h vmparam.h
_mcontext.h byte_order.h limits.h signal.h
_param.h `endian.h` param.h types.h
As you can the file I am getting the error for is already existed! Any help would be appreciated. Thank you.
PS: I am newbie, I don't know what is this link above talking about :(!
On OSX and iOS, you can include endian.h this way:
#include <machine/endian.h>
But note that this will fail on Android or Linux because they expect #include <endian.h>.
You can also include sys/types.h, which will include the right endian.h both on iOS/OSX and Android/Linux:
#include <sys/types.h>
You have to tell the c compiler where it can find this file:
export CFLAGS="$CFLAGS -I~/usr/include/machine"
then run make.
Alternatively you can edit the file Makefile to add the -I~/usr/include/machine part where necessary.

error while building Glibc-2.11.1 for Linux From Scratch

I am trying to configure glibc-2.11.1 using gcc-4.6.1 for kernel 3.16. I am following steps given at http://www.gnu.org/software/libc/manual/html_node/Configuring-and-compiling.html when i am doing make after compiling some file it is giving
make -r PARALLELMFLAGS="" CVSOPTS="" -C ../glibc-2.11.1 objdir=`pwd` all
make[1]: Entering directory `/home/amar/Desktop/glib1/glibc-2.11.1'
make subdir=csu -C csu ..=../ subdir_lib
make[2]: Entering directory `/home/amar/Desktop/glib1/glibc-2.11.1/csu'
gcc /home/amar/Desktop/glib1/gnu/csu/crti.S -c -I../include -I/home/amar/Desktop/glib1/gnu/csu -I/home/amar/Desktop/glib1/gnu -I../sysdeps/i386/elf -I../nptl/sysdeps/unix/sysv/linux/i386/i686 -I../sysdeps/unix/sysv/linux/i386/i686 -I../nptl/sysdeps/unix/sysv/linux/i386 -I../sysdeps/unix/sysv/linux/i386 -I../nptl/sysdeps/unix/sysv/linux -I../nptl/sysdeps/pthread -I../sysdeps/pthread -I../sysdeps/unix/sysv/linux -I../sysdeps/gnu -I../sysdeps/unix/common -I../sysdeps/unix/mman -I../sysdeps/unix/inet -I../sysdeps/unix/sysv/i386 -I../nptl/sysdeps/unix/sysv -I../sysdeps/unix/sysv -I../sysdeps/unix/i386 -I../nptl/sysdeps/unix -I../sysdeps/unix -I../sysdeps/posix -I../sysdeps/i386/i686/fpu -I../nptl/sysdeps/i386/i686 -I../sysdeps/i386/i686 -I../sysdeps/i386/i486 -I../nptl/sysdeps/i386/i486 -I../sysdeps/i386/fpu -I../nptl/sysdeps/i386 -I../sysdeps/i386 -I../sysdeps/wordsize-32 -I../sysdeps/ieee754/ldbl-96 -I../sysdeps/ieee754/dbl-64 -I../sysdeps/ieee754/flt-32 -I../sysdeps/ieee754 -I../sysdeps/generic/elf -I../sysdeps/generic -I../nptl -I.. -I../libio -I. -D_LIBC_REENTRANT -include ../include/libc-symbols.h -DHAVE_INITFINI -DASSEMBLER -I/home/amar/Desktop/glib1/gnu/csu/. -DGAS_SYNTAX -g -Wa,--noexecstack -g0 -o /home/amar/Desktop/glib1/gnu/csu/crti.o
/tmp/ccEB9vct.s: Assembler messages:
/tmp/ccEB9vct.s: Error: open CFI at the end of file; missing .cfi_endproc directive
/tmp/ccEB9vct.s: Error: open CFI at the end of file; missing .cfi_endproc directive
make[2]: *** [/home/amar/Desktop/glib1/gnu/csu/crti.o] Error 1
make[2]: Leaving directory `/home/amar/Desktop/glib1/glibc-2.11.1/csu'
make[1]: *** [csu/subdir_lib] Error 2
make[1]: Leaving directory `/home/amar/Desktop/glib1/glibc-2.11.1'
make: *** [all] Error 2
Why is it so ? How I can rectify this error? Please help me. Thanks in advance
Why is it so ?
The file crti.S that is failing to build is generated by compiling csu/initfini.c, and then splitting the resulting initfini.s on "magic markers".
Unfortunately, this splitting is extremely dependent on the version of gcc that is used to generate initfini.s, and doesn't always work.
This entire mechanism has been eliminated in Feb 2012.
Your options are:
build a newer version of glibc (current is 2.19), or
build using older version of GCC (Google search shows many instances of gcc-4.6 causing this problem).

Resources