Skip to content

Commit

Permalink
Merge bence virtonomy2 (#61)
Browse files Browse the repository at this point in the history
* Verification cases thesis (#15)

* ConstrainSolidBody renamed

* constrain solid body reagion added

* force boundary condition

* force BC edited

* Pressure bc (#16)

* SurfacePressureFromSource added

* SurfacePressureFromSource::Update

* BC prob works but the particle normals are missing

* time dependent surface pressure works

* cube case moved to source tests

* Add test folder (#18)

* Translate body part (#45)

* Feature/contact stent 2 (#10)

* PositionSolidBody added

* boundary condition works but breaks numerically

* no message

* first unit test added

* indentation change

* PositionSolidBody test

* remove file

* small fixes

* position constraint changed
works between start and end time

* scaling boundary condition

* PositionScaleSolidBody unit test

* particel adaptation changed

* system resolution ratio added to particle adaptation

* add googletest to docker and workflow

* unit test removed temporarily

* unit rest removed

* SolidParticleRelaxation added to update initial particle position

* gtest added again

* gtest install changed

* gtest

* gtest

* gtest

* gtest

* cd path updated

* change to shared pointers

* unit test pointers changed

* gtest added to docker

* initialization changed

* disable tests for simbody

* errors fixed

* TranslationSolidBody added; translation cylinder

* whitespace

* fixes

* TranslateSolidBody corrected

* writeToFile update

* change SET to set

* catch(out_of_range& e) added

* change to size_t

* cmake minimum removed

* BoundingBox test changed

* fix writeToFIle

* test change

* Feature/position bc stent (#34)

* PositionSolidBody added

* boundary condition works but breaks numerically

* no message

* first unit test added

* indentation change

* PositionSolidBody test

* remove file

* small fixes

* position constraint changed
works between start and end time

* scaling boundary condition

* PositionScaleSolidBody unit test

* particel adaptation changed

* system resolution ratio added to particle adaptation

* add googletest to docker and workflow

* unit test removed temporarily

* unit rest removed

* SolidParticleRelaxation added to update initial particle position

* gtest added again

* gtest install changed

* gtest

* gtest

* gtest

* gtest

* cd path updated

* change to shared pointers

* unit test pointers changed

* gtest added to docker

* initialization changed

* errors fixed

* TranslationSolidBody added; translation cylinder

* whitespace

* fixes

* TranslateSolidBody corrected

* writeToFile update

* change SET to set

* catch(out_of_range& e) added

* change to size_t

* cmake minimum removed

* BoundingBox test changed

* fix writeToFIle

* test change

Co-authored-by: JohnVirtonomy <[email protected]>

* -Werror only works for linux

* TEST TranslateSolidBodyTuple

* Update CMakeLists.txt

remove werror flag for msvc

* update from bitbucket 01.07.2021

* delete repeated files

* brief information on google test in repo readme

* delete clapack and simbody folder in root

* google test works for windows but the unit test case did not copy stl file right in windows

* now test_3d_unit works in windows.

* information on installing google test in windows

* add a comment on install ing for VS in windows

* translation with same scale&unit test update

* skip testing when [ci skip] in the commit message

* update test_3d_unit - TranslateSolidBody not work

* time-dependent-contact

* number of time dep. contacts fixed

* setup unit test for time dependent contact

* Translate Solid Body fixed
but tolerance is only 0.01

* output changed to 100 files always

* 07.13.2021 update

* typo

* new files from bitbucket

* update 07.13.2021

* time dependent contact fixed

* time dep contact fixed

* remove cout

* time dep. contact tests finished

* renaming

* fix naming

* move test class into seperate header

* cmake changes

* changing function names to lower case

* change cmake list

* small fix

Co-authored-by: Ubuntu <virtonomy@SPHsimulation2.qg4qjrxycqxetcothedhm1ylih.ax.internal.cloudapp.net>
Co-authored-by: JohnVirtonomy <[email protected]>
Co-authored-by: Xiangyu Hu <[email protected]>
Co-authored-by: Wen-Yang Chu <[email protected]>
Co-authored-by: Xiangyu Hu <xiangyu.hu@tum>
Co-authored-by: Xiangyu Hu <[email protected]>

* TranslateSolidBodyPart added

* particle relaxation fixed

* change Get_ to get_

* checkIfPointInBoundingBox moved

Co-authored-by: Ubuntu <virtonomy@SPHsimulation2.qg4qjrxycqxetcothedhm1ylih.ax.internal.cloudapp.net>
Co-authored-by: JohnVirtonomy <[email protected]>
Co-authored-by: Xiangyu Hu <[email protected]>
Co-authored-by: Wen-Yang Chu <[email protected]>
Co-authored-by: Xiangyu Hu <xiangyu.hu@tum>
Co-authored-by: Xiangyu Hu <[email protected]>

* update from bitbucket 07-30-2021

* replace the wrong gpuSPHinXsys

* Simbody artifacts instead of installation

* simbody variable added to cmake command

* change path

* conflict resolved

* remove doubled test

Co-authored-by: Ubuntu <virtonomy@SPHsimulation2.qg4qjrxycqxetcothedhm1ylih.ax.internal.cloudapp.net>
Co-authored-by: JohnVirtonomy <[email protected]>
Co-authored-by: Xiangyu Hu <[email protected]>
Co-authored-by: Wen-Yang Chu <[email protected]>
Co-authored-by: Xiangyu Hu <xiangyu.hu@tum>
Co-authored-by: Xiangyu Hu <[email protected]>

* Pressure bc (#20)

* SurfacePressureFromSource added

* SurfacePressureFromSource::Update

* BC prob works but the particle normals are missing

* stress relaxation changed to Kirchhof

* time dependent surface pressure works

* cube case moved to source tests

* cube test removed

* add overtime to position based tests

* go back to last working state

* back to working version

Co-authored-by: Ubuntu <virtonomy@SPHbence.qg4qjrxycqxetcothedhm1ylih.ax.internal.cloudapp.net>

* simulation class remvoed (#21)

* fix numerical damping (#23)

* Simbody lib seperate (#26)

* remove submodules

* simbody added on no lapack

* simbody

* cases user moved

* scripts removed

* simbody set to master

* variables removed

* 3d lib cmake

* boost option

* simbody linking to built libraries

* renaming + 2D cmake

* option subdir

* werror

* eigen in simbody

* eigen added

* eigen

* eigen include

* eigen

* add wasmtbb

* working wasm example

* cmake changes

* restore working wasm build

* change memory pool for wasm

* work on eigen

Co-authored-by: wen-yang chu <[email protected]>

* update simbody

* Replace clapack (#27)

* work on eigen

* all tests pass with Eigen

* macro renamed simbody

* all SPH tests pass for static build

* remove wasm files

* first setup of spring on surface normal direction (#22)

* first setup of spring on surface normal direction

* adjusted combi of spring and pressure BC

* correction of damping coefficient

* simulation runs
but too small time steps, only one vtu-file

* consideration normal portion in opposite direction

* creation of tests for vector calculations

* simplification of vector norm calculation

* small vector test working, but failing

* small vector tests passing

* angle tests added

* correction of Vector Projection
more test examples

* correction of normal spring
beam still spinning

* adding of functions for vector calculations

* change of spring force in right direction

* debugging, still spinning after timestep 18

* change of vector calculation example

* correction of normal spring force

* for-loop removed, checking of spring & damping

* area moved and considered in damping

* adding gtest to CMakeLists

* simplified dot_product_2 calculation

* change from Vecd to Vec3d for calculations

* changed Vector declaration and functions

* correction of Spring and Damping

Co-authored-by: JohnVirtonomy.io <[email protected]>

* change pressure BC to be define by body part

* SpringNormalOnSurfaceParticles with body part

* option to use inner or outer surface for spring

* zero position of particles fixed

* emscripten option to disable gtest (#28)

* emscripten option to disable gtest

* comment out compiling flags

* bug fix

Co-authored-by: wen-yang chu <[email protected]>

* find simbody

* remove BUILD_WITH_SIMBODY from findsimbody

* bernoulli beam added

* bernoulli test case, no displacement

* bernoulli beam works with gravity
bug with pressure

* fix comments

* add comment

* remove folder

Co-authored-by: Ubuntu <virtonomy@SPHsimulation2.qg4qjrxycqxetcothedhm1ylih.ax.internal.cloudapp.net>
Co-authored-by: JohnVirtonomy <[email protected]>
Co-authored-by: Xiangyu Hu <[email protected]>
Co-authored-by: Wen-Yang Chu <[email protected]>
Co-authored-by: Xiangyu Hu <xiangyu.hu@tum>
Co-authored-by: Xiangyu Hu <[email protected]>
Co-authored-by: Ubuntu <virtonomy@SPHbence.qg4qjrxycqxetcothedhm1ylih.ax.internal.cloudapp.net>
Co-authored-by: JohnVirtonomy <[email protected]>
Co-authored-by: JohnVirtonomy.io <[email protected]>
  • Loading branch information
10 people authored Sep 19, 2021
1 parent a524265 commit 0191fd8
Show file tree
Hide file tree
Showing 83 changed files with 1,342 additions and 92,919 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -1037,4 +1037,8 @@ _deps
modules.order
Module.symvers
Mkfile.old
dkms.conf
dkms.conf

# wasm build
build_wasm_release
build_wasm_debug
18 changes: 9 additions & 9 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[submodule "oneTBB"]
path = oneTBB
url = https://github.com/BenceVirtonomy/oneTBB
[submodule "SPHINXsys/src/shared/clapack_for_SPHinXsys"]
path = SPHINXsys/src/shared/clapack_for_SPHinXsys
url = https://github.com/BenceVirtonomy/clapack_for_SPHinXsys
[submodule "SPHINXsys/src/shared/simbody"]
path = SPHINXsys/src/shared/simbody
url = https://github.com/BenceVirtonomy/simbody
[submodule "3rd_party/simbody"]
path = 3rd_party/simbody
url = https://github.com/BenceVirtonomy/simbody.git
[submodule "3rd_party/eigen"]
path = 3rd_party/eigen
url = https://gitlab.com/libeigen/eigen.git
[submodule "3rd_party/wasmtbb"]
path = 3rd_party/wasmtbb
url = https://github.com/hpcwasm/wasmtbb.git
1 change: 1 addition & 0 deletions 3rd_party/eigen
Submodule eigen added at 314739
1 change: 1 addition & 0 deletions 3rd_party/simbody
Submodule simbody added at 7ef1b3
1 change: 1 addition & 0 deletions 3rd_party/wasmtbb
Submodule wasmtbb added at 6e5db4
71 changes: 57 additions & 14 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,43 @@ set(SPHINXSYS_PROJECT_DIR ${PROJECT_SOURCE_DIR})
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${SPHINXSYS_PROJECT_DIR}/cmake)

###### Change settings in this file if you want to build with Simbody and/or oneTBB source code ######
option(STATIC_BUILD "STATIC_BUILD" 0)
option(ONLY_3D "ONLY_3D" 0)
include(Dependency_free_settings)
option(BUILD_WITH_SIMBODY "BUILD_WITH_SIMBODY" 0)
option(EMSCRIPTEN "EMSCRIPTEN" 0)
option(BUILD_TESTS "BUILD_TESTS" 1)

if(EMSCRIPTEN)
set(STATIC_BUILD 1)
set(BUILD_WITH_SIMBODY 1)
set(ONLY_3D 1)
set(BUILD_TESTS 1)
add_definitions(-D__SIMBODY_WITHOUT_LAPACK__)
add_definitions(-D__EIGEN__)
add_definitions(-D__EMSCRIPTEN__)

remove_definitions(-DTBB_2021_2_0)
set(TBB_ROOT ${SPHINXSYS_PROJECT_DIR}/3rd_party/wasmtbb)
include_directories("${TBB_ROOT}/include")
set(OBJDIR "${TBB_ROOT}/build/linux_wasm32_emscripten_emscripten_wasm32_release")
file(GLOB TBB_OBJECTS ${OBJDIR}/*.o)
else()
set(BOOST_AVAILABLE 1)
add_definitions(-DBOOST_AVAILABLE)
endif()

if(BUILD_WITH_SIMBODY)
add_definitions(-D__SIMBODY_WITHOUT_LAPACK__)
add_definitions(-D__EIGEN__)
set(EIGEN_ROOT ${SPHINXSYS_PROJECT_DIR}/3rd_party/eigen)
message("${EIGEN_ROOT}")
include_directories("${EIGEN_ROOT}")
endif()

if(STATIC_BUILD)
set(BUILD_STATIC_LIBRARIES 1) # Simbody
set(BUILD_DYNAMIC_LIBRARIES 0) # Simbody
endif()

if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)
Expand Down Expand Up @@ -39,18 +74,29 @@ if(MSVC)
SET(CMAKE_CL_64 1)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" " /MP")
add_definitions(-D_USE_MATH_DEFINES)
else(MSVC)
elseif(EMSCRIPTEN)
# set(PRE_POST "")
# #set(EM_FLAGS "${PRE_POST} -fPIC -g -O0 --profiling -DUNIX -D__linux__=1 --bind -std=c++11 -s USE_PTHREADS=1 -s DISABLE_EXCEPTION_CATCHING=0")
# set(EM_FLAGS "${PRE_POST} -fPIC -g -O3 -DUNIX -D__linux__=1 --bind -std=c++11 -s USE_PTHREADS=1 -s DISABLE_EXCEPTION_CATCHING=0")
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EM_FLAGS}")
# set(EM_FLAGS " -s INITIAL_MEMORY=536870912 -s ASSERTIONS=1 -s ALLOW_MEMORY_GROWTH=0 -s ERROR_ON_UNDEFINED_SYMBOLS=1")
# set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${EM_FLAGS}")
else()
add_compile_definitions(__linux__=1)
set(CMAKE_CXX_FLAGS "-Wall -Werror -std=c++11 -DUNIX -pthread")
set(CMAKE_CXX_FLAGS "-w -std=c++11 -DUNIX -pthread")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
set(CMAKE_CXX_FLAGS_DEBUG "-g -O0 -ggdb")
IF(${CMAKE_BUILD_TYPE} MATCHES "Debug")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
ELSE(${CMAKE_BUILD_TYPE} MATCHES "Debug")
set(CMAKE_CXX_FLAGS "-fPIC ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE}")
ENDIF(${CMAKE_BUILD_TYPE} MATCHES "Debug")
endif()

if(NOT BUILD_WITH_SIMBODY)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
endif()

endif(MSVC)
add_compile_definitions(TBB_SUPPRESS_DEPRECATED_MESSAGES=1)

message("===========================================")
Expand All @@ -70,23 +116,20 @@ endif()

enable_testing()

if(NOT WASM_BUILD)
include(Common)
include(Import3rdpartylibs)
include(Common)
include(Import3rdpartylibs)

if(BUILD_WITH_SIMBODY)
set(simbody_root "${SPHINXSYS_PROJECT_DIR}/3rd_party/simbody")
add_subdirectory(${simbody_root})
endif()

option(BUILD_TESTS "BUILD_TESTS" 1)
add_subdirectory(SPHINXsys)
if(BUILD_WITH_ONETBB)
add_subdirectory(oneTBB)
endif()

if(BUILD_TESTS)
add_subdirectory(tests)
endif()

add_subdirectory(cases_user)

if(ACTIVATE_CUDA)
add_subdirectory(cases_test_gpu)
endif()
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM ubuntu:20.04

ARG build_with_dependencies_source=0
ARG sph_only_static_build=0
ARG STATIC_BUILD=0

ENV TZ=Europe/Berlin
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
Expand Down Expand Up @@ -31,4 +31,4 @@ RUN cd /usr/src/gtest
cd /home/SPHinXsys

RUN rm -rf build
RUN mkdir build && cd build && cmake .. -DBUILD_WITH_DEPENDENCIES_SOURCE=${build_with_dependencies_source} -DSPH_ONLY_STATIC_BUILD=${sph_only_static_build} && make -j$(nproc)
RUN mkdir build && cd build && cmake .. -DBUILD_WITH_DEPENDENCIES_SOURCE=${build_with_dependencies_source} -DSTATIC_BUILD=${STATIC_BUILD} && make -j$(nproc)
7 changes: 0 additions & 7 deletions SPHINXsys/cmake/Dirsearch_shared.cmake
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
if(BUILD_WITH_SIMBODY)
include(Simbody_header_directories)
endif()
if(BUILD_WITH_ONETBB)
include(oneTBB_header_directory)
endif()

MACRO(HEADER_DIRECTORIES_SHARED return_list)
FILE(GLOB_RECURSE new_list ${PROJECT_SOURCE_DIR}/src/shared/*.h)
Expand All @@ -20,10 +17,6 @@ MACRO(HEADER_DIRECTORIES_SHARED return_list)
SET(dir_list ${dir_list} ${simbody_header_path})
ENDFOREACH()
endif()

if(BUILD_WITH_ONETBB)
SET(dir_list ${dir_list} ${ONETBB_HEADER_DIRECTORY})
endif()

SET(${return_list} ${dir_list})
ENDMACRO()
Expand Down
30 changes: 18 additions & 12 deletions SPHINXsys/cmake/Simbody_header_directories.cmake
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
set(SHP_SOURCE_DIRECTORY_FOR_INCLUDE_PATHS "")
set(SHP_SOURCE_DIRECTORY_FOR_INCLUDE_PATHS "${SPHINXSYS_PROJECT_DIR}") #SPHinXsys
set(simbody_root "${SPHINXSYS_PROJECT_DIR}/3rd_party/simbody")

set(SIMBODY_HEADER_DIRECTORIES
"${SHP_SOURCE_DIRECTORY_FOR_INCLUDE_PATHS}/SPHINXsys/src/shared/simbody/SimTKcommon/BigMatrix/include"
"${SHP_SOURCE_DIRECTORY_FOR_INCLUDE_PATHS}/SPHINXsys/src/shared/simbody/SimTKcommon/Geometry/include"
"${SHP_SOURCE_DIRECTORY_FOR_INCLUDE_PATHS}/SPHINXsys/src/shared/simbody/SimTKcommon/Mechanics/include"
"${SHP_SOURCE_DIRECTORY_FOR_INCLUDE_PATHS}/SPHINXsys/src/shared/simbody/SimTKcommon/Polynomial/include"
"${SHP_SOURCE_DIRECTORY_FOR_INCLUDE_PATHS}/SPHINXsys/src/shared/simbody/SimTKcommon/Random/include"
"${SHP_SOURCE_DIRECTORY_FOR_INCLUDE_PATHS}/SPHINXsys/src/shared/simbody/SimTKcommon/Scalar/include"
"${SHP_SOURCE_DIRECTORY_FOR_INCLUDE_PATHS}/SPHINXsys/src/shared/simbody/SimTKcommon/Simulation/include"
"${SHP_SOURCE_DIRECTORY_FOR_INCLUDE_PATHS}/SPHINXsys/src/shared/simbody/SimTKcommon/SmallMatrix/include"
"${SHP_SOURCE_DIRECTORY_FOR_INCLUDE_PATHS}/SPHINXsys/src/shared/simbody/SimTKmath/Geometry/include"
"${SHP_SOURCE_DIRECTORY_FOR_INCLUDE_PATHS}/SPHINXsys/src/shared/simbody/SimTKmath/Integrators/include"
"${simbody_root}/SimTKcommon/BigMatrix/include"
"${simbody_root}/SimTKcommon/Geometry/include"
"${simbody_root}/SimTKcommon/Mechanics/include"
"${simbody_root}/SimTKcommon/Polynomial/include"
"${simbody_root}/SimTKcommon/Random/include"
"${simbody_root}/SimTKcommon/Scalar/include"
"${simbody_root}/SimTKcommon/Simulation/include"
"${simbody_root}/SimTKcommon/SmallMatrix/include"
"${simbody_root}/SimTKcommon/include"

"${simbody_root}/SimTKmath/Geometry/include"
"${simbody_root}/SimTKmath/Integrators/include"
"${simbody_root}/SimTKmath/include"

"${simbody_root}/Simbody/include"
"${simbody_root}/Simbody/include/simbody/internal"
"${simbody_root}/Simbody/Visualizer/include"
)
5 changes: 0 additions & 5 deletions SPHINXsys/cmake/oneTBB_header_directory.cmake

This file was deleted.

87 changes: 60 additions & 27 deletions SPHINXsys/src/for_2D_build/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ LIST(REMOVE_ITEM usefulsubdirs ${CMAKE_CURRENT_SOURCE_DIR})

##Add all useful subdirectories
FOREACH(subdir_path ${usefulsubdirs})
#message(STATUS ${subdir_path})
ADD_SUBDIRECTORY(${subdir_path})
ENDFOREACH()

Expand Down Expand Up @@ -50,32 +49,66 @@ FOREACH(srcdir_path ${sourcedirs})
list(APPEND SCR_FILES ${DIR_scrs})
ENDFOREACH()

#FOREACH(file1 ${SCR_FILES})
#message(STATUS ${file1})
#ENDFOREACH()

ADD_LIBRARY(sphinxsys_2d SHARED ${SCR_FILES})
ADD_LIBRARY(sphinxsys_static_2d STATIC ${SCR_FILES})

SET_TARGET_PROPERTIES(sphinxsys_static_2d PROPERTIES OUTPUT_NAME "sphinxsys_2d")
#SET_TARGET_PROPERTIES(sphinxsys PROPERTIES VERSION 1.0 SOVERSION 0)

SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)

if(MSVC)
target_link_libraries(sphinxsys_2d ${TBB_LIBRARYS} ${Simbody_LIBRARIES})
else(MSVC)
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
target_link_libraries(sphinxsys_2d ${TBB_LIBRARYS} ${Simbody_LIBRARIES} ${Boost_LIBRARIES} stdc++)
else(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
target_link_libraries(sphinxsys_2d ${TBB_LIBRARYS} ${Simbody_LIBRARIES} stdc++ stdc++fs)
endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
endif(MSVC)

INSTALL(TARGETS sphinxsys_2d sphinxsys_static_2d
RUNTIME DESTINATION 2d_code/bin
LIBRARY DESTINATION 2d_code/lib
ARCHIVE DESTINATION 2d_code/lib)
if(NOT STATIC_BUILD)
### SPHinXsys dynamic lib ###
ADD_LIBRARY(sphinxsys_2d SHARED ${SCR_FILES})

if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
#target_link_libraries(sphinxsys_3d)
else(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
target_link_libraries(sphinxsys_2d stdc++)
else(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
target_link_libraries(sphinxsys_2d stdc++ stdc++fs)
endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")

if(DEFINED BOOST_AVAILABLE) # link Boost if available (not for Windows)
target_link_libraries(sphinxsys_2d ${Boost_LIBRARIES})
endif()
endif(${CMAKE_SYSTEM_NAME} MATCHES "Windows")

if(BUILD_WITH_SIMBODY)
target_link_libraries(sphinxsys_2d SimTKcommon SimTKmath SimTKsimbody ${TBB_LIBRARYS})
else()
target_link_libraries(sphinxsys_2d ${Simbody_LIBRARIES} ${TBB_LIBRARYS})
endif()
### SPHinXsys dynamic lib ###
else()
### SPHinXsys static lib ###
ADD_LIBRARY(sphinxsys_static_2d STATIC ${SCR_FILES})
if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
#target_link_libraries(sphinxsys_3d)
else(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
target_link_libraries(sphinxsys_static_2d stdc++)
else(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
target_link_libraries(sphinxsys_static_2d stdc++ stdc++fs)
endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")

if(DEFINED BOOST_AVAILABLE) # link Boost if available (not for Windows)
target_link_libraries(sphinxsys_static_2d ${Boost_LIBRARIES})
endif()
endif(${CMAKE_SYSTEM_NAME} MATCHES "Windows")

if(BUILD_WITH_SIMBODY)
target_link_libraries(sphinxsys_static_2d SimTKcommon_static SimTKmath_static SimTKsimbody_static ${TBB_LIBRARYS})
else()
target_link_libraries(sphinxsys_static_2d ${Simbody_LIBRARIES} ${TBB_LIBRARYS})
endif()
### SPHinXsys static lib ###
endif()

if(NOT STATIC_BUILD)
INSTALL(TARGETS sphinxsys_2d
RUNTIME DESTINATION 2d_code/bin
LIBRARY DESTINATION 2d_code/lib
ARCHIVE DESTINATION 2d_code/lib)
else()
INSTALL(TARGETS sphinxsys_static_2d
RUNTIME DESTINATION 2d_code/bin
LIBRARY DESTINATION 2d_code/lib
ARCHIVE DESTINATION 2d_code/lib)
endif()

FILE(GLOB_RECURSE hpp_headers ${PROJECT_SOURCE_DIR}/src/shared/*.hpp ${PROJECT_SOURCE_DIR}/src/for_2D_build/*.hpp)
INSTALL(FILES ${hpp_headers} DESTINATION 2d_code/include)
Loading

0 comments on commit 0191fd8

Please sign in to comment.