-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
febio: 3.6 -> 4.7; febio-studio: 1.6.1 -> 2.7 #331864
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
Changes from all commits
ab44c33
f832d1c
64435f5
b680e6f
c0f739e
a600cdf
aa4aae3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
| index 7ad2c68eb2..0e3e978bd9 100644 | ||
| --- a/CMakeLists.txt | ||
| +++ b/CMakeLists.txt | ||
| @@ -449,6 +449,9 @@ | ||
| set_property(TARGET ${FBS_BIN_NAME} PROPERTY AUTOGEN_BUILD_DIR ${CMAKE_BINARY_DIR}/CMakeFiles/AutoGen/FEBioStudio_autogen) | ||
| endif() | ||
|
|
||
| +include(GNUInstallDirs) | ||
| +install(TARGETS ${FBS_BIN_NAME} BUNDLE DESTINATION Applications) | ||
| + | ||
| macro(addLib name) | ||
| add_library(${name} ${HDR_${name}} ${SRC_${name}}) | ||
| set_property(TARGET ${name} PROPERTY AUTOGEN_BUILD_DIR ${CMAKE_BINARY_DIR}/CMakeFiles/AutoGen/${name}_autogen) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,89 @@ | ||
| { | ||
| lib, | ||
| stdenv, | ||
| overrideSDK, | ||
| fetchFromGitHub, | ||
| cmake, | ||
| ninja, | ||
| zlib, | ||
| libGLU, | ||
| qt6Packages, | ||
| febio, | ||
| glew, | ||
| sshSupport ? true, | ||
| openssl, | ||
| libssh, | ||
| tetgenSupport ? true, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. confirmed that this builds with |
||
| tetgen, | ||
| ffmpegSupport ? true, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. confirmed that this builds with |
||
| ffmpeg_7, | ||
| dicomSupport ? false, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. confirmed that this builds with |
||
| dcmtk, | ||
| withModelRepo ? true, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. confirmed that this builds with |
||
| withCadFeatures ? false, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. confirmed that this builds with |
||
| }: | ||
|
|
||
| let | ||
| stdenv' = | ||
| if stdenv.isDarwin then | ||
| overrideSDK stdenv { | ||
| darwinSdkVersion = "11.0"; | ||
| darwinMinVersion = "10.15"; | ||
| } | ||
| else | ||
| stdenv; | ||
| in | ||
|
|
||
| stdenv'.mkDerivation (finalAttrs: { | ||
| pname = "febio-studio"; | ||
| version = "2.7"; | ||
|
|
||
| src = fetchFromGitHub { | ||
| owner = "febiosoftware"; | ||
| repo = "FEBioStudio"; | ||
| rev = "v${finalAttrs.version}"; | ||
| hash = "sha256-ggIzz6bvNjqlI8s31EVnbM0TOspBSc9/myKpWukS3MU="; | ||
| }; | ||
|
|
||
| patches = [ ./cmake-install.patch ]; | ||
|
|
||
| cmakeFlags = | ||
| [ (lib.cmakeFeature "Qt_Root" "${qt6Packages.qtbase}") ] | ||
| ++ lib.optional sshSupport "-DUSE_SSH=On" | ||
| ++ lib.optional tetgenSupport "-DUSE_TETGEN=On" | ||
| ++ lib.optional ffmpegSupport "-DUSE_FFMPEG=On" | ||
| ++ lib.optional dicomSupport "-DUSE_DICOM=On" | ||
| ++ lib.optional withModelRepo "-DMODEL_REPO=On" | ||
| ++ lib.optional withCadFeatures "-DCAD_FEATURES=On"; | ||
|
|
||
| nativeBuildInputs = [ | ||
| cmake | ||
| ninja | ||
| qt6Packages.wrapQtAppsHook | ||
| ]; | ||
|
|
||
| buildInputs = | ||
| [ | ||
| zlib | ||
| libGLU | ||
| glew | ||
| qt6Packages.qtbase | ||
| febio | ||
| ] | ||
| ++ lib.optionals sshSupport [ | ||
| openssl | ||
| libssh | ||
| ] | ||
| ++ lib.optional tetgenSupport tetgen | ||
| ++ lib.optional ffmpegSupport ffmpeg_7 | ||
| ++ lib.optional dicomSupport dcmtk; | ||
|
|
||
| meta = { | ||
| description = "FEBio Suite Solver"; | ||
| mainProgram = "FEBioStudio"; | ||
| license = with lib.licenses; [ mit ]; | ||
| homepage = "https://febio.org/"; | ||
| platforms = lib.platforms.unix; | ||
| maintainers = with lib.maintainers; [ Scriptkiddi ]; | ||
| }; | ||
| }) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
| index c1bc953edf..f6aaf92fb5 100644 | ||
| --- a/CMakeLists.txt | ||
| +++ b/CMakeLists.txt | ||
| @@ -2,6 +2,7 @@ | ||
| set(CMAKE_CXX_STANDARD 14) | ||
| set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
| mark_as_advanced(FORCE CMAKE_INSTALL_PREFIX) | ||
| +include(GNUInstallDirs) | ||
|
|
||
| project(FEBio) | ||
| set(FEBIO_LIBS FEBioFluid FEBioLib FEBioMech FEBioMix FEBioOpt FECore NumCore FEAMR FEBioRVE FEImgLib) | ||
| @@ -51,7 +52,7 @@ | ||
| find_library(TEMP NAMES ${libName}.lib ${ARGV3}.lib ${ARGV4}.lib ${ARGV5}.lib ${ARGV6}.lib | ||
| PATHS ${${libDir}} NO_DEFAULT_PATH) | ||
| else() | ||
| - find_library(TEMP NAMES lib${libName}.a lib${ARGV3}.a lib${ARGV4}.a lib${ARGV5}.a lib${ARGV6}.a | ||
| + find_library(TEMP NAMES lib${libName}.a lib${ARGV3}.a lib${ARGV4}.a lib${ARGV5}.a lib${ARGV6}.a lib${libName}@so@ lib${ARGV3}@so@ lib${ARGV4}@so@ lib${ARGV5}@so@ lib${ARGV6}@so@ | ||
| PATHS ${${libDir}} NO_DEFAULT_PATH) | ||
| endif() | ||
|
|
||
| @@ -154,7 +155,7 @@ | ||
| ##### Find Source Files ##### | ||
|
|
||
| macro(findHdrSrc name) | ||
| - file(GLOB HDR_${name} "${name}/*.h") | ||
| + file(GLOB HDR_${name} "${name}/*.h" "${name}/*.hpp") | ||
| file(GLOB SRC_${name} "${name}/*.cpp") | ||
| endmacro() | ||
|
|
||
| @@ -171,8 +172,9 @@ | ||
|
|
||
| macro(addLib name TYPE) | ||
| string(TOLOWER ${name} lname) | ||
| - add_library(${lname} ${TYPE} ${HDR_${name}} ${SRC_${name}}) | ||
| + add_library(${lname} ${TYPE} ${SRC_${name}}) | ||
| set_property(TARGET ${lname} PROPERTY AUTOGEN_BUILD_DIR ${CMAKE_BINARY_DIR}/CMakeFiles/AutoGen/${name}_autogen) | ||
| + target_sources(${lname} PUBLIC FILE_SET HEADERS TYPE HEADERS FILES ${HDR_${name}}) | ||
|
|
||
| if(NOT WIN32) | ||
| set_property(TARGET ${lname} PROPERTY POSITION_INDEPENDENT_CODE ON) | ||
| @@ -181,6 +183,8 @@ | ||
| if(APPLE) | ||
| target_link_libraries(${lname} PRIVATE "-undefined dynamic_lookup") | ||
| endif() | ||
| + | ||
| + install(TARGETS ${lname} FILE_SET HEADERS) | ||
| endmacro() | ||
|
|
||
| foreach(name IN LISTS FEBIO_LIBS) | ||
| @@ -194,6 +198,7 @@ | ||
| ##### Set up executable compilation ##### | ||
| file(GLOB SOURCES "FEBio/*.cpp") | ||
| add_executable (febio4 ${SOURCES}) | ||
| +install(TARGETS febio4) | ||
|
|
||
| if(WIN32) | ||
| target_compile_options(febio4 PRIVATE /openmp) | ||
| @@ -269,7 +274,6 @@ | ||
| mark_as_advanced(EXTRA_INC) | ||
|
|
||
| ##### Setup includes, defnitions, and linking options ##### | ||
| -include_directories(${PROJECT_SOURCE_DIR}) | ||
|
|
||
| # Link LEVMAR | ||
| if(USE_LEVMAR) | ||
| @@ -438,3 +442,4 @@ | ||
| file(WRITE ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/febio.xml "${filedata}") | ||
| endif() | ||
|
|
||
| +install(FILES ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/febio.xml TYPE BIN) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| { | ||
| lib, | ||
| stdenv, | ||
| overrideSDK, | ||
| fetchFromGitHub, | ||
| fetchpatch2, | ||
| substituteAll, | ||
| cmake, | ||
| ninja, | ||
| zlib, | ||
| darwin, | ||
| mklSupport ? true, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tested with mklSupport off on x86_64-linux; builds. I know it's in the previous version, but this does make febio a mixed free/non-free derivation.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I get the impression that you’re really just meant to use it:
|
||
| mkl, | ||
| }: | ||
|
|
||
| let | ||
| stdenv' = if stdenv.isDarwin then overrideSDK stdenv "11.0" else stdenv; | ||
| in | ||
|
|
||
| stdenv'.mkDerivation (finalAttrs: { | ||
| pname = "FEBio"; | ||
| version = "4.7"; | ||
|
|
||
| src = fetchFromGitHub { | ||
| owner = "febiosoftware"; | ||
| repo = "FEBio"; | ||
| rev = "v${finalAttrs.version}"; | ||
| hash = "sha256-RRdIOyXg4jYW76ABfJdMfVtCYMLYFdvyOI98nHXCof8="; | ||
| }; | ||
|
|
||
| patches = [ | ||
| # Fix library searching and installation | ||
| (substituteAll { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the pointers! #301350 looks interesting. This is just inherited from the previous version of the derivation, though.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, hence "unrelated" -- no expectation for you to take any action. |
||
| src = ./fix-cmake.patch; | ||
| so = stdenv.hostPlatform.extensions.sharedLibrary; | ||
| }) | ||
|
|
||
| # Fixed missing header include for strcpy | ||
| # https://github.com/febiosoftware/FEBio/pull/92 | ||
| (fetchpatch2 { | ||
| url = "https://github.com/febiosoftware/FEBio/commit/ad9e80e2aa8737828855458a703822f578db2fd3.patch?full_index=1"; | ||
| hash = "sha256-/uLnJB/oAwLQnsZtJnUlaAEpyZVLG6o2riRwwMCH8rI="; | ||
| }) | ||
| ]; | ||
|
|
||
| cmakeFlags = lib.optionals mklSupport [ | ||
| (lib.cmakeBool "USE_MKL" true) | ||
| (lib.cmakeFeature "MKLROOT" "${mkl}") | ||
| ]; | ||
|
|
||
| nativeBuildInputs = [ | ||
| cmake | ||
| ninja | ||
| ]; | ||
|
|
||
| buildInputs = | ||
| [ zlib ] | ||
| ++ lib.optionals mklSupport [ mkl ] | ||
| ++ lib.optionals stdenv.isDarwin [ | ||
| darwin.apple_sdk.frameworks.CoreGraphics | ||
| darwin.apple_sdk.frameworks.CoreVideo | ||
| darwin.apple_sdk.frameworks.Accelerate | ||
| ]; | ||
|
|
||
| meta = { | ||
| description = "FEBio Suite Solver"; | ||
| license = with lib.licenses; [ mit ]; | ||
| homepage = "https://febio.org/"; | ||
| platforms = lib.platforms.unix; | ||
| maintainers = with lib.maintainers; [ Scriptkiddi ]; | ||
| }; | ||
| }) | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirmed that this derivation builds with
febio = febio.override { mklSupport = false; }