Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 393139

Summary: [science overlay] sci-chemistry/nwchem - Delivering High-Performance Computational Chemistry to Science
Product: Gentoo Linux Reporter: gentooer <wilhelm.eger>
Component: New packagesAssignee: Default Assignee for New Packages <maintainer-wanted>
Status: CONFIRMED ---    
Severity: enhancement CC: frp.bissey, sci, vityokster
Priority: Normal Keywords: EBUILD, InOverlay
Version: unspecified   
Hardware: All   
OS: Linux   
URL: http://www.nwchem-sw.org/index.php/Main_Page
Whiteboard: science overlay
Package list:
Runtime testing required: ---
Attachments: Ebuild file
Necessary patch
Necessary patch
Necessary patch
Necessary patch
nwchem-6.0-r1.ebuild: Minor changes
Updated dependencies.
nwchem-6.0-r3.ebuild
nwchem-6.0-adjust-dir-length.patch
nwchem-6.0-r4.ebuild
Ebuild for nwchem-6.1
Modified nwchem-6.1-python_makefile.patch file

Description gentooer 2011-12-04 14:57:11 UTC
Hi,

I've created an ebuild for NWChem, which is an powerful open-source program package covering force-field, ab initio and DFT calculations mostly used in computational chemistry. It would be wonderfu, if I could share this ebuild with other people. It has been tested with amd64 and x86 and works ok.

I've added three use flags: doc, python and mpi, which are more or less self-explanatory. Apparently, Gentoo does not have the license of this ebuild in its license file. It is the ECL (Educational Community License), which apparently is an derivative of the Apache 2.0 license. Therefore I set the ebuild to the latter one.

Thanks,

Wilhelm

Reproducible: Always
Comment 1 gentooer 2011-12-04 14:57:55 UTC
Created attachment 294737 [details]
Ebuild file
Comment 2 gentooer 2011-12-04 14:58:23 UTC
Created attachment 294739 [details, diff]
Necessary patch
Comment 3 gentooer 2011-12-04 14:58:37 UTC
Created attachment 294741 [details, diff]
Necessary patch
Comment 4 gentooer 2011-12-04 14:58:47 UTC
Created attachment 294743 [details, diff]
Necessary patch
Comment 5 gentooer 2011-12-04 14:58:57 UTC
Created attachment 294745 [details, diff]
Necessary patch
Comment 6 gentooer 2011-12-04 15:58:16 UTC
Comment on attachment 294737 [details]
Ebuild file

Installation path needs to be changed: NWChem -> NWchem 

Otherwise change the path in the path for nwchemrc from NWchem to NWChem.

Sorry, typo.
Comment 7 gentooer 2011-12-05 09:32:57 UTC
Created attachment 294841 [details]
nwchem-6.0-r1.ebuild: Minor changes
Comment 8 gentooer 2011-12-15 08:02:17 UTC
Created attachment 295897 [details]
Updated dependencies.
Comment 9 Viktor Yu. Kovalskii 2012-01-25 15:59:36 UTC
> Created attachment 295897 [details]
> Updated dependencies.
(In reply to comment #8)
Thank you for nwchem ebuild.
I try to use your last ebuild but I can't compile nwchem.
Compilation failed with error:

The directory name chosen for NWCHEM_TOP is longer than 
the maximum allowed value of 65 characters
      current NWCHEM_TOP=/var/tmp/portage/sci-chemistry/nwchem-6.0-r2/work/nwchem-6.0/src equal to 1 characters
please chose a directory with a shorter name
E.g., setenv NWCHEM_TOP /home/nwchem_user/nwchem
make[1]: *** [errorlongpwd] Error 1
make: *** [libraries] Error 1
Comment 10 gentooer 2012-01-26 08:36:52 UTC
Ok, I've created a new patch to solve the directory lentgh issue. Unfortunately, the new version of mpich2 introduced a new use flag (fortran90) which is needed to be set for building nwchem. If you use mpich2 version 1.4.1_p1 or later it should be ok, if you are on an earlier version, you might need to remove 'fortran90' from the ebuild file.

Let me know if it works for you.
Comment 11 gentooer 2012-01-26 08:37:23 UTC
Created attachment 299923 [details]
nwchem-6.0-r3.ebuild
Comment 12 gentooer 2012-01-26 08:37:43 UTC
Created attachment 299925 [details, diff]
nwchem-6.0-adjust-dir-length.patch
Comment 13 Viktor Yu. Kovalskii 2012-01-26 10:48:35 UTC
(In reply to comment #10)
> Ok, I've created a new patch to solve the directory lentgh issue.
> Unfortunately, the new version of mpich2 introduced a new use flag (fortran90)
> which is needed to be set for building nwchem. If you use mpich2 version
> 1.4.1_p1 or later it should be ok, if you are on an earlier version, you might
> need to remove 'fortran90' from the ebuild file.
> 
> Let me know if it works for you.

USE flag fortran90 for sys-cluster/mpich2 presents only in science overlay not in a gentoo tree.

sys-cluster/mpich2-1.4.1_p1 only presents in science overlay.
sys-cluster/mpich2-1.4_rc2-r1 presents in gentoo tree.

Without mpi nwchem compiles fine.
Thank you for fast patch preparation.

I think we can add something similar:

mpi? ( sys-cluster/mpich2-1.2.1_p1-r1[fortran] || sys-cluster/mpich2-1.4_rc2-r1[fortarn] || sys-cluster/mpich2-1.4.1_p1[fortran,fortran90] )
Comment 14 gentooer 2012-01-26 12:50:52 UTC
Created attachment 299957 [details]
nwchem-6.0-r4.ebuild

Great. I adopted the ebuild file in a more general manner. Can you please check if it works for you? I have only system with the science overlay enabled at the moment and don't have time to set up a test system.

Thanks!
Comment 15 Viktor Yu. Kovalskii 2012-01-26 14:30:14 UTC
On home ~x86 computer compilation failed with USE="python -mpi -doc" with this error:

gfortran -c -Wextra -ffast-math  -march=pentium4 -mtune=pentium4 -g -O0  -I.  -I/mnt/slag/portage/sci-chemistry/nwchem-6.0-r4/work/nwchem-6.0/src/include -I/mnt/slag/portage/sci-chemistry/nwchem-6.0-r4/work/nwchem-6.0/src/tools/include -DLINUX -DGFORTRAN -DCHKUNDFLW -DGCC4 -DGANXTVAL -DUSE_SUBGROUPS -DBASIS_LIBRARY="'/mnt/slag/portage/sci-chemistry/nwchem-6.0-r4/work/nwchem-6.0/src'"  bas_input.F
bas_input.F:1132.72:

      compiled_name =                                                   
                                                                        1
Error: Unterminated character constant beginning at (1)
make[1]: *** [/mnt/slag/portage/sci-chemistry/nwchem-6.0-r4/work/nwchem-6.0/lib/LINUX/libnwcutil.a(bas_input.o)] Error 1
make: *** [libraries] Error 1
Comment 16 Viktor Yu. Kovalskii 2012-01-30 10:18:33 UTC
At first,

emerge of nwchem-6.0-r4 failed with USE="doc python mpi":

./userpsfix
make[1]: ./userpsfix: Command not found
make[1]: [all] Error 127 (ignored)
make[1]: Leaving directory `/var/tmp/portage/sci-chemistry/nwchem-6.0-r4/work/nwchem-6.0/doc/user'

* QA Notice: file does not exist:
* 
*      doins: /var/tmp/portage/sci-chemistry/nwchem-6.0-r4/work/nwchem-6.0/doc/user/user.001.ps does not exist

At second,
When I try to run test job:

title "Nitrogen cc-pvdz SCF geometry optimization"
geometry
n 0 0 0
n 0 0 1.08
end
basis
* library cc-pvdz
end
task scf optimize

at output file I can see these strings:

  warning:::::::::::::: from_nwchemrc
  NWCHEM_BASIS_LIBRARY set to: </usr/share/NWChem/data/libraries/>
  but file does not exist !
  using compiled in library
  warning:::::::::::::: from_compile
  NWCHEM_BASIS_LIBRARY is: </var/tmp/portage/sci-chemistry/nwchem-6.0-r4/work/nwchem-6.0/src/basis/libraries/>
  but file does not exist or you do not have access to it !
Comment 17 Viktor Yu. Kovalskii 2012-01-30 11:22:11 UTC
(In reply to comment #16)
> At second,
> When I try to run test job:
> 
> title "Nitrogen cc-pvdz SCF geometry optimization"
> geometry
> n 0 0 0
> n 0 0 1.08
> end
> basis
> * library cc-pvdz
> end
> task scf optimize
> 
> at output file I can see these strings:
> 
>   warning:::::::::::::: from_nwchemrc
>   NWCHEM_BASIS_LIBRARY set to: </usr/share/NWChem/data/libraries/>
>   but file does not exist !
>   using compiled in library
>   warning:::::::::::::: from_compile
>   NWCHEM_BASIS_LIBRARY is:
> </var/tmp/portage/sci-chemistry/nwchem-6.0-r4/work/nwchem-6.0/src/basis/libraries/>
>   but file does not exist or you do not have access to it !

NWCHEM_BASIS_LIBRARY should be set to /usr/share/NWChem/data/

And one suggestion maybe set use-flag for installing nwchem tests from srcdir/QA/tests and examples from srcdir/examples.

Wilhelm Eger, Thank you very much for your useful work.
Comment 18 Viktor Yu. Kovalskii 2012-02-18 14:41:25 UTC
Created attachment 302359 [details]
Ebuild for nwchem-6.1

NWChem-6.1 version bump.
I modify ebuild for nwchem-6.0-r4 for nwchem-6.1.

1) Upstream changes filename for nwchem. Right now filename is Nwchem-6.1-2012-Feb-10.tar.gz

2) I don't find doc directory at src. Because of, I remove doc use flag and unneeded patch.

3) nwchem-6.0-python_makefile.patch was modified for new source code. Others patches don't modified.

4) I add two new USE-flags:
    a) tests - Install tests files for testing NWChem installation
    b) examples - Install examples from upstream
Comment 19 Viktor Yu. Kovalskii 2012-02-18 14:42:23 UTC
Created attachment 302361 [details, diff]
Modified nwchem-6.1-python_makefile.patch file
Comment 20 Alexey Shvetsov archtester gentoo-dev 2012-12-02 01:33:24 UTC
Added to sci overlay
Comment 21 Viktor Yu. Kovalskii 2012-12-02 05:28:27 UTC
For mpich2-1.5 we should change in ebuild

 		elif [ "$PROOF_MPICH2" = "3" ] || [ "$PROOF_MPICH2" = "4" ]; then 
			export LIBMPI="-lmpichf90 -lmpich -lmpl -lpthread" # MPICH2 1.3 or 1.4

to

 		elif [ "$PROOF_MPICH2" = "3" ] || [ "$PROOF_MPICH2" = "4" ] || [ "$PROOF_MPICH2" = "5"]; then
                        export LIBMPI="-lmpichf90 -lmpich -lmpl -lpthread" # MPICH2 1.3 or 1.4 or 1.5
Comment 22 Juan 2012-12-04 01:25:49 UTC
Hi, the ebuild for version 6.1.1 fails because it cannot apply one patch:
nwchem-6.1.1-python_makefile.patch

I think (but may be wrong) that the nwchem-6.1.1-python_makefile has changed with this version and the patch needs updating.
I found similar lines to the ones seen in the patch around line 2197. In my system emerging suceeded changing the patch file to:

@@ -2196,7 +2196,7 @@
 endif
 ifdef USE_PYTHON64
-  CORE_LIBS += $(PYTHONHOME)/lib64/python$(PYTHONVERSION)/config/libpython$(PYTHONVERSION).$(PYTHONLIBTYPE)
+  CORE_LIBS += $(PYTHONHOME)/lib/libpython$(PYTHONVERSION).a
 else
-  CORE_LIBS += $(PYTHONHOME)/lib/python$(PYTHONVERSION)/config/libpython$(PYTHONVERSION).$(PYTHONLIBTYPE)
+  CORE_LIBS += $(PYTHONHOME)/lib/libpython$(PYTHONVERSION).a
 endif
 endif
Comment 23 lumbrius 2014-10-16 11:43:18 UTC
Can one just simply use ebuild from 6.3 with 6.5?
Comment 24 François Bissey 2014-10-16 20:12:40 UTC
(In reply to lumbrius from comment #23)
> Can one just simply use ebuild from 6.3 with 6.5?

No. What's more upstream has posted a series of individual patches to put on top (although I disagree with the last one I saw - on technical grounds rather than scientific ground).
And what's more we are starting to support int64 blas/lapack so we may be able to get nwchem to use it (instead of an internal copy) in the near future.