febio: fix build

This commit is contained in:
Weijia Wang 2023-04-29 00:10:19 +03:00
parent 0b863fe2df
commit 23b63e1fef
2 changed files with 9 additions and 3 deletions

View file

@ -1,5 +1,6 @@
{ lib, stdenv, fetchFromGitHub, cmake, boost, eigen, libxml2, mpi, python3
, mklSupport ? true, mkl
, substituteAll
}:
stdenv.mkDerivation rec {
@ -14,13 +15,18 @@ stdenv.mkDerivation rec {
};
patches = [
./fix-cmake.patch # cannot find mkl libraries without this
(substituteAll {
src = ./fix-cmake.patch; # cannot find mkl libraries without this
so = stdenv.hostPlatform.extensions.sharedLibrary;
})
];
cmakeFlags = lib.optional mklSupport "-DUSE_MKL=On"
++ lib.optional mklSupport "-DMKLROOT=${mkl}"
;
env.CXXFLAGS = lib.optionalString stdenv.isLinux "-include cstring";
installPhase = ''
runHook preInstall

View file

@ -5,7 +5,7 @@
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
+ 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()
@ -19,7 +19,7 @@ index 2d644005f..7261ba923 100644
find_library(MKL_OMP_LIB
- NAMES iomp5 iomp5md libiomp5md.lib
- PATHS ${MKLROOT}/../lib ${MKLROOT}/../compiler/lib
+ NAMES libiomp5.so libiomp5 iomp5 iomp5md libiomp5md.lib
+ NAMES libiomp5@so@ libiomp5 iomp5 iomp5md libiomp5md.lib
+ PATHS ${MKLROOT}/lib ${MKLROOT}/../lib ${MKLROOT}/../compiler/lib
PATH_SUFFIXES "intel64" "intel32"
NO_DEFAULT_PATH