Skip to content

Commit

Permalink
update windows installation (#1763)
Browse files Browse the repository at this point in the history
Co-authored-by: Daniel Weindl <[email protected]>
  • Loading branch information
paulflang and dweindl authored Apr 6, 2022
1 parent e4aaa0d commit 6669cfa
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
22 changes: 9 additions & 13 deletions documentation/python_installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -192,29 +192,29 @@ To build OpenBLAS, download the following scripts from the AMICI repository:
The first script needs to be called in Powershell, and it needs to call
``compileBLAS.cmd``, so you will need to modify line 11:
C: \\Users\\travis\\build\\AMICI\\scripts\\compileBLAS.cmd
cmd /c "scripts\compileBLAS.cmd $version"
so that it matches your directory structure.
This will download OpenBLAS and compile it, creating
C:\\BLAS\lib\\openblas.lib
C:\\BLAS\\lib\\openblas.lib
C:\\BLAS\\bin\\openblas.dll
You will also need to define two environment variables:
.. code-block:: text
BLAS_LIBS="/LIBPATH:C:\BLAS\lib openblas.lib"
BLAS_CFLAGS="/IC:/BLAS/OpenBLAS-0.3.12/OpenBLAS-0.3.12"
BLAS_CFLAGS="/IC:/BLAS/OpenBLAS-0.3.19/OpenBLAS-0.3.19"
One way to do that is to run a PowerShell script with the following commands:
.. code-block:: text
[System.Environment]::SetEnvironmentVariable("BLAS_LIBS", "/LIBPATH:C:/BLAS/lib openblas.lib", [System.EnvironmentVariableTarget]::User)
[System.Environment]::SetEnvironmentVariable("BLAS_LIBS", "/LIBPATH:C:/BLAS/lib openblas.lib", [System.EnvironmentVariableTarget]::Process)
[System.Environment]::SetEnvironmentVariable("BLAS_CFLAGS", "-IC:/BLAS/OpenBLAS-0.3.12/OpenBLAS-0.3.12", [System.EnvironmentVariableTarget]::User)
[System.Environment]::SetEnvironmentVariable("BLAS_CFLAGS", "-IC:/BLAS/OpenBLAS-0.3.12/OpenBLAS-0.3.12", [System.EnvironmentVariableTarget]::Process)
[System.Environment]::SetEnvironmentVariable("BLAS_CFLAGS", "-IC:/BLAS/OpenBLAS-0.3.19/OpenBLAS-0.3.19", [System.EnvironmentVariableTarget]::User)
[System.Environment]::SetEnvironmentVariable("BLAS_CFLAGS", "-IC:/BLAS/OpenBLAS-0.3.19/OpenBLAS-0.3.19", [System.EnvironmentVariableTarget]::Process)
The call ending in ``Process`` sets the environment variable in the current
process, and it is no longer in effect in the next process. The call ending in
Expand All @@ -235,14 +235,6 @@ following error upon ``import amici``:
ImportError: DLL load failed: The specified module could not be found.
This can be tested using the "where" command. For example
where openblas.dll
should return
C:\\BLAS\\bin\\openblas.dll
Almost all of the DLLs are standard Windows DLLs and should be included in
either Windows or Visual Studio. But, in case it is necessary to test this,
here is a list of some DLLs required by AMICI (when compiled with MSVC):
Expand Down Expand Up @@ -279,6 +271,10 @@ by MSVC (see Visual Studio above). ``KERNEL32.dll`` is part of Windows and in
or via the environment variable ``AMICI_DLL_DIRS``.
If Python returns the following error upon ``import amici``, try updating to the latest Python version.
OSError: [WinError 87] The parameter is incorrect: ''
Further topics
++++++++++++++
Expand Down
2 changes: 1 addition & 1 deletion scripts/compileBLAS.cmd
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
echo compileBLAS.cmd started for openBLAS version %1
cd /D "C:\BLAS\OpenBLAS-%1\OpenBLAS-%1"
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvars64.bat"
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvars64.bat"
cmake -G "Ninja" ^
-DBUILD_DOUBLE=1 ^
-DBUILD_SHARED_LIBS=ON ^
Expand Down

0 comments on commit 6669cfa

Please sign in to comment.