xmake-io / xmake-repo

📦 An official xmake package repository
https://xrepo.xmake.io
Apache License 2.0
685 stars 395 forks source link

Add wigxjpf #3975

Closed 0382 closed 5 months ago

0382 commented 5 months ago

Is your feature request related to a problem? Please describe.

no

Describe the solution you'd like

package("wigxjpf")
    set_homepage("https://fy.chalmers.se/subatom/wigxjpf/")
    set_description("WIGXJPF evaluates Wigner 3j, 6j and 9j symbols accurately using prime factorisation and multi-word integer arithmetic.")
    set_license("GPL-3.0", "LGPL-3.0")

    set_urls("https://fy.chalmers.se/subatom/wigxjpf/wigxjpf-$(version).tar.gz")
    add_versions("1.13", "90ab9bfd495978ad1fdcbb436e274d6f4586184ae290b99920e5c978d64b3e6a")

    on_install("linux", "macosx", function (package)
        os.vrun("make")
        os.cp("inc/*.h", package:installdir("include"))
        os.cp("lib/*.a", package:installdir("lib"))
        os.cp("bin/*", package:installdir("bin"))
    end)

    on_test(function (package)
        assert(package:check_csnippets({test = [[
            #include "wigxjpf.h"
            int test()
            {
                double val6j;
                wig_table_init(2*100, 9);
                wig_temp_init(2*100);
                val6j = wig6jj(2*  2 , 2*  2 , 2*  1 ,
                                2*  2 , 2*  1 , 2*  1 );
                wig_temp_free();
                wig_table_free();
                return 0;
            }
        ]]}))
    end)

Describe alternatives you've considered

No response

Additional context

This package is used for evaluating Wigner symbols, which is very useful for angular momentum coupling. The GNU-GSL library offers gsl_sf_coupling_?j functions, but they are inaccurate for very large angular momentum. This library use big integer techniques to give accurate result.

c8ef commented 5 months ago

You can open a pull request directly with the package file provided above.