too many arguments error


Clicked A Few Times
Hello,

I am trying to compile Nwchem-6.6. My computer is running Windows 8.1, and has an Intel i7-3520M processor. I followed the steps outline here : http://nwchemgit.github.io/Special_AWCforum/sp/id5124

Here is the output after entering the two make commands:

$ make nwchem_config
/bin/sh: line 0: [: too many arguments
/bin/sh: line 0: [: too many arguments
cat: /proc/cpuinfo: No such file or directory
make -C config -f make_nwchem_config NWCHEM_MODULES="all"
echo \# This configuration generated automatically on \
             `hostname` at `date` > nwchem_config.h
echo "# Request modules from user: all" >> nwchem_config.h
echo "NW_MODULE_SUBDIRS = NWints atomscf ddscf gradients moints nwdft rimp2 step
per driver optim cphf ccsd vib mcscf prepar esp hessian selci dplot mp2_grad qho
p property solvation nwpw fft analyz nwmd cafe space drdy vscf qmmm qmd etrans t
ce bq mm cons perfm dntmc dangchang ccca" >> nwchem_config.h
echo "NW_MODULE_LIBS = -lccsd -lmcscf -lselci -lmp2 -lmoints -lstepper -ldriver
-loptim -lnwdft -lgradients -lcphf -lesp -lddscf -ldangchang -lguess -lhessian -
lvib -lnwcutil -lrimp2 -lproperty -lsolvation -lnwints -lprepar -lnwmd -lnwpw -l
ofpw -lpaw -lpspw -lband -lnwpwlib -lcafe -lspace -lanalyze -lqhop -lpfft -ldplo
t -ldrdy -lvscf -lqmmm -lqmd -letrans -lpspw -ltce -lbq -lmm -lcons -lperfm -ldn
tmc -lccca" >> nwchem_config.h
echo "EXCLUDED_SUBDIRS = develop nwxc scfaux rimp2_grad python argos diana uccsd
t rism geninterface smd nbo leps lucia" >> nwchem_config.h
echo "CONFIG_LIBS = " >> nwchem_config.h
echo \# This configuration generated automatically on \
            `hostname` at `date` > NWCHEM_CONFIG
echo "# Request modules from user: all" >> NWCHEM_CONFIG
echo The following subdirectories are built: >> NWCHEM_CONFIG
echo NWints analyz atomscf bq cafe ccca ccsd cons cphf dangchang ddscf dntmc dpl
ot drdy driver esp etrans fft gradients hessian mcscf mm moints mp2_grad nwdft n
wmd nwpw optim perfm prepar property qhop qmd qmmm rimp2 selci solvation space s
tepper symmetry tce vib vscf >> NWCHEM_CONFIG
echo corresponding to these libraries: >> NWCHEM_CONFIG
echo -lnwints -lanalyze -lguess -lbq -lcafe -lccca -lccsd -lcons -lcphf -ldangch
ang -lddscf -ldntmc -ldplot -ldrdy -ldriver -lesp -letrans -lpfft -lgradients -l
hessian -lmcscf -lmm -lmoints -lmp2 -lnwdft -lnwmd -lnwpw -lofpw -lpaw -lpspw -l
band -lnwpwlib -loptim -lperfm -lprepar -lproperty -lqhop -lqmd -lqmmm -lrimp2 -
lselci -lsolvation -lspace -lstepper -lnwcutil -ltce -lvib -lvscf >> NWCHEM_CONF
IG
echo >> NWCHEM_CONFIG
echo The following directories are excluded from the build: >> NWCHEM_CONFIG
echo develop nwxc scfaux rimp2_grad python argos diana uccsdt rism geninterface
smd nbo leps lucia >> NWCHEM_CONFIG
echo and these routines will be replaced by stubs: >> NWCHEM_CONFIG
echo argos argos_input crossing debtest dia_input diana gasdev geninterface jant
est jvltest jvltest2 kgdtest leps_energy leps_gradient lucia mc_data mc_driver m
c_init mc_main md_data md_driver md_set moints_screen mymc_input mymd_input nbo_
input nwxc_eval_df nwxc_eval_df2 nwxc_eval_df3 nwxc_get_cam nwxc_get_disp nwxc_g
etvals nwxc_getwght nwxc_has_2nd nwxc_has_cam nwxc_has_disp nwxc_has_hfx nwxc_ha
s_mp2c nwxc_has_xc nwxc_init nwxc_input nwxc_is_gga nwxc_is_lda nwxc_is_mgga nwx
c_is_on nwxc_print nwxc_print_nwpw nwxc_reset_rho_tolerance nwxc_rtdb_delete nwx
c_rtdb_load nwxc_rtdb_store nwxc_vdw3_dftd3 nwxc_wght_hfx nwxc_wght_mp2c python_
input raktest rimp2g rism_input rjhtest smd_input task_fragment_energy task_nbo
task_python task_rism task_smd task_smd_dynamics task_smd_energy task_smd_fragme
nt uccsdt uccsdtest urand >> NWCHEM_CONFIG
echo "No extra configuration libraries were added " >> NWCHEM_CONFIG
cp census.skeleton ../stubs.F
for routine in argos argos_input crossing debtest dia_input diana gasdev geninte
rface jantest jvltest jvltest2 kgdtest leps_energy leps_gradient lucia mc_data m
c_driver mc_init mc_main md_data md_driver md_set moints_screen mymc_input mymd_
input nbo_input nwxc_eval_df nwxc_eval_df2 nwxc_eval_df3 nwxc_get_cam nwxc_get_d
isp nwxc_getvals nwxc_getwght nwxc_has_2nd nwxc_has_cam nwxc_has_disp nwxc_has_h
fx nwxc_has_mp2c nwxc_has_xc nwxc_init nwxc_input nwxc_is_gga nwxc_is_lda nwxc_i
s_mgga nwxc_is_on nwxc_print nwxc_print_nwpw nwxc_reset_rho_tolerance nwxc_rtdb_
delete nwxc_rtdb_load nwxc_rtdb_store nwxc_vdw3_dftd3 nwxc_wght_hfx nwxc_wght_mp
2c python_input raktest rimp2g rism_input rjhtest smd_input task_fragment_energy
task_nbo task_python task_rism task_smd task_smd_dynamics task_smd_energy task_
smd_fragment uccsdt uccsdtest urand; do \
          sed s/STUBROUTINE/$routine/g stub.skeleton >> ../stubs.F ; \
done
cp util_module_avail_F.begin ../util/util_module_avail.F
echo "c This function was auto generated by make_nwchem_config" >> ../util/util_
module_avail.F
for module in NWints analyz atomscf bq cafe ccca ccsd cons cphf dangchang ddscf
dntmc dplot drdy driver esp etrans fft gradients hessian mcscf mm moints mp2_gra
d nwdft nwmd nwpw optim perfm prepar property qhop qmd qmmm rimp2 selci solvatio
n space stepper symmetry tce vib vscf; do \
          echo "        case (\""$module"\")" >> ../util/util_module_avail.F ;
\
       done
cat util_module_avail_F.end >> ../util/util_module_avail.F

$ make FC=gfortran DEPEND_CC=gcc
/bin/sh: line 0: [: too many arguments
/bin/sh: line 0: [: too many arguments
cat: /proc/cpuinfo: No such file or directory
NWChem's Performance is degraded by not setting BLASOPT
Please consider using ATLAS, GotoBLAS2, OpenBLAS, Intel MKL,
IBM ESSL, AMD ACML, etc. to improve performance.
If you decide to not use a fast implementation of BLAS/LAPACK,
please define USE_INTERNALBLAS=y and the internal Netlib will be used.


I have two questions:
-how do I fix the “/bin/sh: line 0: [: too many arguments “ error ?
-is this error the reason why I’m not getting a NWchem executable file?

Thank you!

Forum Vet
1) you need to USE_INTERNALBLAS=y

export  USE_INTERNALBLAS=y


2) the error /bin/sh: line 0: [: too many arguments seems to indicate that some of the required mingw commands are missing from your path. Please try the following commands to see if your PATH variable is correctly defined


which ar

which nm


If the output of the following commands is bash: nm: command not found, then you need to add the directory where ar.exe and nm.exe to your PATH. For example, if you have installed mingw under c:\

export PATH=/c/MinGW/bin:$PATH

Clicked A Few Times
Hello,

Thank you for your help. With these changes and a few more, I was able to create a nwchem executable file. However, when trying to run it with the following command

nwchem n2

This is the output I get:
argument 1 = n2
 Unable to open n2 --- appending .nw
------------------------------------------------------------------------
nwchem: failed to open the input file 0
------------------------------------------------------------------------
------------------------------------------------------------------------
current input line :
0:
------------------------------------------------------------------------
------------------------------------------------------------------------
There is an error in the input file
------------------------------------------------------------------------
For more information see the NWChem manual at http://nwchemgit.github.io/index.ph
p/NWChem_Documentation


For further details see manual section:



0:nwchem: failed to open the input file:Received an Error in Communication
application called MPI_Abort(comm=0x84000000, -1) - process 0


I’ve tried running it as well with the following command:
mpiexec -np 1 ~/nwchem-6.6/bin/LINUX/nwchem n2

and nothing happens (the cursor stays on an empty command line and there are no messages being output).

Any suggestions as to what I can try next?

Thank you!

Forum Vet
I have seen this input file problems with some MPI implementation.
The following work-around might help:


cp n2.nw nwchem.nw

mpirun -np 2  ~/nwchem-6.6/bin/LINUX/nwchem

Clicked A Few Times
Thank you very much! Everything is working now.

Here is my version of how I got NWchem to compile and run on Windows, based on the information I found in the documentation (http://nwchemgit.github.io/index.php/Compiling_NWChem#How-to:_Windows_Platforms) and these tips (http://nwchemgit.github.io/Special_AWCforum/sp/id5124).

Suggested process to compile and run NWchem on Windows 8.1
1. Download NWchem from http://nwchemgit.github.io/index.php/Download
2. Download MinGW from http://sourceforge.net/projects/mingw/files/ . Install the Basic Setup, and from All Packages, install pthreads-w32 as well as MSYS.
3. Download and install MPICH2 from http://www.mpich.org/static/tarballs/1.4.1p1/mpich2-1.4.1p1-win-ia32.msi .
4. Assuming your MinGW installation is in the C drive, go to C:/MinGW/msys/1.0 and open msys.bat. The first time you open this application, it will create a folder C:/MinGW/msys/1.0/home/<user_name>. Unpack the NWchem download inside this folder. If necessary, shorten the name of the NWchem folder to nwchem-6.6.
5. Cut and paste the MPICH2 folder also inside the folder C:/MinGW/msys/1.0/home/<user_name>.
6. Inside the msys console, enter the following command to add the path of MinGW to the PATH environment variable:

export PATH=/c/MinGW/bin:$PATH

7. Inside the msys console, enter the following commands

export NWCHEM_TOP=~/nwchem-6.6
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
export USE_INTERNALBLAS=y

cd $NWCHEM_TOP/src
make nwchem_config
make FC=gfortran DEPEND_CC=gcc

If there are no errors, the final line of the output on the console will say all is built. An executable file called nwchem will be created in ~/nwchem-6.6/bin/LINUX.

8. Create an input file with one of the two sample examples from http://nwchemgit.github.io/index.php/Release66:Getting_Started . Make sure to change the extension of the file to .nw
9. Say that your input file is in ~/nwchem-6.6, you need to add the path to the nwchem executable to the PATH variable

export PATH=/c/MinGW/msys/1.0/home/<user_name>/nwchem-6.6/bin/LINUX:$PATH

Then, while being inside the folder ~/nwchem-6.6, and for an input file named n2 for example, type the following to start the calculations:

nwchem n2

Extra notes:
a) version 6.6 was used for this compilation
b) To check that the path has been added, type printenv and find the PATH variable. In it, you should see your path /c/MinGW/bin. You might also see a path for mingw/bin. This is not the same as the former. To check if your addition to PATH has worked, type gfortran –v . If it returns command not found it means that the path was not added correctly.

Just Got Here
gfortran: command not found
Hello, I want to install it on my windows 7 Enterprise 32 Bit, and I try to following the step:

Quote:
Here is my version of how I got NWchem to compile and run on Windows, based on the information I found in the documentation (http://nwchemgit.github.io/index.php/Compiling_NWChem#How-to:_Windows_Platforms) and these tips (http://nwchemgit.github.io/Special_AWCforum/sp/id5124).

Suggested process to compile and run NWchem on Windows 8.1
1. Download NWchem from http://nwchemgit.github.io/index.php/Download
2. Download MinGW from http://sourceforge.net/projects/mingw/files/ . Install the Basic Setup, and from All Packages, install pthreads-w32 as well as MSYS.
3. Download and install MPICH2 from http://www.mpich.org/static/tarballs/1.4.1p1/mpich2-1.4.1p1-win-ia32.msi .
4. Assuming your MinGW installation is in the C drive, go to C:/MinGW/msys/1.0 and open msys.bat. The first time you open this application, it will create a folder C:/MinGW/msys/1.0/home/<user_name>. Unpack the NWchem download inside this folder. If necessary, shorten the name of the NWchem folder to nwchem-6.6.
5. Cut and paste the MPICH2 folder also inside the folder C:/MinGW/msys/1.0/home/<user_name>.
6. Inside the msys console, enter the following command to add the path of MinGW to the PATH environment variable:

export PATH=/c/MinGW/bin:$PATH

7. Inside the msys console, enter the following commands

export NWCHEM_TOP=~/nwchem-6.6
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
export USE_INTERNALBLAS=y

cd $NWCHEM_TOP/src
make nwchem_config
make FC=gfortran DEPEND_CC=gcc


BUT, when I enter the last command:
Quote:
make FC=gfortran DEPEND_CC=gcc


there is some error of /bin/sh: line 0: [: too many arguments

and it the end
Quote:
/bin/sh:gfortran: command not found
make [1]: *** [/home/Septy/nwchem-6.6/lib/LINUX/libnwcutil.a<basis.0>] ERROR 127
make: *** [libraries] Error 1.


so, actually yesterday I tried to put until this command:
Quote:
make nwchem_config


but it take a long time and a lot of 'too many arguments' so I leave it until tomorrow, and when I come back the console window already gone, so I try it again too put the command from begining:
Quote:
export PATH=/c/MinGW/bin:$PATH


and also try this command:
Quote:
which ar
which nm


all is fine until gfortran command..

Can anyone suggest why it can be happened and what at to do to fix it? Thank you.

Clicked A Few Times
Hello,

For your gfortran problem, I would suggest simply searching in your C drive where the gfortran.exe file is. It seems that it is on a different path than /c/MinGW/bin. When you have the correct path, you can add it to the PATH environment variable.

In other words, what is the full path of your folder MinGW?

Just Got Here
Quote:LJ Nov 20th 10:22 am
Hello,

For your gfortran problem, I would suggest simply searching in your C drive where the gfortran.exe file is. It seems that it is on a different path than /c/MinGW/bin. When you have the correct path, you can add it to the PATH environment variable.

In other words, what is the full path of your folder MinGW?


Thank you for the response, Maybe because I dont know which package should I choose for instalation in MinGW, at first I just choose MinGW32-base and mysys-base only, after I tried to choose all in basic setup, I think it should be work, but I still cant make it, this time there is a lot of 'undefined reference to...'

Forum Vet
mingw32-gcc-fortran
The missing packages are likely to be

mingw32-gcc-fortran

(both dev and bin)


Forum >> NWChem's corner >> Compiling NWChem