Skip to content

Commit

Permalink
fmk - updating conanfile or HDF5, changes to CMakeLists for such, upd…
Browse files Browse the repository at this point in the history
…ate the Conf.cmake
  • Loading branch information
fmckenna committed Nov 17, 2021
2 parents e124611 + f59a872 commit 72471da
Show file tree
Hide file tree
Showing 7 changed files with 94 additions and 233 deletions.
41 changes: 0 additions & 41 deletions BuildTools/cmake/FMK.cmake

This file was deleted.

73 changes: 17 additions & 56 deletions BuildTools/cmake/OpenSeesDependenciesUnix.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,71 +5,32 @@
#
#==============================================================================
# External Libraries
#
#==============================================================================
# Synopsis
# - opensees_load(<PACKAGE> [FLAGS] [<PATHS>])
#
# Flags:
# - FIND: Use CMake to find library on system, fail if not found
#
# Keyword arguments:
# Provide specific paths for library.
#
# - BUNDLED <path/to/OTHER/LIB/>
# Provide path to OpenSees bundled library directory containing a
# CMakeLists.txt file.
#
# - LIBRARY <path/to/lib.a> INCLUDE <path/to/include/>
#
# - CONAN <conan-package/version>
# Point to a conan package.
#
#----------------------------------------------------------------
#opensees_load(TCL CONAN tcl/8.6.10)
opensees_load(TCL FIND)
set(TCL_LIBRARIES ${TCL_LIBRARY})

opensees_load(BLAS FIND)

opensees_load(LAPACK FIND)

opensees_load(SUPERLU
BUNDLED "${OPS_BUNDLED_DIR}/SuperLU_5.1.1/"
#LIBRARY "${OPS_BUNDLED_DIR}/bin/SuperLU_5.1.1/libSUPERLU.a"
)

opensees_load(ARPACK
BUNDLED "${OPS_BUNDLED_DIR}/ARPACK/"
#LIBRARY "${OPS_BUNDLED_DIR}/bin/ARPACK/libARPACK.a"
)

opensees_load(UMFPACK
BUNDLED "${OPS_BUNDLED_DIR}/UMFPACK/"
#LIBRARY "${OPS_BUNDLED_DIR}/bin/UMFPACK/libUMFPACK.a"
)

opensees_load(CSPARSE
BUNDLED "${OPS_BUNDLED_DIR}/CSPARSE/"
#LIBRARY "${OPS_BUNDLED_DIR}/bin/CSPARSE/libCSPARSE.a"
)
find_package(TCL REQUIRED)
find_package(MySQL REQUIRED)

opensees_load(AMD
BUNDLED "${OPS_BUNDLED_DIR}/AMD/"
#LIBRARY "${OPS_BUNDLED_DIR}/bin/AMD/libAMD.a"
)

opensees_load(METIS FIND)
#
#sudo apt-get install libhdf5-serial-dev
# - installed version 1.10
# - we need version 1.12
# - hdf5-1.12.1-linux-centos7-x86_64-gcc485-static.tar.gz

opensees_load(HDF5 FIND)
set (HDF5_USE_STATIC_LIBRARIES ON)
find_package(HDF5)
if (HDF5_FOUND)
message(STATUS "HDF5 found version: ${HDF5_VERSION}")
message(STATUS "HDF5_CXX_DEFINITIONS = ${HDF5_CXX_DEFINITIONS}")
message(STATUS "HDF5_LIBRARIES = ${HDF5_LIBRARIES}" )
if (HDF_VERSION VERSION_LESS 1.12)
message(STATUS "HDF5 VERSION OLD: ${HDF5_VERSION}" )
endif()
endif()

opensees_load(MySQL FIND)

find_package(Python COMPONENTS Development)

# Integrated exteral libraries
opensees_load(FEDEAS_Uniaxial
LIBRARY FALSE
)


40 changes: 24 additions & 16 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,11 @@ set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" "${PROJECT_SOURCE_DIR}/BuildTools/c
#include(OpenSeesFunctions)
#cmake -DCMAKE_RULE_MESSAGES:BOOL=OFF -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON .

# for OpenSeesPY
add_Compile_options(-fPIC)

#
# externa; packages
# external packages
#

add_library(OPS_External_packages INTERFACE)
Expand All @@ -49,6 +52,8 @@ include(${PROJECT_SOURCE_DIR}/Conf.cmake)
if(EXISTS "${CMAKE_BINARY_DIR}/conanbuildinfo.cmake")
include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake")
conan_basic_setup()
set (HDF5_FOUND TRUE)
set (HDF5_VERSION "1.12.0")
set(USING_CONAN TRUE)
else()
include(OpenSeesFunctions)
Expand Down Expand Up @@ -349,15 +354,12 @@ add_library(OPS_PFEM OBJECT EXCLUDE_FROM_ALL)

add_library(OPS_InterpTcl STATIC)

target_compile_definitions(OPS_InterpTcl PUBLIC _TCL85)
if(NOT EXISTS "${CMAKE_BINARY_DIR}/conanbuildinfo.cmake")
target_include_directories(OpenSees PUBLIC ${TCL_INCLUDE_PATH})
target_include_directories(OPS_InterpTcl PUBLIC ${TCL_INCLUDE_PATH})
target_link_libraries(OPS_InterpTcl PRIVATE ${TCL_LIBRARIES})
endif()

target_compile_definitions(OPS_InterpTcl PUBLIC _TCL85)


#
# OpenSees G3 Library - a slimmed down OpenSees
#
Expand Down Expand Up @@ -432,8 +434,13 @@ add_executable(OpenSees EXCLUDE_FROM_ALL
${OPS_SRC_DIR}/tcl/tclMain.cpp
)

if(NOT EXISTS "${CMAKE_BINARY_DIR}/conanbuildinfo.cmake")
target_include_directories(OpenSees PUBLIC ${TCL_INCLUDE_PATH})
endif()


target_link_libraries(OpenSees
OPS_InterpTcl OPS_Thermal OpenSeesLIB ${CMAKE_DL_LIBS} ${CONAN_LIBS}
OPS_InterpTcl OPS_Thermal OpenSeesLIB ${CMAKE_DL_LIBS} ${HDF5_LIBRARIES} ${CONAN_LIBS}
)


Expand Down Expand Up @@ -474,7 +481,6 @@ target_link_libraries(OpenSeesMP OpenSeesLIB)

add_library(OpenSeesPy SHARED EXCLUDE_FROM_ALL)

# add_Compile_options(-fPIC)
target_compile_options(OpenSeesPy PUBLIC -fPIC)
target_include_directories(OpenSeesPy PUBLIC ${Python_INCLUDE_DIRS})

Expand Down Expand Up @@ -577,15 +583,17 @@ endif()
#----------------------------
# HDF5
#----------------------------
if(OPS_Use_HDF5)
find_package(HDF5)
if(HDF5_FOUND)
include_directories(${HDF5_INCLUDE_DIR})
set(_hdf5_libs hdf5 hdf5_cpp)
add_compile_definitions(-D_H5DRM)
else()
message(STATUS "OPS >>> Could not find HDF5")
endif()

if(HDF5_FOUND)
include_directories(${HDF5_INCLUDE_DIR})
set(_hdf5_libs hdf5 hdf5_cpp)
add_compile_definitions(_H5DRM)
if (HDF5_VERSION VERSION_GREATER_EQUAL 1.12.0)
add_compile_definitions(_HDF5)
message(STATUS "OPS >>> Have HDF5 and VERSION >= 1.12.0")
endif()
else()
message(STATUS "OPS >>> Could not find HDF5")
endif()


Expand Down
5 changes: 0 additions & 5 deletions Conf.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,13 @@
set(OPS_FINAL_TARGET "OpenSees" CACHE STRING "OpenSees final target")




#==============================================================================
# Basic Switches
#==============================================================================

option(OPS_Use_Dev_Directories
"Include files in DEVELOPER directory" OFF)

option(OPS_Use_HDF5
"HDF5 Dependent Code" OFF)

option(FMK
"Special FMK Code" OFF)

Expand Down
5 changes: 3 additions & 2 deletions SRC/domain/pattern/drm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ target_sources(OPS_Domain
DRMInputHandler.h
PlaneDRMInputHandler.h
)
if (OPS_Use_HDF5)
target_sources(OPS_DRM

if (HDF5_FOUND)
target_sources(OPS_Domain
PRIVATE
H5DRM.cpp
PUBLIC
Expand Down
Loading

0 comments on commit 72471da

Please sign in to comment.