Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
Fixed what ever was causing the source code to not be found in debug …
Browse files Browse the repository at this point in the history
…mode
  • Loading branch information
daminton committed Feb 13, 2024
1 parent 8b1f16c commit 415eb69
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 25 deletions.
6 changes: 2 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,10 @@ docs/_static/fortran_docs/*/**
!environment.yml
!.dockerignore

swiftest/_bindings.cpython*
bin/
build/*
hdf5-*
netcdf-c-*
netcdf-fortran-*
zlib-*
lib*

actions-runner*

Expand Down
4 changes: 1 addition & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ ELSE()
# Define the paths to the source code and python files
SET(SRC "${CMAKE_SOURCE_DIR}/src")
SET(PY "${CMAKE_SOURCE_DIR}/swiftest")

MESSAGE(STATUS "CMAKE_Fortran_PREPROCESS_SOURCE: ${CMAKE_Fortran_PREPROCESS_SOURCE}")
# Make sure paths are correct for Unix or Windows style
FILE(TO_CMAKE_PATH ${SRC} SRC)
FILE(TO_CMAKE_PATH ${PY} PY)
Expand All @@ -59,8 +59,6 @@ ELSE()
SET(INSTALL_LIBDIR ${CMAKE_INSTALL_LIBDIR})
SET(INSTALL_INCLUDEDIR ${CMAKE_INSTALL_INCLUDEDIR})
ENDIF ()
SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)

# Have the .mod files placed in the include folder
SET(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/mod)
Expand Down
29 changes: 19 additions & 10 deletions buildscripts/build_negishi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,23 @@ module load use.own
module load conda-env/mintongroup-py3.9.13
module load netcdf-fortran/intel-oneapi/4.6.1
module load shtools/intel-oneapi/4.11.10
# cmake -P distclean.cmake
# pip install --config-settings=build-dir="build" \
# --config-settings=cmake.build-type="${BUILD_TYPE}" \
# --config-settings=cmake.args="-DUSE_SIMD=ON" \
# --config-settings=cmake.args="-DUSE_OPENMP=ON" \
# --config-settings=cmake.args="-DCMAKE_Fortran_COMPILER=mpiifort" \
# --config-settings=cmake.args="-DCMAKE_Fortran_FLAGS=\"-f90=ifort\"" \
# --config-settings=cmake.args="-DMACHINE_CODE_VALUE=\"CORE-AVX-I\" " \
# --config-settings=install.strip=false \
# --no-build-isolation \
# -ve .

cmake -P distclean.cmake
pip install --config-settings=build-dir="build" \
--config-settings=cmake.build-type="${BUILD_TYPE}" \
--config-settings=cmake.args="-DUSE_SIMD=ON" \
--config-settings=cmake.args="-DUSE_OPENMP=ON" \
--config-settings=cmake.args="-DCMAKE_Fortran_COMPILER=mpiifort" \
--config-settings=cmake.args="-DCMAKE_Fortran_FLAGS=\"-f90=ifort\"" \
--config-settings=cmake.args="-DMACHINE_CODE_VALUE=\"CORE-AVX-I\" " \
--config-settings=install.strip=false \
--no-build-isolation \
-ve .
cmake -B ${ROOT_DIR}/build -S . -G Ninja \
-DMACHINE_CODE_VALUE="CORE-AVX-I" \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DCMAKE_Fortran_COMPILER=mpiifort \
-DCMAKE_Fortran_FLAGS="-f90=ifort"

cmake --build ${ROOT_DIR}/build -j${OMP_NUM_THREADS} -v
6 changes: 0 additions & 6 deletions cmake/Modules/SetSwiftestFlags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -309,12 +309,6 @@ IF (CMAKE_BUILD_TYPE STREQUAL "DEBUG" OR CMAKE_BUILD_TYPE STREQUAL "TESTING" )
Fortran "/Qopt-prefetch-" # Intel Windows
)
ELSE ()
SET_COMPILE_FLAG(CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG}"
Fortran REQUIRED "-pg -g3"
)
SET_COMPILE_FLAG(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}"
C REQUIRED "-g3"
)
SET_COMPILE_FLAG(CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG}"
Fortran REQUIRED "-O0" # All compilers not on Windows
)
Expand Down
1 change: 1 addition & 0 deletions distclean.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ FILE(GLOB_RECURSE CMAKEINSTALL "${TOPDIR}/*cmake_install.cmake"
"${TOPDIR}/*install_manifest.txt")
FILE(GLOB_RECURSE CMAKETESTFILES "${TOPDIR}/*CTestTestfile.cmake")
SET(TOPDIRECTORIES "${TOPDIR}/lib"
"${TOPDIR}/lib64"
"${TOPDIR}/libexec"
"${TOPDIR}/bin"
"${TOPDIR}/include"
Expand Down
4 changes: 2 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,12 @@ IF(USE_COARRAY)
set(SWIFTEST_src ${SWIFTEST_src} ${COARRAY_FILES} )
ENDIF ()

STRING(TOUPPER "${CMAKE_BUILD_TYPE}" BT)

# Turn preprocessor on for all files
SET_SOURCE_FILES_PROPERTIES(${SWIFTEST_src} ${DRIVER_src} PROPERTIES Fortran_PREPROCESS ON)

#Set strict vs fast math flags
STRING(TOUPPER "${CMAKE_BUILD_TYPE}" BT)
IF(BT STREQUAL "RELEASE" OR BT STREQUAL "PROFILE")
SET_PROPERTY(SOURCE ${STRICT_MATH_FILES} APPEND_STRING PROPERTY COMPILE_FLAGS "${STRICTMATH_FLAGS}")
SET_PROPERTY(SOURCE ${FAST_MATH_FILES} APPEND_STRING PROPERTY COMPILE_FLAGS "${FASTMATH_FLAGS}")
Expand All @@ -127,7 +128,6 @@ ADD_EXECUTABLE(${SWIFTEST_DRIVER} ${DRIVER_src})
# Add the needed libraries
#####################################################
# Create a library from the source files, except the driver

ADD_LIBRARY(${SWIFTEST_LIBRARY} ${SWIFTEST_src})
IF (NOT BUILD_SHARED_LIBS)
SET_PROPERTY(TARGET ${SWIFTEST_LIBRARY} PROPERTY POSITION_INDEPENDENT_CODE)
Expand Down

0 comments on commit 415eb69

Please sign in to comment.