Multiwfn forum

Multiwfn official website: //www.umsyar.com/multiwfn. Multiwfn forum in Chinese: http://bbs.keinsci.com/wfn

You are not logged in.

#12022-03-17 17:05:29

i.s.ger
Member
Registered: 2020-12-01
Posts: 55

Build MultiWFN with CMake; work with dependencies

Dear Tian Lu,

I've created a new Density Functional Approximation's feature implied on generalized hypergeometric function.
My implementation in MultiWFN is based on Arb C library (https://arblib.org/). I hacked Makefile for linking MultiWFN with it. Unfortunately, currently, it leads to dynamic dependency from this library. Somehow, it is possible to link it statically.
Anyway, in the future, if somebody wants to compile MultiWFN by himself, it will require to have compiled Arb C library, which is not provided by MultiWFN. So, somebody will want to drop support of this library for his experiments. In that case, it will require to have one more script which removes Arb C library dependency (as it is done with ./noGUI.sh).

Also, compiling of libreta is too long. I disabled it in some of my experiments by removing its code.

Can we go out from Makefile to CMake (https://cmake.org) for simplifying building MultiWFN without applying anynoSMTH.sh?
CMake allows people to choose which parts can be compiled much simpler than the running ofnoSMTH.shwith:

cmake -DENABLE_FEATURE=OFF

What do you think about it?

Best regards,
Igor

Offline

#22022-03-17 20:34:31

sobereva
Tian Lu (Multiwfn developer)
From: Beijing
Registered: 2017-09-11
Posts: 1,773
Website

Re: Build MultiWFN with CMake; work with dependencies

Dear Igor,

Thank you for sharing your opinion. Currently I don't have plan to introduce CMake into the compilation process of Multiwfn.

Compiling libreta is indeed time-consuming, but it only needs to be compiled once.

best regards,

Tian

Offline

#32022-05-16 02:30:53

i.s.ger
Member
Registered: 2020-12-01
Posts: 55

Re: Build MultiWFN with CMake; work with dependencies

Dear Tian Lu,

I found a very annoying bug in CMake's module dependency resolver that requires renaming module `function` to module `functions`. Mostly, it can be done via the following sed-script:

sed "s/^use function\b/use functions/" *.f90 -i

Could you please apply it to the Multiwfn source code?

Best regards,
Igor

Offline

#42022-05-16 04:45:12

sobereva
Tian Lu (Multiwfn developer)
From: Beijing
Registered: 2017-09-11
Posts: 1,773
Website

Re: Build MultiWFN with CMake; work with dependencies

Dear Igor,

I have correspondingly modified codes and updated source code package to official site.

Best regards,

Tian

Offline

#52022-05-16 09:00:03

i.s.ger
Member
Registered: 2020-12-01
Posts: 55

Re: Build MultiWFN with CMake; work with dependencies

Dear Tian Lu,

Looks like `module function` is continuing to be... So, the parallel compilation of Multiwfn using CMake is broken...

Anyway, there is a patch that makes Multiwfn's compiling possible using CMake >=3.16 under Linux.
0001-Add-compilation-via-CMake.patch.txt

Tested compilers:
- gfortran 9.3.0
- ifort 2021
- ifx 2022

Tested version of CMake:
- 3.16
- 3.22

I used Ubuntu for testing.

I will introduce the support of Windows and MacOS later. Later, I will also update compilation methods, since currently, there is only a very short description about build customizing.

Best regards,
Igor

Offline

#62022-05-16 09:55:18

sobereva
Tian Lu (Multiwfn developer)
From: Beijing
Registered: 2017-09-11
Posts: 1,773
Website

Re: Build MultiWFN with CMake; work with dependencies

Dear Igor,

I uploaded the file again, it should be correct now.

I don't have a clear plan to introduce cmake into the official compilation of Multiwfn. Because unlike programs with complicate structure, such as GROMACS, source code of Multiwfn doesn't have a complex structure and number of files is not large, therefore I prefer to manually prepare Makefile, which is easier for me, and users do not need to install cmake first.

Best regards,

Tian

Offline

Board footer

Baidu
map