Re: Building Postgres with lz4 on Visual Studio

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: Building Postgres with lz4 on Visual Studio
Дата
Msg-id CA+TgmobDSEspndsHet3TNmSgKpDqZtUe8wuZYRAd3Nz9W==jUg@mail.gmail.com
обсуждение исходный текст
Ответ на Building Postgres with lz4 on Visual Studio  (Melih Mutlu <m.melihmutlu@gmail.com>)
Ответы Re: Building Postgres with lz4 on Visual Studio  (Andrew Dunstan <andrew@dunslane.net>)
Список pgsql-hackers
On Wed, Apr 13, 2022 at 10:22 AM Melih Mutlu <m.melihmutlu@gmail.com> wrote:
> What I realized is that c:\lz4\lib\liblz4.lib actually does not exist.
> The latest versions of lz4, downloaded from [2], do not contain \liblz4.lib anymore, as opposed to what's written
here[3]. Also there isn't a lib folder too.
 
>
> After those changes on lz4 side, AFAIU there seems like this line adds library from wrong path in Solution.pm file
[4].
>>
>> $proj->AddIncludeDir($self->{options}->{lz4} . '\include');
>> $proj->AddLibrary($self->{options}->{lz4} . '\lib\liblz4.lib');
>
> Even if I spent some time on this problem and tried to fix some places, I'm not able to run a successful build yet.
> This is also the case for zstd too. Enabling zstd gives the same error.
>
> Has anyone had this issue before? Is this something that anyone is aware of and somehow made it work?
> I would appreciate any comment/suggestion etc.

In Solution.pm we have this:

    if ($self->{options}->{lz4})
    {
        $proj->AddIncludeDir($self->{options}->{lz4} . '\include');
        $proj->AddLibrary($self->{options}->{lz4} . '\lib\liblz4.lib');
    }
    if ($self->{options}->{zstd})
    {
        $proj->AddIncludeDir($self->{options}->{zstd} . '\include');
        $proj->AddLibrary($self->{options}->{zstd} . '\lib\libzstd.lib');
    }

I think what you're saying is that the relative pathnames here may not
be correct, depending on which version of lz4/zstd you're using. The
solution is probably to use perl's -e to test which files actually
exists e.g.

    if ($self->{options}->{lz4})
    {
        $proj->AddIncludeDir($self->{options}->{lz4} . '\include');
        if (-e $proj->AddLibrary($self->{options}->{lz4} .
'\someplace\somelz4.lib')
        {
            $proj->AddLibrary($self->{options}->{lz4} .
'\someplace\somelz4.lib');
        }
        else
        {
            $proj->AddLibrary($self->{options}->{lz4} . '\lib\liblz4.lib');
        }
        $proj->AddLibrary($self->{options}->{lz4} . '\lib\liblz4.lib');
   }

The trick, at least as it seems to me, is figuring out exactly what
the right set of conditions is, based on what kinds of different
builds exist out there and where they put stuff.

-- 
Robert Haas
EDB: http://www.enterprisedb.com



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Nathan Bossart
Дата:
Сообщение: Re: avoid multiple hard links to same WAL file after a crash
Следующее
От: Thomas Munro
Дата:
Сообщение: Re: pgsql: Add contrib/pg_walinspect.