Mingw32 compilation

From NWChem

Viewed 3314 times, With a total of 30 Posts
Jump to: navigation, search

Jump to page 12Next 16Last
Gets Around
Threads 26
Posts 85
Hi,

According to the release news, version 6.5 is compiled by Mingw32.
Unfortunately I did not find any information about it. The documentation refers to the compilation by Cygnus.
Could you be so kind to help with this?

Forum Vet
Threads 4
Posts 936
This is what I have done to install NWChem under Mingw32

A prerequisite is to install Mpich, that can be found at the following URL

http://www.mpich.org/static/tarballs/1.4.1p1/mpich2-1.4.1p1-win-ia32.msi

Once Mpich is installed, you should copy the installation files to a different location to avoid the failure of the tools compilation. You can use the following command

cp -rp /c/Program\ Files\ \(x86\)/MPICH2/ ~/

Next, you need to set the env.

export NWCHEM_TOP=~/nwchem-6.5
export NWCHEM_TARGET=LINUX
export USE_MPI=y
export MPI_LOC=~/MPICH2
export MPI_INCLUDE=$MPI_LOC/include
export MPI_LIB=$MPI_LOC/lib
export LIBMPI="-lfmpich2g -lmpi"
export PYTHONHOME=/c/Python27/
export PYTHONVERSION=27
export DEPEND_CC=gcc

Then, you can start the compilation by typing

make FC=gfortran DEPEND_CC=gcc

Gets Around
Threads 26
Posts 85
Thank you very much for your help and for addition into documentation.

Let me make a few clarifications.

1. Since the compilation done by UNIX commands, I guess that you used Msys. This is not a trivial point for Windows. I have never dealt with Msys, and it was not installed, even though I use Mingw32 itself. Please write about it, so that for Windows programmers it was clear.

2. In the description was not specified that before command
% make FC=gfortran DEPEND_CC=gcc
must be
% cd $NWCHEM_TOP/src 
% make nwchem_config

3. It would be nice also give example of compilation without Python.

4. You specify
NWCHEM_TOP=~/nwchem-6.5
but the distribution is used a long name, and compilation with a long name fails. It would be good to explicitly specify the need for renaming.

I am afraid that the failure with a long name suggests that the full path enter into the program. I would not want that path of my PC were in the program. Can this be avoided?

Gets Around
Threads 26
Posts 85
Unfortunately, the compilation fails:

Making all in paw_atom
gcc -c -I.  -I/home/amnikitin/nwchem-6.5/src/include -I/home/amnikitin/nwchem-6.
5/src/tools/install/include -DLINUX -DGFORTRAN -DGFORTRAN -DCHKUNDFLW -DGCC4 -DG
CC46 -DPARALLEL_DIAG  -m32 -g -O2 -o paw_atom_driver.o paw_atom_driver.c
make[5]: *** No rule to make target `/home/amnikitin/nwchem-6.5/src/include/paw_
my_constants.h', needed by `/home/amnikitin/nwchem-6.5/lib/LINUX/libnwpwlib.a(pa
w_atom.o)'.  Stop.
make[4]: *** [optimized] Error 2
make[3]: *** [subdirs] Error 1
make[2]: *** [subdirs] Error 1
make[1]: *** [subdirs] Error 1
make: *** [libraries] Error 1

Forum Vet
Threads 4
Posts 936
Quote:P99 Sep 12th 8:58 am
Thank you very much for your help and for addition into documentation.

Let me make a few clarifications.

1. Since the compilation done by UNIX commands, I guess that you used Msys. This is not a trivial point for Windows. I have never dealt with Msys, and it was not installed, even though I use Mingw32 itself. Please write about it, so that for Windows programmers it was clear.



Yes
I have been using MSYS, too.
Edited On 1:17:42 PM PDT - Fri, Sep 12th 2014 by Edoapra

Forum Vet
Threads 4
Posts 936
Quote:P99 Sep 12th 8:58 am


2. In the description was not specified that before command
% make FC=gfortran DEPEND_CC=gcc
must be
% cd $NWCHEM_TOP/src 
% make nwchem_config

Of course, all the usual NWChem compilation steps apply

Quote:P99 Sep 12th 8:58 am

3. It would be nice also give example of compilation without Python.

4. You specify
NWCHEM_TOP=~/nwchem-6.5
but the distribution is used a long name, and compilation with a long name fails. It would be good to explicitly specify the need for renaming.

I am afraid that the failure with a long name suggests that the full path enter into the program. I would not want that path of my PC were in the program. Can this be avoided?


I am not a MingW32/MSYS experts, therefore I cannot really help you on this.
My home directory on MSYS is /home/edo, therefore the full path of NWCHEM_TOP is
/home/edo/nwchem-6.5

If you have any suggestions to improve the MingW32 installation process, they are very welcome
Edited On 1:41:03 PM PDT - Fri, Sep 12th 2014 by Edoapra

Forum Vet
Threads 4
Posts 936
Quote:P99 Sep 12th 9:11 am
Unfortunately, the compilation fails:

[pre]Making all in paw_atom
gcc -c -I. -I/home/amnikitin/nwchem-6.5/src/include -I/home/amnikitin/nwchem-6.
5/src/tools/install/include -DLINUX -DGFORTRAN -DGFORTRAN -DCHKUNDFLW -DGCC4 -DG
CC46 -DPARALLEL_DIAG -m32 -g -O2 -o paw_atom_driver.o paw_atom_driver.c
make[5]: *** No rule to make target `/home/amnikitin/nwchem-6.5/src/include/paw_my_constants.h', needed by `/home/amnikitin/nwchem-6.5/lib/LINUX/libnwpwlib.a(paw_atom.o)'. Stop.
make[4]: *** [optimized] Error 2
make[3]: *** [subdirs] Error 1
make[2]: *** [subdirs] Error 1
make[1]: *** [subdirs] Error 1
make: *** [libraries] Error 1[/pre]

Unfortunately, I am not able to reproduce this problem.

Could you please try the following:
cd /home/amnikitin/nwchem-6.5/src/nwpw/nwpwlib/pseudopotential/paw_atom
rm dependencies
make FC=gfortran DEPEND_CC=gcc

If this still fails with the same error, please send me the output of
grep paw_atom.o dependencies

Gets Around
Threads 26
Posts 85
Yes, the same error

$ grep paw_atom.o dependencies
$(LIBRARY_PATH)(paw_atom.o):    ./paw_vosko.h ./paw_utilities.h ./paw_sdir.h ./p
aw_potential.h ./paw_orbitals.h $(INCDIR)/paw_my_constants.h ./paw_matrix_elemen
ts.h ./paw_loggrid.h ./paw_kinetic_energy.h ./paw_ion.h ./paw_hartree.h ./paw_di
rac_exchange.h ./paw_core.h ./paw_comp_charge.h ./paw_basis.h ./paw_atom.h

Forum Vet
Threads 4
Posts 936
What version of MinGW/gcc are you using?
Could you please try the following:
gcc -O0 -g -o $NWCHEM_TOP/bin/LINUX/depend.x $NWCHEM_TOP/src/config/makefile.h
cd /home/amnikitin/nwchem-6.5/src/nwpw/nwpwlib/pseudopotential/paw_atom
ls -l paw_my_constants.h
rm dependencies
make FC=gfortran DEPEND_CC=gcc

Gets Around
Threads 26
Posts 85
Quote:Edoapra Sep 13th 6:59 am

What version of MinGW/gcc are you using?

4.8.1-4

Quote:Edoapra Sep 13th 6:59 am

Could you please try the following:
gcc -O0 -g -o $NWCHEM_TOP/bin/LINUX/depend.x $NWCHEM_TOP/src/config/makefile.h



D:/MinGW/msys/1.0/home/amnikitin/nwchem-6.5/src/config/makefile.h:2830:8: error:
 unknown type name 'flint'
 .F.o:; flint $(CPPFLAGS) -L $(SRCDIR)/nwchem.lbt $<
        ^
D:/MinGW/msys/1.0/home/amnikitin/nwchem-6.5/src/config/makefile.h:2830:26: error
: expected '=', ',', ';', 'asm' or '__attribute__' before '-' token
 .F.o:; flint $(CPPFLAGS) -L $(SRCDIR)/nwchem.lbt $<
                          ^
D:/MinGW/msys/1.0/home/amnikitin/nwchem-6.5/src/config/makefile.h:2832:8: error:
 unknown type name 'flint'
 .f.o:; flint $(CPPFLAGS) -L $(SRCDIR)/nwchem.lbt $<
        ^
D:/MinGW/msys/1.0/home/amnikitin/nwchem-6.5/src/config/makefile.h:2832:26: error
: expected '=', ',', ';', 'asm' or '__attribute__' before '-' token
 .f.o:; flint $(CPPFLAGS) -L $(SRCDIR)/nwchem.lbt $<
                          ^
D:/MinGW/msys/1.0/home/amnikitin/nwchem-6.5/src/config/makefile.h:2834:8: error:
 unknown type name 'flint'
 .F.o:; flint $(CPPFLAGS) -g -f -u $(SRCDIR)/nwchem.lbt $<
        ^
D:/MinGW/msys/1.0/home/amnikitin/nwchem-6.5/src/config/makefile.h:2834:26: error
: expected '=', ',', ';', 'asm' or '__attribute__' before '-' token
 .F.o:; flint $(CPPFLAGS) -g -f -u $(SRCDIR)/nwchem.lbt $<
                          ^
D:/MinGW/msys/1.0/home/amnikitin/nwchem-6.5/src/config/makefile.h:2836:8: error:
 unknown type name 'flint'
 .f.o:; flint $(CPPFLAGS) -g -f -u $(SRCDIR)/nwchem.lbt $<
        ^
D:/MinGW/msys/1.0/home/amnikitin/nwchem-6.5/src/config/makefile.h:2836:26: error
: expected '=', ',', ';', 'asm' or '__attribute__' before '-' token
 .f.o:; flint $(CPPFLAGS) -g -f -u $(SRCDIR)/nwchem.lbt $<
                          ^
D:/MinGW/msys/1.0/home/amnikitin/nwchem-6.5/src/config/makefile.h:1982:45: error
: declaration for parameter 'FC' but no such parameter
           ### extra mic compile stuff; make FC=ifort CC=icc
AR=xiar


Quote:Edoapra Sep 13th 6:59 am

cd /home/amnikitin/nwchem-6.5/src/nwpw/nwpwlib/pseudopotential/paw_atom
ls -l paw_my_constants.h

$ ls -l paw_my_constants.h
ls: paw_my_constants.h: No such file or directory

Quote:Edoapra Sep 13th 6:59 am

rm dependencies

$ rm dependencies
rm: cannot lstat `dependencies': No such file or directory

Quote:Edoapra Sep 13th 6:59 am

make FC=gfortran DEPEND_CC=gcc

$ make FC=gfortran DEPEND_CC=gcc
( cd /home/amnikitin/nwchem-6.5/src/config; make /home/amnikitin/nwchem-6.5/bin/
LINUX/depend.x ; )
gcc  -g -o /home/amnikitin/nwchem-6.5/bin/LINUX/depend.x depend.c
/bin/rm -f depend.o
/home/amnikitin/nwchem-6.5/bin/LINUX/depend.x  -I/home/amnikitin/nwchem-6.5/src/
tools/install/include > dependencies
gcc -c -I.  -I/home/amnikitin/nwchem-6.5/src/include -I/home/amnikitin/nwchem-6.
5/src/tools/install/include -DLINUX -DGFORTRAN -DGFORTRAN -DCHKUNDFLW -DGCC4 -DG
CC46 -DPARALLEL_DIAG  -m32 -g -O2 -o paw_atom_driver.o paw_atom_driver.c
make[1]: *** No rule to make target `/home/amnikitin/nwchem-6.5/src/include/paw_
my_constants.h', needed by `/home/amnikitin/nwchem-6.5/lib/LINUX/libnwpwlib.a(pa
w_atom.o)'.  Stop.
make: *** [optimized] Error 2

Forum Vet
Threads 4
Posts 936
I am sorry, I sent you the wrong command
I meant
gcc -O0 -g -o $NWCHEM_TOP/bin/LINUX/depend.x $NWCHEM_TOP/src/config/depend.c
Quote:P99 Sep 15th 6:34 am
Quote:Edoapra Sep 13th 6:59 am

What version of MinGW/gcc are you using?

4.8.1-4

Quote:Edoapra Sep 13th 6:59 am

Could you please try the following:
gcc -O0 -g -o $NWCHEM_TOP/bin/LINUX/depend.x $NWCHEM_TOP/src/config/makefile.h



D:/MinGW/msys/1.0/home/amnikitin/nwchem-6.5/src/config/makefile.h:2830:8: error:
 unknown type name 'flint'
 .F.o:; flint $(CPPFLAGS) -L $(SRCDIR)/nwchem.lbt $<
        ^
D:/MinGW/msys/1.0/home/amnikitin/nwchem-6.5/src/config/makefile.h:2830:26: error
: expected '=', ',', ';', 'asm' or '__attribute__' before '-' token
 .F.o:; flint $(CPPFLAGS) -L $(SRCDIR)/nwchem.lbt $<
                          ^
D:/MinGW/msys/1.0/home/amnikitin/nwchem-6.5/src/config/makefile.h:2832:8: error:
 unknown type name 'flint'
 .f.o:; flint $(CPPFLAGS) -L $(SRCDIR)/nwchem.lbt $<
        ^
D:/MinGW/msys/1.0/home/amnikitin/nwchem-6.5/src/config/makefile.h:2832:26: error
: expected '=', ',', ';', 'asm' or '__attribute__' before '-' token
 .f.o:; flint $(CPPFLAGS) -L $(SRCDIR)/nwchem.lbt $<
                          ^
D:/MinGW/msys/1.0/home/amnikitin/nwchem-6.5/src/config/makefile.h:2834:8: error:
 unknown type name 'flint'
 .F.o:; flint $(CPPFLAGS) -g -f -u $(SRCDIR)/nwchem.lbt $<
        ^
D:/MinGW/msys/1.0/home/amnikitin/nwchem-6.5/src/config/makefile.h:2834:26: error
: expected '=', ',', ';', 'asm' or '__attribute__' before '-' token
 .F.o:; flint $(CPPFLAGS) -g -f -u $(SRCDIR)/nwchem.lbt $<
                          ^
D:/MinGW/msys/1.0/home/amnikitin/nwchem-6.5/src/config/makefile.h:2836:8: error:
 unknown type name 'flint'
 .f.o:; flint $(CPPFLAGS) -g -f -u $(SRCDIR)/nwchem.lbt $<
        ^
D:/MinGW/msys/1.0/home/amnikitin/nwchem-6.5/src/config/makefile.h:2836:26: error
: expected '=', ',', ';', 'asm' or '__attribute__' before '-' token
 .f.o:; flint $(CPPFLAGS) -g -f -u $(SRCDIR)/nwchem.lbt $<
                          ^
D:/MinGW/msys/1.0/home/amnikitin/nwchem-6.5/src/config/makefile.h:1982:45: error
: declaration for parameter 'FC' but no such parameter
           ### extra mic compile stuff; make FC=ifort CC=icc
AR=xiar


Quote:Edoapra Sep 13th 6:59 am

cd /home/amnikitin/nwchem-6.5/src/nwpw/nwpwlib/pseudopotential/paw_atom
ls -l paw_my_constants.h

$ ls -l paw_my_constants.h
ls: paw_my_constants.h: No such file or directory

Quote:Edoapra Sep 13th 6:59 am

rm dependencies

$ rm dependencies
rm: cannot lstat `dependencies': No such file or directory

Quote:Edoapra Sep 13th 6:59 am

make FC=gfortran DEPEND_CC=gcc

$ make FC=gfortran DEPEND_CC=gcc
( cd /home/amnikitin/nwchem-6.5/src/config; make /home/amnikitin/nwchem-6.5/bin/
LINUX/depend.x ; )
gcc  -g -o /home/amnikitin/nwchem-6.5/bin/LINUX/depend.x depend.c
/bin/rm -f depend.o
/home/amnikitin/nwchem-6.5/bin/LINUX/depend.x  -I/home/amnikitin/nwchem-6.5/src/
tools/install/include > dependencies
gcc -c -I.  -I/home/amnikitin/nwchem-6.5/src/include -I/home/amnikitin/nwchem-6.
5/src/tools/install/include -DLINUX -DGFORTRAN -DGFORTRAN -DCHKUNDFLW -DGCC4 -DG
CC46 -DPARALLEL_DIAG  -m32 -g -O2 -o paw_atom_driver.o paw_atom_driver.c
make[1]: *** No rule to make target `/home/amnikitin/nwchem-6.5/src/include/paw_
my_constants.h', needed by `/home/amnikitin/nwchem-6.5/lib/LINUX/libnwpwlib.a(pa
w_atom.o)'.  Stop.
make: *** [optimized] Error 2

Forum Vet
Threads 4
Posts 936
It seems that paw_my_constants.h got deleted. I have just verified that is present in the tarball available from download.
I suggest to reopen the tar.gz file.

$ rm Nwchem-6.5.revision26243-src.2014-09-10.tar.gz
$ wget "http://www.nwchem-sw.org/download.php?f=Nwchem-6.5.revision26243-src.2014-09-10.tar.gz" \
-O Nwchem-6.5.revision26243-src.2014-09-10.tar.gz >& /dev/null
$ tar tzf Nwchem-6.5.revision26243-src.2014-09-10.tar.gz|grep paw_my_constants.h

Nwchem-6.5.revision26243-src.2014-09-10/src/nwpw/nwpwlib/pseudopotential/paw_atom/paw_my_constants.h


Quote:P99 Sep 15th 6:34 am
Quote:Edoapra Sep 13th 6:59 am

Quote:Edoapra Sep 13th 6:59 am

cd /home/amnikitin/nwchem-6.5/src/nwpw/nwpwlib/pseudopotential/paw_atom
ls -l paw_my_constants.h

$ ls -l paw_my_constants.h
ls: paw_my_constants.h: No such file or directory


Gets Around
Threads 26
Posts 85
The file paw_my_constants.h was somehow corrupted.
I recompiled the newly opened archive.

export NWCHEM_TOP=~/nwchem-6.5
export NWCHEM_TARGET=LINUX
export USE_MPI=y
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 


Now the error has become:
Making libraries in ccca
gfortran -c -m32 -march=pentium4 -mtune=pentium4 -O2 -g -fno-aggressive-loop-opt
imizations  -I. -I../basis -I/home/amnikitin/nwchem-6.5/src/include -I/home/amni
kitin/nwchem-6.5/src/tools/install/include -DLINUX -DGFORTRAN -DGFORTRAN -DCHKUN
DFLW -DGCC4 -DGCC46 -DPARALLEL_DIAG   task_ccca.F
gfortran -c -m32 -march=pentium4 -mtune=pentium4 -O2 -g -fno-aggressive-loop-opt
imizations  -I. -I../basis -I/home/amnikitin/nwchem-6.5/src/include -I/home/amni
kitin/nwchem-6.5/src/tools/install/include -DLINUX -DGFORTRAN -DGFORTRAN -DCHKUN
DFLW -DGCC4 -DGCC46 -DPARALLEL_DIAG   ccca_utils.F
Got lock on /home/amnikitin/nwchem-6.5/lib/LINUX/libccca.lock
ar r /home/amnikitin/nwchem-6.5/lib/LINUX/libccca.a task_ccca.o ccca_utils.o
d:\TDM-GCC-32\bin\ar.exe: creating D:/MinGW/msys/1.0/home/amnikitin/nwchem-6.5/l
ib/LINUX/libccca.a
ranlib /home/amnikitin/nwchem-6.5/lib/LINUX/libccca.a
make nwchem.o stubs.o
gfortran -m32 -march=pentium4 -mtune=pentium4 -O2 -g -fno-aggressive-loop-optimi
zations  -I.  -I/home/amnikitin/nwchem-6.5/src/include -I/home/amnikitin/nwchem-
6.5/src/tools/install/include -DLINUX -DGFORTRAN -DGFORTRAN -DCHKUNDFLW -DGCC4 -
DGCC46 -DPARALLEL_DIAG -DCOMPILATION_DATE="'`date +%a_%b_%d_%H:%M:%S_%Y`'" -DCOM
PILATION_DIR="'/home/amnikitin/nwchem-6.5'" -DNWCHEM_BRANCH="'6.5'"  -c -o nwche
m.o nwchem.F
gfortran -m32 -march=pentium4 -mtune=pentium4 -O2 -g -fno-aggressive-loop-optimi
zations  -I.  -I/home/amnikitin/nwchem-6.5/src/include -I/home/amnikitin/nwchem-
6.5/src/tools/install/include -DLINUX -DGFORTRAN -DGFORTRAN -DCHKUNDFLW -DGCC4 -
DGCC46 -DPARALLEL_DIAG -DCOMPILATION_DATE="'`date +%a_%b_%d_%H:%M:%S_%Y`'" -DCOM
PILATION_DIR="'/home/amnikitin/nwchem-6.5'" -DNWCHEM_BRANCH="'6.5'"  -c -o stubs
.o stubs.F
gfortran -m32 -march=pentium4 -mtune=pentium4 -g -O0  -L/home/amnikitin/nwchem-6
.5/lib/LINUX -L/home/amnikitin/nwchem-6.5/src/tools/install/lib  -o /home/amniki
tin/nwchem-6.5/bin/LINUX/nwchem nwchem.o stubs.o -lnwctask -lccsd -lmcscf -lselc
i -lmp2 -lmoints -lstepper -ldriver -loptim -lnwdft -lgradients -lcphf -lesp -ld
dscf -ldangchang -lguess -lhessian -lvib -lnwcutil -lrimp2 -lproperty -lsolvatio
n -lnwints -lprepar -lnwmd -lnwpw -lofpw -lpaw -lpspw -lband -lnwpwlib -lnwxc -l
cafe -lspace -lanalyze -lqhop -lpfft -ldplot -ldrdy -lvscf -lqmmm -lqmd -letrans
 -lpspw -ltce -lbq -lcons -lperfm -ldntmc -lccca -lnwcutil -lga -larmci -lpeigs
-lperfm -lcons -lbq -lnwcutil -llapack  -lblas -llapack  -lblas   -L/home/amniki
tin/MPICH2/lib -lfmpich2g -lmpi    -lwsock32
D:/MinGW/msys/1.0/home/amnikitin/nwchem-6.5/lib/LINUX/libnwcutil.a(util_md_socke
ts.o): In function `create_server_socket':
D:\MinGW\msys\1.0\home\amnikitin\nwchem-6.5\src\util/util_md_sockets.c:29: undef
ined reference to `ga_error'
D:/MinGW/msys/1.0/home/amnikitin/nwchem-6.5/lib/LINUX/libnwcutil.a(util_md_socke
ts.o): In function `create_client_socket':
D:\MinGW\msys\1.0\home\amnikitin\nwchem-6.5\src\util/util_md_sockets.c:68: undef
ined reference to `ga_error'
collect2.exe: error: ld returned 1 exit status
make: *** [all] Error 1

Forum Vet
Threads 4
Posts 936
Never seen this one before since I have to confess that have not compiled the MD part with mingw32 yet.

You can find a fix for this by applying the patch available at
http://www.nwchem-sw.org/images/Util_md_sockets.patch.gz

Instructions:

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

Gets Around
Threads 26
Posts 85
Quote:Edoapra Sep 16th 10:03 am

Instructions:

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


Thank you very much. Compilation is successful.

Please tell me can I run NWChem in parallel mode, on a single processor, without installing MPI resident?


Forum >> NWChem's corner >> Compiling NWChem
Jump to page 12Next 16Last



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


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