Skip to content

Commit

Permalink
cmp - merge Win with Unix changes
Browse files Browse the repository at this point in the history
  • Loading branch information
claudioperez committed Jul 16, 2021
2 parents e69d316 + c82ff42 commit 9472fa7
Show file tree
Hide file tree
Showing 154 changed files with 557 additions and 683 deletions.
23 changes: 20 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ set(OPS_EXTERNALS_DIR "${PROJECT_SOURCE_DIR}/OTHER/")
set(OPS_BUNDLED_DIR "${PROJECT_SOURCE_DIR}/OTHER/")
set(OPS_SRC_DIR "${PROJECT_SOURCE_DIR}/SRC/")
include(OpenSeesFunctions)

include(${PROJECT_SOURCE_DIR}/Conf.cmake)

set_property(CACHE OPS_FINAL_TARGET PROPERTY STRINGS
Expand All @@ -58,7 +59,7 @@ if (UNIX)
endif()
endif()

if(WIN32)
if(WIN32) # NOTE: this will execute for both 32-bit and 64-bit builds.
include(OpenSeesDependenciesWin)
target_sources(OPS_OS_Specific_libs INTERFACE ${OPS_SRC_DIR}/api/win32Functions.cpp)
target_link_libraries(OPS_OS_Specific_libs INTERFACE ${CBLAS_LIBRARIES} wsock32 ws2_32)
Expand Down Expand Up @@ -218,6 +219,7 @@ target_link_libraries(G3_Numerics INTERFACE
${LAPACK_LIBRARIES} ${BLAS_LIBRARIES}
)


# Core OpenSees
add_library(OPS_Tcl STATIC)
add_library(OPS_Domain OBJECT)
Expand Down Expand Up @@ -249,8 +251,12 @@ add_executable(OpenSeesTcl EXCLUDE_FROM_ALL
${OPS_SRC_DIR}/tcl/tclAppInit.cpp
${OPS_SRC_DIR}/tcl/tclMain.cpp
)
add_executable(OpenSeesSP EXCLUDE_FROM_ALL ${OPS_SRC_DIR}/tcl/tclAppInit.cpp)
add_executable(OpenSeesMP EXCLUDE_FROM_ALL ${OPS_SRC_DIR}/tcl/tclAppInit.cpp)
add_executable(OpenSeesSP EXCLUDE_FROM_ALL
${OPS_SRC_DIR}/tcl/tclAppInit.cpp
)
add_executable(OpenSeesMP EXCLUDE_FROM_ALL
${OPS_SRC_DIR}/tcl/tclAppInit.cpp
)
add_executable(OpenSeesPy EXCLUDE_FROM_ALL ${OPS_SRC_DIR}/interpreter/pythonMain.cpp)


Expand Down Expand Up @@ -480,6 +486,17 @@ if(FMK)
)
endif()

#----------------------------
# Extensions
#----------------------------
message("OPS >>> Configuring OpenSees extensions")
foreach(extension IN LISTS OPS_Element_List OPS_Extension_List)
string(TOUPPER "${extension}" ext_flag)
set(ext_flag "_${ext_flag}")
message(" Adding macro definition '${ext_flag}'")
add_compile_definitions(${ext_flag})
endforeach()

#----------------------------
# Renderer
#----------------------------
Expand Down
35 changes: 26 additions & 9 deletions Conf.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
# All Rights Reserved
# (Copyright and Disclaimer @ http://www.berkeley.edu/OpenSees/copyright.html)
#
#------------------------------------------------------------------------------

#==============================================================================
# Select Executable
#
Expand All @@ -23,12 +21,14 @@ set(OPS_FINAL_TARGET "OpenSeesTcl"
option(FMK
"Special FMK Code" OFF)

option(OPS_THREADSAFE
"Only build thread safe components" ON)
# G3 Options
#--------------------------------------
option(G3_Api_OPS_Global
"Compile G3 library with bindings \
to the global OpenSees API" ON)

# Component Libraries
#--------------------------------------

option(OPS_Use_Reliability
"Include reliability" OFF)

Expand Down Expand Up @@ -68,17 +68,34 @@ define_property(TARGET
FULL_DOCS "..."
)


#==============================================================================
# Select Element Libraries
# Select Auxiliary Libraries
#
# Each element in this list ows and associated macro definition
# Each element in this list owns an associated macro definition that is the
# name of the lib converted to uppercase, and prepended with an underscore
# (e.g. using OPS_Element_truss defines the macro _OPS_ELEMENT_TRUSS)
#==============================================================================
set(OPS_Extension_List

OPS_Reliability # TODO: replace existing tests on '_RELIABILITY'

OPS_NumLib_PETSC
OPS_NumLib_METIS
OPS_NumLib_UMFPACK

OPS_ExtLib_PFEM

OPS_Graphics
OPS_Renderer
OPS_Renderer_GLX # TODO: replace existing tests on '_GLX'
OPS_Renderer_X11
)

set(OPS_Element_List

OPS_Element_truss
OPS_Element_beam3d
#OPS_Element_beam2d
OPS_Element_beam3d
OPS_Element_dispBeamColumnInt
OPS_Element_forceBeamColumn
OPS_Element_mixedBeamColumn
Expand Down
23 changes: 14 additions & 9 deletions ETC/scripts/make_cmake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,32 @@ for i in */
do
# remove trailing slash
i=${i%*/}
name=`echo $i | sed 's|-|_|g'`;
#name=`echo $i | sed 's|-|_|g' | sed -r 's/\<./\U&/g'`;
name="Renderer";
if [ -f $i/CMakeLists.txt ]; then
:
#echo $i;
#cat $i/CMakeLists.txt;
else
echo "OPS_Element_$name"
#echo "OPS_$name"
{
echo "add_library(OPS_Element_$name OBJECT)";
echo "add_library(OPS_$name OBJECT)";
echo "";
cd "$i";
echo "target_sources(OPS_Element_$name";
echo "target_sources(OPS_$name";
echo " PRIVATE";
ls -1 *.[cfF]* | sed 's|^\([A-z]\)| \1|g';
ls -1 *.[cfF]* | sed 's|^\([A-z]\)| \1|g' | grep -v Tcl;
echo " PUBLIC";
ls -1 *.h | sed 's|^\([A-z]\)| \1|g';
cd ../;
ls -1 *.h | sed 's|^\([A-z]\)| \1|g' | grep -v Tcl;
echo ")";
echo "target_include_directories(OPS_Element_$name PUBLIC \$(CMAKE_CURRENT_LIST_DIR))";
echo "target_include_directories(OPS_$name PUBLIC \$(CMAKE_CURRENT_LIST_DIR))";
echo "";
} > $i/CMakeLists.txt 2>&1
for d in ./*/
do
echo "add_subdirectory($d)" | grep -v '/\*/';
done
cd ../;
} 2>&1 #> $i/CMakeLists.txt
fi;
done

40 changes: 0 additions & 40 deletions OTHER/AMD/CMakeLists.txt

This file was deleted.

67 changes: 46 additions & 21 deletions OTHER/ARPACK/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,38 +1,64 @@
############################################################################
#==============================================================================
#
# OpenSees -- Open System For Earthquake Engineering Simulation
# Pacific Earthquake Engineering Research Center
#
# Program: ARPACK
# (c) Copyright 1999-2021 The Regents of the University of California
# All Rights Reserved
# (Copyright and Disclaimer @ http://www.berkeley.edu/OpenSees/copyright.html)
#
# Module: Makefile
#
# Purpose: Sources Makefile
#
# Creation date: February 22, 1996
#
# Modified: 2021
#
# Send bug reports, comments or suggestions to arpack.caam.rice.edu
#
############################################################################
#------------------------------------------------------------------------------
# Claudio Perez

project(ARPACK Fortran)

add_library(ARPACK)

# Arg-mismatch check adapted from OneLab CMakeLists
# This checks whether the compiler has an "argument mismatch" flag;
# if it does, it needs to be set. This solution was inspired by
# a CMake file in the OneLab repositories
include(CheckFortranCompilerFlag)
check_fortran_compiler_flag("-fallow-argument-mismatch" ARGMISMATCH)
if (ARGMISMATCH)
message("Setting -fallow-argument-mismatch")
#add_compile_options("-fallow-argument-mismatch")
target_compile_options(ARPACK PUBLIC $<$<COMPILE_LANGUAGE:Fortran>:-fallow-argument-mismatch>)
endif()

target_sources(ARPACK PUBLIC
dgetv0.f dlaqrb.f dstqrb.f dsortc.f dsortr.f dstatn.f dstats.f
dnaitr.f dnapps.f dnaup2.f dnaupd.f dnconv.f dneigh.f dngets.f
dsaitr.f dsapps.f dsaup2.f dsaupd.f dsconv.f dseigt.f dsgets.f
dneupd.f dseupd.f dsesrt.f dvout.f dmout.f
icnteq.f icopy.f iset.f iswap.f ivout.f second.f
dgetv0.f
dlaqrb.f
dstqrb.f
dsortc.f
dsortr.f
dstatn.f
dstats.f
dnaitr.f
dnapps.f
dnaup2.f
dnaupd.f
dnconv.f
dneigh.f
dngets.f
dsaitr.f
dsapps.f
dsaup2.f
dsaupd.f
dsconv.f
dseigt.f
dsgets.f

dneupd.f
dseupd.f
dsesrt.f
dvout.f
dmout.f

icnteq.f
icopy.f
iset.f
iswap.f
ivout.f
second.f
)
target_link_libraries(ARPACK PUBLIC ${LAPACK_LIBRARIES})

Expand All @@ -47,7 +73,6 @@ set(${PROJECT_NAME}_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}

export(TARGETS ARPACK
FILE "${CMAKE_CURRENT_BINARY_DIR}/cmake/ARPACK.cmake"
#EXPORT_LINK_INTERFACE_LIBRARIES #NAMESPACE MathFunctions::
)


91 changes: 0 additions & 91 deletions OTHER/CBLAS/CMakeLists.txt

This file was deleted.

Loading

0 comments on commit 9472fa7

Please sign in to comment.