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

Cmake #440

Closed
wants to merge 129 commits into from
Closed

Cmake #440

wants to merge 129 commits into from

Conversation

LecrisUT
Copy link
Contributor

@LecrisUT LecrisUT commented Apr 18, 2023

Opening a PR to review this branch and track the progress.

Please rebase at some point

sstgfbc and others added 30 commits June 1, 2022 09:55
Jerome Jackson and others added 25 commits January 25, 2023 17:34
and avoid using reserved stdout/stderr keywords as library interface
dummy argument names (for py interoperability vi f90wrap)
get_proj(w90main, w90dat, n, site, l, m, s, istdout, istderr, ierr, comm, sqa, z, x, rad, zona)

l,m,s,rad,zona must be arrays of length n
site, sqa, z,x  must be arrays with size (3,n)
sqa, z, x, rad, zona are optional arguments

returned is the full list of projections as indicated by projections
block in .win file
still missing:
1. branching for serial/parallel testing
2. config setup for compiler options
3. integration to github runner
4. documentation
Copy link
Contributor Author

@LecrisUT LecrisUT left a comment

Choose a reason for hiding this comment

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

I would recommend https://github.com/spglib/spglib or https://github.com/stevengj/nlopt for more modern implementations

Includedir: ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}
Libdir: ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}
Cflags: -I${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}
Libs: -L${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR} -lwannier90
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Please move to /cmake folder. Preferrably use wannier90.pc.in.

Use @ONLY replacements

CMakeLists.txt Outdated
# -Dwith_mpif08=off to disable use of f08 MPI module, to use f90 module instead
# -Dwith_mpih=on to force use of mpif.h include file

option(with_mpi "build MPI version" ON)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Namespace the options, otherwise it will not work with FetchContent

CMakeLists.txt Outdated
option(with_mpi "build MPI version" ON)
if (with_mpi)
option(with_mpif08 "build MPI version using f08 module" ON)
option(with_mpih "build MPI version using Fortran 77 mpif.h header" OFF)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Options should not be if blocked against other option, they are not properly parsed. Also why not fully remove mpih support in 2023? Legacy systems should use legacy code or upgrade

CMakeLists.txt Outdated
find_package(MPI REQUIRED)
include_directories(${MPI_Fortran_INCLUDE_PATH})
message(STATUS "MPI_Fortran_INCLUDE_PATH ${MPI_Fortran_INCLUDE_PATH}")
set(LIBS ${LIBS} ${MPI_Fortran_LINK_FLAGS} ${MPI_Fortran_LIBRARIES})
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Use target_link_libraries() not manual set. Manual approach does not include definition and other settings that find_package provides

CMakeLists.txt Outdated

find_package(BLAS REQUIRED) # binaries require blas
if (BLAS_FOUND)
set(LIBS ${LIBS} ${BLAS_LIBRARIES})
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same, use target_link_libraries

CMakeLists.txt Outdated
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/wannier90.pc DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/pkgconfig COMPONENT pkgconfig)

# test system
include(CTest)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Wrap around WANNIER90_TEST

CMakeLists.txt Outdated
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/w90_helper_types.mod DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})

# pkg-config
configure_file(wannier90.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/wannier90.pc)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Add equivalent wannier90Config.cmake files to expose to find_package

@@ -0,0 +1,71 @@
add_test(NAME partestw90_mpierr COMMAND ./run_tests -c partestw90_mpierr)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Wrap these in a for loop

@@ -0,0 +1,216 @@

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What is the plan with these. Maintenance of two build systems will be a nightmare, and the version is already bumped to a new major version

@@ -0,0 +1,2 @@
#!/bin/bash
make -j -C ../.. lib && make && ./test_library_serial.x
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why are these using plain make here?

@LecrisUT LecrisUT mentioned this pull request Aug 25, 2023
@LecrisUT LecrisUT closed this Aug 25, 2023
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.

3 participants