Skip to content

Conversation

@sassy-crick
Copy link
Contributor

(created using eb --new-pr)

@ocaisa
Copy link
Member

ocaisa commented May 19, 2022

    def configure_step(self):
        """
        Set the CMake options for SuperLU
        """
        # Make sure not to build the slow BLAS library included in the package
        self.cfg.update('configopts', '-Denable_blaslib=OFF')

        # Set the BLAS library to use
        # For this, use the BLA_VENDOR option from the FindBLAS module of CMake
        # Check for all possible values at https://cmake.org/cmake/help/latest/module/FindBLAS.html
        toolchain_blas_list = self.toolchain.definition().get('BLAS', None)
        if toolchain_blas_list is None:
            # This toolchain has no BLAS library
            raise EasyBuildError("No BLAS library found in the toolchain")

        toolchain_blas = toolchain_blas_list[0]
        cmake_version = get_software_version('cmake')
        if toolchain_blas == 'imkl':
            imkl_version = get_software_version('imkl')
            if LooseVersion(imkl_version) >= LooseVersion('10'):
                # 'Intel10_64lp' -> For Intel mkl v10 64 bit,lp thread model, lp64 model
                # It should work for Intel MKL 10 and above, as long as the library names stay the same
                # SuperLU requires thread, 'Intel10_64lp_seq' will not work!
                self.cfg.update('configopts', '-DBLA_VENDOR="Intel10_64lp"')

            else:
                # 'Intel' -> For older versions of mkl 32 and 64 bit
                self.cfg.update('configopts', '-DBLA_VENDOR="Intel"')

        elif toolchain_blas in ['ACML', 'ATLAS']:
            self.cfg.update('configopts', '-DBLA_VENDOR="%s"' % toolchain_blas)

        elif toolchain_blas == 'OpenBLAS':
            if LooseVersion(cmake_version) >= LooseVersion('3.6'):
                self.cfg.update('configopts', '-DBLA_VENDOR="%s"' % toolchain_blas)
            else:
                # Unfortunately, OpenBLAS is not recognized by FindBLAS from CMake,
                # we have to specify the OpenBLAS library manually
                openblas_lib = os.path.join(get_software_root('OpenBLAS'), get_software_libdir('OpenBLAS'), "libopenblas.a")
                self.cfg.update('configopts', '-DBLAS_LIBRARIES="%s;-pthread"' % openblas_lib)

        elif toolchain_blas == 'FlexiBLAS':
            if LooseVersion(cmake_version) >= LooseVersion('3.19'):
                self.cfg.update('configopts', '-DBLA_VENDOR="%s"' % toolchain_blas)
            else:
                # Unfortunately, FlexiBLAS is not recognized by FindBLAS from CMake,
                # we have to specify the FlexiBLAS library manually
                flexiblas_lib = os.path.join(get_software_root('FlexiBLAS'), get_software_libdir('FlexiBLAS'), 
                "libflexiblas.so")
                self.cfg.update('configopts', '-DBLAS_LIBRARIES="%s;-pthread"' % flexiblas_lib)

        else:
            # This BLAS library is not supported yet
            raise EasyBuildError("BLAS library '%s' is not supported yet", toolchain_blas)

        super(EB_SuperLU, self).configure_step()

Copy link
Member

@ocaisa ocaisa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style fixes

@ocaisa
Copy link
Member

ocaisa commented May 20, 2022

@sassy-crick You need to ok my suggestions above to update the PR (and get the tests to pass)

@boegel boegel changed the title Support for FlexiBlas added enhance SuperLU easyblock to support building on top of FlexiBLAS May 25, 2022
@boegel boegel added this to the 4.x milestone May 25, 2022
@sassy-crick
Copy link
Contributor Author

We might need to think about whether the change from extra_vars['build_shared_libs'][0] = False to extra_vars['build_shared_libs'][0] = True might break things with older versions. Also, if we are going for the shared_libs we need to make sure that the static libs are also build.

Reverted `extra_vars['build_shared_libs'][0] = True` back to the original `extra_vars['build_shared_libs'][0] = False`
@ocaisa
Copy link
Member

ocaisa commented May 30, 2022

Test report by @ocaisa

Overview of tested easyconfigs (in order)

  • SUCCESS SuperLU-5.2.2-foss-2020a.eb
  • SUCCESS SuperLU-5.2.2-intel-2020a.eb

Build succeeded for 2 out of 2 (2 easyconfigs in total)
login1 - Linux Rocky Linux 8.5, x86_64, Intel(R) Xeon(R) CPU E5-2690 v3 @ 2.60GHz, Python 3.6.8
See https://gist.github.com/d7389a7b14a7feeace5d2d7c3b99a490 for a full test report.

@sassy-crick
Copy link
Contributor Author

Thanks for your help! I am sure one day I understand Python! :-)

@ocaisa
Copy link
Member

ocaisa commented May 31, 2022

Test report by @ocaisa

Overview of tested easyconfigs (in order)

  • SUCCESS SuperLU-5.2.2-foss-2020a.eb
  • SUCCESS SuperLU-5.2.2-intel-2020a.eb

Build succeeded for 2 out of 2 (2 easyconfigs in total)
login1 - Linux Rocky Linux 8.5, x86_64, Intel(R) Xeon(R) CPU E5-2690 v3 @ 2.60GHz, Python 3.6.8
See https://gist.github.com/73a822f1084845858bfba4f8d15e97ab for a full test report.

Copy link
Member

@ocaisa ocaisa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested with FlexiBLAS, OpenBLAS and MKL

@ocaisa ocaisa merged commit 4db03c5 into easybuilders:develop May 31, 2022
@boegel boegel modified the milestones: 4.x, 4.5.5 Jun 2, 2022
@boegel boegel changed the title enhance SuperLU easyblock to support building on top of FlexiBLAS enhance SuperLU easyblock to support building on top of FlexiBLAS and be compatible with SuperLU v5.3 Jun 2, 2022
@sassy-crick sassy-crick deleted the 20220519103809_new_pr_superlu branch July 15, 2022 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants