Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make on Windows fails #4

Closed
gillerman opened this issue Mar 21, 2017 · 11 comments
Closed

make on Windows fails #4

gillerman opened this issue Mar 21, 2017 · 11 comments
Assignees
Labels

Comments

@gillerman
Copy link

C:\Program Files\PostgreSQL\timescaledb-master>"C:\Program Files (x86)\GnuWin32\bin\make.exe"
process_begin: CreateProcess(NULL, pg_config --pgxs, ...) failed.
'cat' is not recognized as an internal or external command,
operable program or batch file.
'cat' is not recognized as an internal or external command,
operable program or batch file.
process_begin: CreateProcess(NULL, cat sql/load_order.txt, ...) failed.
'cat' is not recognized as an internal or external command,
operable program or batch file.
'cat' is not recognized as an internal or external command,
operable program or batch file.
make: Nothing to be done for `all'.

@RobAtticus
Copy link
Member

Unfortunately we have not yet tested the extension's build process on Windows. We will add a note in the README on platforms we have tested, and will see what level of commitment is needed to get this working on Windows.

@mfreed
Copy link
Member

mfreed commented Oct 3, 2017

There has been some recent progress on getting Timescale to natively compile on windows (from Visual Studio). See, e.g., PR #228 , although this doesn't (yet) address the build process mechanism described above.

@gillerman
Copy link
Author

gillerman commented Oct 3, 2017 via email

@sonofaforester
Copy link

Wondering where this is at? We need an on-premise version of our cloud platform that contains a time series database. Thinking that your solution could be a viable option and wondering what the expected time frame for having native Windows support might be and whether there is a way for us to help move it along?

@RobAtticus
Copy link
Member

Hi @sonofaforester , glad you're interested. We currently have a PR/branch that will make building the extension on Windows possible:
#286

If you would like to help test it by checking out the branch and building/playing with it, that would be great! Once that is merged we will also be able to offer Windows builds for download.

@mfreed
Copy link
Member

mfreed commented Nov 23, 2017

@gillerman Please see @RobAtticus note above: Branch/PR should now build on Windows and we've done various testing, but we'd appreciate others' experience building/using it on Windows. Please let us know!

@sonofaforester
Copy link

So I was able to build it by running the bootstrap.bat file and then opening the resulting solution in visual studio and building. I installed the plugin into version 9.6 and was able to create a hypertable, so it seems to be working. Thanks!

I wasn't able to build using the Visual Studio CMake integration. I've got VS2017 15.4.2. When I open, the CMake stuff seems to run, but when I open the CMake menu and select Build All, I get a bunch of linker errors. I'm not a C++ guy, so I'm not much help here.

------ Build started: Project: CMakeLists, Configuration: Debug ------
[1/1] cmd.exe /C "cd . && "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E vs_link_dll --intdir=src\CMakeFiles\timescaledb.dir --manifests -- C:\PROGRA2\MICROS2\2017\ENTERP1\VC\Tools\MSVC\14111.255\bin\Hostx86\x86\link.exe /nologo src\CMakeFiles\timescaledb.dir\agg_bookend.c.obj src\CMakeFiles\timescaledb.dir\cache.c.obj src\CMakeFiles\timescaledb.dir\cache_invalidate.c.obj src\CMakeFiles\timescaledb.dir\catalog.c.obj src\CMakeFiles\timescaledb.dir\chunk.c.obj src\CMakeFiles\timescaledb.dir\chunk_constraint.c.obj src\CMakeFiles\timescaledb.dir\chunk_dispatch.c.obj src\CMakeFiles\timescaledb.dir\chunk_dispatch_info.c.obj src\CMakeFiles\timescaledb.dir\chunk_dispatch_plan.c.obj src\CMakeFiles\timescaledb.dir\chunk_dispatch_state.c.obj src\CMakeFiles\timescaledb.dir\chunk_index.c.obj src\CMakeFiles\timescaledb.dir\chunk_insert_state.c.obj src\CMakeFiles\timescaledb.dir\compat.c.obj src\CMakeFiles\timescaledb.dir\constraint_aware_append.c.obj src\CMakeFiles\timescaledb.dir\copy.c.obj src\CMakeFiles\timescaledb.dir\dimension.c.obj src\CMakeFiles\timescaledb.dir\dimension_slice.c.obj src\CMakeFiles\timescaledb.dir\dimension_vector.c.obj src\CMakeFiles\timescaledb.dir\event_trigger.c.obj src\CMakeFiles\timescaledb.dir\executor.c.obj src\CMakeFiles\timescaledb.dir\extension.c.obj src\CMakeFiles\timescaledb.dir\guc.c.obj src\CMakeFiles\timescaledb.dir\histogram.c.obj src\CMakeFiles\timescaledb.dir\hypercube.c.obj src\CMakeFiles\timescaledb.dir\hypertable.c.obj src\CMakeFiles\timescaledb.dir\hypertable_cache.c.obj src\CMakeFiles\timescaledb.dir\hypertable_insert.c.obj src\CMakeFiles\timescaledb.dir\indexing.c.obj src\CMakeFiles\timescaledb.dir\init.c.obj src\CMakeFiles\timescaledb.dir\parse_analyze.c.obj src\CMakeFiles\timescaledb.dir\parse_rewrite.c.obj src\CMakeFiles\timescaledb.dir\partitioning.c.obj src\CMakeFiles\timescaledb.dir\planner.c.obj src\CMakeFiles\timescaledb.dir\planner_utils.c.obj src\CMakeFiles\timescaledb.dir\process_utility.c.obj src\CMakeFiles\timescaledb.dir\scanner.c.obj src\CMakeFiles\timescaledb.dir\sort_transform.c.obj src\CMakeFiles\timescaledb.dir\subspace_store.c.obj src\CMakeFiles\timescaledb.dir\trigger.c.obj src\CMakeFiles\timescaledb.dir\utils.c.obj src\CMakeFiles\timescaledb.dir\version.c.obj /out:src\timescaledb.dll /implib:src\timescaledb.lib /pdb:src\timescaledb.pdb /dll /version:0.0 /machine:X86 /MANIFEST:NO C:/PROGRA1/POSTGR1/9.6/lib/postgres.lib ws2_32.lib /debug /INCREMENTAL kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ."
FAILED: src/timescaledb.dll
cmd.exe /C "cd . && "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E vs_link_dll --intdir=src\CMakeFiles\timescaledb.dir --manifests -- C:\PROGRA2\MICROS2\2017\ENTERP1\VC\Tools\MSVC\14111.255\bin\Hostx86\x86\link.exe /nologo src\CMakeFiles\timescaledb.dir\agg_bookend.c.obj src\CMakeFiles\timescaledb.dir\cache.c.obj src\CMakeFiles\timescaledb.dir\cache_invalidate.c.obj src\CMakeFiles\timescaledb.dir\catalog.c.obj src\CMakeFiles\timescaledb.dir\chunk.c.obj src\CMakeFiles\timescaledb.dir\chunk_constraint.c.obj src\CMakeFiles\timescaledb.dir\chunk_dispatch.c.obj src\CMakeFiles\timescaledb.dir\chunk_dispatch_info.c.obj src\CMakeFiles\timescaledb.dir\chunk_dispatch_plan.c.obj src\CMakeFiles\timescaledb.dir\chunk_dispatch_state.c.obj src\CMakeFiles\timescaledb.dir\chunk_index.c.obj src\CMakeFiles\timescaledb.dir\chunk_insert_state.c.obj src\CMakeFiles\timescaledb.dir\compat.c.obj src\CMakeFiles\timescaledb.dir\constraint_aware_append.c.obj src\CMakeFiles\timescaledb.dir\copy.c.obj src\CMakeFiles\timescaledb.dir\dimension.c.obj src\CMakeFiles\timescaledb.dir\dimension_slice.c.obj src\CMakeFiles\timescaledb.dir\dimension_vector.c.obj src\CMakeFiles\timescaledb.dir\event_trigger.c.obj src\CMakeFiles\timescaledb.dir\executor.c.obj src\CMakeFiles\timescaledb.dir\extension.c.obj src\CMakeFiles\timescaledb.dir\guc.c.obj src\CMakeFiles\timescaledb.dir\histogram.c.obj src\CMakeFiles\timescaledb.dir\hypercube.c.obj src\CMakeFiles\timescaledb.dir\hypertable.c.obj src\CMakeFiles\timescaledb.dir\hypertable_cache.c.obj src\CMakeFiles\timescaledb.dir\hypertable_insert.c.obj src\CMakeFiles\timescaledb.dir\indexing.c.obj src\CMakeFiles\timescaledb.dir\init.c.obj src\CMakeFiles\timescaledb.dir\parse_analyze.c.obj src\CMakeFiles\timescaledb.dir\parse_rewrite.c.obj src\CMakeFiles\timescaledb.dir\partitioning.c.obj src\CMakeFiles\timescaledb.dir\planner.c.obj src\CMakeFiles\timescaledb.dir\planner_utils.c.obj src\CMakeFiles\timescaledb.dir\process_utility.c.obj src\CMakeFiles\timescaledb.dir\scanner.c.obj src\CMakeFiles\timescaledb.dir\sort_transform.c.obj src\CMakeFiles\timescaledb.dir\subspace_store.c.obj src\CMakeFiles\timescaledb.dir\trigger.c.obj src\CMakeFiles\timescaledb.dir\utils.c.obj src\CMakeFiles\timescaledb.dir\version.c.obj /out:src\timescaledb.dll /implib:src\timescaledb.lib /pdb:src\timescaledb.pdb /dll /version:0.0 /machine:X86 /MANIFEST:NO C:/PROGRA1/POSTGR1/9.6/lib/postgres.lib ws2_32.lib /debug /INCREMENTAL kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ."
Creating library src\timescaledb.lib and object src\timescaledb.exp

C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\utils.c.obj : error LNK2019: unresolved external symbol _errstart referenced in function _create_fmgr

C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\indexing.c.obj : error LNK2001: unresolved external symbol _errstart

C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\init.c.obj : error LNK2001: unresolved external symbol _errstart

.... (There's 635 errors similar to these)

@RobAtticus
Copy link
Member

@sonofaforester Hmm, let me ping @erimatnor since he was the one who tried this using Visual Studio integration. I'm glad you got it working

(By the way the PR has landed and will be in the 0.8.0 release)

@GeoffCapper
Copy link

I've successfully built on windows 10 with VS2015. One thing to note (though maybe it will only affect absolute novices to building C projects like me?!) is that the INSTALL phase needs to be called from VS2015 run as administrator if PostgreSQL is installed in /Program Files/ or a similar protected directory, or write permissions need to be adjusted to the same effect.

@RobAtticus
Copy link
Member

With the release of 0.8.0, there is now a way to build on Windows!

@mfreed
Copy link
Member

mfreed commented Jan 26, 2018

Closing this out. Let us know if you have any other issues.

@mfreed mfreed closed this as completed Jan 26, 2018
cevian added a commit to cevian/timescaledb that referenced this issue Oct 16, 2019
Whenever paths are added to a rel, that path or another
path that previously was on the rel can be freed.

Previously, the compressed rel's paths could be freed when it was re-planned
by the postgres planner after being created and planned by us. The new path
the postgres planner added was cheaper and overwrote and pfreed the old path
which we created and saved as a child path of the decompress node. Thus
we ended up with a dangling reference to a pfreed path.

This solution prevents this bug by removing the path we create from the
compressed rel. Thus, the chunk rel now "owns" the path. Note that this
does not prevent the compressed rel from being replanned and thus some
throw-away planner work is still happening. But that's a battle for
another day.

The backtrace for the core planner overwriting our path is:
```
frame timescale#4: 0x0000000105c4ed0f postgres`pfree(pointer=0x00007fe20d01a628) at mcxt.c:1035
  * frame timescale#5: 0x000000010594c998 postgres`add_partial_path(parent_rel=0x00007fe20d01ae10, new_path=0x00007fe20f800298) at pathnode.c:844
    frame timescale#6: 0x00000001058ede4b postgres`create_plain_partial_paths(root=0x00007fe2113fc668, rel=0x00007fe20d01ae10) at allpaths.c:753
    frame timescale#7: 0x00000001058edb93 postgres`set_plain_rel_pathlist(root=0x00007fe2113fc668, rel=0x00007fe20d01ae10, rte=0x00007fe20d0198c0) at allpaths.c:727
    frame timescale#8: 0x00000001058ed78b postgres`set_rel_pathlist(root=0x00007fe2113fc668, rel=0x00007fe20d01ae10, rti=13, rte=0x00007fe20d0198c0) at allpaths.c:452
    frame timescale#9: 0x00000001058e8e16 postgres`set_base_rel_pathlists(root=0x00007fe2113fc668) at allpaths.c:310
    frame timescale#10: 0x00000001058e8b49 postgres`make_one_rel(root=0x00007fe2113fc668, joinlist=0x00007fe20d0121c8) at allpaths.c:180
    frame timescale#11: 0x000000010591ee77 postgres`query_planner(root=0x00007fe2113fc668, tlist=0x00007fe2113fcb58, qp_callback=(postgres`standard_qp_callback at planner.c:3492), qp_extra=0x00007ffeea6ba2b8) at planmain.c:265
    frame timescale#12: 0x00000001059229cb postgres`grouping_planner(root=0x00007fe2113fc668, inheritance_update=false, tuple_fraction=0) at planner.c:1942
    frame timescale#13: 0x0000000105920546 postgres`subquery_planner(glob=0x00007fe218000328, parse=0x00007fe218000858, parent_root=0x0000000000000000, hasRecursion=false, tuple_fraction=0) at planner.c:966
    frame timescale#14: 0x000000010591f1e7 postgres`standard_planner(parse=0x00007fe218000858, cursorOptions=256, boundParams=0x0000000000000000) at planner.c:405
    frame timescale#15: 0x000000010642d9b4 timescaledb-1.5.0-dev.so`timescaledb_planner(parse=0x00007fe218000858, cursor_opts=256, bound_params=0x0000000000000000) at planner.c:152
```
cevian added a commit that referenced this issue Oct 28, 2019
Whenever paths are added to a rel, that path or another
path that previously was on the rel can be freed.

Previously, the compressed rel's paths could be freed when it was re-planned
by the postgres planner after being created and planned by us. The new path
the postgres planner added was cheaper and overwrote and pfreed the old path
which we created and saved as a child path of the decompress node. Thus
we ended up with a dangling reference to a pfreed path.

This solution prevents this bug by removing the path we create from the
compressed rel. Thus, the chunk rel now "owns" the path. Note that this
does not prevent the compressed rel from being replanned and thus some
throw-away planner work is still happening. But that's a battle for
another day.

The backtrace for the core planner overwriting our path is:
```
frame #4: 0x0000000105c4ed0f postgres`pfree(pointer=0x00007fe20d01a628) at mcxt.c:1035
  * frame #5: 0x000000010594c998 postgres`add_partial_path(parent_rel=0x00007fe20d01ae10, new_path=0x00007fe20f800298) at pathnode.c:844
    frame #6: 0x00000001058ede4b postgres`create_plain_partial_paths(root=0x00007fe2113fc668, rel=0x00007fe20d01ae10) at allpaths.c:753
    frame #7: 0x00000001058edb93 postgres`set_plain_rel_pathlist(root=0x00007fe2113fc668, rel=0x00007fe20d01ae10, rte=0x00007fe20d0198c0) at allpaths.c:727
    frame #8: 0x00000001058ed78b postgres`set_rel_pathlist(root=0x00007fe2113fc668, rel=0x00007fe20d01ae10, rti=13, rte=0x00007fe20d0198c0) at allpaths.c:452
    frame #9: 0x00000001058e8e16 postgres`set_base_rel_pathlists(root=0x00007fe2113fc668) at allpaths.c:310
    frame #10: 0x00000001058e8b49 postgres`make_one_rel(root=0x00007fe2113fc668, joinlist=0x00007fe20d0121c8) at allpaths.c:180
    frame #11: 0x000000010591ee77 postgres`query_planner(root=0x00007fe2113fc668, tlist=0x00007fe2113fcb58, qp_callback=(postgres`standard_qp_callback at planner.c:3492), qp_extra=0x00007ffeea6ba2b8) at planmain.c:265
    frame #12: 0x00000001059229cb postgres`grouping_planner(root=0x00007fe2113fc668, inheritance_update=false, tuple_fraction=0) at planner.c:1942
    frame #13: 0x0000000105920546 postgres`subquery_planner(glob=0x00007fe218000328, parse=0x00007fe218000858, parent_root=0x0000000000000000, hasRecursion=false, tuple_fraction=0) at planner.c:966
    frame #14: 0x000000010591f1e7 postgres`standard_planner(parse=0x00007fe218000858, cursorOptions=256, boundParams=0x0000000000000000) at planner.c:405
    frame #15: 0x000000010642d9b4 timescaledb-1.5.0-dev.so`timescaledb_planner(parse=0x00007fe218000858, cursor_opts=256, bound_params=0x0000000000000000) at planner.c:152
```
cevian added a commit that referenced this issue Oct 28, 2019
Whenever paths are added to a rel, that path or another
path that previously was on the rel can be freed.

Previously, the compressed rel's paths could be freed when it was re-planned
by the postgres planner after being created and planned by us. The new path
the postgres planner added was cheaper and overwrote and pfreed the old path
which we created and saved as a child path of the decompress node. Thus
we ended up with a dangling reference to a pfreed path.

This solution prevents this bug by removing the path we create from the
compressed rel. Thus, the chunk rel now "owns" the path. Note that this
does not prevent the compressed rel from being replanned and thus some
throw-away planner work is still happening. But that's a battle for
another day.

The backtrace for the core planner overwriting our path is:
```
frame #4: 0x0000000105c4ed0f postgres`pfree(pointer=0x00007fe20d01a628) at mcxt.c:1035
  * frame #5: 0x000000010594c998 postgres`add_partial_path(parent_rel=0x00007fe20d01ae10, new_path=0x00007fe20f800298) at pathnode.c:844
    frame #6: 0x00000001058ede4b postgres`create_plain_partial_paths(root=0x00007fe2113fc668, rel=0x00007fe20d01ae10) at allpaths.c:753
    frame #7: 0x00000001058edb93 postgres`set_plain_rel_pathlist(root=0x00007fe2113fc668, rel=0x00007fe20d01ae10, rte=0x00007fe20d0198c0) at allpaths.c:727
    frame #8: 0x00000001058ed78b postgres`set_rel_pathlist(root=0x00007fe2113fc668, rel=0x00007fe20d01ae10, rti=13, rte=0x00007fe20d0198c0) at allpaths.c:452
    frame #9: 0x00000001058e8e16 postgres`set_base_rel_pathlists(root=0x00007fe2113fc668) at allpaths.c:310
    frame #10: 0x00000001058e8b49 postgres`make_one_rel(root=0x00007fe2113fc668, joinlist=0x00007fe20d0121c8) at allpaths.c:180
    frame #11: 0x000000010591ee77 postgres`query_planner(root=0x00007fe2113fc668, tlist=0x00007fe2113fcb58, qp_callback=(postgres`standard_qp_callback at planner.c:3492), qp_extra=0x00007ffeea6ba2b8) at planmain.c:265
    frame #12: 0x00000001059229cb postgres`grouping_planner(root=0x00007fe2113fc668, inheritance_update=false, tuple_fraction=0) at planner.c:1942
    frame #13: 0x0000000105920546 postgres`subquery_planner(glob=0x00007fe218000328, parse=0x00007fe218000858, parent_root=0x0000000000000000, hasRecursion=false, tuple_fraction=0) at planner.c:966
    frame #14: 0x000000010591f1e7 postgres`standard_planner(parse=0x00007fe218000858, cursorOptions=256, boundParams=0x0000000000000000) at planner.c:405
    frame #15: 0x000000010642d9b4 timescaledb-1.5.0-dev.so`timescaledb_planner(parse=0x00007fe218000858, cursor_opts=256, bound_params=0x0000000000000000) at planner.c:152
```
cevian added a commit that referenced this issue Oct 29, 2019
Whenever paths are added to a rel, that path or another
path that previously was on the rel can be freed.

Previously, the compressed rel's paths could be freed when it was re-planned
by the postgres planner after being created and planned by us. The new path
the postgres planner added was cheaper and overwrote and pfreed the old path
which we created and saved as a child path of the decompress node. Thus
we ended up with a dangling reference to a pfreed path.

This solution prevents this bug by removing the path we create from the
compressed rel. Thus, the chunk rel now "owns" the path. Note that this
does not prevent the compressed rel from being replanned and thus some
throw-away planner work is still happening. But that's a battle for
another day.

The backtrace for the core planner overwriting our path is:
```
frame #4: 0x0000000105c4ed0f postgres`pfree(pointer=0x00007fe20d01a628) at mcxt.c:1035
  * frame #5: 0x000000010594c998 postgres`add_partial_path(parent_rel=0x00007fe20d01ae10, new_path=0x00007fe20f800298) at pathnode.c:844
    frame #6: 0x00000001058ede4b postgres`create_plain_partial_paths(root=0x00007fe2113fc668, rel=0x00007fe20d01ae10) at allpaths.c:753
    frame #7: 0x00000001058edb93 postgres`set_plain_rel_pathlist(root=0x00007fe2113fc668, rel=0x00007fe20d01ae10, rte=0x00007fe20d0198c0) at allpaths.c:727
    frame #8: 0x00000001058ed78b postgres`set_rel_pathlist(root=0x00007fe2113fc668, rel=0x00007fe20d01ae10, rti=13, rte=0x00007fe20d0198c0) at allpaths.c:452
    frame #9: 0x00000001058e8e16 postgres`set_base_rel_pathlists(root=0x00007fe2113fc668) at allpaths.c:310
    frame #10: 0x00000001058e8b49 postgres`make_one_rel(root=0x00007fe2113fc668, joinlist=0x00007fe20d0121c8) at allpaths.c:180
    frame #11: 0x000000010591ee77 postgres`query_planner(root=0x00007fe2113fc668, tlist=0x00007fe2113fcb58, qp_callback=(postgres`standard_qp_callback at planner.c:3492), qp_extra=0x00007ffeea6ba2b8) at planmain.c:265
    frame #12: 0x00000001059229cb postgres`grouping_planner(root=0x00007fe2113fc668, inheritance_update=false, tuple_fraction=0) at planner.c:1942
    frame #13: 0x0000000105920546 postgres`subquery_planner(glob=0x00007fe218000328, parse=0x00007fe218000858, parent_root=0x0000000000000000, hasRecursion=false, tuple_fraction=0) at planner.c:966
    frame #14: 0x000000010591f1e7 postgres`standard_planner(parse=0x00007fe218000858, cursorOptions=256, boundParams=0x0000000000000000) at planner.c:405
    frame #15: 0x000000010642d9b4 timescaledb-1.5.0-dev.so`timescaledb_planner(parse=0x00007fe218000858, cursor_opts=256, bound_params=0x0000000000000000) at planner.c:152
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants