GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Windows Compile Command · lava/matplotlib-cpp@b815a43

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • .gitignore
  • README.md
  • Win
    • CMakeLists.txt
    • README.md
    • WinBuild.cmd
  • examples
    • basic.cpp
    • modern.cpp
  • matplotlibcpp.h
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎.gitignore‎

Copy file name to clipboardExpand all lines: .gitignore
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,6 @@
3030
# Logfiles
3131
*.tlog
3232
*.log
33+
34+
# Build
35+
/examples/build/*
Collapse file

‎README.md‎

Copy file name to clipboardExpand all lines: README.md
+3Lines changed: 3 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -138,3 +138,6 @@ Todo/Issues/Wishlist
138138
be easy to add.
139139

140140
* A lot of copying could be avoided if we generate numpy arrays directly instead of python lists
141+
142+
* If you use Anaconda on Windows, you might need to set PYTHONHOME to Anaconda home directory and QT_QPA_PLATFORM_PLUGIN_PATH to %PYTHONHOME%Library/plugins/platforms. The latter is for especially when you get the error which says 'This application failed to start because it could not find or load the Qt platform plugin "windows"
143+
in "".'
Collapse file

‎Win/CMakeLists.txt‎

Copy file name to clipboard
+21Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
cmake_minimum_required(VERSION 3.1)
2+
project (MatplotlibCPP_Test)
3+
4+
set(CMAKE_CXX_STANDARD 11)
5+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
6+
7+
include_directories(${PYTHONHOME}/include)
8+
link_directories(${PYTHONHOME}/libs)
9+
10+
add_definitions(-DPY_INCLUDE)
11+
12+
# message(STATUS "*** dump start cmake variables ***")
13+
# get_cmake_property(_variableNames VARIABLES)
14+
# foreach(_variableName ${_variableNames})
15+
# message(STATUS "${_variableName}=${${_variableName}}")
16+
# endforeach()
17+
# message(STATUS "*** dump end ***")
18+
19+
add_executable(minimal ${CMAKE_CURRENT_SOURCE_DIR}/../examples/minimal.cpp)
20+
add_executable(basic ${CMAKE_CURRENT_SOURCE_DIR}/../examples/basic.cpp)
21+
add_executable(modern ${CMAKE_CURRENT_SOURCE_DIR}/../examples/modern.cpp)
Collapse file

‎Win/README.md‎

Copy file name to clipboard
+8Lines changed: 8 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
### Configuring and Building Samples
2+
3+
```cmd
4+
> cd Win
5+
> Win\build_win.cmd
6+
```
7+
8+
The `build_win.cmd` will set up temporal ENV variables and build binaries in (matplotlib root)/examples with the Release configuration.
Collapse file

‎Win/WinBuild.cmd‎

Copy file name to clipboard
+46Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
@echo off
2+
@setlocal EnableDelayedExpansion
3+
4+
if NOT DEFINED MSVC_VERSION set MSVC_VERSION=14
5+
if NOT DEFINED CMAKE_CONFIG set CMAKE_CONFIG=Release
6+
if NOT DEFINED PYTHONHOME set PYTHONHOME=C:/Users/%username%/Anaconda3
7+
8+
if "%MSVC_VERSION%"=="14" (
9+
if "%processor_architecture%" == "AMD64" (
10+
set CMAKE_GENERATOR=Visual Studio 14 2015 Win64
11+
) else (
12+
set CMAKE_GENERATOR=Visual Studio 14 2015
13+
)
14+
) else if "%MSVC_VERSION%"=="12" (
15+
if "%processor_architecture%" == "AMD64" (
16+
set CMAKE_GENERATOR=Visual Studio 12 2013 Win64
17+
18+
) else (
19+
set CMAKE_GENERATOR=Visual Studio 12 2013
20+
)
21+
)
22+
23+
set batch_file=!VS%MSVC_VERSION%0COMNTOOLS!..\..\VC\vcvarsall.bat
24+
call "%batch_file%" %processor_architecture%
25+
26+
pushd ..
27+
pushd examples
28+
if NOT EXIST build mkdir build
29+
pushd build
30+
31+
cmake -G"!CMAKE_GENERATOR!" ^
32+
-DPYTHONHOME:STRING=%PYTHONHOME%^
33+
-DCMAKE_BUILD_TYPE:STRING=%CMAKE_CONFIG% ^
34+
../../Win/
35+
cmake --build . --config %CMAKE_CONFIG%
36+
37+
pushd %CMAKE_CONFIG%
38+
if not EXIST platforms mkdir platforms
39+
if EXIST %PYTHONHOME%/Library/plugins/platforms/qwindows.dll ^
40+
cp %PYTHONHOME%/Library/plugins/platforms/qwindows.dll ./platforms/
41+
popd
42+
move ./%CMAKE_CONFIG% ../
43+
popd
44+
popd
45+
popd
46+
@endlocal
Collapse file

‎examples/basic.cpp‎

Copy file name to clipboardExpand all lines: examples/basic.cpp
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#include "../matplotlibcpp.h"
2-
1+
#define _USE_MATH_DEFINES
32
#include <cmath>
3+
#include "../matplotlibcpp.h"
44

55
namespace plt = matplotlibcpp;
66

Collapse file

‎examples/modern.cpp‎

Copy file name to clipboardExpand all lines: examples/modern.cpp
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#include "../matplotlibcpp.h"
2-
1+
#define _USE_MATH_DEFINES
32
#include <cmath>
3+
#include "../matplotlibcpp.h"
44

55
using namespace std;
66
namespace plt = matplotlibcpp;
Collapse file

‎matplotlibcpp.h‎

Copy file name to clipboardExpand all lines: matplotlibcpp.h
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#include <stdexcept>
77
#include <iostream>
88

9-
#if __cplusplus > 199711L
9+
#if __cplusplus > 199711L || _MSC_VER > 1800
1010
#include <functional>
1111
#endif
1212

@@ -583,7 +583,7 @@ namespace matplotlibcpp {
583583
Py_DECREF(res);
584584
}
585585

586-
#if __cplusplus > 199711L
586+
#if __cplusplus > 199711L || _MSC_VER > 1800
587587
// C++11-exclusive content starts here (variadic plot() and initializer list support)
588588

589589
namespace detail {

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.