Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
fossils
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Boman Romain
fossils
Commits
99ed7388
Commit
99ed7388
authored
2 years ago
by
Boman Romain
Browse files
Options
Downloads
Patches
Plain Diff
solve mkl_intel_thread problem
parent
80339e04
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#7103
passed
2 years ago
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
cxxfem/CMakeLists.txt
+10
-2
10 additions, 2 deletions
cxxfem/CMakeLists.txt
cxxfem/src/CMakeLists.txt
+5
-1
5 additions, 1 deletion
cxxfem/src/CMakeLists.txt
envs/win-msvc.cmd
+5
-54
5 additions, 54 deletions
envs/win-msvc.cmd
fossils.py
+6
-10
6 additions, 10 deletions
fossils.py
with
26 additions
and
67 deletions
cxxfem/CMakeLists.txt
+
10
−
2
View file @
99ed7388
...
@@ -59,6 +59,14 @@ IF(FEM_USE_MKL)
...
@@ -59,6 +59,14 @@ IF(FEM_USE_MKL)
MESSAGE
(
STATUS
"MKL_INCLUDE_DIRS=
${
MKL_INCLUDE_DIRS
}
"
)
MESSAGE
(
STATUS
"MKL_INCLUDE_DIRS=
${
MKL_INCLUDE_DIRS
}
"
)
# library (mkl_rt.so) searched using LIBRARY_PATH (Linux/macOS) or LIB (windows)
# library (mkl_rt.so) searched using LIBRARY_PATH (Linux/macOS) or LIB (windows)
FIND_LIBRARY
(
MKL_LIBRARIES mkl_rt PATHS ENV LIBRARY_PATH
)
FIND_LIBRARY
(
MKL_LIBRARIES mkl_rt PATHS ENV LIBRARY_PATH
)
IF
(
MSVC
)
# with MSVC+MKL, we must link to intel OpenMP so that we have only 1 OpenMP lib
FIND_LIBRARY
(
INTEL_OPENMP libiomp5md
)
MESSAGE
(
STATUS
"INTEL_OPENMP=
${
INTEL_OPENMP
}
"
)
IF
(
NOT INTEL_OPENMP
)
MESSAGE
(
FATAL_ERROR
"libiomp5md library not found!"
)
ENDIF
()
ENDIF
()
# IF(MINGW)
# IF(MINGW)
# FIND_LIBRARY(MKL_LIB1 mkl_intel_lp64_dll PATHS ENV LIBRARY_PATH)
# FIND_LIBRARY(MKL_LIB1 mkl_intel_lp64_dll PATHS ENV LIBRARY_PATH)
# FIND_LIBRARY(MKL_LIB2 mkl_intel_thread_dll PATHS ENV LIBRARY_PATH)
# FIND_LIBRARY(MKL_LIB2 mkl_intel_thread_dll PATHS ENV LIBRARY_PATH)
...
@@ -88,9 +96,9 @@ ENDIF()
...
@@ -88,9 +96,9 @@ ENDIF()
# OpenMP --
# OpenMP --
FIND_PACKAGE
(
OpenMP
)
FIND_PACKAGE
(
OpenMP
)
IF
(
OPENMP_FOUND
)
IF
(
OPENMP_FOUND
)
MESSAGE
(
"OpenMP enabled (CXX_FLAGS=
${
OpenMP_CXX_FLAGS
}
)"
)
MESSAGE
(
STATUS
"OpenMP enabled (CXX_FLAGS=
${
OpenMP_CXX_FLAGS
}
)"
)
ELSE
()
ELSE
()
MESSAGE
(
"OpenMP disabled."
)
MESSAGE
(
STATUS
"OpenMP disabled."
)
ENDIF
()
ENDIF
()
# Python --
# Python --
...
...
This diff is collapsed.
Click to expand it.
cxxfem/src/CMakeLists.txt
+
5
−
1
View file @
99ed7388
FILE
(
GLOB SRCS *.cpp
)
FILE
(
GLOB SRCS *.cpp
)
ADD_LIBRARY
(
fem SHARED
${
SRCS
}
)
ADD_LIBRARY
(
fem SHARED
${
SRCS
}
)
TARGET_LINK_LIBRARIES
(
fem PUBLIC
${
GMSH_LIBRARIES
}
)
TARGET_LINK_LIBRARIES
(
fem PUBLIC
${
GMSH_LIBRARIES
}
)
...
@@ -9,4 +8,9 @@ ENDIF()
...
@@ -9,4 +8,9 @@ ENDIF()
IF
(
FEM_USE_MKL
)
IF
(
FEM_USE_MKL
)
TARGET_LINK_LIBRARIES
(
fem PUBLIC
${
MKL_LIBRARIES
}
)
TARGET_LINK_LIBRARIES
(
fem PUBLIC
${
MKL_LIBRARIES
}
)
TARGET_INCLUDE_DIRECTORIES
(
fem PUBLIC
${
MKL_INCLUDE_DIRS
}
)
TARGET_INCLUDE_DIRECTORIES
(
fem PUBLIC
${
MKL_INCLUDE_DIRS
}
)
# with MSVC+MKL, we must link to intel OpenMP so that we have only 1 OpenMP lib
IF
(
MSVC
)
TARGET_LINK_OPTIONS
(
fem PUBLIC -NODEFAULTLIB:
"vcomp"
-NODEFAULTLIB:
"vcompd"
)
TARGET_LINK_LIBRARIES
(
fem PUBLIC
${
INTEL_OPENMP
}
)
ENDIF
()
ENDIF
()
ENDIF
()
\ No newline at end of file
This diff is collapsed.
Click to expand it.
envs/win-msvc.cmd
+
5
−
54
View file @
99ed7388
@echo
off
@echo
off
:: This file opens a terminal which allows you to compile the code with
:: This file opens a terminal which allows you to compile the code with
:: Microsoft Visual Studio 2017 (x64) on Windows
:: Microsoft Visual Studio 2019 (x64) on Windows
::
:: HOW TO USE THIS FILE?
:: [run this file]
:: mkdir build
:: cd build
:: cmake -A x64 ..
:: cmake --build . --config Release
:: [executables are built in the bin/Release folder]
:: ctest -C Release
:: set the location of gmsh SDK / mingw compiler
set
"GMSHSDK=
%~dp0
..\lib\gmsh-sdk"
set
"EIGEN=
%~dp0
..\lib\eigen"
set
COMPILERPATH
=
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build"
set
COMPILERPATH
=
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build"
:: perform some tests...
IF
NOT
EXIST
"
%GMSHSDK%
"
(
ECHO
-
gmsh
-sdk
NOT
found
in
%GMSHSDK%!!
PAUSE
EXIT
/B
)
ELSE
(
ECHO
-
gmsh
-sdk
found
.
)
IF
NOT
EXIST
"
%EIGEN%
"
(
ECHO
-
eigen
NOT
found
in
%EIGEN%!!
PAUSE
EXIT
/B
)
ELSE
(
ECHO
-
eigen
found
.
)
IF
NOT
EXIST
%COMPILERPATH%
(
ECHO
-
compiler
NOT
found
in
%COMPILERPATH%!!
PAUSE
EXIT
/B
)
ELSE
(
ECHO
-
compiler
found
.
)
:: Intel MKL
:: Intel MKL
set
"INTELPATH=C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.5.281\windows"
set
"INTELPATH=C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.5.281\windows"
set
LIB
=
%INTELPATH%
\mkl\lib\intel64_win
;
%INTELPATH%
\compiler\lib\intel64_win
;
%LIB%
@REM set LIB=%INTELPATH%\mkl\lib\intel64_win;%INTELPATH%\compiler\lib\intel64_win;%LIB%
set
INCLUDE
=
%INTELPATH%
\mkl\include
;
%INCLUDE%
@REM set INCLUDE=%INTELPATH%\mkl\include;%INCLUDE%
:: does not always work
call
"
%INTELPATH%
\mkl\bin\mklvars.bat"
intel64
vs2019
@REM call %INTELPATH%\mkl\bin\mklvars.bat intel64 vs2019
:: where is gmsh.exe and gmsh-**.dll ?
set
PATH
=
%GMSHSDK%
\bin
;
%GMSHSDK%
\lib
;
%PATH%
:: where is gmsh.h ?
set
INCLUDE
=
%EIGEN%
;
%GMSHSDK%
\include
;
%INCLUDE%
:: where is gmsh.lib ?
set
LIB
=
%GMSHSDK%
\lib
;
%LIB%
:: where is gmsh.py ? (required only if you want to use the python API)
set
PYTHONPATH
=
%GMSHSDK%
\lib
;
%PYTHONPATH%
:: set the environment of the msvc compiler
:: set the environment of the msvc compiler
CD
/d
"
%~dp0
"
CD
/d
"
%~dp0
"
CD
..
CD
..
:: problem with mkl_rt (mkl_intel_thread cannot be loaded)
%comspec%
/k
"
%COMPILERPATH%
\vcvars64.bat"
:: %comspec% /k "%COMPILERPATH%\vcvars64.bat"
%comspec%
/k
This diff is collapsed.
Click to expand it.
fossils.py
+
6
−
10
View file @
99ed7388
...
@@ -176,12 +176,12 @@ def setup_pythonpath():
...
@@ -176,12 +176,12 @@ def setup_pythonpath():
'
build
'
,
'
bin
'
,
'
Release
'
))
# msvc
'
build
'
,
'
bin
'
,
'
Release
'
))
# msvc
# allows this script to be run without setting env
# allows this script to be run without setting env
rm_folder_from_path
(
'
gmsh
'
)
#
rm_folder_from_path('gmsh')
rm_folder_from_pypath
(
'
gmsh
'
)
#
rm_folder_from_pypath('gmsh')
add_folder2pypath
(
os
.
path
.
join
(
this_script_dir
,
'
lib
'
,
#
add_folder2pypath(os.path.join(this_script_dir, 'lib',
'
gmsh-sdk
'
,
'
lib
'
))
# msvc
#
'gmsh-sdk', 'lib')) # msvc
add_folder2path
(
os
.
path
.
join
(
this_script_dir
,
'
lib
'
,
#
add_folder2path(os.path.join(this_script_dir, 'lib',
'
gmsh-sdk
'
,
'
bin
'
))
# gmsh
#
'gmsh-sdk', 'bin')) # gmsh
# print(f'sys.path={sys.path}')
# print(f'sys.path={sys.path}')
...
@@ -217,10 +217,6 @@ if __name__ == "__main__":
...
@@ -217,10 +217,6 @@ if __name__ == "__main__":
# add main program folder and binaries dir to the PYTHONPATH
# add main program folder and binaries dir to the PYTHONPATH
setup_pythonpath
()
setup_pythonpath
()
# preload some modules (vtk before gmsh)
import
vtk
import
gmsh
# redirect C++ streams to Python
# redirect C++ streams to Python
import
cxxfem
import
cxxfem
redirect
=
cxxfem
.
StdOutErr2Py
()
redirect
=
cxxfem
.
StdOutErr2Py
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment