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

Updating the anisotropy branch with updates in devel for future move. #361

Merged
merged 52 commits into from
Jan 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
faa1a69
Added an example: fluid-solid-bathymetry
Nov 11, 2024
8e51e7b
Fixed a typo
sirpipat Nov 21, 2024
8b4a524
Scale down the number of elements per direction and the number of tim…
sirpipat Nov 22, 2024
c2523c6
Merge pull request #154 from sirpipat/devel
Rohit-Kakodkar Nov 24, 2024
3054ad8
Added CMake templates for SPECFEM++ run
Rohit-Kakodkar Nov 24, 2024
f3bb2d8
Merge branch 'devel' into issue-160
Rohit-Kakodkar Nov 27, 2024
01dea2c
Merge branch 'devel' into issue-158
Rohit-Kakodkar Nov 27, 2024
d08bf92
Fixed moment tensor documentation issue
Rohit-Kakodkar Nov 27, 2024
95b9121
Added test to Cmakelists | updated gitignore
Rohit-Kakodkar Nov 27, 2024
c38eb81
Merge pull request #163 from PrincetonUniversity/issue-160
Rohit-Kakodkar Dec 2, 2024
4123de1
Merge branch 'devel' into issue-158
Rohit-Kakodkar Dec 4, 2024
d7826b6
Removed tracking for .yaml and Par_File
Rohit-Kakodkar Dec 4, 2024
b8dc584
Added display node to .yaml file
Rohit-Kakodkar Dec 4, 2024
ef92666
Added snakemake workflow with jinja templating
Rohit-Kakodkar Dec 5, 2024
0ee9606
Added plotting scripts to snakemake
Rohit-Kakodkar Dec 5, 2024
01872cf
Merge branch 'devel' into issue-213
Rohit-Kakodkar Dec 6, 2024
8af4b29
Turned Matplotlib gui off | removed pressure seis from ivy's example
Rohit-Kakodkar Dec 6, 2024
af102bc
Merge branch 'devel' into issue-158
Rohit-Kakodkar Dec 6, 2024
264afde
Removed single source file which was not needed
Rohit-Kakodkar Dec 6, 2024
0e55182
Merge pull request #240 from PrincetonUniversity/issue-213
Rohit-Kakodkar Dec 9, 2024
8c5acab
Merge pull request #241 from PrincetonUniversity/issue-158
Rohit-Kakodkar Dec 17, 2024
2a0ddf9
Updated the location of meshfem2D to fortran/meshfem2d
lsawade Dec 19, 2024
cf400b5
Added a lot of files for meshfem3d
lsawade Dec 19, 2024
68fc143
fml, the constants.h was corrupted for some reason and I spent an hou…
lsawade Dec 19, 2024
870b775
weird it compiles only sometimes
lsawade Dec 19, 2024
6f6dbc7
Added cmake for shared module
Rohit-Kakodkar Dec 19, 2024
54f083b
Removed formatting issues with the header
Rohit-Kakodkar Dec 19, 2024
07fd0ff
removed cray compiler guards
Rohit-Kakodkar Dec 19, 2024
cfe0996
Added cmake build infrastructure around shared and meshfem3d directories
Rohit-Kakodkar Dec 19, 2024
acbe7da
Removed commented lines
Rohit-Kakodkar Dec 19, 2024
18cdb6b
Merge pull request #329 from PrincetonUniversity/issue-328
lsawade Dec 20, 2024
37ddfdc
Split up meshfem3d CMakeLists.txt into separate CMakeLists.txt
lsawade Dec 20, 2024
139e615
Stepwise adding parts to the CMakeLists.txt
lsawade Dec 20, 2024
b46c4c7
xgenerate_database is compiled
lsawade Dec 20, 2024
50b6fe4
Updated the CMakeLists.txt to build things in bin,archive,lib respect…
lsawade Dec 20, 2024
b6f3453
wrong capitalization/lowercazation
lsawade Dec 20, 2024
be82ac4
fixed capitalization in cmakefiles
lsawade Dec 20, 2024
5535ec0
fixed capitalization in cmakefiles part 2
lsawade Dec 20, 2024
3ebac5f
fixed all the capitalize
lsawade Dec 20, 2024
4a6776b
Merge pull request #334 from PrincetonUniversity/issue-327
lsawade Dec 30, 2024
7b1cb78
Merge pull request #350 from PrincetonUniversity/issue-309-meshfem3d
lsawade Dec 31, 2024
8dc99c1
Updated cmake version
lsawade Dec 31, 2024
74fc842
Revert "Updated cmake version"
lsawade Dec 31, 2024
8712e46
Update the build of boost as part of the project
lsawade Jan 2, 2025
49c0af7
Removed timestamp warning from the fetch download
lsawade Jan 2, 2025
b623c86
Forgot the tokenizer dependency of boost
lsawade Jan 2, 2025
f5e8515
Increased boost dependency so that the dependencies work on jenkins
lsawade Jan 2, 2025
d1700c8
Updated installation
lsawade Jan 2, 2025
0064fe4
Changed 7z to tar gz checking whether that is the issue
lsawade Jan 2, 2025
7cfd82b
skdjf
lsawade Jan 2, 2025
57b2c03
Made the required boost libraries a variable that is set separately f…
lsawade Jan 2, 2025
f7d4465
Merge pull request #358 from PrincetonUniversity/issue-357
lsawade Jan 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
157 changes: 99 additions & 58 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ set(NUM_CHUNKS 1)
set(NUM_THREADS 160)
set(NUM_VECTOR_LANES 1)

# Set binary output directories.
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/archive)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)

# For external modules that need to be built suppress build output
set(FETCHCONTENT_QUIET TRUE)

if (SPECFEMPP_ENABLE_PYTHON)
message("-- Adding -fPIC flag for Python binding.")
if(CMAKE_CXX_COMPILER_ID STREQUAL "IntelLLVM")
Expand Down Expand Up @@ -48,40 +56,43 @@ else(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
endif()

if (DEFINED Kokkos_ENABLE_CUDA)
if (Kokkos_ENABLE_CUDA)
# message("Setting CUDA variables")
set(Kokkos_ENABLE_CUDA_LAMBDA ON CACHE BOOL "Using CUDA Lambda by default")
set(Kokkos_ENABLE_CUDA_RELOCATABLE_DEVICE_CODE ON CACHE BOOL "Using CUDA Relocatable device by default")
endif()
if (Kokkos_ENABLE_CUDA)
# message("Setting CUDA variables")
set(Kokkos_ENABLE_CUDA_LAMBDA ON CACHE BOOL "Using CUDA Lambda by default")
set(Kokkos_ENABLE_CUDA_RELOCATABLE_DEVICE_CODE ON CACHE BOOL "Using CUDA Relocatable device by default")
endif()
endif()


# Install Kokkos as a dependency
## TODO: Add options for on utilizing in house builds
include(FetchContent)
FetchContent_Declare(
kokkos
URL https://github.com/kokkos/kokkos/archive/refs/tags/4.3.01.zip
kokkos
URL https://github.com/kokkos/kokkos/archive/refs/tags/4.3.01.zip
DOWNLOAD_EXTRACT_TIMESTAMP FALSE
)
FetchContent_MakeAvailable(kokkos)

FetchContent_Declare(
yaml
URL https://github.com/jbeder/yaml-cpp/archive/refs/tags/0.8.0.tar.gz
DOWNLOAD_EXTRACT_TIMESTAMP FALSE
)
FetchContent_MakeAvailable(yaml)

include_directories(BEFORE SYSTEM ${yaml_BINARY_DIR} ${yaml_SOURCE_DIR}/include)

find_package(VTK COMPONENTS
CommonColor
CommonCore
FiltersSources
InteractionStyle
RenderingContextOpenGL2
RenderingCore
RenderingFreeType
RenderingGL2PSOpenGL2
RenderingOpenGL2
CommonColor
CommonCore
FiltersSources
InteractionStyle
RenderingContextOpenGL2
RenderingCore
RenderingFreeType
RenderingGL2PSOpenGL2
RenderingOpenGL2
)


Expand All @@ -96,41 +107,72 @@ endif()
# Try finding boost and if not found install.
find_package(Boost 1.73.0 COMPONENTS program_options filesystem system)


if (NOT ${Boost_FOUND})
add_subdirectory(boost-cmake)
else ()
message(STATUS " LIB: ${Boost_LIBRARY_DIRS}")
message(STATUS " INC: ${Boost_INCLUDE_DIRS}")
message(STATUS " LIBSO: ${Boost_LIBRARIES}")
# Add boost lib sources
set(BOOST_INCLUDE_LIBRARIES program_options filesystem system algorithm tokenizer)
set(BOOST_LIBS Boost::program_options Boost::filesystem Boost::system Boost::algorithm Boost::tokenizer)
set(BOOST_ENABLE_CMAKE ON)
set(BOOST_ENABLE_MPI OFF CACHE INTERNAL "Boost MPI Switch") # Assume outer variable
set(BOOST_ENABLE_PYTHON OFF CACHE INTERNAL "Boost Python Switch") # Assume outer variable
set(BOOST_BUILD_TESTING OFF CACHE BOOL INTERNAL "Boost Test Switch") # Disable testing for boost
# The test flag is not really working... added it for completeness

# Download and extract the boost library from GitHub
set(BOOST_VERSION 1.87.0)
message(STATUS "Downloading and extracting boost (${BOOST_VERSION}) library sources. This will take <1 min.")
include(FetchContent)

# Fetch boost from the Github release zip file to reduce download time
FetchContent_Declare(
Boost
URL https://github.com/boostorg/boost/releases/download/boost-${BOOST_VERSION}/boost-${BOOST_VERSION}-cmake.tar.gz # downloading a zip release speeds up the download
USES_TERMINAL_DOWNLOAD True
GIT_PROGRESS TRUE
DOWNLOAD_NO_EXTRACT FALSE
DOWNLOAD_EXTRACT_TIMESTAMP FALSE
)
FetchContent_MakeAvailable(Boost)

else()
# Check which boost LIBRARY_DIRS to use
set(BOOST_LIBS Boost::boost Boost::program_options Boost::filesystem Boost::system)
message(STATUS "Boost libs/ and incs/:")
message(STATUS " LIB: ${Boost_LIBRARY_DIRS}")
message(STATUS " INC: ${Boost_INCLUDE_DIRS}")
message(STATUS " LIBSO: ${Boost_LIBRARIES}")
endif()

# Install HDF5 as a dependency if not found
find_package(HDF5 COMPONENTS CXX)

if (NOT ${HDF5_FOUND})
message("-- HDF5 not found. Building without HDF5.")
set(HDF5_CXX_BUILD OFF)
else ()
message(STATUS " LIB: ${HDF5_LIBRARIES}")
message(STATUS " INC: ${HDF5_INCLUDE_DIRS}")
message(STATUS " LIBSO: ${HDF5_CXX_LIBRARIES}")
message("-- HDF5 not found. Building without HDF5.")
set(HDF5_CXX_BUILD OFF)
else()
message("HDF5 libs/ and incs/:.")
message(STATUS " LIB: ${HDF5_LIBRARIES}")
message(STATUS " INC: ${HDF5_INCLUDE_DIRS}")
message(STATUS " LIBSO: ${HDF5_CXX_LIBRARIES}")
endif()


configure_file(constants.hpp.in constants.hpp)

include_directories(include)
include_directories(${CMAKE_BINARY_DIR})

add_subdirectory(meshfem2d)
add_subdirectory(fortran/meshfem2d)
add_subdirectory(fortran/meshfem3d)

if (ENABLE_SIMD)
message("-- Enabling SIMD")
add_definitions(-DENABLE_SIMD)
message("-- Enabling SIMD")
add_definitions(-DENABLE_SIMD)
endif()

if (ENABLE_PROFILING)
message("-- Enabling profiling")
add_definitions(-DENABLE_PROFILING)
message("-- Enabling profiling")
add_definitions(-DENABLE_PROFILING)
endif()

# Build specfem2d libraries
Expand Down Expand Up @@ -165,31 +207,30 @@ add_library(
)

if (NOT HDF5_CXX_BUILD)
target_compile_definitions(
IO
PUBLIC -DNO_HDF5
)
target_compile_definitions(
IO
PUBLIC -DNO_HDF5
)

target_link_libraries(
IO
Boost::boost
Kokkos::kokkos
)
target_link_libraries(
IO
mesh
source_class
receiver_class
${BOOST_LIBS}
Kokkos::kokkos)
else()
target_link_libraries(
IO
${HDF5_LIBRARIES}
Boost::boost
Kokkos::kokkos
)
target_link_libraries(
IO
mesh
source_class
receiver_class

Kokkos::kokkos
${HDF5_LIBRARIES}
)
endif()

target_link_libraries(
IO
mesh
source_class
receiver_class
)

add_library(
point
Expand Down Expand Up @@ -358,7 +399,7 @@ target_link_libraries(
yaml-cpp
point
algorithms
Boost::boost
${BOOST_LIBS}
)

add_library(
Expand All @@ -373,7 +414,7 @@ target_link_libraries(
# utilities
quadrature
yaml-cpp
Boost::boost
${BOOST_LIBS}
)

add_library(
Expand Down Expand Up @@ -576,7 +617,7 @@ target_link_libraries(
kernels
domain
solver
Boost::filesystem
${BOOST_LIBS}
)

add_executable(
Expand All @@ -603,7 +644,7 @@ target_link_libraries(
coupled_interface
kernels
solver
Boost::program_options
${BOOST_LIBS}
)

# Include tests
Expand Down Expand Up @@ -666,7 +707,7 @@ if (SPECFEMPP_ENABLE_PYTHON)
coupled_interface
kernels
solver
Boost::program_options
${BOOST_LIBS}
pybind11::headers
)
target_compile_definitions(_core PRIVATE SPECFEMPP_ENABLE_PYTHON)
Expand Down
4 changes: 2 additions & 2 deletions docs/cookbooks/example_01.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ If the above command returns a path to the ``specfem2d`` executable, then the bu

.. code:: bash

export PATH=$PATH:<PATH TO SPECFEM++ BUILD DIRECTORY>
export PATH=$PATH:<PATH TO SPECFEM++ BUILD DIRECTORY/bin>

.. note::

Make sure to replace ``<PATH TO SPECFEM++ BUILD DIRECTORY>`` with the actual path to the SPECFEM++ build directory on your system.
Make sure to replace ``<PATH TO SPECFEM++ BUILD DIRECTORY/bin>`` with the actual path to the SPECFEM++ build directory on your system.

Now let's create the necessary directories to store the input files and output artifacts.

Expand Down
4 changes: 2 additions & 2 deletions docs/cookbooks/example_02.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ If the above command returns a path to the ``specfem2d`` executable, then the bu

.. code:: bash

export PATH=$PATH:<PATH TO SPECFEM++ BUILD DIRECTORY>
export PATH=$PATH:<PATH TO SPECFEM++ BUILD DIRECTORY/bin>

.. note::

Make sure to replace ``<PATH TO SPECFEM++ BUILD DIRECTORY>`` with the actual path to the SPECFEM++ build directory on your system.
Make sure to replace ``<PATH TO SPECFEM++ BUILD DIRECTORY/bin>`` with the actual path to the SPECFEM++ build directory on your system.

Now let's create the necessary directories to store the input files and output artifacts.

Expand Down
4 changes: 2 additions & 2 deletions docs/cookbooks/example_03.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ If the above command returns a path to the ``specfem2d`` executable, then the bu

.. code:: bash

export PATH=$PATH:<PATH TO SPECFEM++ BUILD DIRECTORY>
export PATH=$PATH:<PATH TO SPECFEM++ BUILD DIRECTORY/bin>

.. note::

Make sure to replace ``<PATH TO SPECFEM++ BUILD DIRECTORY>`` with the actual path to the SPECFEM++ build directory on your system.
Make sure to replace ``<PATH TO SPECFEM++ BUILD DIRECTORY/bin>`` with the actual path to the SPECFEM++ build directory on your system.

Now let's create the necessary directories to store the input files and output artifacts.

Expand Down
2 changes: 1 addition & 1 deletion docs/getting_started/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Finally, once compiled you could run SPECFEM++ from inside the build directory,

.. code-block:: bash

export PATH=${PATH}:<location to build directory>
export PATH=${PATH}:<location to SPECFEM++ build directory/bin>

Testing Installation
=====================
Expand Down
Loading
Loading