graph compilation

184 views
Skip to first unread message

Victor Volkov

unread,
Jun 27, 2023, 3:14:27 PM6/27/23
to cp2k
Dear developers:
sorry to bother.

CP2K instructs that graph.sopt should be compiled on its own.
I found three F-files on git, and copied them
and placed into created graph directory.

When I tried to use gfortran, it started but with errors: please, see below.
If possible, would you hint how to compile this tool?

I run under both, Cygwin and WLS-Ubuntu.

Thank you.
Victor

 gfortran graph.f -o graph.sopt
graph.f:18:1:
 PROGRAM graph
 1
Error: Non-numeric character in statement label at (1)
graph.f:18:1:
 PROGRAM graph
 1
Error: Unclassifiable statement at (1)

Krack Matthias

unread,
Jun 28, 2023, 3:22:58 AM6/28/23
to cp...@googlegroups.com

Hi Victor

 

The binary graph.<VERSION> is created by default when CP2K is built. So, you should find it after a successful CP2K build in the folder cp2k/exe/<ARCH>/ where also the cp2k binary is stored. You can create it selectively via the make target “fes”, e.g. by “make ARCH=… VERSION=… fes”.

 

HTH

 

Matthias

 

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/cp2k/cae741a5-467d-4b38-a830-e324aeeb1b96n%40googlegroups.com.

Victor Volkov

unread,
Jun 28, 2023, 3:28:00 AM6/28/23
to cp...@googlegroups.com
Thank you, dear Matthias.
I will study.
With best regards.
Victor

Victor Volkov

unread,
Jul 6, 2023, 12:46:55 PM7/6/23
to cp...@googlegroups.com
Dear Matthias:
good evening.
Sorry to bother in the graph compilation.

Having the CP2K response, as I copy below,
what should I add to the arch file
...
or something else?
Thank you.

Best,
Victor

$ make fes.sopt ARCH=Linux-x86-64-gfortran VERSION=sopt
Discovering programs ...
make: *** No rule to make target 'fes.sopt'.  Stop.

On Wed, Jun 28, 2023 at 10:22 AM Krack Matthias <matthia...@psi.ch> wrote:

Krack Matthias

unread,
Jul 6, 2023, 12:59:27 PM7/6/23
to cp...@googlegroups.com

Dear Victor

 

Try just

 

make ARCH=Linux-x86-64-gfortran VERSION=sopt fes

 

HTH

 

Matthias

 

Victor Volkov

unread,
Jul 6, 2023, 1:18:04 PM7/6/23
to cp...@googlegroups.com
This runs make, indeed,
but it seems an idle run:
I do not see neither fes.sopt nor graph.sopt
to be generated in the exe directory.
:-)
Victor


Krack Matthias

unread,
Jul 6, 2023, 1:29:17 PM7/6/23
to cp...@googlegroups.com

That should work, Victor. No clue, why it doesn’t create graph.<VERSION>.

Do you have any file in exe/Linux…/ ?

Does

make ARCH=Linux-x86-64-gfortran VERSION=sopt execlean
make ARCH=Linux-x86-64-gfortran VERSION=sopt fes

trigger any compiler/linker output?

Victor Volkov

unread,
Jul 6, 2023, 1:43:56 PM7/6/23
to cp...@googlegroups.com
Dear Matthias:
there is a good step forward.
It might be due to the cygwin environment.
Since there is a good load of information, I will study
and will let you know if something interesting.
With best regards
Victor

Victor Volkov

unread,
Nov 21, 2023, 3:39:59 AM11/21/23
to cp...@googlegroups.com
Dear Mattheas:
while still trying to make fes, 
I managed to get this response

$ make ARCH=Cygwin-x86_64-gfortran VERSION=sopt fes
Discovering programs ...
Version sopt is now an alias for ssmp with OMP_NUM_THREADS=1.
Removing stale archives for ssmp ...
Resolving dependencies for ssmp ...
make -C /cp2k2023/cp2k/exts/dbcsr -f /cp2k2023/cp2k/exts/build_dbcsr/Makefile \
   ARCHFILE=/cp2k2023/cp2k/arch/Cygwin-x86_64-gfortran.ssmp \
   LIBDIR=/cp2k2023/cp2k/lib/Cygwin-x86_64-gfortran/ssmp/exts/dbcsr \
   OBJDIR=/cp2k2023/cp2k/obj/Cygwin-x86_64-gfortran/ssmp/exts/dbcsr \
   USE_ACCEL="" \
   ACC="" \
   ACCFLAGS=""
Removing stale archives ...
Resolving dependencies ...

However, 
I do not find any executable to be generated neither in
cp2k\exe\Cygwin-x86_64-gfortran
nor in
cp2k\exe

May be something is inconsistent about the ssmp file - below I provide its content.
Would you give a hint?

Thank you.
Victor

**************
CC       = gcc
CPP      =
AR       = ar -r

FC       = gfortran -fopenmp
LD       = gfortran -fopenmp

CFLAGS = -fopenmp -funroll-loops -ftree-vectorize -march=native -mtune=native

DFLAGS   = -D__GFORTRAN -D__FFTW3 -D__LIBINT -D__LIBXC -fopenmp

FCFLAGS  = -g -O2 -funroll-loops -ftree-vectorize -march=native -ffree-form $(DFLAGS) -fopenmp
FCFLAGS  = -ffree-form -ffree-line-length-none -fno-omit-frame-pointer
FCFLAGS += -I/usr/include -I/usr/local/include -I/libint-v2.6.0-cp2k-lmax-7/include
FCFLAGS += -fbacktrace -std=f2008 -Wl,--stack,4194304

LDFLAGS  = $(FCFLAGS)

LIBS    =  -llapack -lblas -lint2 -lxc -lxcf03 -ldl -ldbghelp -lstdc++
LIBS   +=  -lgsl -lz -ldl -lm -fopenmp -fopenmp-simd
LIBS   +=  -L/usr/local/lib  
LIBS   +=  /lib/gcc/x86_64-pc-cygwin/7.4.0/libstdc++.a
LIBS   +=  /lib/gcc/x86_64-pc-cygwin/7.4.0/libgomp.dll.a
LIBS   +=  /lib/libgsl.dll.a /lib/libmpi.dll.a
LIBS   +=  /lib/liblapack.dll.a /lib/libblas.dll.a /lib/libhdf5.dll.a /lib/libhdf5_hl.dll.a
LIBS   +=  /lib/libfftw3.dll.a /lib/libfftw3_omp.dll.a /lib/libfftw3_threads.dll.a -llapack -lblas
LIBS   +=  /lib/libfftw3f.dll.a /lib/libfftw3f_omp.dll.a /lib/libfftw3f_threads.dll.a
LIBS   +=  /lib/libfftw3l.dll.a /lib/libfftw3l_omp.dll.a /lib/libfftw3l_threads.dll.a
LIBS   +=  /usr/local/lib/libint2.a /usr/local/lib/libfftw3.a /usr/local/lib/libfftw3_threads.a
LIBS   +=  /usr/local/lib/libxc.a /usr/local/lib/libxcf03.a /usr/local/lib/libxcf90.a

OBJECTS_ARCHITECTURE = machine_gfortran.o




Victor Volkov

unread,
Nov 21, 2023, 4:06:27 AM11/21/23
to cp...@googlegroups.com
May be it would be easier for me to write own FES code in Mathematica.

For example the DOS python utility from CP2K never worked on my notebook,
and I coded a Mathematica notebook.

There is this book
Ch. Chipot A. Pohorille (Eds.)
Free Energy Calculations
Theory and Applications

According to your knowledge,
does it have the equation set that I would be able to use with the
HILLS and COLVAR prints by CP2K?

Thank you.
Best

Krack Matthias

unread,
Nov 21, 2023, 4:49:22 AM11/21/23
to cp...@googlegroups.com

Dear Victor

 

Did you consider instead of installing and using CP2K with Cygwin to use a Windows Subsystem for Linux (WSL) as suggested?

 

Best

 

Matthias

 

Victor Volkov

unread,
Nov 21, 2023, 5:16:16 AM11/21/23
to cp...@googlegroups.com
Dear Matthias:

During Summer and Autumn, I did invest into WSL-Ubuntu.
The original drive was to learn tleap and antechamber to prepare topologies for ligands.
In result, I did manage the key steps, 
which are not explained (but granted) in the CP2K QMMM tutorial for Chorismate Mutase.

Since it took, half of year (in 2021) to learn how to install CP2K under cygwin,
I got somewhat reluctant to spent another 6 month battling to manage the same under WSL.

In mean time, there are several articles to finish 
and several long-term CP2K jobs under cygwin.

Being isolated in the Russian country side without any support, 
but what I was growing and brewing in the summer, I may not have that much time in my age and under my conditions.
Since the state rep has my anti-war statement in written - it is up to them
to place me in a penal colony for 7 years, any time.
 
Therefore, by now, I failed to force self to reserve time with the black screen on WSL CP2K.

In principle, you are right - I should do.

On the other hand,
since I use Mathematica for 20 years, if having equations, 
trying to program (rather than having passive hopes into "problematic handouts")
may seem to be a good math-programming time investment.
This is why I posted the "sort of" simple question.

I hope you would forgive.

Sincerely,
Victor


Victor Volkov

unread,
Nov 26, 2023, 8:21:31 AM11/26/23
to cp...@googlegroups.com
> Did you consider instead of installing and using CP2K with Cygwin to use a Windows Subsystem for Linux (WSL) as suggested?

Dear Matthias:
I was working to try to install CP2K under WLS ubuntu.
The standard protocol 
using
git clone --recursive https://github.com/cp2k/cp2k.git cp2k
make ARCH=Darwin-gfortran VERSION=sopt
does not work - the installer is not universal: it cannot find directories, it cannot find gfortran.
(Comparatively, miniconda and amber-tools are universal.)

However, on YouTube there is a description
to do
sudo apt install cp2k.

This does work, but it installs the retired version 6.1
and it is not clear where its location, neither how to deal with it.

Curiously, ubuntu tells that (wherever it is) it is popt.
I never was able to compile popt under Cygwin.

Somewhere on pc there is this cp2k.popt package, but it is not clear 
if this can be used to generate graph and how.
I will explore this: even the outdated dummy soft, still it might help to plot FES
:-)

Best,
Victor



 




Krack Matthias

unread,
Nov 29, 2023, 12:29:41 PM11/29/23
to cp...@googlegroups.com

Dear Victor

 

I just created a small howto for the installation of CP2K under Windows using the Windows System for Linux (WSL).

I will check this evening that howto on my old Win10 office PC at home, but any other tests are appreciated. I am pretty sure that there are at least some typos. This should also provide the “fes” (graph.ssmp) tool under Windows.

 

HTH

 

Matthias

 

Victor Volkov

unread,
Nov 29, 2023, 5:34:32 PM11/29/23
to cp...@googlegroups.com
Dear Matthias:
good evening.

Excellent!
I am following the how to and made all the steps till
make -j ARCH=local VERSION=ssmp
At present, the compilations is running ....seems alright, flawless.
:-)

Thank you.
With best regards,
Victor


Victor Volkov

unread,
Nov 30, 2023, 3:14:19 AM11/30/23
to cp...@googlegroups.com
Dear Matthias:
good morning.

 local installation is running properly
 CP2K| version string:                 CP2K version 2023.2 (Development Version)
 CP2K| source code revision number:                                  git:845a3ae

Considering the given format to install
make -j ARCH=local VERSION=ssmp
I cd into
github/cp2k/cp2k

and tried to compile graph instructing
make ARCH=local VERSION=ssmp fes

The package returned
*******************************
Discovering programs ...

Removing stale archives for ssmp ...
Resolving dependencies for ssmp ...
make -C /home/volkovskr/github/cp2k/cp2k/exts/dbcsr -f /home/volkovskr/github/cp2k/cp2k/exts/build_dbcsr/Makefile \
   ARCHFILE=/home/volkovskr/github/cp2k/cp2k/arch/local.ssmp \
   LIBDIR=/home/volkovskr/github/cp2k/cp2k/lib/local/ssmp/exts/dbcsr \
   OBJDIR=/home/volkovskr/github/cp2k/cp2k/obj/local/ssmp/exts/dbcsr \

   USE_ACCEL="" \
   ACC="" \
   ACCFLAGS=""
Removing stale archives ...
Resolving dependencies ...
********************************
However,
there is no any outcome:
content of the folder
github/cp2k/cp2k/local
is the same as before.

There is graph.ssmp file there with its time creation when CP2K version 2023.2was compiled.

It seems, under WLS, compiling graph is the same problematic as under Cygwin.

I anticipate that graph-fes protocol is not your product.
May be it could be possible to post this to the author.

Thank you.
With best regards.
Victor





Krack Matthias

unread,
Nov 30, 2023, 6:15:49 AM11/30/23
to cp...@googlegroups.com

Dear Victor

 

Thanks for testing.

After running

make -j ARCH=local VERSION=ssmp

in “~/github/cp2k/cp2k/

there should already be a “graph.ssmp” binary

in “~/github/cp2k/cp2k/exe/local/”

Is that the case and can you run

~/github/cp2k/cp2k/exe/local/cp2k.ssmp -v

and/or

~/github/cp2k/cp2k/exe/local/graph.ssmp

?

 

Matthias

 

Victor Volkov

unread,
Nov 30, 2023, 7:34:41 AM11/30/23
to cp...@googlegroups.com
Dear Mathias:
thank you for the kind reply with instructions.

I cd into
/github/cp2k/cp2k/exe/local/
and instructed
./cp2k.ssmp -v

The package printed its version and command format properly.

Then, I copied into the same directory the files I generated while
following the Metadynamics tutorial

and I edited the instruction from the tutorial as


./graph.ssmp -cp2k -file METADYN-1.restart -out fes.dat

In return, the package started to print:
**********************************************************************
FES|  Parsing file:   <METADYN-1.restart>
**********************************************************************
FES|  Parameters for FES:
FES|  NDIM         ::           1
etc.
....
and after few minutes
the package produced the fes.dat file.

Therefore, the proper performance of graph routing is confirmed.

Thank you, dear Matthias!
Now, I understand how to approach and elaborate the usage of it further.
:-)
With best regards,
Victor


Krack Matthias

unread,
Dec 1, 2023, 4:37:14 AM12/1/23
to cp...@googlegroups.com

Dear Victor

 

I am glad that you could finally get graph work on your local Windows PC.

 

I have further extended the How to Compile CP2K on Windows with the instructions to build also an MPI/OpenMP parallel CP2K (psmp) binary under Windows and with some further information and hints. The cp2k.psmp binary will provide better performance in case you have a larger number of CPU cores (more than 4) available.

 

Best

 

Matthias

 

Victor Volkov

unread,
Dec 1, 2023, 6:41:48 AM12/1/23
to cp...@googlegroups.com
Excellent, dear Matthias:
I have 6 cores (12 logical processors).
According to your notice, it may be interesting to explore setting up a popt version.

In PS, I provide a description I developed while working on WSL-Ubuntu installation.

I think, CP2K is seriously "under-selling" its capacity among students and postdocs 
world-wide.
Potentially, there is a several million community if they see how easy to install,
and how easy to follow examples.

Just watching what kind of demos people prepare to sell self on YouTube while using CP2K,
it seems to me that CP2K misses the huge market of students in Asia/Africa/America.    

G16 is expensive, QChem and Turbomole and VASP are not cheap, Quantum Espresso is not handy at all
and their "discussion group" is below any level, Crystal is underdeveloped, Dalton is sort of "narrow" and underdeveloped,
CPMD is dragging behind slow.

Perhaps, only ABINIT may be a competitor, but their installation is not described,
and their discussion group and archive are not competitive.
They do demonstrate an amazing database of Raman examples
    
I do believe that CP2K may have an EXPANSE.
Within the past 20 years, the world-wide experimental chemistry-bio-phys community of students and postdocs did grow up to start to pick
theoretical tools if hints to compile.

I can see this, since I remember black-white Norton Commander and a hard-drive of 20 MB.

With best regards,
Victor

PS:
In order to install Ubuntu in Windows environment,
you would need to have PowerShell and WSL.

1)
Download current version (for example, PowerShell-7.3.0-win-x64.msi)
and install PowerShell

2) setting up WSL2
Open PowerShell in administrator mode and enter
wsl --install
to see a list of available Linux distributions available
for download through the online store 
Enter:
wsl --list --online
setting upl a Linux(Ubuntu) distribution environment
wsl --install -d <Distribution Name>.
for example,
wsl --install -d Ubuntu
Setting WSL2 for your Linux distros
wsl --set-default-version 2

3) Installing Ubuntu
Using Microsoft Store, we download Ubuntu.
We do not wish to run installation via MS-Store.
Instead, in Search command:
Ubuntu

This initiates the installation window.
Using the moment, we click on the header with Right-Mouse
to pin the executable (to be able to open Ubuntu terminal)
where we want to.

After installation, we instruct user name and pass:
user: XXXX
pass: XXXX

To create a shortcut to the Ubuntu directory in File Explorer enter
\\wsl$

You will see the folder
Ubuntu (wsl&)

Click on with Right Mouse and create a shortcut to this folder
and place the shortcut where convenient:




Victor Volkov

unread,
Dec 1, 2023, 7:03:28 AM12/1/23
to cp...@googlegroups.com
Two issues:
1)
a chemistry student might need a short hint that it is possible to run several CP2K jobs on the same computer simultaneously
and how to do this
2)
I have noticed that WSL-Ubuntu local installation runs the same job 6-times faster than when under Sygwin.
At the same time (I would need to reconfirm this), Task Manager shows Vmmem (I think this is the WSL-Ubuntu util by cp2k) takes 6 times
more intense usage of CPU. This is a curious. difference - I attach an image.
Victor


WSL and SygWin.png

Krack Matthias

unread,
Dec 1, 2023, 9:27:42 AM12/1/23
to cp...@googlegroups.com

Dear Victor

 

Thanks for the feedback.

I did not need a PowerShell for the WSL installation. No clue, if it is used In the background, because it is installed.

Anyway, I just clicked in the browser on the install button shown in the Microsoft Store for the App Ubuntu 22.04.2 LTS and a terminal window opens requesting username and password, done. That’s as easy as installing an App on the Smartphone. For convenience, I pinned that App also to the task bar by dragging the icon there.

 

Best

 

Matthias

 

Krack Matthias

unread,
Dec 1, 2023, 9:42:30 AM12/1/23
to cp...@googlegroups.com

Dear Victor

 

  1. The typical CPU and memory resources of a Windows PC usually do not allow for running several CP2K jobs concurrently and the installation of a job scheduler like slurm (if possible) might not be worth the effort. Alternatively, one can use the Linux shell feature for sending jobs into the background by appending “&” to the command. I have added some further hints to the wiki page how to launch a parallel run with mpiexec, hth.
  2. I cannot assess if your assignment of the processes is correct. I suggest to run only the cp2k.sopt and cp2k.popt binaries. If you launch just cp2k.ssmp, it will start by default 12 threads on a Windows PC with a 6-core CPU and hyperthreading which will be quite inefficient.

 

Best

 

Matthias

 

Reply all
Reply to author
Forward
0 new messages