cp2k 2.6.0 compilation on cygwin

446 views
Skip to first unread message

brhr

unread,
Feb 15, 2015, 8:03:04 AM2/15/15
to cp...@googlegroups.com

Hello,

I cannot find the arch file for cygwin in cp2k 2.6.0.
I tried to compile cp2k 2.6.0 using Cygwin-i686-gfortran.sopt in cp2k 2.5.1, but the complilation failed.
(Cp2k 2.5.1 was successfully compiled on cygwin using the same file.)

Is there a way to compile 2.6.0 on Cygwin?

Regards,

Samuel Andermatt

unread,
Feb 16, 2015, 5:27:59 AM2/16/15
to cp...@googlegroups.com
I think you will have to be ore specific to receive help.

brhr

unread,
Feb 16, 2015, 6:48:00 AM2/16/15
to cp...@googlegroups.com
Hello,


On Monday, February 16, 2015 at 7:27:59 PM UTC+9, Samuel Andermatt wrote:
I think you will have to be ore specific to receive help.

Okey.
I use Windows 8.1, cygwin version 1.7.33-1, GNU Fortran version 4.8.3, and GNU Make 4.0.
A definition file for Cygwin was not found in cp2k-2.6.0/arch directory, so I copied Cygwin-i686-gfortran.sopt from
cp2k-2.5.1/arch to cp2k-2.6.0/arch directory, and I did command operation on cygwin console as follows:

$ make ARCH=Cygwin-i686-gfortran VERSION=sopt
Discovering programs ...
Removing stale archives for sopt ...
Traceback (most recent call last):
  File "/home/user/cp2k-2.6.0/tools/build_utils/check_archives.py", line 57, in <module>
    main()
  File "/home/user/cp2k-2.6.0/tools/build_utils/check_archives.py", line 26, in main
    package = eval(content)
  File "<string>", line 1
    27 mtime=1398856463.517754
           ^
SyntaxError: invalid syntax
/home/user/cp2k-2.6.0/makefiles/Makefile:320: recipe for target 'makedep' failed
make[2]: *** [makedep] Error 1
/home/user/cp2k-2.6.0/makefiles/Makefile:107: recipe for target 'sopt' failed
make[1]: *** [sopt] Error 2
Makefile:102: recipe for target 'all' failed
make: *** [all] Error 2

Could I get some advice?

 

brhr

unread,
Mar 12, 2015, 6:54:01 AM3/12/15
to cp...@googlegroups.com

Hello,

 

The problem was settled.

I had used the archiver of Lhaplus which is very popular in Japan to unpack cp2k-2.6.0.tar.bz2.

 

Additional directories named PaxHeaders.XXXX and files were generated in the unpacked cp2k-2.6.0 directory and its subdirectories, these files seemed to be responsible for the compilation failure of cp2k 2.6.0.

 

Instead of using Lhaplus, I used Cygwin command to unpack tar.bz2.

tar -xvf cp2k-2.6.0.tar.bz2

 

I made a definition file which named Cygwin-i686-gfortran-noflag.sopt as follows,

 

CC       = cc

CPP     =

FC       = gfortran

LD       = gfortran

AR       = ar -r

CPPFLAGS =

DFLAGS   = -D__FFTSG

FCFLAGS  = -O2 -ffast-math -funroll-loops -ftree-vectorize -ffree-form $(DFLAGS)

LDFLAGS  = $(FCFLAGS)

LIBS     =  -llapack -lblas

 

,which is almost identical to Cygwin-i686-gfortran.sopt in cp2k-2.5.1/arch except absence of -D__FORTRAN and -march=native flags.

-D__FORTRAN may be unnecessary (as I read by an another thread in this group).

I removed -march=native to run the cp2k.sopt on Windows PC which Cygwin is not installed.

After I did the following command operation, “make ARCH=Cygwin-i686-gfortran-noflag VERSION=sopt”, cp2k.sopt and other sopts were generated in exe directory. The cp2k.sopt seems to work fine.

 

Regards.

Ole Schütt

unread,
Mar 12, 2015, 7:26:55 AM3/12/15
to cp...@googlegroups.com
Hi,

I'm glad to hear that CP2K apparently also works on Windows. Maybe you could share your experiences by writting a short tutorial for the wiki?

Cheers,
Ole


Am Donnerstag, 12. März 2015 11:54:01 UTC+1 schrieb brhr:

Hello,

 

The problem was settled.

I had used the archiver of Lhaplus which is very popular in Japan to unpack cp2k-2.6.0.tar.bz2.

 

Additional directories named PaxHeaders.XXXX and files were generated in the unpacked cp2k-2.6.0 directory and its subdirectories, the compilation failure of cp2k 2.6.0 seemed to be responsible for these files.

 

Instead of using Lhaplus, I used Cygwin command to unpack tar.bz2.

tar -xvf cp2k-2.6.0.tar.bz2

 

I made a definition file which named Cygwin-i686-gfortran-noflag.sopt as follows,

 

CC       = cc

CPP     =

FC       = gfortran

LD       = gfortran

AR       = ar -r

CPPFLAGS =

DFLAGS   = -D__FFTSG

FCFLAGS  = -O2 -ffast-math -funroll-loops -ftree-vectorize -ffree-form $(DFLAGS)

LDFLAGS  = $(FCFLAGS)

LIBS     =  -llapack -lblas

 

,which is almost identical to Cygwin-i686-gfortran.sopt in cp2k-2.5.1/arch except absence of -D__FORTRAN and -march=native flags.

-D__FORTRAN may be unnecessary (as I read by an another thread in this group).

I removed -march=native to run the cp2k.sopt on Windows PC which Cygwin is not installed.

After I did the following command operation, “make ARCH=Cygwin-i686-gfortran-noflag VERSION=sopt”, cp2k.sopt and and other sopts were generated in exe directory. The cp2k.sopt seems to work fine.

 

Regards.

brhr

unread,
Mar 12, 2015, 8:03:08 AM3/12/15
to cp...@googlegroups.com
Hi,

Oh, I have not used Wiki, but I will try to write a short tutorial.... Give me some time please.

brhr

Ole Schütt

unread,
Mar 12, 2015, 9:35:06 AM3/12/15
to cp...@googlegroups.com
> Oh, I have not used Wiki, but I will try to write a short tutorial.... Give me some time please.

Cool :-)

Using the wiki is very simple, it's basically plain text. You can have a look at code of the existing pages.
Let me know if you have any questions.

-Ole

brhr

unread,
Mar 12, 2015, 6:37:17 PM3/12/15
to cp...@googlegroups.com

 Thank you. I will do so.
Best regards.

brhr

brhr

unread,
Mar 19, 2015, 8:45:54 AM3/19/15
to cp...@googlegroups.com
I contributed an article of "How to Compile and Install CP2K on Windows with Cygwin"  at http://www.cp2k.org/howto:compile_on_windows_with_cygwin.

Thank you in advance.

brhr

Iain Bethune

unread,
Mar 19, 2015, 9:11:59 AM3/19/15
to cp...@googlegroups.com
That’s great! I have made some minor edits to your instructions, but thanks again.

- Iain

--

Iain Bethune
Project Manager, EPCC

Email: ibet...@epcc.ed.ac.uk
Twitter: @IainBethune
Web: http://www2.epcc.ed.ac.uk/~ibethune
Tel/Fax: +44 (0)131 650 5201/6555
Mob: +44 (0)7598317015
Addr: 2404 JCMB, The King's Buildings, Peter Guthrie Tait Road, Edinburgh, EH9 3FD

> On 19 Mar 2015, at 12:45, brhr <iwao....@gmail.com> wrote:
>
> I contributed a article of "How to Compile and Install CP2K on Windows with Cygwin" at http://www.cp2k.org/howto:compile_on_windows_with_cygwin.
>
> Thank you in advance.
>
> brhr
>
> --
> You received this message because you are subscribed to the Google Groups "cp2k" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to cp2k+uns...@googlegroups.com.
> To post to this group, send email to cp...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cp2k.
> For more options, visit https://groups.google.com/d/optout.


--
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.

brhr

unread,
Mar 19, 2015, 4:39:17 PM3/19/15
to cp...@googlegroups.com
Hi
 
  Thank you for your kindness. 
   Please remedy if you can find more defects.

  Best Regards.

  brhr

Added:  At March 24 I have also made some corrections about the use of -D__GFORTRAN flag.
Reply all
Reply to author
Forward
0 new messages