Mingw32 compilation - attempt two

From NWChem

Viewed 2931 times, With a total of 7 Posts
Jump to: navigation, search

Gets Around
Threads 31
Posts 101
Hi,

Unfortunately, all that I wrote about mingw32 compilation is wrong. My new Mingw32 installation conflicts with the old one, and the resulting executable is not able to work with MPI.

So I took the computer on which never was neither MPI nor Mingw (on WindowsXP).
I installed the current versions of Mingw and MPI, copy MPI in home folder and try to compile:
gcc -c -I. -I/home/amnikitin/MPICH2/include -I/home/amnikitin/nwchem-6.5/src/inc
lude -I/home/amnikitin/nwchem-6.5/src/tools/install/include -DLINUX -DGFORTRAN -
DGFORTRAN -DCHKUNDFLW -DGCC4 -DGCC46 -DPARALLEL_DIAG -DNEED_LOC -DJOBTIMEPATH=\"
/home/amnikitin/nwchem-6.5/bin/LINUX\" -DNWCHEM_SRCDIR="\"/home/amnikitin/nwchem
-6.5/src\"" -DBYTE_SHORT_PACKING   -DBYTE_SHORT_PACKING   -m32 -g  -o linux_prin
taff.o linux_printaff.c
linux_printaff.c:2:19: fatal error: sched.h: No such file or directory
 #include <sched.h>
                   ^
compilation terminated.
make[1]: *** [/home/amnikitin/nwchem-6.5/lib/LINUX/libnwcutil.a(linux_printaff.o
)] Error 1
make: *** [libraries] Error 1

The result is reproduced on another computer with Windows7.

Which versions of mingw32 and MPI used developers?

Forum Vet
Threads 8
Posts 1384
Alexei
I am not quite sure I will be able to help you on mingw32 installation issues because of my very limited windows knowledge.
I have simply installed the files from the sourceforge page linked from mingw.org
Here are some of the version numbers

$ mingw-get.exe -V
mingw-get version 0.6.2-beta-20131004-1
Copyright (C) 2009-2013, MinGW.org Project

$ gcc -v
Using built-in specs.
COLLECT_GCC=D:\MinGW\bin\gcc.exe
COLLECT_LTO_WRAPPER=d:/mingw/bin/../libexec/gcc/mingw32/4.8.1/lto-wrapper.exe
Target: mingw32
Configured with: ../gcc-4.8.1/configure --prefix=/mingw --host=mingw32 --build=m
ingw32 --without-pic --enable-shared --enable-static --with-gnu-ld --enable-lto
--enable-libssp --disable-multilib --enable-languages=c,c++,fortran,objc,obj-c++
,ada --disable-sjlj-exceptions --with-dwarf2 --disable-win32-registry --enable-l
ibstdcxx-debug --enable-version-specific-runtime-libs --with-gmp=/usr/src/pkg/gm
p-5.1.2-1-mingw32-src/bld --with-mpc=/usr/src/pkg/mpc-1.0.1-1-mingw32-src/bld --
with-mpfr= --with-system-zlib --with-gnu-as --enable-decimal-float=yes --enable-
libgomp --enable-threads --with-libiconv-prefix=/mingw32 --with-libintl-prefix=/
mingw --disable-bootstrap LDFLAGS=-s CFLAGS=-D_USE_32BIT_TIME_T
Thread model: win32
gcc version 4.8.1 (GCC)

From the graphical interface mingw-get, I can see that the mingw32-base version is
20130722200

The MPICH installation details are clearly listed at
http://www.nwchem-sw.org/index.php/Compiling_NWChem#How-to:_Windows_Platforms

Gets Around
Threads 31
Posts 101
It seems that I have the same version.
Are you sure that your computer have not another MinGW in parallel, especially TDM-GCC?

Forum Vet
Threads 8
Posts 1384
Yet one more time, I am not a sophisticated Windows user (and I'd rather not become one ...)
I did just a single MinGW installation.
Did you check the content of /etc/fstab under MSYS?
sched.h should be in c:\mingw\include (assuming you installed mingw under c:)
/etc/fstab should be of this form (or something close)
C:/MinGW /mingw
C:/MinGW/opt/ /opt
C:/MinGW/local32/ /local32
C:/MinGW/build32/ /build32
C:/MinGW/local64/ /local64
C:/MinGW/build64/ /build64
C:/MinGW/sources/ /sources

Further details at
http://www.kineticsystem.org/mingw

Gets Around
Threads 31
Posts 101
Quote:Edoapra Sep 19th 11:13 am

Did you check the content of /etc/fstab under MSYS?
sched.h should be in c:\mingw\include (assuming you installed mingw under c:)


Basic MinGW installation does not have POSIX.
Should I install Pthreads-win32? Maybe something else?
I am Windows programmer and know about Unix very little.

Forum Vet
Threads 8
Posts 1384
Alexei
I am inclined to drop native support for MinGW and support only cross compilation from Linux based on the feddback I got from you.
Anyhow, this is what I got from the command

mingw-get list |grep Package


Package: mingw-developer-toolkit Subsystem: msys
Package: mingw32-autoconf Subsystem: mingw32
Package: mingw32-autoconf2.1 Subsystem: mingw32
Package: mingw32-autoconf2.5 Subsystem: mingw32
Package: mingw32-automake Subsystem: mingw32
Package: mingw32-automake1.10 Subsystem: mingw32
Package: mingw32-automake1.11 Subsystem: mingw32
Package: mingw32-automake1.4 Subsystem: mingw32
Package: mingw32-automake1.5 Subsystem: mingw32
Package: mingw32-automake1.6 Subsystem: mingw32
Package: mingw32-automake1.7 Subsystem: mingw32
Package: mingw32-automake1.8 Subsystem: mingw32
Package: mingw32-automake1.9 Subsystem: mingw32
Package: mingw32-autotools Subsystem: mingw32
Package: mingw32-base Subsystem: mingw32
Package: mingw32-basic-bsdtar Subsystem: mingw32
Package: mingw32-binutils Subsystem: mingw32
Package: mingw32-bsdcpio Subsystem: mingw32
Package: mingw32-bsdtar Subsystem: mingw32
Package: mingw32-bzip2 Subsystem: mingw32
Package: mingw32-dos2unix Subsystem: mingw32
Package: mingw32-expat Subsystem: mingw32
Package: mingw32-gcc Subsystem: mingw32
Package: mingw32-gcc-ada Subsystem: mingw32
Package: mingw32-gcc-fortran Subsystem: mingw32
Package: mingw32-gcc-g++ Subsystem: mingw32
Package: mingw32-gcc-objc Subsystem: mingw32
Package: mingw32-gcc-tools-epoch2-autoconf Subsystem: mingw32
Package: mingw32-gcc-tools-epoch2-automake Subsystem: mingw32
Package: mingw32-gcc-v3-ada Subsystem: mingw32
Package: mingw32-gcc-v3-core Subsystem: mingw32
Package: mingw32-gcc-v3-fortran Subsystem: mingw32
Package: mingw32-gcc-v3-g++ Subsystem: mingw32
Package: mingw32-gcc-v3-java Subsystem: mingw32
Package: mingw32-gcc-v3-objc Subsystem: mingw32
Package: mingw32-gdb Subsystem: mingw32
Package: mingw32-gdb-python Subsystem: mingw32
Package: mingw32-gendef Subsystem: mingw32
Package: mingw32-gettext Subsystem: mingw32
Package: mingw32-gmp Subsystem: mingw32
Package: mingw32-libarchive Subsystem: mingw32
Package: mingw32-libasprintf Subsystem: mingw32
Package: mingw32-libbz2 Subsystem: mingw32
Package: mingw32-libcharset Subsystem: mingw32
Package: mingw32-libexpat Subsystem: mingw32
Package: mingw32-libgcc Subsystem: mingw32
Package: mingw32-libgettextpo Subsystem: mingw32
Package: mingw32-libgfortran Subsystem: mingw32
Package: mingw32-libgmp Subsystem: mingw32
Package: mingw32-libgmpxx Subsystem: mingw32
Package: mingw32-libgnat Subsystem: mingw32
Package: mingw32-libgomp Subsystem: mingw32
Package: mingw32-libiconv Subsystem: mingw32
Package: mingw32-libintl Subsystem: mingw32
Package: mingw32-libltdl Subsystem: mingw32
Package: mingw32-liblzma Subsystem: mingw32
Package: mingw32-libminizip Subsystem: mingw32
Package: mingw32-libmpc Subsystem: mingw32
Package: mingw32-libmpfr Subsystem: mingw32
Package: mingw32-libobjc Subsystem: mingw32
Package: mingw32-libpdcurses Subsystem: mingw32
Package: mingw32-libpopt Subsystem: mingw32
Package: mingw32-libpthread-old Subsystem: mingw32
Package: mingw32-libpthreadgc Subsystem: mingw32
Package: mingw32-libpthreadgce Subsystem: mingw32
Package: mingw32-libquadmath Subsystem: mingw32
Package: mingw32-libquserex Subsystem: mingw32
Package: mingw32-libssp Subsystem: mingw32
Package: mingw32-libstdc++ Subsystem: mingw32
Package: mingw32-libtool Subsystem: mingw32
Package: mingw32-libunistring Subsystem: mingw32
Package: mingw32-libz Subsystem: mingw32
Package: mingw32-lua Subsystem: mingw32
Package: mingw32-make Subsystem: mingw32
Package: mingw32-mgwport Subsystem: mingw32
Package: mingw32-mingw-get Subsystem: mingw32
MinGW Package Download and Installation Tool
Package: mingw32-mingw-utils Subsystem: mingw32
Package: mingw32-mingwrt Subsystem: mingw32
Package: mingw32-minizip Subsystem: mingw32
Package: mingw32-mpc Subsystem: mingw32
Package: mingw32-mpfr Subsystem: mingw32
Package: mingw32-pdcurses Subsystem: mingw32
Package: mingw32-pexports Subsystem: mingw32
Package: mingw32-pkginfo Subsystem: mingw32
MinGW Package Identification Tool
Package: mingw32-popt Subsystem: mingw32
Package: mingw32-pthreads-w32 Subsystem: mingw32
Package: mingw32-tcl Subsystem: mingw32
Package: mingw32-tk Subsystem: mingw32
Package: mingw32-w32api Subsystem: mingw32
Package: mingw32-wsl_rc Subsystem: mingw32
Windows System Libraries Meta-Package
Package: mingw32-xerces-c Subsystem: mingw32
Package: mingw32-xz Subsystem: mingw32
Package: mingw32-zlib Subsystem: mingw32
Package: msys-autoconf Subsystem: msys
Package: msys-autogen Subsystem: msys
Package: msys-automake Subsystem: msys
Package: msys-base Subsystem: msys
Package: msys-bash Subsystem: msys
Package: msys-binutils Subsystem: msys
Package: msys-bison Subsystem: msys
Package: msys-bsdcpio Subsystem: msys
Package: msys-bsdtar Subsystem: msys
Package: msys-bzip2 Subsystem: msys
Package: msys-console Subsystem: msys
Package: msys-core Subsystem: msys
Package: msys-coreutils Subsystem: msys
Package: msys-crypt Subsystem: msys
Package: msys-cvs Subsystem: msys
Package: msys-cygutils Subsystem: msys
Package: msys-dash Subsystem: msys
Package: msys-diffstat Subsystem: msys
Package: msys-diffutils Subsystem: msys
Package: msys-dos2unix Subsystem: msys
Package: msys-expat Subsystem: msys
Package: msys-file Subsystem: msys
Package: msys-findutils Subsystem: msys
Package: msys-flex Subsystem: msys
Package: msys-gawk Subsystem: msys
Package: msys-gcc Subsystem: msys
Package: msys-gdbm Subsystem: msys
Package: msys-gettext Subsystem: msys
Package: msys-gmp Subsystem: msys
Package: msys-grep Subsystem: msys
Package: msys-groff Subsystem: msys
Package: msys-guile Subsystem: msys
Package: msys-gzip Subsystem: msys
Package: msys-help2man Subsystem: msys
Package: msys-inetutils Subsystem: msys
Package: msys-less Subsystem: msys
Package: msys-libarchive Subsystem: msys
Package: msys-libasprintf Subsystem: msys
Package: msys-libbz2 Subsystem: msys
Package: msys-libcharset Subsystem: msys
Package: msys-libcrypt Subsystem: msys
Package: msys-libexpat Subsystem: msys
Package: msys-libgdbm Subsystem: msys
Package: msys-libgettextpo Subsystem: msys
Package: msys-libgmp Subsystem: msys
Package: msys-libguile Subsystem: msys
Package: msys-libiconv Subsystem: msys
Package: msys-libintl Subsystem: msys
Package: msys-libltdl Subsystem: msys
Package: msys-liblzma Subsystem: msys
Package: msys-libmagic Subsystem: msys
Package: msys-libminires Subsystem: msys
Package: msys-libminizip Subsystem: msys
Package: msys-libopenssl Subsystem: msys
Package: msys-libopts Subsystem: msys
Package: msys-libpopt Subsystem: msys
Package: msys-libregex Subsystem: msys
Package: msys-libtermcap Subsystem: msys
Package: msys-libtool Subsystem: msys
Package: msys-libxml2 Subsystem: msys
Package: msys-lndir Subsystem: msys
Package: msys-locate Subsystem: msys
Package: msys-lpr-enhanced Subsystem: msys
Package: msys-m4 Subsystem: msys
Package: msys-make Subsystem: msys
Package: msys-man Subsystem: msys
Package: msys-minires Subsystem: msys
Package: msys-minizip Subsystem: msys
Package: msys-mintty Subsystem: msys
Package: msys-mksh Subsystem: msys
Package: msys-mktemp Subsystem: msys
Package: msys-openssh Subsystem: msys
Package: msys-openssl Subsystem: msys
Package: msys-patch Subsystem: msys
Package: msys-perl Subsystem: msys
Package: msys-popt Subsystem: msys
Package: msys-rebase Subsystem: msys
Package: msys-regex Subsystem: msys
Package: msys-rsync Subsystem: msys
Package: msys-rxvt Subsystem: msys
Package: msys-sed Subsystem: msys
Package: msys-system-builder Subsystem: msys
Package: msys-tar Subsystem: msys
Package: msys-termcap Subsystem: msys
Package: msys-texinfo Subsystem: msys
Package: msys-tiny Subsystem: msys
Package: msys-unzip Subsystem: msys
Package: msys-vim Subsystem: msys
Package: msys-w32api Subsystem: msys
Package: msys-wget Subsystem: msys
Package: msys-xz Subsystem: msys
Package: msys-zip Subsystem: msys
Package: msys-zlib Subsystem: msys

Gets Around
Threads 31
Posts 101
Thanks, I think I understand what the problem was. I definitely intend to finish the job, because there are small additions into the code that I needed.

The big request to give binaries, at least for Windows. Not many people know how to compile and those who can compile Unix program is almost there.

Gets Around
Threads 31
Posts 101
So successful compilation came out to me:

1. MinGW can be installed using a semi-automatic tool mingw-get-setup.exe 
(http://sourceforge.net/projects/mingw/files/).
We need basic MinGW installation (Basic Setup) plus pthreads-32 of "All Packages". 
Msys required.

2. Installation does not writes the path to "C:\MinGW\bin". 
It is necessary to do it yourself, as well as remove all the paths 
to the others UNIX installations if any. 

3. When we first start  "msys.bat" a folder "C:\MinGW\msys\1.0\home\<user_name>" 
created where we should unpack the NWChem archive, and place a copy of the MPICH2 folder.

4. The name of the distribution folder should be reduced to "Nwchem-6.5".

5. It is necessary to put a patch in a folder "Nwchem-6.5\sys" and apply it: 
 cd $NWCHEM_TOP/src
 wget http://www.nwchem-sw.org/images/Util_md_sockets.patch.gz
 gzip -d Util_md_sockets.patch.gz
 patch -p0 < Util_md_sockets.patch 

6. Compilation made from Msys console by:
 export NWCHEM_TOP=~/nwchem-6.5
 export NWCHEM_TARGET=LINUX
 export USE_MPI=yes
 export MPI_LOC=~/MPICH2
 export MPI_INCLUDE=$MPI_LOC/include
 export MPI_LIB=$MPI_LOC/lib
 export LIBMPI="-lfmpich2g -lmpi"
 export NWCHEM_MODULES=all
 export DEPEND_CC=gcc
 cd $NWCHEM_TOP/src
 make nwchem_config
 make FC=gfortran DEPEND_CC=gcc 
Edited On 6:43:57 AM PDT - Sat, Sep 20th 2014 by P99


Forum >> NWChem's corner >> Compiling NWChem



Who's here now Members 0 Guests 0 Bots/Crawler 1


AWC's: 2.5.10 MediaWiki - Stand Alone Forum Extension
Forum theme style by: AWC