• Multiwfn forum

    Multiwfn official website: http://www.shanxitv.org/multiwfn. Multiwfn forum in Chinese: http://bbs.keinsci.com/wfn. E-mail of admin: sobereva[at]sina.com

    You are not logged in.

    #1 2022-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 any noSMTH.sh?
    CMake allows people to choose which parts can be compiled much simpler than the running of noSMTH.sh with:

    cmake -DENABLE_FEATURE=OFF

    What do you think about it?

    Best regards,
    Igor

    Offline

    #2 2022-03-17 20:34:31

    sobereva
    Tian Lu (Multiwfn developer)
    From: Beijing
    Registered: 2017-09-11
    Posts: 1,468
    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

    #3 2022-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

    #4 2022-05-16 04:45:12

    sobereva
    Tian Lu (Multiwfn developer)
    From: Beijing
    Registered: 2017-09-11
    Posts: 1,468
    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

    #5 2022-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

    #6 2022-05-16 09:55:18

    sobereva
    Tian Lu (Multiwfn developer)
    From: Beijing
    Registered: 2017-09-11
    Posts: 1,468
    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

    Powered by FluxBB

    久久精品国产99久久香蕉