From: krishna96-cd (@krishna96-cd) <noreply+krishna96-cd@github.com>
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
Subject: Re: [pgvector/pgvector] issue #492: trouble while instaling postgres pgvector in windows
Date: Tue, 28 Jan 2025 19:10:08 +0000
Message-ID: <gh-pgvector-pgvector-492-c2619848221@github.com> (raw)
In-Reply-To: <gh-pgvector-pgvector-492@github.com>
References: <gh-pgvector-pgvector-492@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