-
Notifications
You must be signed in to change notification settings - Fork 12
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
base: development
Are you sure you want to change the base?
Conversation
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)
(cherry picked from commit e695cab)
- Try adding headers back to fakempi.c
- -DLittleEndian was being defined before pulling in windows.h causing compiler errors
- PSBLAS is setting LowerUnderscore on windows without this
The conflicts in |
@sfilippone I think it's just as much work to merge into |
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.