Skip to content
Snippets Groups Projects
Commit 0440d3e6 authored by Boman Romain's avatar Boman Romain
Browse files

port to python 3.10, vs2022, oneapi

parent 5427984a
No related branches found
No related tags found
No related merge requests found
Pipeline #18773 passed
PROJECT(FEM CXX)
CMAKE_MINIMUM_REQUIRED(VERSION 3.14) CMAKE_MINIMUM_REQUIRED(VERSION 3.14)
PROJECT(FEM CXX)
OPTION(FEM_USE_MKL "Use Pardiso linear solver from MKL" ON) OPTION(FEM_USE_MKL "Use Pardiso linear solver from MKL" ON)
......
...@@ -11,7 +11,12 @@ Medium::Medium(Problem &pbl, std::string const &groupname, ...@@ -11,7 +11,12 @@ Medium::Medium(Problem &pbl, std::string const &groupname,
if (pbl.entities.empty()) // is the problem already sync'ed? if (pbl.entities.empty()) // is the problem already sync'ed?
pbl.sync(); pbl.sync();
group = pbl.groups_by_name.at(groupname); group = pbl.groups_by_name.at(groupname);
// (windows) if "fossils" fails here, check that gmsh.dll is not in both bin and lib
// folders of the gmsh folder (otherwise, both are loaded simultaneously,
// one from python, the other from c++! => 2 gmsh DBs are in use!)
// => move (do not copy) the dll from lib to bin
pbl.media.push_back(this); pbl.media.push_back(this);
// construct 2D-plane-stress Hooke matrix // construct 2D-plane-stress Hooke matrix
......
...@@ -5,10 +5,8 @@ ...@@ -5,10 +5,8 @@
set COMPILERPATH="C:\mingw-w64" set COMPILERPATH="C:\mingw-w64"
:: Intel MKL :: Intel MKL
set "INTELPATH=C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.5.281\windows" set "INTELPATH=C:\Program Files (x86)\Intel\oneAPI"
@REM set LIB=%INTELPATH%\mkl\lib\intel64_win;%INTELPATH%\compiler\lib\intel64_win;%LIB% call "%INTELPATH%\mkl\latest\env\vars.bat" intel64 lp64
@REM set INCLUDE=%INTELPATH%\mkl\include;%INCLUDE%
call "%INTELPATH%\mkl\bin\mklvars.bat" intel64 vs2019
:: set the environment of the MinGW compiler :: set the environment of the MinGW compiler
CD /d "%~dp0" CD /d "%~dp0"
......
@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 2019 (x64) on Windows :: Microsoft Visual Studio 2022 (x64) on Windows
set COMPILERPATH="C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build" set COMPILERPATH="C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build"
:: Intel MKL :: Intel MKL
set "INTELPATH=C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.5.281\windows" set "INTELPATH=C:\Program Files (x86)\Intel\oneAPI"
@REM set LIB=%INTELPATH%\mkl\lib\intel64_win;%INTELPATH%\compiler\lib\intel64_win;%LIB% call "%INTELPATH%\mkl\latest\env\vars.bat" intel64 lp64
@REM set INCLUDE=%INTELPATH%\mkl\include;%INCLUDE%
call "%INTELPATH%\mkl\bin\mklvars.bat" intel64 vs2019
:: set the environment of the msvc compiler :: set the environment of the msvc compiler
CD /d "%~dp0" CD /d "%~dp0"
......
...@@ -2,6 +2,13 @@ ...@@ -2,6 +2,13 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fossils: # Fossils:
# main script # main script
#
# note:
# if starting Qt fails with
# qt.qpa.plugin: Could not find the Qt platform plugin "windows" in ""
# this means that an application in the PATH provides another version of Qt
# which is incompatible (MikTeX)
# => move MikTeX to the bottom of the user PATH.
from PyQt5.QtCore import * from PyQt5.QtCore import *
from PyQt5.QtGui import * from PyQt5.QtGui import *
...@@ -246,6 +253,12 @@ def setup_pythonpath(): ...@@ -246,6 +253,12 @@ def setup_pythonpath():
# 'gmsh-sdk', 'bin')) # gmsh # 'gmsh-sdk', 'bin')) # gmsh
# print(f'sys.path={sys.path}') # print(f'sys.path={sys.path}')
# add_dll_directory for python>3.8 (add all folders)
import platform
if platform.system() == 'Windows' and sys.version_info.minor >= 8:
for v in os.environ['path'].split(';'):
if os.path.exists(v):
os.add_dll_directory(v)
def build_workspace_name(workspace, testname): def build_workspace_name(workspace, testname):
"""create workspace folder and chdir into it """create workspace folder and chdir into it
...@@ -277,8 +290,11 @@ if __name__ == "__main__": ...@@ -277,8 +290,11 @@ 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()
# redirect C++ streams to Python # if the following import fails, check that all the dlls are in the PATH
# (in particular gmsh.dll)
import cxxfem import cxxfem
# redirect C++ streams to Python
redirect = cxxfem.StdOutErr2Py() redirect = cxxfem.StdOutErr2Py()
args = cxxfem.parseargs() args = cxxfem.parseargs()
......
...@@ -8,6 +8,8 @@ import cxxfem as fem ...@@ -8,6 +8,8 @@ import cxxfem as fem
from . import boneload from . import boneload
import os import os
import gmsh import gmsh
if not gmsh.isInitialized():
gmsh.initialize()
import numpy as np import numpy as np
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment