Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CMake functionality #12

Open
wants to merge 48 commits into
base: development
Choose a base branch
from

Conversation

zbeekman
Copy link
Collaborator

@zbeekman zbeekman commented Mar 9, 2020

Hi Salvatore and Fabio,

Here is a pull request to upstream the CMake build system that I/we added. The initial cut at this was somewhat sloppy, but the end product is not so bad.

There are some things that can stand to be updated/changed, but it has worked for us on Linux and macOS with GCC/GFortran 8, Windows with MSVC C compiler and Intel Fortran 2018 compiler, and Linux with Intel 18 for Fortran & C.

There were some concerns about the license of ParMetis which is NOT free to use, and is not a normal, OSI approved license, so the build system finds and links with Metis, NOT ParMetis. To get Metis to build on windows and all platforms, I wrote a CMake build system for that as well:

https://github.com/nrc-fuels/metis

One focus/requirement of the project was to be able to make binaries as redistributable as possible, so I think things are setup to statically link by default.

Another issue we encountered was that GFortran was generating ABI incompatible code when using -fcoarray=lib to build and link code against OpenCoarrays. While PSBLAS does not use OpenCoarrays (as far as I know) we other parts of the project were using it, so we had to add a flag to allow all the libraries to be ABI compatible by building everything with -fcoarray=lib and linking to OpenCoarrays. This is an option in the CMake build, and should be OFF by default, if my memory is correct.

There are some utility functions and modules in the top level cmake directory.

IMO, most of the introspection stuff surrounding name mangling and other issues should be obviated (become unnecessary) through the use of ISO_C_BINDING. CMake provides some intrinsic support for name mangling introspection but it wasn't 100% compatible with the way PSBLAS was doing things, from what I recall.

rouson and others added 30 commits December 12, 2017 18:02
Also remove psb_sxdot.f90 from CMakeLists.txt to
be consistent with the file removal in the previous commit.
CMakeLists.txt files have been created for
krylov/
prec/
util/

Skipping cbind/ for now and skipping serial build for now.
- Use canonical -DBUILD_SHARED_LIBS=TRUE (CMake)
 - I think there is some special stuff that needs to happen to get the others working
 - Delete trainling white space
 - Use native line endings (hopefully)
@zbeekman
Copy link
Collaborator Author

zbeekman commented Mar 9, 2020

The conflicts in base/modules/aux are due, in part, to the fact that you cannot checkout a git branch/working copy on windows if there is a directory named aux so we renamed it to auxil. I can try to resolve some of these conflicts later tonight when I'm home.

@zbeekman zbeekman self-assigned this Mar 9, 2020
@zbeekman zbeekman changed the base branch from psblas-3.6-maint to development March 9, 2020 16:00
@zbeekman
Copy link
Collaborator Author

zbeekman commented Mar 9, 2020

@sfilippone I think it's just as much work to merge into develop and probably makes more sense for that to be the target. Please let me know if you disagree.

@ivan-pi ivan-pi mentioned this pull request May 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants