pg.ddx.io  pgvector/pgvector GitHub issues and pull requests  
help / color / mirror / Atom feed
[pgvector/pgvector] issue #492: trouble while instaling postgres pgvector in windows
9+ messages / 4 participants
[nested] [flat]

* [pgvector/pgvector] issue #492: trouble while instaling postgres pgvector in windows
@ 2024-03-15 17:51 "mdsardar (@mdsardar)" <noreply+mdsardar@github.com>
  0 siblings, 0 replies; 9+ messages in thread

From: mdsardar (@mdsardar) @ 2024-03-15 17:51 UTC (permalink / raw)
  To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>

Hey All, 

I'm keenly following the steps explained in this github page. [pgvector](https://github.com/pgvector/pgvector?tab=readme-ov-file#conda-forge)

Windows

Ensure [C++ support in Visual Studio](https://learn.microsoft.com/en-us/cpp/build/building-on-the-command-line?view=msvc-170#download-and-...) is installed, and run:

call "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat"

Note: The exact path will vary depending on your Visual Studio version and edition

Then use nmake to build:

set "PGROOT=C:\Program Files\PostgreSQL\16"
git clone --branch v0.6.1 https://github.com/pgvector/pgvector.git
cd pgvector
nmake /F Makefile.win
nmake /F Makefile.win install

The issue pops while I try to invoke nmake /F MakeFile.win. The below error is shown. 

C:\Users\moham\pgvector\pgvector>nmake /F Makefile.win

Microsoft (R) Program Maintenance Utility Version 14.39.33522.0
Copyright (C) Microsoft Corporation.  All rights reserved.

        cl /nologo /I"C:\Program Files\PostgreSQL\16\include\server\port\win32_msvc" /I"C:\Program Files\PostgreSQL\16\include\server\port\win32" /I"C:\Program Files\PostgreSQL\16\include\server" /I"C:\Program Files\PostgreSQL\16\include"   /O2 /fp:fast /c src\hnsw.c /Fosrc\hnsw.obj
hnsw.c
src\hnsw.c(1): fatal error C1083: Cannot open include file: 'postgres.h': No such file or directory
NMAKE : fatal error U1077: 'cl /nologo /I"C:\Program Files\PostgreSQL\16\include\server\port\win32_msvc" /I"C:\Program Files\PostgreSQL\16\include\server\port\win32" /I"C:\Program Files\PostgreSQL\16\include\server" /I"C:\Program Files\PostgreSQL\16\include"   /O2 /fp:fast /c src\hnsw.c /Fosrc\hnsw.obj' : return code '0x2'
Stop.

I tried to work this out but couldn't find anything useful from net. Can someone like to help to move forward that's appreciated.Thanks. 

^ permalink  raw  [nested|flat] 9+ messages in thread

* Re: [pgvector/pgvector] issue #492: trouble while instaling postgres pgvector in windows
@ 2024-03-15 19:18 ` "ankane (@ankane)" <noreply+ankane@github.com>
  7 siblings, 0 replies; 9+ messages in thread

From: ankane (@ankane) @ 2024-03-15 19:18 UTC (permalink / raw)
  To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>

Hi @mdsardar, it looks like `PGROOT` might not be correct. I'd confirm that the paths in the failed command (`C:\Program Files\PostgreSQL\16\include\server`, etc.) exist.

^ permalink  raw  [nested|flat] 9+ messages in thread

* Re: [pgvector/pgvector] issue #492: trouble while instaling postgres pgvector in windows
@ 2024-03-15 19:18 ` "ankane (@ankane)" <noreply+ankane@github.com>
  7 siblings, 0 replies; 9+ messages in thread

From: ankane (@ankane) @ 2024-03-15 19:18 UTC (permalink / raw)
  To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>

@ankane closed this.

^ permalink  raw  [nested|flat] 9+ messages in thread

* Re: [pgvector/pgvector] issue #492: trouble while instaling postgres pgvector in windows
@ 2024-03-16 06:37 ` "mdsardar (@mdsardar)" <noreply+mdsardar@github.com>
  7 siblings, 0 replies; 9+ messages in thread

From: mdsardar (@mdsardar) @ 2024-03-16 06:37 UTC (permalink / raw)
  To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>

> correct

Thanks and I confirm C:\Program Files\PostgreSQL\15\include\server -the path exist as part of post gres

^ permalink  raw  [nested|flat] 9+ messages in thread

* Re: [pgvector/pgvector] issue #492: trouble while instaling postgres pgvector in windows
@ 2024-03-16 09:22 ` "mdsardar (@mdsardar)" <noreply+mdsardar@github.com>
  7 siblings, 0 replies; 9+ messages in thread

From: mdsardar (@mdsardar) @ 2024-03-16 09:22 UTC (permalink / raw)
  To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>

Now when I make 

C:\Users\moham\pgvector>nmake /F Makefile.win install

Microsoft (R) Program Maintenance Utility Version 14.39.33522.0
Copyright (C) Microsoft Corporation.  All rights reserved.

        copy vector.dll "C:\Program Files\PostgreSQL\15\lib"
Access is denied.
        0 file(s) copied.
NMAKE : fatal error U1077: 'copy vector.dll "C:\Program Files\PostgreSQL\15\lib"' : return code '0x1'
Stop.

^ permalink  raw  [nested|flat] 9+ messages in thread

* Re: [pgvector/pgvector] issue #492: trouble while instaling postgres pgvector in windows
@ 2024-03-16 17:49 ` "ankane (@ankane)" <noreply+ankane@github.com>
  7 siblings, 0 replies; 9+ messages in thread

From: ankane (@ankane) @ 2024-03-16 17:49 UTC (permalink / raw)
  To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>

It looks like a permissions error (`Access is denied.`). Try re-running the steps as an administrator.

^ permalink  raw  [nested|flat] 9+ messages in thread

* Re: [pgvector/pgvector] issue #492: trouble while instaling postgres pgvector in windows
@ 2024-03-17 05:48 ` "mdsardar (@mdsardar)" <noreply+mdsardar@github.com>
  7 siblings, 0 replies; 9+ messages in thread

From: mdsardar (@mdsardar) @ 2024-03-17 05:48 UTC (permalink / raw)
  To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>

> It looks like a permissions error (`Access is denied.`). Try re-running the steps as an administrator.

Thanks @ankane. I found the issue was nmake was added to system environment variable but did not include "\" at the end. After figuring out all seems ok at my side. 

^ permalink  raw  [nested|flat] 9+ messages in thread

* Re: [pgvector/pgvector] issue #492: trouble while instaling postgres pgvector in windows
@ 2025-01-28 19:10 ` "krishna96-cd (@krishna96-cd)" <noreply+krishna96-cd@github.com>
  7 siblings, 0 replies; 9+ messages in thread

From: krishna96-cd (@krishna96-cd) @ 2025-01-28 19:10 UTC (permalink / raw)
  To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>

> Hey All,
> 
> I'm keenly following the steps explained in this github page. [pgvector](https://github.com/pgvector/pgvector?tab=readme-ov-file#conda-forge)
> 
> Windows
> 
> Ensure [C++ support in Visual Studio](https://learn.microsoft.com/en-us/cpp/build/building-on-the-command-line?view=msvc-170#download-and-...) is installed, and run:
> 
> call "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat"
> 
> Note: The exact path will vary depending on your Visual Studio version and edition
> 
> Then use nmake to build:
> 
> set "PGROOT=C:\Program Files\PostgreSQL\16" git clone --branch v0.6.1 https://github.com/pgvector/pgvector.git cd pgvector nmake /F Makefile.win nmake /F Makefile.win install
> 
> The issue pops while I try to invoke nmake /F MakeFile.win. The below error is shown.
> 
> C:\Users\moham\pgvector\pgvector>nmake /F Makefile.win
> 
> Microsoft (R) Program Maintenance Utility Version 14.39.33522.0 Copyright (C) Microsoft Corporation. All rights reserved.
> 
> ```
>     cl /nologo /I"C:\Program Files\PostgreSQL\16\include\server\port\win32_msvc" /I"C:\Program Files\PostgreSQL\16\include\server\port\win32" /I"C:\Program Files\PostgreSQL\16\include\server" /I"C:\Program Files\PostgreSQL\16\include"   /O2 /fp:fast /c src\hnsw.c /Fosrc\hnsw.obj
> ```
> 
> hnsw.c src\hnsw.c(1): fatal error C1083: Cannot open include file: 'postgres.h': No such file or directory NMAKE : fatal error U1077: 'cl /nologo /I"C:\Program Files\PostgreSQL\16\include\server\port\win32_msvc" /I"C:\Program Files\PostgreSQL\16\include\server\port\win32" /I"C:\Program Files\PostgreSQL\16\include\server" /I"C:\Program Files\PostgreSQL\16\include" /O2 /fp:fast /c src\hnsw.c /Fosrc\hnsw.obj' : return code '0x2' Stop.
> 
> I tried to work this out but couldn't find anything useful from net. Can someone like to help to move forward that's appreciated.Thanks.

open Makefile.win hardcode all the path instead of assigning to variables INCLUDEDIR="C:\Program Files\PostgreSQL\16\include"
INCLUDEDIR_SERVER="C:\Program Files\PostgreSQL\16\include\server"
LIBDIR="C:\Program Files\PostgreSQL\16\lib"
PKGLIBDIR="C:\Program Files\PostgreSQL\16\lib"
SHAREDIR="C:\Program Files\PostgreSQL\16\share"

CFLAGS=/nologo /I"C:\Program Files\PostgreSQL\16\include\server\port\win32_msvc" \
         /I"C:\Program Files\PostgreSQL\16\include\server\port\win32" \
         /I"C:\Program Files\PostgreSQL\16\include\server" \
         /I"C:\Program Files\PostgreSQL\16\include"
it will work this is because of path issues 

^ permalink  raw  [nested|flat] 9+ messages in thread

* Re: [pgvector/pgvector] issue #492: trouble while instaling postgres pgvector in windows
@ 2026-02-02 07:32 ` "dli-deckers (@dli-deckers)" <noreply+dli-deckers@github.com>
  7 siblings, 0 replies; 9+ messages in thread

From: dli-deckers (@dli-deckers) @ 2026-02-02 07:32 UTC (permalink / raw)
  To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>

any solution for this ,I faced the same issue when build pg vector for postgres18,
an.obj src\hnswutils.obj src\hnswvacuum.obj src\ivfbuild.obj src\ivfflat.obj src\ivfinsert.obj src\ivfkmeans.obj src\ivfscan.obj src\ivfutils.obj src\ivfvacuum.obj src\sparsevec.obj src\vector.obj "D:\app\PostgreSQL18\lib\postgres.lib" /link /DLL /OUT:vector.dll
  正在创建库 vector.lib 和对象 vector.exp
libucrt.lib(invalid_parameter.obj) : error LNK2019: 无法解析的外部符号 __crt_debugger_hook,函数 __acrt_call_reportfault 中引用了该符号
vector.dll : fatal error LNK1120: 1 个无法解析的外部命令
NMAKE : fatal error U1077: “cl /nologo /I"D:\app\PostgreSQL18\include\server\port\win32_msvc" /I"D:\app\PostgreSQL18\include\server\port\win32" /I"D:\app\PostgreSQL18\include\server" /I"D:\app\PostgreSQL18\include" /I"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.44.35207\include" /I"C:\Program Files (x86)\Windows Kits\10\Lib\10.0.26100.0\ucrt_enclave\x64" /I"C:\Program Files (x86)\Windows Kits\10\Lib\10.0.26100.0\ucrt\x64" /I"C:\Program Files (x86)\Windows Kits\10\Lib\10.0.26100.0\um\x64" /I"C:\Program Files (x86)\Windows Kits\10\Lib" /I"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.44.35207\lib\onecore\x64" /I"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.44.35207\lib\x64\enclave" /I"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.44.35207\include" /I"C:\Program Files (x86)\Windows Kits\10\Include" /I"C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt" /I"C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\um" /I"C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\shared"  /I"D:\app\PostgreSQL18\server\port\win32_msvc"/I"D:\app\PostgreSQL18\include\server\port\win32"/I"D:\app\PostgreSQL18\include\server"/I"D:\app\PostgreSQL18\include"   /O2 /fp:fast src\bitutils.obj src\bitvec.obj src\halfutils.obj src\halfvec.obj src\hnsw.obj src\hnswbuild.obj src\hnswinsert.obj src\hnswscan.obj src\hnswutils.obj src\hnswvacuum.obj src\ivfbuild.obj src\ivfflat.obj src\ivfinsert.obj src\ivfkmeans.obj src\ivfscan.obj src\ivfutils.obj src\ivfvacuum.obj src\sparsevec.obj src\vector.obj "D:\app\PostgreSQL18\lib\postgres.lib" /link /DLL /OUT:vector.dll”: 返回代码“0x2”
Stop.

^ permalink  raw  [nested|flat] 9+ messages in thread


end of thread, other threads:[~2026-02-02 07:32 UTC | newest]

Thread overview: 9+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-03-15 17:51 [pgvector/pgvector] issue #492: trouble while instaling postgres pgvector in windows "mdsardar (@mdsardar)" <noreply+mdsardar@github.com>
2024-03-15 19:18 ` "ankane (@ankane)" <noreply+ankane@github.com>
2024-03-15 19:18 ` "ankane (@ankane)" <noreply+ankane@github.com>
2024-03-16 06:37 ` "mdsardar (@mdsardar)" <noreply+mdsardar@github.com>
2024-03-16 09:22 ` "mdsardar (@mdsardar)" <noreply+mdsardar@github.com>
2024-03-16 17:49 ` "ankane (@ankane)" <noreply+ankane@github.com>
2024-03-17 05:48 ` "mdsardar (@mdsardar)" <noreply+mdsardar@github.com>
2025-01-28 19:10 ` "krishna96-cd (@krishna96-cd)" <noreply+krishna96-cd@github.com>
2026-02-02 07:32 ` "dli-deckers (@dli-deckers)" <noreply+dli-deckers@github.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox