KarthikRIyer / swiftplot

Swift library for Data Visualization :bar_chart:
Apache License 2.0
401 stars 39 forks source link

Fails to install on swift-jupyter #77

Closed WilliamHYZhang closed 4 years ago

WilliamHYZhang commented 4 years ago

Using the latest release of swift-jupyter, installing SwiftPlot seems to fail with a file not found error for gpc.h.

Input:

%install-swiftpm-flags -Xcc -isystem/usr/include/freetype2 -Xswiftc -lfreetype
%install '.package(url: "https://github.com/IBM-Swift/BlueCryptor.git", from: "1.0.28")' Cryptor
%install '.package(url: "https://github.com/KarthikRIyer/swiftplot", .branch("master"))' SwiftPlot AGGRenderer

Output:

Installing packages:
    .package(url: "https://github.com/IBM-Swift/BlueCryptor.git", from: "1.0.28")
        Cryptor
    .package(url: "https://github.com/KarthikRIyer/swiftplot", .branch("master"))
        SwiftPlot
        AGGRenderer
With SwiftPM flags: ['-Xcc', '-isystem/usr/include/freetype2', '-Xswiftc', '-lfreetype']
Working in: /tmp/tmpmbt5fxt1/swift-install
Fetching https://github.com/KarthikRIyer/swiftplot
Fetching https://github.com/IBM-Swift/BlueCryptor.git
Fetching https://github.com/IBM-Swift/OpenSSL.git
Cloning https://github.com/IBM-Swift/BlueCryptor.git
Resolving https://github.com/IBM-Swift/BlueCryptor.git at 1.0.32
Cloning https://github.com/IBM-Swift/OpenSSL.git
Resolving https://github.com/IBM-Swift/OpenSSL.git at 2.2.2
Cloning https://github.com/KarthikRIyer/swiftplot
Resolving https://github.com/KarthikRIyer/swiftplot at master
<module-includes>:1:1: warning: umbrella header for module 'CPPAGGRenderer' does not include header 'pixel_formats.h' [-Wincomplete-umbrella]
#include "/tmp/tmpmbt5fxt1/swift-install/package/.build/checkouts/swiftplot/Sources/AGGRenderer/CPPAGGRenderer/include/CPPAGGRenderer.h"
^
<module-includes>:1:1: warning: umbrella header for module 'CPPAGGRenderer' does not include header 'savebmp.h' [-Wincomplete-umbrella]
In file included from /tmp/tmpmbt5fxt1/swift-install/package/.build/checkouts/swiftplot/Sources/AGG/ctrl/agg_scale_ctrl.cpp:20:
In file included from /tmp/tmpmbt5fxt1/swift-install/package/.build/checkouts/swiftplot/Sources/AGG/include/ctrl/agg_scale_ctrl.h:23:
/tmp/tmpmbt5fxt1/swift-install/package/.build/checkouts/swiftplot/Sources/AGG/include/agg_basics.h:206:13: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
            register unsigned q = a * b + (1 << (Shift-1));
            ^~~~~~~~~
In file included from /tmp/tmpmbt5fxt1/swift-install/package/.build/checkouts/swiftplot/Sources/AGG/ctrl/agg_slider_ctrl.cpp:22:
In file included from /tmp/tmpmbt5fxt1/swift-install/package/.build/checkouts/swiftplot/Sources/AGG/include/ctrl/agg_slider_ctrl.h:23:
/tmp/tmpmbt5fxt1/swift-install/package/.build/checkouts/swiftplot/Sources/AGG/include/agg_basics.h:206:13: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
            register unsigned q = a * b + (1 << (Shift-1));
            ^~~~~~~~~
In file included from /tmp/tmpmbt5fxt1/swift-install/package/.build/checkouts/swiftplot/Sources/AGG/ctrl/agg_scale_ctrl.cpp:20:
In file included from /tmp/tmpmbt5fxt1/swift-install/package/.build/checkouts/swiftplot/Sources/AGG/include/ctrl/agg_scale_ctrl.h:26:
/tmp/tmpmbt5fxt1/swift-install/package/.build/checkouts/swiftplot/Sources/AGG/include/agg_trans_affine.h:295:9: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
        register double tmp = *x;
        ^~~~~~~~~
/tmp/tmpmbt5fxt1/swift-install/package/.build/checkouts/swiftplot/Sources/AGG/include/agg_trans_affine.h:303:9: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
        register double tmp = *x;
        ^~~~~~~~~
/tmp/tmpmbt5fxt1/swift-install/package/.build/checkouts/swiftplot/Sources/AGG/include/agg_trans_affine.h:311:9: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
        register double d = determinant_reciprocal();
        ^~~~~~~~~
/tmp/tmpmbt5fxt1/swift-install/package/.build/checkouts/swiftplot/Sources/AGG/include/agg_trans_affine.h:312:9: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
        register double a = (*x - tx) * d;
        ^~~~~~~~~
/tmp/tmpmbt5fxt1/swift-install/package/.build/checkouts/swiftplot/Sources/AGG/include/agg_trans_affine.h:313:9: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
        register double b = (*y - ty) * d;
        ^~~~~~~~~
In file included from /tmp/tmpmbt5fxt1/swift-install/package/.build/checkouts/swiftplot/Sources/AGG/ctrl/agg_slider_ctrl.cpp:22:
In file included from /tmp/tmpmbt5fxt1/swift-install/package/.build/checkouts/swiftplot/Sources/AGG/include/ctrl/agg_slider_ctrl.h:26:
/tmp/tmpmbt5fxt1/swift-install/package/.build/checkouts/swiftplot/Sources/AGG/include/agg_trans_affine.h:295:9: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
        register double tmp = *x;
        ^~~~~~~~~
/tmp/tmpmbt5fxt1/swift-install/package/.build/checkouts/swiftplot/Sources/AGG/include/agg_trans_affine.h:303:9: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
        register double tmp = *x;
        ^~~~~~~~~
/tmp/tmpmbt5fxt1/swift-install/package/.build/checkouts/swiftplot/Sources/AGG/include/agg_trans_affine.h:311:9: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
        register double d = determinant_reciprocal();
        ^~~~~~~~~
/tmp/tmpmbt5fxt1/swift-install/package/.build/checkouts/swiftplot/Sources/AGG/include/agg_trans_affine.h:312:9: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
        register double a = (*x - tx) * d;
        ^~~~~~~~~
/tmp/tmpmbt5fxt1/swift-install/package/.build/checkouts/swiftplot/Sources/AGG/include/agg_trans_affine.h:313:9: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
        register double b = (*y - ty) * d;
        ^~~~~~~~~
In file included from /tmp/tmpmbt5fxt1/swift-install/package/.build/checkouts/swiftplot/Sources/AGG/ctrl/agg_spline_ctrl.cpp:20:
In file included from /tmp/tmpmbt5fxt1/swift-install/package/.build/checkouts/swiftplot/Sources/AGG/include/ctrl/agg_spline_ctrl.h:23:
/tmp/tmpmbt5fxt1/swift-install/package/.build/checkouts/swiftplot/Sources/AGG/include/agg_basics.h:206:13: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
            register unsigned q = a * b + (1 << (Shift-1));
            ^~~~~~~~~
/tmp/tmpmbt5fxt1/swift-install/package/.build/checkouts/swiftplot/Sources/AGG/ctrl/agg_scale_ctrl.cpp:366:16: warning: enumeration value 'move_nothing' not handled in switch [-Wswitch]
        switch(m_move_what)
               ^
/tmp/tmpmbt5fxt1/swift-install/package/.build/checkouts/swiftplot/Sources/AGG/ctrl/agg_scale_ctrl.cpp:366:16: note: add missing switch cases
        switch(m_move_what)
               ^
In file included from /tmp/tmpmbt5fxt1/swift-install/package/.build/checkouts/swiftplot/Sources/AGG/ctrl/agg_spline_ctrl.cpp:20:
In file included from /tmp/tmpmbt5fxt1/swift-install/package/.build/checkouts/swiftplot/Sources/AGG/include/ctrl/agg_spline_ctrl.h:27:
In file included from /tmp/tmpmbt5fxt1/swift-install/package/.build/checkouts/swiftplot/Sources/AGG/include/agg_path_storage.h:23:
In file included from /tmp/tmpmbt5fxt1/swift-install/package/.build/checkouts/swiftplot/Sources/AGG/include/agg_bezier_arc.h:24:
In file included from /tmp/tmpmbt5fxt1/swift-install/package/.build/checkouts/swiftplot/Sources/AGG/include/agg_conv_transform.h:23:
/tmp/tmpmbt5fxt1/swift-install/package/.build/checkouts/swiftplot/Sources/AGG/include/agg_trans_affine.h:295:9: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
        register double tmp = *x;
        ^~~~~~~~~
/tmp/tmpmbt5fxt1/swift-install/package/.build/checkouts/swiftplot/Sources/AGG/include/agg_trans_affine.h:303:9: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
        register double tmp = *x;
        ^~~~~~~~~
/tmp/tmpmbt5fxt1/swift-install/package/.build/checkouts/swiftplot/Sources/AGG/include/agg_trans_affine.h:311:9: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
        register double d = determinant_reciprocal();
        ^~~~~~~~~

/tmp/tmpmbt5fxt1/swift-install/package/.build/checkouts/swiftplot/Sources/AGG/include/agg_trans_affine.h:312:9: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
        register double a = (*x - tx) * d;
        ^~~~~~~~~
/tmp/tmpmbt5fxt1/swift-install/package/.build/checkouts/swiftplot/Sources/AGG/include/agg_trans_affine.h:313:9: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
        register double b = (*y - ty) * d;
        ^~~~~~~~~
7 warnings generated.
[1/43] Compiling agg_scale_ctrl.cpp
6 warnings generated.
2 warnings generated.
6 warnings generated.
While building module 'AGG' imported from /tmp/tmpmbt5fxt1/swift-install/package/.build/checkouts/swiftplot/Sources/AGGRenderer/CPPAGGRenderer/CPPAGGRenderer.cpp:6:
In file included from <module-includes>:1:
In file included from /tmp/tmpmbt5fxt1/swift-install/package/.build/checkouts/swiftplot/Sources/AGG/include/agg_math.h:23:
/tmp/tmpmbt5fxt1/swift-install/package/.build/checkouts/swiftplot/Sources/AGG/include/agg_basics.h:206:13: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
            register unsigned q = a * b + (1 << (Shift-1));
            ^~~~~~~~~
While building module 'AGG' imported from /tmp/tmpmbt5fxt1/swift-install/package/.build/checkouts/swiftplot/Sources/AGGRenderer/CPPAGGRenderer/CPPAGGRenderer.cpp:6:
In file included from <module-includes>:5:
In file included from /tmp/tmpmbt5fxt1/swift-install/package/.build/checkouts/swiftplot/Sources/AGG/include/agg_conv_marker.h:23:
/tmp/tmpmbt5fxt1/swift-install/package/.build/checkouts/swiftplot/Sources/AGG/include/agg_trans_affine.h:295:9: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
        register double tmp = *x;
        ^~~~~~~~~
/tmp/tmpmbt5fxt1/swift-install/package/.build/checkouts/swiftplot/Sources/AGG/include/agg_trans_affine.h:303:9: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
        register double tmp = *x;
        ^~~~~~~~~
/tmp/tmpmbt5fxt1/swift-install/package/.build/checkouts/swiftplot/Sources/AGG/include/agg_trans_affine.h:311:9: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
        register double d = determinant_reciprocal();
        ^~~~~~~~~
/tmp/tmpmbt5fxt1/swift-install/package/.build/checkouts/swiftplot/Sources/AGG/include/agg_trans_affine.h:312:9: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
        register double a = (*x - tx) * d;
        ^~~~~~~~~
/tmp/tmpmbt5fxt1/swift-install/package/.build/checkouts/swiftplot/Sources/AGG/include/agg_trans_affine.h:313:9: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
        register double b = (*y - ty) * d;
        ^~~~~~~~~
While building module 'AGG' imported from /tmp/tmpmbt5fxt1/swift-install/package/.build/checkouts/swiftplot/Sources/AGGRenderer/CPPAGGRenderer/CPPAGGRenderer.cpp:6:
In file included from <module-includes>:18:
/tmp/tmpmbt5fxt1/swift-install/package/.build/checkouts/swiftplot/Sources/AGG/include/agg_renderer_markers.h:555:20: warning: enumeration value 'end_of_markers' not handled in switch [-Wswitch]
            switch(type)
                   ^
/tmp/tmpmbt5fxt1/swift-install/package/.build/checkouts/swiftplot/Sources/AGG/include/agg_renderer_markers.h:555:20: note: add missing switch cases
            switch(type)
                   ^
/tmp/tmpmbt5fxt1/swift-install/package/.build/checkouts/swiftplot/Sources/AGG/include/agg_renderer_markers.h:596:20: warning: enumeration value 'end_of_markers' not handled in switch [-Wswitch]
            switch(type)
                   ^
/tmp/tmpmbt5fxt1/swift-install/package/.build/checkouts/swiftplot/Sources/AGG/include/agg_renderer_markers.h:596:20: note: add missing switch cases
            switch(type)
                   ^
/tmp/tmpmbt5fxt1/swift-install/package/.build/checkouts/swiftplot/Sources/AGG/include/agg_renderer_markers.h:624:20: warning: enumeration value 'end_of_markers' not handled in switch [-Wswitch]
            switch(type)
                   ^
/tmp/tmpmbt5fxt1/swift-install/package/.build/checkouts/swiftplot/Sources/AGG/include/agg_renderer_markers.h:624:20: note: add missing switch cases
            switch(type)
                   ^
/tmp/tmpmbt5fxt1/swift-install/package/.build/checkouts/swiftplot/Sources/AGG/include/agg_renderer_markers.h:652:20: warning: enumeration value 'end_of_markers' not handled in switch [-Wswitch]
            switch(type)
                   ^
/tmp/tmpmbt5fxt1/swift-install/package/.build/checkouts/swiftplot/Sources/AGG/include/agg_renderer_markers.h:652:20: note: add missing switch cases
            switch(type)
                   ^
/tmp/tmpmbt5fxt1/swift-install/package/.build/checkouts/swiftplot/Sources/AGG/include/agg_renderer_markers.h:680:20: warning: enumeration value 'end_of_markers' not handled in switch [-Wswitch]
            switch(type)
                   ^
/tmp/tmpmbt5fxt1/swift-install/package/.build/checkouts/swiftplot/Sources/AGG/include/agg_renderer_markers.h:680:20: note: add missing switch cases
            switch(type)
                   ^
While building module 'AGG' imported from /tmp/tmpmbt5fxt1/swift-install/package/.build/checkouts/swiftplot/Sources/AGGRenderer/CPPAGGRenderer/CPPAGGRenderer.cpp:6:
In file included from <module-includes>:27:
/tmp/tmpmbt5fxt1/swift-install/package/.build/checkouts/swiftplot/Sources/AGG/include/agg_image_accessors.h:177:13: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
            register int x = m_x;
            ^~~~~~~~~
/tmp/tmpmbt5fxt1/swift-install/package/.build/checkouts/swiftplot/Sources/AGG/include/agg_image_accessors.h:178:13: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
            register int y = m_y;
            ^~~~~~~~~
While building module 'AGG' imported from /tmp/tmpmbt5fxt1/swift-install/package/.build/checkouts/swiftplot/Sources/AGGRenderer/CPPAGGRenderer/CPPAGGRenderer.cpp:6:
In file included from <module-includes>:65:
/tmp/tmpmbt5fxt1/swift-install/package/.build/checkouts/swiftplot/Sources/AGG/include/agg_conv_gpc.h:33:10: fatal error: 'gpc.h' file not found
#include "gpc.h" 
         ^~~~~~~
[2/64] Compiling agg_spline_ctrl.cpp
/tmp/tmpmbt5fxt1/swift-install/package/.build/checkouts/swiftplot/Sources/AGGRenderer/CPPAGGRenderer/CPPAGGRenderer.cpp:6:10: fatal error: could not build module 'AGG'
#include "agg_basics.h"
 ~~~~~~~~^~~~~~~~~~~~~~
13 warnings and 2 errors generated.
[3/75] Compiling lodepng lodepng.cpp
[3/75] Compiling CPPAGGRenderer CPPAGGRenderer.cpp
[4/75] Compiling agg_slider_ctrl.cpp
[5/75] Compiling CAGGRenderer CAGGRenderer.cpp
[5/75] Compiling agg_rbox_ctrl.cpp

Install Error: swift-build returned nonzero exit code 1.
WilliamHYZhang commented 4 years ago

It's definitely something to do with the AGGRenderer, installing SwiftPlot by itself works fine.

KarthikRIyer commented 4 years ago

@WilliamHYZhang I'm not sure why this error wasn't showing up earlier. It wasn't building even when using the latest S4TF toolchain. It was indeed due to the missing gpc.h file. This file is for the Generic Polygon Clipper library that is included with AGG. AGG uses make as it's build system and therefore doesn't have the header and source files inside it's main codebase. It links the library using make. I just added the required files and changed a small line where the header was included.

It seems to work now. With both swift-jupyter and command line. Can you give it a try?

WilliamHYZhang commented 4 years ago

Yep! Works perfectly with swift-jupyter now. Thank you for the quick fix.