Conversation
- Add top-level CMakeLists.txt with per-solver opt-in flags - Add Grand_Potential_Serial/CMakeLists.txt (gcc + libm) - Add Grand_Potential_MPI/CMakeLists.txt (MPI + HDF5 + GSL) - Add KKS_CuFFT/CMakeLists.txt (CUDA + cuFFT) - Add KKS_FD_CUDA_MPI/CMakeLists.txt (CUDA separable + MPI + HDF5 + GSL) - Add KKS_OpenCl/CMakeLists.txt (MPI + OpenCL + HDF5 + GSL) - Add Cahn_Hilliard_FFT_2D/CMakeLists.txt (FFTW3) - Add cmake/FindFFTW3.cmake custom find module - Add docs/cmake_upgrade.md migration guide Agent-Logs-Url: https://github.com/samcom12/MicroSim/sessions/653f1394-fccb-4a78-a946-ddc1e529fd46 Co-authored-by: samcom12 <13285627+samcom12@users.noreply.github.com>
Agent-Logs-Url: https://github.com/samcom12/MicroSim/sessions/653f1394-fccb-4a78-a946-ddc1e529fd46 Co-authored-by: samcom12 <13285627+samcom12@users.noreply.github.com>
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
|
@copilot remove any hardcoded paths from makefile and build microsim wih the changes and see if it creates executables properly |
…efaults - Grand_Potential_MPI: replace /share/apps/gsl/* with GSL_ROOT_DIR auto-detected via gsl-config, fully overridable - KKS_OpenCl: replace $(HOME)/gsl_2_7, /usr/local/cuda, /usr/include/hdf5 with CUDA_HOME / GSL_ROOT_DIR / HDF5_INC_DIR variables - KKS_FD_CUDA_MPI: remove spack-hash HDF5 and GSL paths; use empty defaults with inline instructions; fix NVHPC_ROOT default path Build verified: Grand_Potential_Serial produces microsim_gp executable via both `make` and `cmake --build`. Agent-Logs-Url: https://github.com/samcom12/MicroSim/sessions/83c47819-1f44-4cb4-a635-26b7e4367139 Co-authored-by: samcom12 <13285627+samcom12@users.noreply.github.com>
Done in commit
Build verified: The other solvers (MPI, CUDA, OpenCL) require toolchains (MPI, CUDA toolkit, OpenCL SDK) not present in this sandbox, so they can't be compiled here, but the Makefile paths are now portable. |
samcom12
left a comment
There was a problem hiding this comment.
It covers all required changes
|
Can be merged |
|
needs to merge |
Summary
Migrates the MicroSim build system from a collection of independent hand-written
Makefiles to a unified CMake 3.18+ build system. All originalMakefiles are retained alongside the newCMakeLists.txtfiles to ease the transition. Hardcoded absolute paths in the existingMakefiles have also been replaced with portable, overridable environment-variable-based defaults.Changes
New files
CMakeLists.txtBUILD_*flagsGrand_Potential_Serial/CMakeLists.txtGrand_Potential_MPI/CMakeLists.txtKKS_CuFFT/CMakeLists.txtKKS_FD_CUDA_MPI/CMakeLists.txtKKS_OpenCl/CMakeLists.txtCahn_Hilliard_FFT_2D/CMakeLists.txtcmake/FindFFTW3.cmakedocs/cmake_upgrade.mdMakefile hardcoded path fixes
Grand_Potential_MPI/Makefile/share/apps/gsl/lib,/share/apps/gsl/includeGSL_ROOT_DIRauto-detected viagsl-config --prefix, fully overridableKKS_OpenCl/Makefile$(HOME)/gsl_2_7/...,/usr/local/cuda/...,/usr/include/hdf5/openmpiCUDA_HOME,GSL_ROOT_DIR,HDF5_INC_DIRvariables with auto-detection fallbacksKKS_FD_CUDA_MPI/MakefileHDF5_HOME ?=,GSL_HOME ?=) with inline instructions; fixedNVHPC_ROOTdefault pathOut of scope (build system unchanged)
Grand_potential_AMReX/— uses AMReX's own GNUmake infrastructureGrand_potential_OpenFOAM/andBridgman/— use OpenFOAM'swmakeHow to build
CMake (recommended)
Key configuration options:
CUDA_ARCH(default70),ENABLE_HDF5,ENABLE_CUFFTMP,FFTW3_ROOT,GSL_ROOT_DIR,HDF5_ROOT.Make (with portable paths)
Testing
The
Grand_Potential_Serialsolver was verified to compile cleanly and produce themicrosim_gpexecutable (157 KB ELF binary) via bothmakeandcmake --buildusing GCC 13.3.0. The remaining solvers require CUDA, MPI, and/or HDF5 toolchains — their CMake configuration syntax was validated up to the dependency-not-found stage, and their Makefile path variables are confirmed portable.